SwTimer#
Modules#
Enumerations#
Defines return values from SwTimer methods.
Typedefs#
Defines return values from SwTimer methods.
Typedef needed to include pointer for struct SSwTimerLiaison in struct SSwTimer, without requiring include of definition SSwTimerLiaison.
Timer Liaison object.
Functions#
Configures the callback method called on timer timeout.
Configures Timer timeout and starts the timer.
Configures Timer timeout and starts the timer from an Interrupt Service Routine.
Restarts the timer.
Restarts the timer.
Stops an active timer.
Stops an active timer from an Interrupt Service Routine.
Returns if the timer is active.
Returns if timer has a timeout callback pending.
Returns if timer has a timeout callback pending from an Interrupt Service Routine.
Queries a timer for number of milliseconds remaining before time out Method may be called on inactive timers, but in that case ESWTIMER_STATUS_FAILED will be returned and pMsUntilTimeout will not be modified.
Returns the period of a freeRTOS timer.
Macros#
Space for holding FreeRTOS StaticEventGroup_t and EventGroupHandle_t.
Enumeration Documentation#
ESwTimerStatus#
ESwTimerStatus
Defines return values from SwTimer methods.
Enumerator | |
---|---|
ESWTIMER_STATUS_SUCCESS | ESWTIMER_STATUS_SUCCESS. |
ESWTIMER_STATUS_FAILED | ESWTIMER_STATUS_FAILED. |
Typedef Documentation#
ESwTimerStatus#
typedef enum ESwTimerStatus ESwTimerStatus
Defines return values from SwTimer methods.
SSwTimerLiaisonPtr#
typedef struct SSwTimerLiaison* SSwTimerLiaisonPtr
Typedef needed to include pointer for struct SSwTimerLiaison in struct SSwTimer, without requiring include of definition SSwTimerLiaison.
SSwTimerPrivate_t#
typedef struct SSwTimerPrivate_t SSwTimerPrivate_t
Timer Liaison object.
All content is private.
Function Documentation#
TimerSetCallback#
void TimerSetCallback (SSwTimer * pTimer, void(*)(SSwTimer *pTimer) pCallback)
Configures the callback method called on timer timeout.
Type | Direction | Argument Name | Description |
---|---|---|---|
SSwTimer * | [in] | pTimer | Pointer to the timer object |
void(*)(SSwTimer *pTimer) | [in] | pCallback | Callback method of type void Callback(SSwTimer* pTimer). Argument may be NULL, in which case no callback is performed. |
If called on a timer that has a pending callback, the callback will be executed on the new callback method.
TimerStart#
ESwTimerStatus TimerStart (SSwTimer * pTimer, uint32_t iTimeout)
Configures Timer timeout and starts the timer.
Type | Direction | Argument Name | Description |
---|---|---|---|
SSwTimer * | [in] | pTimer | Pointer to the timer object |
uint32_t | [in] | iTimeout | Timeout value in ms. Zero is illegal. |
If method is called on a timer that is already started, the timer will restart from zero and count towards the new timeout.
TimerStartFromISR#
ESwTimerStatus TimerStartFromISR (SSwTimer * pTimer, uint32_t iTimeout)
Configures Timer timeout and starts the timer from an Interrupt Service Routine.
Type | Direction | Argument Name | Description |
---|---|---|---|
SSwTimer * | [in] | pTimer | Pointer to the timer object |
uint32_t | [in] | iTimeout | Timeout value in ms. Zero is illegal. |
If method is called on a timer that is already started, the timer will restart from zero and count towards the new timeout.
TimerRestart#
ESwTimerStatus TimerRestart (SSwTimer * pTimer)
Restarts the timer.
Type | Direction | Argument Name | Description |
---|---|---|---|
SSwTimer * | [in] | pTimer | Pointer to the timer object |
Starts an inactive timer. If called on a timer that is already started, the timer will restart from zero.
TimerRestartFromISR#
ESwTimerStatus TimerRestartFromISR (SSwTimer * pTimer)
Restarts the timer.
Type | Direction | Argument Name | Description |
---|---|---|---|
SSwTimer * | [in] | pTimer | Pointer to the timer object |
Starts an inactive timer. If called on a timer that is already started, the timer will restart from zero.
TimerStop#
ESwTimerStatus TimerStop (SSwTimer * pTimer)
Stops an active timer.
Type | Direction | Argument Name | Description |
---|---|---|---|
SSwTimer * | [in] | pTimer | Pointer to the timer object |
Method may be called on inactive timers. Any pending callbacks that has not been performed yet will be cleared.
TimerStopFromISR#
ESwTimerStatus TimerStopFromISR (SSwTimer * pTimer)
Stops an active timer from an Interrupt Service Routine.
Type | Direction | Argument Name | Description |
---|---|---|---|
SSwTimer * | [in] | pTimer | Pointer to the timer object |
Method may be called on inactive timers. Any pending callbacks that has not been performed yet will be cleared.
TimerIsActive#
bool TimerIsActive (SSwTimer * pTimer)
Returns if the timer is active.
Type | Direction | Argument Name | Description |
---|---|---|---|
SSwTimer * | [in] | pTimer | Pointer to the timer object |
Active is defined as the timer counting, or having a pending callback.
TimerHasPendingCallback#
bool TimerHasPendingCallback (SSwTimer * pTimer)
Returns if timer has a timeout callback pending.
Type | Direction | Argument Name | Description |
---|---|---|---|
SSwTimer * | [in] | pTimer | Pointer to the timer object |
TimerHasPendingCallbackFromISR#
bool TimerHasPendingCallbackFromISR (SSwTimer * pTimer)
Returns if timer has a timeout callback pending from an Interrupt Service Routine.
Type | Direction | Argument Name | Description |
---|---|---|---|
SSwTimer * | [in] | pTimer | Pointer to the timer object |
TimerGetMsUntilTimeout#
ESwTimerStatus TimerGetMsUntilTimeout (SSwTimer * pTimer, uint32_t refTaskTickCount, uint32_t * pMsUntilTimeout)
Queries a timer for number of milliseconds remaining before time out Method may be called on inactive timers, but in that case ESWTIMER_STATUS_FAILED will be returned and pMsUntilTimeout will not be modified.
Type | Direction | Argument Name | Description |
---|---|---|---|
SSwTimer * | [in] | pTimer | Pointer to the timer object |
uint32_t | [in] | refTaskTickCount | The xTaskGetTickCount() value to use as a reference for the timeout. |
uint32_t * | [out] | pMsUntilTimeout | Pointer to variable to receive remaining time until timeout |