Functions | |
void | TLx4966_Config (TLx4966_Handle_t *handle, uint8_t polesPair, TLx4966_PowerMode_t powMode, TLx4966_MeasMode_t measMode, TLx4966_SpeedUnit_t speedUnit, TLx4966_HwIntf_t *hwIntf) |
Configures the sensor handle attributes Mandatory hw interfaces: dir, speed, timer. Optional hw interfaces: power (only for switch mode platform). More... | |
TLx4966_Error_t | TLx4966_Init (TLx4966_Handle_t *handle) |
Initilializes the hardware interfaces. More... | |
STATIC void | TLx4966_DirectionCallback (TLx4966_Handle_t *handle) |
Direction interrupt callback The sensor instance direction is updated upon interrupt event: rising or falling edge. More... | |
STATIC INLINE void | TLx4966_CalculateSpeed (TLx4966_Handle_t *handle) |
Calculates the speed. More... | |
STATIC void | TLx4966_SpeedCallback (TLx4966_Handle_t *handle) |
Speed interrupt callback The sensor instance instant speed is updated upon rising edge. More... | |
TLx4966_Error_t | TLx4966_Enable (TLx4966_Handle_t *handle) |
Enables the sensor. More... | |
TLx4966_Error_t | TLx4966_Disable (TLx4966_Handle_t *handle) |
Disables the sensor. More... | |
void | TLx4966_UpdateSpeed (TLx4966_Handle_t *handle) |
Updates the sensor speed. A rising edge is detected when the gpio voltage level changes from low to high. More... | |
INLINE void | TLx4966_UpdateDirection (TLx4966_Handle_t *handle) |
Updates the rotation direction A rising edge is detected when the gpio voltage level changes from low to high. More... | |
INLINE void | TLx4966_UpdateValues (TLx4966_Handle_t *handle) |
Updates the rotation direction and speed. More... | |
INLINE void | TLx4966_GetValues (TLx4966_Handle_t *handle, TLx4966_Params_t *params) |
Gets the rotation direction and speed parameters. More... | |
INLINE TLx4966_Status_t | TLx4966_GetStatus (TLx4966_Handle_t *handle) |
Gets the sensor status. More... | |
INLINE double | TLx4966_GetSpeed (TLx4966_Handle_t *handle) |
Gets the rotation speed. More... | |
INLINE TLx4966_Dir_t | TLx4966_GetDirection (TLx4966_Handle_t *handle) |
Gets the rotation direction The direction definition (clock-wise/anticlock-wise, left/rigth, positive/negative...) is dependant of the mechanical configuration of the sensor with repect to the rotor. The library just provide voltage-low/voltage-high directions. More... | |
Variables | |
STATIC double | TLx4966_SpeedCoeffient [3] |
Look-up array for Speed Unit Coeffients. More... | |
STATIC INLINE void TLx4966_CalculateSpeed | ( | TLx4966_Handle_t * | handle | ) |
Calculates the speed.
The rising edge of the speed GPIO signal determines the rotating period between a pair of poles. The speed is then obtained by applying the selected speed unit product coefficient, and dividing between the number of poles pairs.
[in] | handle | Pointer to the sensor entity handle |
void TLx4966_Config | ( | TLx4966_Handle_t * | handle, |
uint8_t | polesPair, | ||
TLx4966_PowerMode_t | powMode, | ||
TLx4966_MeasMode_t | measMode, | ||
TLx4966_SpeedUnit_t | speedUnit, | ||
TLx4966_HwIntf_t * | hwIntf | ||
) |
Configures the sensor handle attributes Mandatory hw interfaces: dir, speed, timer. Optional hw interfaces: power (only for switch mode platform).
[in,out] | *handle | Pointer to the sensor instance handle |
[in] | polesPair | Rotor poles pair number |
[in] | powMode | Power mode |
[in] | measMode | Measuring mode |
[in] | speedUnit | Speed unit |
[in] | *hwIntf | Pointer to hardware interface handle |
STATIC void TLx4966_DirectionCallback | ( | TLx4966_Handle_t * | handle | ) |
Direction interrupt callback The sensor instance direction is updated upon interrupt event: rising or falling edge.
[in] | handle | Pointer to the sensor entity handle |
TLx4966_Error_t TLx4966_Disable | ( | TLx4966_Handle_t * | handle | ) |
Disables the sensor.
[in] | handle | Pointer to the sensor entity handle |
TLx4966_OK | if success |
TLx4966_INTF_ERROR | if hardware interface error |
TLx4966_Error_t TLx4966_Enable | ( | TLx4966_Handle_t * | handle | ) |
Enables the sensor.
[in] | handle | Pointer to the sensor entity handle |
TLx4966_OK | if success |
TLx4966_INTF_ERROR | if hardware interface error |
INLINE TLx4966_Dir_t TLx4966_GetDirection | ( | TLx4966_Handle_t * | handle | ) |
Gets the rotation direction The direction definition (clock-wise/anticlock-wise, left/rigth, positive/negative...) is dependant of the mechanical configuration of the sensor with repect to the rotor. The library just provide voltage-low/voltage-high directions.
[in] | handle | Pointer to the sensor entity handle |
TLx4966_DIR_UNDEF | prior initial rotor movement (after initialization) |
INLINE double TLx4966_GetSpeed | ( | TLx4966_Handle_t * | handle | ) |
Gets the rotation speed.
[in] | handle | Pointer to the sensor entity handle |
INLINE TLx4966_Status_t TLx4966_GetStatus | ( | TLx4966_Handle_t * | handle | ) |
Gets the sensor status.
[in] | handle | Pointer to the sensor entity handle |
INLINE void TLx4966_GetValues | ( | TLx4966_Handle_t * | handle, |
TLx4966_Params_t * | params | ||
) |
Gets the rotation direction and speed parameters.
[in] | handle | Pointer to the sensor entity handle |
[out] | *params | Pointer to the struct to store the parameter values |
TLx4966_Error_t TLx4966_Init | ( | TLx4966_Handle_t * | handle | ) |
Initilializes the hardware interfaces.
[in] | handle | Pointer to the sensor entity handle |
TLx4966_OK | if success |
TLx4966_INTF_ERROR | if hardware interface error |
STATIC void TLx4966_SpeedCallback | ( | TLx4966_Handle_t * | handle | ) |
Speed interrupt callback The sensor instance instant speed is updated upon rising edge.
[in] | handle | Pointer to the sensor entity handle |
INLINE void TLx4966_UpdateDirection | ( | TLx4966_Handle_t * | handle | ) |
Updates the rotation direction A rising edge is detected when the gpio voltage level changes from low to high.
[in] | handle | Pointer to the sensor entity handle |
void TLx4966_UpdateSpeed | ( | TLx4966_Handle_t * | handle | ) |
Updates the sensor speed. A rising edge is detected when the gpio voltage level changes from low to high.
[in] | handle | Pointer to the sensor entity handle |
INLINE void TLx4966_UpdateValues | ( | TLx4966_Handle_t * | handle | ) |
Updates the rotation direction and speed.
[in] | handle | Pointer to the sensor entity handle |
STATIC double TLx4966_SpeedCoeffient[3] |
Look-up array for Speed Unit Coeffients.