iLLD_TC29x  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 Ifx_TimerValue IfxStdIf_Timer_getTrigger (IfxStdIf_Timer *stdIf)
 Return the timer trigger point. 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...
 
IFX_INLINE float32 IfxStdIf_Timer_getPeriodSecond (IfxStdIf_Timer *stdIf)
 Return the timer period in second. 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 368 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 375 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 312 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 319 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 270 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 326 of file IfxStdIf_Timer.h.

Referenced by IfxStdIf_Timer_getPeriodSecond().

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 277 of file IfxStdIf_Timer.h.

IFX_INLINE float32 IfxStdIf_Timer_getPeriodSecond ( IfxStdIf_Timer stdIf)

Return the timer period in second.

Parameters
stdIfPointer to the interface driver object

Definition at line 406 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 291 of file IfxStdIf_Timer.h.

IFX_INLINE Ifx_TimerValue IfxStdIf_Timer_getTrigger ( IfxStdIf_Timer stdIf)

Return the timer trigger point.

Parameters
driverPointer to the interface driver object
Returns
Return the timer timer point

Definition at line 284 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 333 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 298 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 340 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 347 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 354 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 361 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 397 of file IfxStdIf_Timer.h.

Referenced by IfxCcu6_PwmHl_setDeadtime(), IfxCcu6_PwmHl_setMinPulse(), IfxCcu6_TimerWithTrigger_setFrequency(), IfxGtm_Atom_PwmHl_setDeadtime(), IfxGtm_Atom_PwmHl_setMinPulse(), IfxGtm_Atom_Timer_init(), IfxGtm_Atom_Timer_setFrequency(), IfxGtm_Tom_PwmHl_setDeadtime(), IfxGtm_Tom_PwmHl_setMinPulse(), IfxGtm_Tom_Timer_init(), 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 386 of file IfxStdIf_Timer.h.

Referenced by IfxCcu6_PwmHl_getDeadtime(), IfxCcu6_PwmHl_getMinPulse(), IfxCcu6_TimerWithTrigger_getFrequency(), IfxGtm_Atom_PwmHl_getDeadtime(), IfxGtm_Atom_PwmHl_getMinPulse(), IfxGtm_Atom_Timer_getFrequency(), IfxGtm_Tom_PwmHl_getDeadtime(), IfxGtm_Tom_PwmHl_getMinPulse(), IfxGtm_Tom_Timer_getFrequency(), and IfxStdIf_Timer_getPeriodSecond().

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 305 of file IfxStdIf_Timer.h.