iLLD_TC27xC  1.0
Standard interface: Timer
Collaboration diagram for Standard interface: Timer:

Functions

IFX_INLINE float32 IfxStdIf_Timer_getFrequency (IfxStdIf_Timer *stdIf)
 Return the timer frequency in Hz. More...
 
IFX_INLINE Ifx_TimerValue IfxStdIf_Timer_getPeriod (IfxStdIf_Timer *stdIf)
 Return the timer period in ticks. More...
 
IFX_INLINE float32 IfxStdIf_Timer_getResolution (IfxStdIf_Timer *stdIf)
 Return the timer resolution in seconds. More...
 
IFX_INLINE boolean IfxStdIf_Timer_setFrequency (IfxStdIf_Timer *stdIf, float32 frequency)
 Set the timer frequency in Hz. More...
 
IFX_INLINE void IfxStdIf_Timer_updateInputFrequency (IfxStdIf_Timer *stdIf)
 Indicates the driver that the imput frequency has changed and that it should be taken in account. More...
 
IFX_INLINE void IfxStdIf_Timer_applyUpdate (IfxStdIf_Timer *stdIf)
 Apply requested updates. More...
 
IFX_INLINE void IfxStdIf_Timer_disableUpdate (IfxStdIf_Timer *stdIf)
 Disable updates. More...
 
IFX_INLINE float32 IfxStdIf_Timer_getInputFrequency (IfxStdIf_Timer *stdIf)
 Return the timer input frequency in Hz. More...
 
IFX_INLINE void IfxStdIf_Timer_run (IfxStdIf_Timer *stdIf)
 Immediately start the timer. More...
 
IFX_INLINE boolean IfxStdIf_Timer_setPeriod (IfxStdIf_Timer *stdIf, Ifx_TimerValue period)
 Set the timer period. More...
 
IFX_INLINE void IfxStdIf_Timer_setSingleMode (IfxStdIf_Timer *stdIf, boolean enabled)
 Stop timer at the end of the period. More...
 
IFX_INLINE void IfxStdIf_Timer_setTrigger (IfxStdIf_Timer *stdIf, Ifx_TimerValue triggerPoint)
 Set trigger point. More...
 
IFX_INLINE void IfxStdIf_Timer_stop (IfxStdIf_Timer *stdIf)
 Immediately stops the timer. More...
 
IFX_INLINE boolean IfxStdIf_Timer_ackTimerIrq (IfxStdIf_Timer *stdIf)
 Return the timer interrupt flag and reset it. More...
 
IFX_INLINE boolean IfxStdIf_Timer_ackTriggerIrq (IfxStdIf_Timer *stdIf)
 Return the trigger interrupt flag and reset it. More...
 
IFX_INLINE float32 IfxStdIf_Timer_tickToS (float32 clockFreq, Ifx_TimerValue ticks)
 Convert timer ticks to seconds. More...
 
IFX_INLINE Ifx_TimerValue IfxStdIf_Timer_sToTick (float32 clockFreq, float32 seconds)
 Convert seconds to timer ticks. More...
 

Detailed Description

The standard interface timer (Timer) abstract the hardware used for timer feature. It provide, after proper initialization an hardware independant way to interact with the timer functionallity like setting period, trigger points, ...

The figure below shows the standard timer interface.

Timer.png
Standard timer interface

This interface defines the following features:

Function Documentation

IFX_INLINE boolean IfxStdIf_Timer_ackTimerIrq ( IfxStdIf_Timer stdIf)

Return the timer interrupt flag and reset it.

Parameters
driverPointer to the interface driver object
Returns
Return the timer interrupt flag

Definition at line 353 of file IfxStdIf_Timer.h.

IFX_INLINE boolean IfxStdIf_Timer_ackTriggerIrq ( IfxStdIf_Timer stdIf)

Return the trigger interrupt flag and reset it.

Parameters
driverPointer to the interface driver object
Returns
Return the trigger interrupt flag

Definition at line 360 of file IfxStdIf_Timer.h.

IFX_INLINE void IfxStdIf_Timer_applyUpdate ( IfxStdIf_Timer stdIf)

Apply requested updates.

Such requested update are calls to:

It is important to note, that only one call to Timer_applyUpdate() is allowed within one timer period!!! In order to ensure correct update synchronisation, disableUpdate() should have been called previously.

Parameters
driverPointer to the interface driver object
Returns
None

Definition at line 297 of file IfxStdIf_Timer.h.

IFX_INLINE void IfxStdIf_Timer_disableUpdate ( IfxStdIf_Timer stdIf)

Disable updates.

The following API action will not be taken in account before applyUpdate is called:

Parameters
driverPointer to the interface driver object
Returns
None

Definition at line 304 of file IfxStdIf_Timer.h.

IFX_INLINE float32 IfxStdIf_Timer_getFrequency ( IfxStdIf_Timer stdIf)

Return the timer frequency in Hz.

Parameters
driverPointer to the interface driver object
Returns
Return the timer frequency in Hz

Definition at line 262 of file IfxStdIf_Timer.h.

IFX_INLINE float32 IfxStdIf_Timer_getInputFrequency ( IfxStdIf_Timer stdIf)

Return the timer input frequency in Hz.

Parameters
driverPointer to the interface driver object
Returns
Return the timer input frequency in Hz

Definition at line 311 of file IfxStdIf_Timer.h.

IFX_INLINE Ifx_TimerValue IfxStdIf_Timer_getPeriod ( IfxStdIf_Timer stdIf)

Return the timer period in ticks.

Parameters
driverPointer to the interface driver object
Returns
Return the timer period in ticks

Definition at line 269 of file IfxStdIf_Timer.h.

IFX_INLINE float32 IfxStdIf_Timer_getResolution ( IfxStdIf_Timer stdIf)

Return the timer resolution in seconds.

Parameters
driverPointer to the interface driver object
Returns
Return the timer resolution in seconds

Definition at line 276 of file IfxStdIf_Timer.h.

IFX_INLINE void IfxStdIf_Timer_run ( IfxStdIf_Timer stdIf)

Immediately start the timer.

Please note that other mechanism may avoid the timer to tick, such as when the global (input) clock to the timer block is inactive.

Parameters
driverPointer to the interface driver object
Returns
none

Definition at line 318 of file IfxStdIf_Timer.h.

IFX_INLINE boolean IfxStdIf_Timer_setFrequency ( IfxStdIf_Timer stdIf,
float32  frequency 
)

Set the timer frequency in Hz.

Parameters
driverPointer to the interface driver object
frequencyRequested timer frequency in Hz
Return values
TRUEThe requested frequency could be set
FALSEThe requested frequency is out of range

Definition at line 283 of file IfxStdIf_Timer.h.

IFX_INLINE boolean IfxStdIf_Timer_setPeriod ( IfxStdIf_Timer stdIf,
Ifx_TimerValue  period 
)

Set the timer period.

Timer_applyUpdate() shall be invoked in order this to take effect.

Parameters
driverPointer to the interface driver object
periodPeriod value in ticks
Return values
TRUEThe requested period could be set
FALSEThe requested period is out of range

Definition at line 325 of file IfxStdIf_Timer.h.

IFX_INLINE void IfxStdIf_Timer_setSingleMode ( IfxStdIf_Timer stdIf,
boolean  enabled 
)

Stop timer at the end of the period.

Timer_applyUpdate() shall be invoked in order this to take effect.

Parameters
driverPointer to the interface driver object
enabledIf TRUE, enable the single mode, else disable the single mode (continuous mode)
Returns
none

Definition at line 332 of file IfxStdIf_Timer.h.

IFX_INLINE void IfxStdIf_Timer_setTrigger ( IfxStdIf_Timer stdIf,
Ifx_TimerValue  triggerPoint 
)

Set trigger point.

See Also
Timer_OutputEvent for the definition of the output level. Active state is defined by Timer_Config::outputActiveState.

Timer_applyUpdate() shall be invoked in order this to take effect.

Parameters
driverPointer to the interface driver object
triggerPointTrigger point in ticks from the period start.
Returns
none

Definition at line 339 of file IfxStdIf_Timer.h.

IFX_INLINE void IfxStdIf_Timer_stop ( IfxStdIf_Timer stdIf)

Immediately stops the timer.

Parameters
driverPointer to the interface driver object
Returns
none

Definition at line 346 of file IfxStdIf_Timer.h.

IFX_INLINE Ifx_TimerValue IfxStdIf_Timer_sToTick ( float32  clockFreq,
float32  seconds 
)

Convert seconds to timer ticks.

Parameters
clockFreqTimer clock frequency
secondstime value in seconds to be converted
Returns
Return the converted time in timer ticks

Definition at line 382 of file IfxStdIf_Timer.h.

Referenced by IfxGtm_Atom_PwmHl_setDeadtime(), IfxGtm_Atom_PwmHl_setMinPulse(), IfxGtm_Atom_Timer_setFrequency(), IfxGtm_Tom_PwmHl_setDeadtime(), IfxGtm_Tom_PwmHl_setMinPulse(), and IfxGtm_Tom_Timer_setFrequency().

IFX_INLINE float32 IfxStdIf_Timer_tickToS ( float32  clockFreq,
Ifx_TimerValue  ticks 
)

Convert timer ticks to seconds.

Parameters
clockFreqTimer clock frequency
tickstime value in ticks to be converted
Returns
Return the converted time in s

Definition at line 371 of file IfxStdIf_Timer.h.

Referenced by IfxGtm_Atom_PwmHl_getDeadtime(), IfxGtm_Atom_PwmHl_getMinPulse(), IfxGtm_Atom_Timer_getFrequency(), IfxGtm_Tom_PwmHl_getDeadtime(), IfxGtm_Tom_PwmHl_getMinPulse(), and IfxGtm_Tom_Timer_getFrequency().

IFX_INLINE void IfxStdIf_Timer_updateInputFrequency ( IfxStdIf_Timer stdIf)

Indicates the driver that the imput frequency has changed and that it should be taken in account.

Parameters
driverPointer to the interface driver object
Returns
None

Definition at line 290 of file IfxStdIf_Timer.h.