iLLD_TC29x
1.0
|
The standard interface position interface (IfxStdIf_Pos) abstract the hardware used for position interface feature like encoder, hall, resolver, ... It provide, after proper initialization an hardware Independent way to interact with the position sensor like getting position, speed, direction, ...
The figure below shows the standard position interface.
This interface defines the following features:
IFX_INLINE float32 IfxStdIf_Pos_getAbsolutePosition | ( | IfxStdIf_Pos * | stdIf) |
Return the position, inclusive turns.
Return the sensor position in rad for rotating sensor inclusive turns, or in m for linear sensors. For linear sensor the effect is the same as IfxStdIf_Pos_GetPosition.
driver | Pointer to the interface driver object |
Definition at line 312 of file IfxStdIf_Pos.h.
IFX_INLINE IfxStdIf_Pos_Dir IfxStdIf_Pos_getDirection | ( | IfxStdIf_Pos * | stdIf) |
Return the direction.
Return the sensor direction.
driver | Pointer to the interface driver object |
Definition at line 340 of file IfxStdIf_Pos.h.
IFX_INLINE IfxStdIf_Pos_Status IfxStdIf_Pos_getFault | ( | IfxStdIf_Pos * | stdIf) |
Return the sensor status.
driver | Pointer to the interface driver object |
Definition at line 319 of file IfxStdIf_Pos.h.
Referenced by IfxStdIf_Pos_isFault().
IFX_INLINE sint32 IfxStdIf_Pos_getOffset | ( | IfxStdIf_Pos * | stdIf) |
Return the raw position sensor offset.
driver | Pointer to the interface driver object |
Definition at line 326 of file IfxStdIf_Pos.h.
IFX_INLINE uint16 IfxStdIf_Pos_getPeriodPerRotation | ( | IfxStdIf_Pos * | stdIf) |
Definition at line 346 of file IfxStdIf_Pos.h.
IFX_INLINE float32 IfxStdIf_Pos_getPosition | ( | IfxStdIf_Pos * | stdIf) |
Return the position.
Return the sensor position in rad for rotating sensor or in m for linear sensors. For rotating sensor, the position is always between 0 and 2*IFX_PI.
driver | Pointer to the interface driver object |
Definition at line 333 of file IfxStdIf_Pos.h.
IFX_INLINE sint32 IfxStdIf_Pos_getRawPosition | ( | IfxStdIf_Pos * | stdIf) |
Return the raw position in ticks.
Return the sensor raw position in ticks.
driver | Pointer to the interface driver object |
Definition at line 353 of file IfxStdIf_Pos.h.
IFX_INLINE float32 IfxStdIf_Pos_getRefreshPeriod | ( | IfxStdIf_Pos * | stdIf) |
Get the update period.
driver | Pointer to the interface driver object |
Definition at line 360 of file IfxStdIf_Pos.h.
IFX_INLINE sint32 IfxStdIf_Pos_getResolution | ( | IfxStdIf_Pos * | stdIf) |
Get the resolution.
driver | Pointer to the interface driver object |
Definition at line 367 of file IfxStdIf_Pos.h.
IFX_INLINE IfxStdIf_Pos_SensorType IfxStdIf_Pos_getSensorType | ( | IfxStdIf_Pos * | stdIf) |
Get the sensor type.
driver | Pointer to the interface driver object |
Definition at line 381 of file IfxStdIf_Pos.h.
IFX_INLINE float32 IfxStdIf_Pos_getSpeed | ( | IfxStdIf_Pos * | stdIf) |
Return the speed.
driver | Pointer to the interface driver object |
Definition at line 388 of file IfxStdIf_Pos.h.
IFX_INLINE sint32 IfxStdIf_Pos_getTurn | ( | IfxStdIf_Pos * | stdIf) |
Return position in turn.
driver | Pointer to the interface driver object |
Definition at line 374 of file IfxStdIf_Pos.h.
IFX_INLINE boolean IfxStdIf_Pos_isFault | ( | IfxStdIf_Pos * | stdIf) |
Check whether the sensor is faulty
Definition at line 395 of file IfxStdIf_Pos.h.
IFX_INLINE void IfxStdIf_Pos_onZeroIrq | ( | IfxStdIf_Pos * | stdIf) |
Handles the zero interrupt.
driver | Pointer to the interface driver object |
Definition at line 305 of file IfxStdIf_Pos.h.
IFX_INLINE void IfxStdIf_Pos_reset | ( | IfxStdIf_Pos * | stdIf) |
Reset the driver.
Clear faults, reset speed and position to 0
driver | Pointer to the interface driver object |
Definition at line 409 of file IfxStdIf_Pos.h.
IFX_INLINE void IfxStdIf_Pos_resetFaults | ( | IfxStdIf_Pos * | stdIf) |
Reset the driver fault.
Clear faults
driver | Pointer to the interface driver object |
Definition at line 416 of file IfxStdIf_Pos.h.
IFX_INLINE void IfxStdIf_Pos_setOffset | ( | IfxStdIf_Pos * | stdIf, |
sint32 | offset | ||
) |
Set the sensor offset.
driver | Pointer to the interface driver object |
offset | Offset in sensor ticks |
Definition at line 423 of file IfxStdIf_Pos.h.
IFX_INLINE void IfxStdIf_Pos_setPosition | ( | IfxStdIf_Pos * | stdIf, |
float32 | position | ||
) |
Set the sensor position (virtual sensor)
driver | Pointer to the interface driver object |
position | Position sensor rad |
Definition at line 430 of file IfxStdIf_Pos.h.
IFX_INLINE void IfxStdIf_Pos_setRawPosition | ( | IfxStdIf_Pos * | stdIf, |
sint32 | position | ||
) |
Set the sensor position (virtual sensor)
driver | Pointer to the interface driver object |
position | Position sensor ticks |
Definition at line 437 of file IfxStdIf_Pos.h.
IFX_INLINE void IfxStdIf_Pos_setRefreshPeriod | ( | IfxStdIf_Pos * | stdIf, |
float32 | updatePeriod | ||
) |
Set the update period.
driver | Pointer to the interface driver object |
updatePeriod | Refresh period in s |
Definition at line 451 of file IfxStdIf_Pos.h.
IFX_INLINE void IfxStdIf_Pos_setSpeed | ( | IfxStdIf_Pos * | stdIf, |
float32 | speed | ||
) |
Set the sensor speed (virtual sensor)
driver | Pointer to the interface driver object |
speed | speed in rad/s |
Definition at line 444 of file IfxStdIf_Pos.h.
IFX_INLINE void IfxStdIf_Pos_update | ( | IfxStdIf_Pos * | stdIf) |
Refresh the status.
Update the driver state like speed, position, status, taking into account the updatePeriod
driver | Pointer to the interface driver object |
Definition at line 402 of file IfxStdIf_Pos.h.