iLLD_TC29x
1.0
|
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.
This interface defines the following features:
IFX_INLINE boolean IfxStdIf_Timer_ackTimerIrq | ( | IfxStdIf_Timer * | stdIf) |
Return the timer interrupt flag and reset it.
driver | Pointer to the interface driver object |
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.
driver | Pointer to the interface driver object |
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.
driver | Pointer to the interface driver object |
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:
driver | Pointer to the interface driver object |
Definition at line 319 of file IfxStdIf_Timer.h.
IFX_INLINE float32 IfxStdIf_Timer_getFrequency | ( | IfxStdIf_Timer * | stdIf) |
Return the timer frequency in Hz.
driver | Pointer to the interface driver object |
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.
driver | Pointer to the interface driver object |
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.
driver | Pointer to the interface driver object |
Definition at line 277 of file IfxStdIf_Timer.h.
IFX_INLINE float32 IfxStdIf_Timer_getPeriodSecond | ( | IfxStdIf_Timer * | stdIf) |
Return the timer period in second.
stdIf | Pointer 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.
driver | Pointer to the interface driver object |
Definition at line 291 of file IfxStdIf_Timer.h.
IFX_INLINE Ifx_TimerValue IfxStdIf_Timer_getTrigger | ( | IfxStdIf_Timer * | stdIf) |
Return the timer trigger point.
driver | Pointer to the interface driver object |
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.
driver | Pointer to the interface driver object |
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.
driver | Pointer to the interface driver object |
frequency | Requested timer frequency in Hz |
TRUE | The requested frequency could be set |
FALSE | The 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.
driver | Pointer to the interface driver object |
period | Period value in ticks |
TRUE | The requested period could be set |
FALSE | The 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.
driver | Pointer to the interface driver object |
enabled | If TRUE, enable the single mode, else disable the single mode (continuous mode) |
Definition at line 347 of file IfxStdIf_Timer.h.
IFX_INLINE void IfxStdIf_Timer_setTrigger | ( | IfxStdIf_Timer * | stdIf, |
Ifx_TimerValue | triggerPoint | ||
) |
Set trigger point.
Timer_applyUpdate() shall be invoked in order this to take effect.
driver | Pointer to the interface driver object |
triggerPoint | Trigger point in ticks from the period start. |
Definition at line 354 of file IfxStdIf_Timer.h.
IFX_INLINE void IfxStdIf_Timer_stop | ( | IfxStdIf_Timer * | stdIf) |
Immediately stops the timer.
driver | Pointer to the interface driver object |
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.
clockFreq | Timer clock frequency |
seconds | time value in seconds to be converted |
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.
clockFreq | Timer clock frequency |
ticks | time value in ticks to be converted |
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.
driver | Pointer to the interface driver object |
Definition at line 305 of file IfxStdIf_Timer.h.