iLLD_TC29x  1.0
Standard interface: Position interface
Collaboration diagram for Standard interface: Position interface:

Functions

IFX_INLINE void IfxStdIf_Pos_onZeroIrq (IfxStdIf_Pos *stdIf)
 Handles the zero interrupt. More...
 
IFX_INLINE float32 IfxStdIf_Pos_getAbsolutePosition (IfxStdIf_Pos *stdIf)
 Return the position, inclusive turns. More...
 
IFX_INLINE IfxStdIf_Pos_Status IfxStdIf_Pos_getFault (IfxStdIf_Pos *stdIf)
 Return the sensor status. More...
 
IFX_INLINE sint32 IfxStdIf_Pos_getOffset (IfxStdIf_Pos *stdIf)
 Return the raw position sensor offset. More...
 
IFX_INLINE float32 IfxStdIf_Pos_getPosition (IfxStdIf_Pos *stdIf)
 Return the position. More...
 
IFX_INLINE IfxStdIf_Pos_Dir IfxStdIf_Pos_getDirection (IfxStdIf_Pos *stdIf)
 Return the direction. More...
 
IFX_INLINE uint16 IfxStdIf_Pos_getPeriodPerRotation (IfxStdIf_Pos *stdIf)
 
IFX_INLINE sint32 IfxStdIf_Pos_getRawPosition (IfxStdIf_Pos *stdIf)
 Return the raw position in ticks. More...
 
IFX_INLINE float32 IfxStdIf_Pos_getRefreshPeriod (IfxStdIf_Pos *stdIf)
 Get the update period. More...
 
IFX_INLINE sint32 IfxStdIf_Pos_getResolution (IfxStdIf_Pos *stdIf)
 Get the resolution. More...
 
IFX_INLINE sint32 IfxStdIf_Pos_getTurn (IfxStdIf_Pos *stdIf)
 Return position in turn. More...
 
IFX_INLINE IfxStdIf_Pos_SensorType IfxStdIf_Pos_getSensorType (IfxStdIf_Pos *stdIf)
 Get the sensor type. More...
 
IFX_INLINE float32 IfxStdIf_Pos_getSpeed (IfxStdIf_Pos *stdIf)
 Return the speed. More...
 
IFX_INLINE boolean IfxStdIf_Pos_isFault (IfxStdIf_Pos *stdIf)
 
IFX_INLINE void IfxStdIf_Pos_update (IfxStdIf_Pos *stdIf)
 Refresh the status. More...
 
IFX_INLINE void IfxStdIf_Pos_reset (IfxStdIf_Pos *stdIf)
 Reset the driver. More...
 
IFX_INLINE void IfxStdIf_Pos_resetFaults (IfxStdIf_Pos *stdIf)
 Reset the driver fault. More...
 
IFX_INLINE void IfxStdIf_Pos_setOffset (IfxStdIf_Pos *stdIf, sint32 offset)
 Set the sensor offset. More...
 
IFX_INLINE void IfxStdIf_Pos_setPosition (IfxStdIf_Pos *stdIf, float32 position)
 Set the sensor position (virtual sensor) More...
 
IFX_INLINE void IfxStdIf_Pos_setRawPosition (IfxStdIf_Pos *stdIf, sint32 position)
 Set the sensor position (virtual sensor) More...
 
IFX_INLINE void IfxStdIf_Pos_setSpeed (IfxStdIf_Pos *stdIf, float32 speed)
 Set the sensor speed (virtual sensor) More...
 
IFX_INLINE void IfxStdIf_Pos_setRefreshPeriod (IfxStdIf_Pos *stdIf, float32 updatePeriod)
 Set the update period. More...
 

Detailed Description

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.

stdif_PosIf.png
Standard position interface

This interface defines the following features:

Function Documentation

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.

Parameters
driverPointer to the interface driver object
Returns
Return the position inclusive turns in rad

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.

Parameters
driverPointer to the interface driver object
Returns
Return the direction

Definition at line 340 of file IfxStdIf_Pos.h.

IFX_INLINE IfxStdIf_Pos_Status IfxStdIf_Pos_getFault ( IfxStdIf_Pos stdIf)

Return the sensor status.

Parameters
driverPointer to the interface driver object
Returns
Return the sensor status

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.

Parameters
driverPointer to the interface driver object
Returns
Return the raw position sensor offset sensor in ticks

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.

Parameters
driverPointer to the interface driver object
Returns
Return the position in rad or m

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.

Parameters
driverPointer to the interface driver object
Returns
Return the raw position in ticks

Definition at line 353 of file IfxStdIf_Pos.h.

IFX_INLINE float32 IfxStdIf_Pos_getRefreshPeriod ( IfxStdIf_Pos stdIf)

Get the update period.

Parameters
driverPointer to the interface driver object
Returns
Return the update period in s

Definition at line 360 of file IfxStdIf_Pos.h.

IFX_INLINE sint32 IfxStdIf_Pos_getResolution ( IfxStdIf_Pos stdIf)

Get the resolution.

Parameters
driverPointer to the interface driver object
Returns
Return the resolution

Definition at line 367 of file IfxStdIf_Pos.h.

IFX_INLINE IfxStdIf_Pos_SensorType IfxStdIf_Pos_getSensorType ( IfxStdIf_Pos stdIf)

Get the sensor type.

Parameters
driverPointer to the interface driver object
Returns
Return the sensor type

Definition at line 381 of file IfxStdIf_Pos.h.

IFX_INLINE float32 IfxStdIf_Pos_getSpeed ( IfxStdIf_Pos stdIf)

Return the speed.

Parameters
driverPointer to the interface driver object
Returns
Return the speed in rad/s or m/s

Definition at line 388 of file IfxStdIf_Pos.h.

IFX_INLINE sint32 IfxStdIf_Pos_getTurn ( IfxStdIf_Pos stdIf)

Return position in turn.

Parameters
driverPointer to the interface driver object
Returns
Return position in turn

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.

Parameters
driverPointer to the interface driver object
Returns
none

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

Parameters
driverPointer to the interface driver object
Returns
None

Definition at line 409 of file IfxStdIf_Pos.h.

IFX_INLINE void IfxStdIf_Pos_resetFaults ( IfxStdIf_Pos stdIf)

Reset the driver fault.

Clear faults

Parameters
driverPointer to the interface driver object
Returns
None

Definition at line 416 of file IfxStdIf_Pos.h.

IFX_INLINE void IfxStdIf_Pos_setOffset ( IfxStdIf_Pos stdIf,
sint32  offset 
)

Set the sensor offset.

Parameters
driverPointer to the interface driver object
offsetOffset in sensor ticks
Returns
None

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)

Parameters
driverPointer to the interface driver object
positionPosition sensor rad
Returns
None

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)

Parameters
driverPointer to the interface driver object
positionPosition sensor ticks
Returns
None

Definition at line 437 of file IfxStdIf_Pos.h.

IFX_INLINE void IfxStdIf_Pos_setRefreshPeriod ( IfxStdIf_Pos stdIf,
float32  updatePeriod 
)

Set the update period.

Parameters
driverPointer to the interface driver object
updatePeriodRefresh period in s
Returns
None

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)

Parameters
driverPointer to the interface driver object
speedspeed in rad/s
Returns
None

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

Parameters
driverPointer to the interface driver object
Returns
None

Definition at line 402 of file IfxStdIf_Pos.h.