iLLD_TC27xD  1.0
IfxStdIf_Pos.h File Reference

Standard interface: Position interface. More...

#include "Cpu/Std/Ifx_Types.h"
#include "IfxStdIf.h"

Go to the source code of this file.

Data Structures

union  IfxStdIf_Pos_Status
 Position sensor status definition. More...
 
struct  IfxStdIf_Pos_
 Standard interface object. More...
 
struct  IfxStdIf_Pos_Config
 Position interface configuration. More...
 
struct  IfxStdIf_Pos_Status.B
 

Typedefs

typedef sint32 IfxStdIf_Pos_RawAngle
 
typedef struct IfxStdIf_Pos_ IfxStdIf_Pos
 Forward declaration. More...
 
typedef float32(* IfxStdIf_Pos_GetAbsolutePosition )(IfxStdIf_InterfaceDriver driver)
 Return the position, inclusive turns. More...
 
typedef void(* IfxStdIf_Pos_OnZeroIrq )(IfxStdIf_InterfaceDriver driver)
 Handles the zero interrupt. More...
 
typedef sint32(* IfxStdIf_Pos_GetOffset )(IfxStdIf_InterfaceDriver driver)
 Return the raw position sensor offset. More...
 
typedef float32(* IfxStdIf_Pos_GetPosition )(IfxStdIf_InterfaceDriver driver)
 Return the position. More...
 
typedef IfxStdIf_Pos_Dir(* IfxStdIf_Pos_GetDirection )(IfxStdIf_InterfaceDriver driver)
 Return the direction. More...
 
typedef IfxStdIf_Pos_Status(* IfxStdIf_Pos_GetFault )(IfxStdIf_InterfaceDriver driver)
 Return the sensor status. More...
 
typedef uint16(* IfxStdIf_Pos_GetPeriodPerRotation )(IfxStdIf_InterfaceDriver driver)
 Return the period per rotation setting. More...
 
typedef sint32(* IfxStdIf_Pos_GetRawPosition )(IfxStdIf_InterfaceDriver driver)
 Return the raw position in ticks. More...
 
typedef float32(* IfxStdIf_Pos_GetRefreshPeriod )(IfxStdIf_InterfaceDriver driver)
 Get the update period. More...
 
typedef sint32(* IfxStdIf_Pos_GetResolution )(IfxStdIf_InterfaceDriver driver)
 Get the resolution. More...
 
typedef IfxStdIf_Pos_SensorType(* IfxStdIf_Pos_GetSensorType )(IfxStdIf_InterfaceDriver driver)
 Get the sensor type. More...
 
typedef float32(* IfxStdIf_Pos_GetSpeed )(IfxStdIf_InterfaceDriver driver)
 Return the speed. More...
 
typedef sint32(* IfxStdIf_Pos_GetTurn )(IfxStdIf_InterfaceDriver driver)
 Return position in turn. More...
 
typedef void(* IfxStdIf_Pos_Update )(IfxStdIf_InterfaceDriver driver)
 Refresh the status. More...
 
typedef void(* IfxStdIf_Pos_Reset )(IfxStdIf_InterfaceDriver driver)
 Reset the driver. More...
 
typedef void(* IfxStdIf_Pos_ResetFaults )(IfxStdIf_InterfaceDriver driver)
 Reset the driver fault. More...
 
typedef void(* IfxStdIf_Pos_SetOffset )(IfxStdIf_InterfaceDriver driver, sint32 offset)
 Set the sensor offset. More...
 
typedef void(* IfxStdIf_Pos_SetPosition )(IfxStdIf_InterfaceDriver driver, float32 position)
 Set the sensor position (virtual sensor) More...
 
typedef void(* IfxStdIf_Pos_SetRawPosition )(IfxStdIf_InterfaceDriver driver, sint32 position)
 Set the sensor position (virtual sensor) More...
 
typedef void(* IfxStdIf_Pos_SetSpeed )(IfxStdIf_InterfaceDriver driver, float32 speed)
 Set the sensor speed (virtual sensor) More...
 
typedef void(* IfxStdIf_Pos_SetRefreshPeriod )(IfxStdIf_InterfaceDriver driver, float32 updatePeriod)
 Set the update period. More...
 

Enumerations

enum  IfxStdIf_Pos_MotionType {
  IfxStdIf_Pos_MotionType_rotating,
  IfxStdIf_Pos_MotionType_linear
}
 Output event enable / disable. More...
 
enum  IfxStdIf_Pos_ResolutionFactor {
  IfxStdIf_Pos_ResolutionFactor_oneFold = 1,
  IfxStdIf_Pos_ResolutionFactor_twoFold = 2,
  IfxStdIf_Pos_ResolutionFactor_fourFold = 4
}
 Output event enable / disable. More...
 
enum  IfxStdIf_Pos_SensorType {
  IfxStdIf_Pos_SensorType_encoder,
  IfxStdIf_Pos_SensorType_hall,
  IfxStdIf_Pos_SensorType_resolver,
  IfxStdIf_Pos_SensorType_angletrk,
  IfxStdIf_Pos_SensorType_igmr,
  IfxStdIf_Pos_SensorType_virtual
}
 Position sensor Types. More...
 
enum  IfxStdIf_Pos_Dir {
  IfxStdIf_Pos_Dir_forward,
  IfxStdIf_Pos_Dir_backward,
  IfxStdIf_Pos_Dir_unknown
}
 Position sensor direction definition. More...
 

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...
 
IFX_INLINE float32 IfxStdIf_Pos_radsToRpm (float32 speed)
 Converts from rad/s to rpm. More...
 
IFX_INLINE float32 IfxStdIf_Pos_rpmToRads (float32 speed)
 Converts from rpm to rad/s. More...
 
IFX_EXTERN void IfxStdIf_Pos_initConfig (IfxStdIf_Pos_Config *config)
 

Detailed Description

Standard interface: Position interface.

Version
iLLD_1_0_0_11_0
                            IMPORTANT NOTICE

Infineon Technologies AG (Infineon) is supplying this file for use exclusively with Infineon's microcontroller products. This file can be freely distributed within development tools that are supporting such microcontroller products.

THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. INFINEON SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.

Definition in file IfxStdIf_Pos.h.


Data Structure Documentation

union IfxStdIf_Pos_Status

Position sensor status definition.

Definition at line 82 of file IfxStdIf_Pos.h.

Data Fields
struct IfxStdIf_Pos_Status B Bitfielf status access.
uint32 status Global status access.
struct IfxStdIf_Pos_

Standard interface object.

Definition at line 258 of file IfxStdIf_Pos.h.

Collaboration diagram for IfxStdIf_Pos_:
Data Fields
IfxStdIf_InterfaceDriver driver Interface driver object.
IfxStdIf_Pos_GetAbsolutePosition getAbsolutePosition Return the absolute position.
IfxStdIf_Pos_GetDirection getDirection
See Also
IfxStdIf_Pos_GetDirection
IfxStdIf_Pos_GetFault getFault
See Also
IfxStdIf_Pos_GetFault
IfxStdIf_Pos_GetOffset getOffset
See Also
IfxStdIf_Pos_GetOffset
IfxStdIf_Pos_GetPeriodPerRotation getPeriodPerRotation
See Also
IfxStdIf_Pos_GetPeriodPerRotation
IfxStdIf_Pos_GetPosition getPosition
See Also
IfxStdIf_Pos_GetPosition
IfxStdIf_Pos_GetRawPosition getRawPosition
See Also
IfxStdIf_Pos_GetRawPosition
IfxStdIf_Pos_GetRefreshPeriod getRefreshPeriod
See Also
IfxStdIf_Pos_GetRefreshPeriod
IfxStdIf_Pos_GetResolution getResolution
See Also
IfxStdIf_Pos_GetResolution
IfxStdIf_Pos_GetSensorType getSensorType
See Also
IfxStdIf_Pos_GetSensorType
IfxStdIf_Pos_GetSpeed getSpeed
See Also
IfxStdIf_Pos_GetSpeed
IfxStdIf_Pos_GetTurn getTurn
See Also
IfxStdIf_Pos_GetTurn
IfxStdIf_Pos_OnZeroIrq onZeroIrq
See Also
IfxStdIf_Pos_OnZeroIrq
IfxStdIf_Pos_Reset reset
See Also
IfxStdIf_Pos_Reset
IfxStdIf_Pos_ResetFaults resetFaults
See Also
IfxStdIf_Pos_ResetFaults
IfxStdIf_Pos_SetOffset setOffset
See Also
IfxStdIf_Pos_SetOffset
IfxStdIf_Pos_SetPosition setPosition
See Also
IfxStdIf_Pos_SetPosition
IfxStdIf_Pos_SetRawPosition setRawPosition
See Also
IfxStdIf_Pos_SetRawPosition
IfxStdIf_Pos_SetRefreshPeriod setRefreshPeriod
See Also
IfxStdIf_Pos_SetRefreshPeriod
IfxStdIf_Pos_SetSpeed setSpeed
See Also
IfxStdIf_Pos_SetSpeed
IfxStdIf_Pos_Update update
See Also
IfxStdIf_Pos_Update
struct IfxStdIf_Pos_Config

Position interface configuration.

Definition at line 285 of file IfxStdIf_Pos.h.

Data Fields
float32 maxSpeed Absolute maximal allowed speed. Above speed is recognized as error.
float32 minSpeed Absolute minimal allowed speed. below speed is recognized as 0rad/s.
sint32 offset Position sensor offset.
uint16 periodPerRotation Number of period per rotation. Is usually 1 for encoder.
sint32 resolution Sensor resolution. For encoder with 1024 pulse per revolution, the value should be 1024.
IfxStdIf_Pos_ResolutionFactor resolutionFactor Resolution multiplier for encoder interface, valid is 2, 4.
boolean reversed If true, the sensor direction is reversed.
float32 speedFilerCutOffFrequency Speed low pass filter cut off frequency.
boolean speedFilterEnabled Enable / disable the speed low pass filter.
float32 speedModeThreshold Speed threshold used for the speed calculation mode. For encoder, above the threshold the pulse count mode is used, below the threshold, the time delta is used.
float32 updatePeriod period in seconds, at which the application calls IfxStdIf_Pos_update()
struct IfxStdIf_Pos_Status.B

Definition at line 85 of file IfxStdIf_Pos.h.

Data Fields
uint32 commError: 1 Communication error.
uint32 notSynchronised: 1 Sensor is not synchronized.
uint32 signalDegradation: 1 Signal degradation warning.
uint32 signalLoss: 1 Loss of signal error.
uint32 trackingLoss: 1 Tracking loss error.

Typedef Documentation

typedef struct IfxStdIf_Pos_ IfxStdIf_Pos

Forward declaration.

Definition at line 98 of file IfxStdIf_Pos.h.

typedef float32(* IfxStdIf_Pos_GetAbsolutePosition)(IfxStdIf_InterfaceDriver driver)

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 108 of file IfxStdIf_Pos.h.

typedef IfxStdIf_Pos_Dir(* IfxStdIf_Pos_GetDirection)(IfxStdIf_InterfaceDriver driver)

Return the direction.

Return the sensor direction.

Parameters
driverPointer to the interface driver object
Returns
Return the direction

Definition at line 140 of file IfxStdIf_Pos.h.

typedef IfxStdIf_Pos_Status(* IfxStdIf_Pos_GetFault)(IfxStdIf_InterfaceDriver driver)

Return the sensor status.

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

Definition at line 147 of file IfxStdIf_Pos.h.

typedef sint32(* IfxStdIf_Pos_GetOffset)(IfxStdIf_InterfaceDriver driver)

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 121 of file IfxStdIf_Pos.h.

typedef uint16(* IfxStdIf_Pos_GetPeriodPerRotation)(IfxStdIf_InterfaceDriver driver)

Return the period per rotation setting.

Parameters
driverPointer to the interface driver object
Returns
Return the period per rotation setting

Definition at line 154 of file IfxStdIf_Pos.h.

typedef float32(* IfxStdIf_Pos_GetPosition)(IfxStdIf_InterfaceDriver driver)

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 131 of file IfxStdIf_Pos.h.

typedef sint32(* IfxStdIf_Pos_GetRawPosition)(IfxStdIf_InterfaceDriver driver)

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 163 of file IfxStdIf_Pos.h.

typedef float32(* IfxStdIf_Pos_GetRefreshPeriod)(IfxStdIf_InterfaceDriver driver)

Get the update period.

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

Definition at line 169 of file IfxStdIf_Pos.h.

typedef sint32(* IfxStdIf_Pos_GetResolution)(IfxStdIf_InterfaceDriver driver)

Get the resolution.

Parameters
driverPointer to the interface driver object
Returns
Return the resolution

Definition at line 175 of file IfxStdIf_Pos.h.

typedef IfxStdIf_Pos_SensorType(* IfxStdIf_Pos_GetSensorType)(IfxStdIf_InterfaceDriver driver)

Get the sensor type.

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

Definition at line 181 of file IfxStdIf_Pos.h.

typedef float32(* IfxStdIf_Pos_GetSpeed)(IfxStdIf_InterfaceDriver driver)

Return the speed.

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

Definition at line 187 of file IfxStdIf_Pos.h.

typedef sint32(* IfxStdIf_Pos_GetTurn)(IfxStdIf_InterfaceDriver driver)

Return position in turn.

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

Definition at line 193 of file IfxStdIf_Pos.h.

typedef void(* IfxStdIf_Pos_OnZeroIrq)(IfxStdIf_InterfaceDriver driver)

Handles the zero interrupt.

Parameters
driverPointer to the interface driver object
Returns
none

Definition at line 114 of file IfxStdIf_Pos.h.

Definition at line 95 of file IfxStdIf_Pos.h.

typedef void(* IfxStdIf_Pos_Reset)(IfxStdIf_InterfaceDriver driver)

Reset the driver.

Clear faults, reset speed and position to 0

Parameters
driverPointer to the interface driver object
Returns
None

Definition at line 211 of file IfxStdIf_Pos.h.

typedef void(* IfxStdIf_Pos_ResetFaults)(IfxStdIf_InterfaceDriver driver)

Reset the driver fault.

Clear faults

Parameters
driverPointer to the interface driver object
Returns
None

Definition at line 220 of file IfxStdIf_Pos.h.

typedef void(* IfxStdIf_Pos_SetOffset)(IfxStdIf_InterfaceDriver driver, sint32 offset)

Set the sensor offset.

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

Definition at line 227 of file IfxStdIf_Pos.h.

typedef void(* IfxStdIf_Pos_SetPosition)(IfxStdIf_InterfaceDriver driver, float32 position)

Set the sensor position (virtual sensor)

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

Definition at line 234 of file IfxStdIf_Pos.h.

typedef void(* IfxStdIf_Pos_SetRawPosition)(IfxStdIf_InterfaceDriver driver, sint32 position)

Set the sensor position (virtual sensor)

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

Definition at line 240 of file IfxStdIf_Pos.h.

typedef void(* IfxStdIf_Pos_SetRefreshPeriod)(IfxStdIf_InterfaceDriver driver, float32 updatePeriod)

Set the update period.

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

Definition at line 254 of file IfxStdIf_Pos.h.

typedef void(* IfxStdIf_Pos_SetSpeed)(IfxStdIf_InterfaceDriver driver, float32 speed)

Set the sensor speed (virtual sensor)

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

Definition at line 247 of file IfxStdIf_Pos.h.

typedef void(* IfxStdIf_Pos_Update)(IfxStdIf_InterfaceDriver driver)

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 202 of file IfxStdIf_Pos.h.

Enumeration Type Documentation

Position sensor direction definition.

Enumerator
IfxStdIf_Pos_Dir_forward 

Forward direction. For rotating position sensor, forward is clockwise rotation.

IfxStdIf_Pos_Dir_backward 

Backward direction. For rotating position sensor, fackward is counter-clockwise rotation.

IfxStdIf_Pos_Dir_unknown 

Unknown direction.

Definition at line 74 of file IfxStdIf_Pos.h.

Output event enable / disable.

Enumerator
IfxStdIf_Pos_MotionType_rotating 

Rotating sensor.

IfxStdIf_Pos_MotionType_linear 

Linear sensor.

Definition at line 48 of file IfxStdIf_Pos.h.

Output event enable / disable.

Enumerator
IfxStdIf_Pos_ResolutionFactor_oneFold 

Default, no multipluication factor.

IfxStdIf_Pos_ResolutionFactor_twoFold 

2-fold resolution. Valid for encoder

IfxStdIf_Pos_ResolutionFactor_fourFold 

4-fold resolution. Valid for encoder

Definition at line 55 of file IfxStdIf_Pos.h.

Position sensor Types.

Enumerator
IfxStdIf_Pos_SensorType_encoder 
IfxStdIf_Pos_SensorType_hall 
IfxStdIf_Pos_SensorType_resolver 
IfxStdIf_Pos_SensorType_angletrk 
IfxStdIf_Pos_SensorType_igmr 
IfxStdIf_Pos_SensorType_virtual 

Definition at line 63 of file IfxStdIf_Pos.h.

Function Documentation

IFX_EXTERN void IfxStdIf_Pos_initConfig ( IfxStdIf_Pos_Config config)

Initialize the configuration structure to default

Parameters
configPosition interface configuration. This parameter is initialized by the function

Definition at line 28 of file IfxStdIf_Pos.c.

Referenced by IfxGpt12_IncrEnc_initConfig().

IFX_INLINE float32 IfxStdIf_Pos_radsToRpm ( float32  speed)

Converts from rad/s to rpm.

Parameters
speedSpecifies the speed in rad/s.
Returns
returns the converted speed in rpm.
See Also
IfxStdIf_Pos_rpmToRads()

Definition at line 466 of file IfxStdIf_Pos.h.

IFX_INLINE float32 IfxStdIf_Pos_rpmToRads ( float32  speed)

Converts from rpm to rad/s.

Parameters
speedSpecifies the speed in rpm.
Returns
returns the converted speed in rad/s.
See Also
IfxStdIf_Pos_radsToRpm()

Definition at line 479 of file IfxStdIf_Pos.h.