TLx4966 Direction Speed Sensor 1.1.1
C/C++ library of Infineons double Hall-effect direction and speed sensor TLx4966(K)/(G)/(L)/(V) family for magnetic sensing applications.
 
Loading...
Searching...
No Matches
TLx4966.c File Reference

TLx4966 C library Hardware Abstraction Layer Features: More...

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).
 
TLx4966_Error_t TLx4966_Init (TLx4966_Handle_t *handle)
 Initilializes the hardware interfaces.
 
STATIC void TLx4966_DirectionCallback (TLx4966_Handle_t *handle)
 Direction interrupt callback The sensor instance direction is updated upon interrupt event: rising or falling edge.
 
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.
 
STATIC void TLx4966_SpeedCallback (TLx4966_Handle_t *handle)
 Speed interrupt callback The sensor instance instant speed is updated upon rising edge.
 
TLx4966_Error_t TLx4966_Enable (TLx4966_Handle_t *handle)
 Enables the sensor.
 
TLx4966_Error_t TLx4966_Disable (TLx4966_Handle_t *handle)
 Disables the sensor.
 
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.
 
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.
 
INLINE void TLx4966_UpdateValues (TLx4966_Handle_t *handle)
 Updates the rotation direction and speed.
 
INLINE void TLx4966_GetValues (TLx4966_Handle_t *handle, TLx4966_Params_t *params)
 Gets the rotation direction and speed parameters.
 
INLINE TLx4966_Status_t TLx4966_GetStatus (TLx4966_Handle_t *handle)
 Gets the sensor status.
 
INLINE double TLx4966_GetSpeed (TLx4966_Handle_t *handle)
 Gets the rotation speed.
 
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.
 

Variables

STATIC double TLx4966_SpeedCoeffient [3]
 Look-up array for Speed Unit Coeffients.
 

Detailed Description

TLx4966 C library Hardware Abstraction Layer Features:

  • Polling or interrupt based measuring mode
  • GPIO controlled power-on/off interface avilable
  • Flexible hardware platform configuration
    Date
    April 2019