APM:Libraries
Classes | Public Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
AP_WheelEncoder_Quadrature Class Reference

#include <WheelEncoder_Quadrature.h>

Inheritance diagram for AP_WheelEncoder_Quadrature:
[legend]
Collaboration diagram for AP_WheelEncoder_Quadrature:
[legend]

Classes

struct  IrqState
 

Public Member Functions

 AP_WheelEncoder_Quadrature (AP_WheelEncoder &frontend, uint8_t instance, AP_WheelEncoder::WheelEncoder_State &state)
 
void update (void)
 
- Public Member Functions inherited from AP_WheelEncoder_Backend
 AP_WheelEncoder_Backend (AP_WheelEncoder &frontend, uint8_t instance, AP_WheelEncoder::WheelEncoder_State &state)
 
virtual ~AP_WheelEncoder_Backend (void)
 

Static Private Member Functions

static int irq_handler0_pina (int irq, void *context)
 
static int irq_handler0_pinb (int irq, void *context)
 
static int irq_handler1_pina (int irq, void *context)
 
static int irq_handler1_pinb (int irq, void *context)
 
static void irq_handler (uint8_t instance, bool pin_a)
 
static uint32_t get_gpio (uint8_t pin_number)
 
static uint8_t pin_ab_to_phase (bool pin_a, bool pin_b)
 
static void update_phase_and_error_count (bool pin_a_now, bool pin_b_now, uint8_t &phase, int32_t &distance_count, uint32_t &total_count, uint32_t &error_count)
 

Private Attributes

uint8_t last_pin_a
 
uint8_t last_pin_b
 

Static Private Attributes

static struct IrqState irq_state [WHEELENCODER_MAX_INSTANCES]
 

Additional Inherited Members

- Protected Member Functions inherited from AP_WheelEncoder_Backend
int8_t get_pin_a () const
 
int8_t get_pin_b () const
 
- Protected Attributes inherited from AP_WheelEncoder_Backend
AP_WheelEncoder_frontend
 
AP_WheelEncoder::WheelEncoder_State_state
 

Detailed Description

Definition at line 22 of file WheelEncoder_Quadrature.h.

Constructor & Destructor Documentation

◆ AP_WheelEncoder_Quadrature()

AP_WheelEncoder_Quadrature::AP_WheelEncoder_Quadrature ( AP_WheelEncoder frontend,
uint8_t  instance,
AP_WheelEncoder::WheelEncoder_State state 
)

Definition at line 28 of file WheelEncoder_Quadrature.cpp.

Member Function Documentation

◆ get_gpio()

uint32_t AP_WheelEncoder_Quadrature::get_gpio ( uint8_t  pin_number)
staticprivate

Definition at line 115 of file WheelEncoder_Quadrature.cpp.

Referenced by update().

Here is the caller graph for this function:

◆ irq_handler()

void AP_WheelEncoder_Quadrature::irq_handler ( uint8_t  instance,
bool  pin_a 
)
staticprivate

Definition at line 180 of file WheelEncoder_Quadrature.cpp.

Referenced by irq_handler0_pina(), irq_handler0_pinb(), irq_handler1_pina(), and irq_handler1_pinb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ irq_handler0_pina()

int AP_WheelEncoder_Quadrature::irq_handler0_pina ( int  irq,
void *  context 
)
staticprivate

Definition at line 87 of file WheelEncoder_Quadrature.cpp.

Referenced by update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ irq_handler0_pinb()

int AP_WheelEncoder_Quadrature::irq_handler0_pinb ( int  irq,
void *  context 
)
staticprivate

Definition at line 94 of file WheelEncoder_Quadrature.cpp.

Referenced by update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ irq_handler1_pina()

int AP_WheelEncoder_Quadrature::irq_handler1_pina ( int  irq,
void *  context 
)
staticprivate

Definition at line 101 of file WheelEncoder_Quadrature.cpp.

Referenced by update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ irq_handler1_pinb()

int AP_WheelEncoder_Quadrature::irq_handler1_pinb ( int  irq,
void *  context 
)
staticprivate

Definition at line 108 of file WheelEncoder_Quadrature.cpp.

Referenced by update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pin_ab_to_phase()

uint8_t AP_WheelEncoder_Quadrature::pin_ab_to_phase ( bool  pin_a,
bool  pin_b 
)
staticprivate

Definition at line 137 of file WheelEncoder_Quadrature.cpp.

Referenced by update_phase_and_error_count().

Here is the caller graph for this function:

◆ update()

void AP_WheelEncoder_Quadrature::update ( void  )
virtual

Implements AP_WheelEncoder_Backend.

Definition at line 33 of file WheelEncoder_Quadrature.cpp.

Here is the call graph for this function:

◆ update_phase_and_error_count()

void AP_WheelEncoder_Quadrature::update_phase_and_error_count ( bool  pin_a_now,
bool  pin_b_now,
uint8_t &  phase,
int32_t &  distance_count,
uint32_t &  total_count,
uint32_t &  error_count 
)
staticprivate

Definition at line 159 of file WheelEncoder_Quadrature.cpp.

Referenced by irq_handler().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ irq_state

AP_WheelEncoder_Quadrature::IrqState AP_WheelEncoder_Quadrature::irq_state
staticprivate

Definition at line 58 of file WheelEncoder_Quadrature.h.

Referenced by irq_handler(), and update().

◆ last_pin_a

uint8_t AP_WheelEncoder_Quadrature::last_pin_a
private

Definition at line 61 of file WheelEncoder_Quadrature.h.

Referenced by update().

◆ last_pin_b

uint8_t AP_WheelEncoder_Quadrature::last_pin_b
private

Definition at line 62 of file WheelEncoder_Quadrature.h.

Referenced by update().


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