Boboter
Loading...
Searching...
No Matches
Device::Encoders Class Reference

#include <encoders.h>

Public Types

enum class  encoder_id_t : uint8_t { LEFT = 0 , RIGHT = 1 }

Public Member Functions

 Encoders (Robot &robot)
 ~Encoders ()
void initialize ()
 Sets up the necessary GPIO pins.
int32_t get_pulse_count (encoder_id_t encoder_id) const
 Gets the pulse count of the given encoder.
void reset_pulse_count (encoder_id_t encoder_id)
 Resets the pulse count of the given encoder back to zero.

Static Public Member Functions

static void IRAM_ATTR encoder_isr_handler (void *arg)

Member Enumeration Documentation

◆ encoder_id_t

enum class Device::Encoders::encoder_id_t : uint8_t
strong
Enumerator
LEFT 
RIGHT 

Constructor & Destructor Documentation

◆ Encoders()

Device::Encoders::Encoders ( Robot & robot)
explicit

◆ ~Encoders()

Device::Encoders::~Encoders ( )

Member Function Documentation

◆ encoder_isr_handler()

void Device::Encoders::encoder_isr_handler ( void * arg)
static

◆ get_pulse_count()

int32_t Device::Encoders::get_pulse_count ( encoder_id_t encoder_id) const
inlinenodiscard

Gets the pulse count of the given encoder.

Returns
The pulse count
Parameters
encoder_idThe id of the encoder of which to get the pulse count

◆ initialize()

void Device::Encoders::initialize ( )

Sets up the necessary GPIO pins.

◆ reset_pulse_count()

void Device::Encoders::reset_pulse_count ( encoder_id_t encoder_id)
inline

Resets the pulse count of the given encoder back to zero.

Parameters
encoder_idThe id of the encoder of which to reset the pulse count

The documentation for this class was generated from the following files: