Defines the API for timer.
Typedefs | |
| typedef struct dwTimeSourceObject * | dwTimeSourceHandle_t |
| Handle represents a TimeSource object. More... | |
| typedef struct dwTimerObject * | dwTimerHandle_t |
| Handle represents a Timer object. More... | |
| typedef void(* | dwTimerWork) (void *ptr) |
| dwTimerWork is a timer schedule task callback function, input void* ptr passes the extra data to the task More... | |
Functions | |
| DW_API_PUBLIC dwStatus | dwTimer_initializeFromSource (dwTimerHandle_t *const timer, char8_t const *const timerName, dwTimeSourceHandle_t const source) |
| Creates a new DW timer. More... | |
| DW_API_PUBLIC dwStatus | dwTimer_release (dwTimerHandle_t const timer) |
| Release the timer instance. More... | |
| DW_API_PUBLIC dwStatus | dwTimer_cancelSync (dwTimerHandle_t const timer) |
| Synchronously cancels all scheduled work associated with this timer. More... | |
| DW_API_PUBLIC dwStatus | dwTimer_cancelAsync (dwTimerHandle_t const timer) |
| Asynchronously cancels all scheduled work associated with this timer. More... | |
| DW_API_PUBLIC dwStatus | dwTimer_scheduleTaskOneShot (dwTimerWork const task, void *const clientData, dwTime_t const startTime, dwTimerHandle_t const timer) |
| Scheduled a task to be run at a future time (non-recurring) More... | |
| DW_API_PUBLIC dwStatus | dwTimer_scheduleTaskRecurring (dwTimerWork const task, void *const clientData, dwTime_t const startTime, dwTime_t const period, dwTimerHandle_t const timer) |
| Scheduled a task to be run at a future time (recurring) More... | |
| typedef struct dwTimerObject* dwTimerHandle_t |
| typedef struct dwTimeSourceObject* dwTimeSourceHandle_t |
| DW_API_PUBLIC dwStatus dwTimer_cancelAsync | ( | dwTimerHandle_t const | timer | ) |
Asynchronously cancels all scheduled work associated with this timer.
Asynchronously means this call will not wait the cancel operation finished. This call will allow pending work to complete before cancelling the job. This call will clear the all the time value assigned to timer. And then stop the timer.
@req{GID-AV_REQ-6775270}
| [in] | timer | A handle to the timer |
| DW_API_PUBLIC dwStatus dwTimer_cancelSync | ( | dwTimerHandle_t const | timer | ) |
Synchronously cancels all scheduled work associated with this timer.
Synchronously means this call will wait until the task is canceled. This call will allow pending work to complete before cancelling the job. This call will clear the all the time value assigned to timer. And then stop the timer.
@req{GID-AV_REQ-6775267}
| [in] | timer | A handle to the timer |
| DW_API_PUBLIC dwStatus dwTimer_initializeFromSource | ( | dwTimerHandle_t *const | timer, |
| char8_t const *const | timerName, | ||
| dwTimeSourceHandle_t const | source | ||
| ) |
Creates a new DW timer.
The new timer is initially disarmed. This call registers the timer with the primary time source of the context.
@req{GID-AV_REQ-6775262}
| [out] | timer | A pointer to the timer handle |
| [in] | timerName | Name of the timer, Note maximal length is 16 (incl. null character). Names longer than 16 characters will be truncated. |
| [in] | source | Specifies the handle to the time source which is used as time provider. |
| DW_API_PUBLIC dwStatus dwTimer_release | ( | dwTimerHandle_t const | timer | ) |
Release the timer instance.
The timer will be stopped if it's started.
| [in] | timer | The timer handle |
| DW_API_PUBLIC dwStatus dwTimer_scheduleTaskOneShot | ( | dwTimerWork const | task, |
| void *const | clientData, | ||
| dwTime_t const | startTime, | ||
| dwTimerHandle_t const | timer | ||
| ) |
Scheduled a task to be run at a future time (non-recurring)
@req{GID-AV_REQ-6775269}
| [in] | task | Function pointer for the task to be executed |
| [in] | clientData | Pointer to data to be passed back to task |
| [in] | startTime | Time when the task should be activated |
| [in] | timer | Handle to the timer object |
| DW_API_PUBLIC dwStatus dwTimer_scheduleTaskRecurring | ( | dwTimerWork const | task, |
| void *const | clientData, | ||
| dwTime_t const | startTime, | ||
| dwTime_t const | period, | ||
| dwTimerHandle_t const | timer | ||
| ) |
Scheduled a task to be run at a future time (recurring)
@req{GID-AV_REQ-6775263}
| [in] | task | Function pointer for the task to be executed |
| [in] | clientData | Pointer to data to be passed back to task |
| [in] | startTime | Time when the task should be activated, in Us. |
| [in] | period | Period at which to fire the task, in Us. |
| [in] | timer | Handle to the timer object |