le_timer.h
Go to the documentation of this file.
11 * This is an initial version of the API that only provides support for relative timers (e.g., expires12 * in 10 seconds). Absolute timers allow a specific time/date to be used, and will be supported in a18 * Timers are created using @ref le_timer_Create. The timer name is used for logging purposes only.27 * attributes must be explicitly set. At a minimum, the interval must be set before the timer can be28 * used. Note that these attributes can only be set if the timer is not currently running; otherwise,31 * Timers must be explicitly deleted using @ref le_timer_Delete. If the timer is currently running,33 * context pointer is allocated memory, then the context pointer must be freed when deleting the timer.57 * handler will be called with a reference to the expired timer. If additional data is required in the58 * handler, @ref le_timer_SetContextPtr can be used to set the appropriate context before starting the59 * timer, and @ref le_timer_GetContextPtr can be used to retrieve the context while in the handler.60 * In addition, a suspended system will also wake up by default if the timer expires. If this behaviour63 * The number of times that a timer has expired can be retrieved by @ref le_timer_GetExpiryCount. This69 * or manipulate a timer that belongs to another thread. The timer expiry handler is called by the72 * The call to the timer expiry handler may not occur immediately after the timer expires, depending76 * dropped expiries, the combined execution time of all handlers called from the event loop should114 //--------------------------------------------------------------------------------------------------123 //--------------------------------------------------------------------------------------------------129 //--------------------------------------------------------------------------------------------------133 //--------------------------------------------------------------------------------------------------137 //--------------------------------------------------------------------------------------------------144 //--------------------------------------------------------------------------------------------------146 (151 //--------------------------------------------------------------------------------------------------158 //--------------------------------------------------------------------------------------------------165 //--------------------------------------------------------------------------------------------------172 //--------------------------------------------------------------------------------------------------179 //--------------------------------------------------------------------------------------------------192 //--------------------------------------------------------------------------------------------------200 //--------------------------------------------------------------------------------------------------213 //--------------------------------------------------------------------------------------------------221 //--------------------------------------------------------------------------------------------------234 //--------------------------------------------------------------------------------------------------242 //--------------------------------------------------------------------------------------------------256 //--------------------------------------------------------------------------------------------------264 //--------------------------------------------------------------------------------------------------276 //--------------------------------------------------------------------------------------------------284 //--------------------------------------------------------------------------------------------------297 //--------------------------------------------------------------------------------------------------305 //--------------------------------------------------------------------------------------------------317 //--------------------------------------------------------------------------------------------------324 //--------------------------------------------------------------------------------------------------337 //--------------------------------------------------------------------------------------------------344 //--------------------------------------------------------------------------------------------------357 //--------------------------------------------------------------------------------------------------364 //--------------------------------------------------------------------------------------------------377 //--------------------------------------------------------------------------------------------------384 //--------------------------------------------------------------------------------------------------388 * Start the given timer. If the timer is currently running, it will be stopped and then started.394 //--------------------------------------------------------------------------------------------------401 //--------------------------------------------------------------------------------------------------408 //--------------------------------------------------------------------------------------------------le_result_t le_timer_SetRepeat(le_timer_Ref_t timerRef, uint32_t repeatCount)le_result_t le_timer_SetWakeup(le_timer_Ref_t timerRef, bool wakeupEnabled)le_result_t le_timer_Start(le_timer_Ref_t timerRef)void le_timer_Delete(le_timer_Ref_t timerRef)le_timer_Ref_t le_timer_Create(const char *nameStr)Definition: le_clock.h:98le_result_t le_timer_SetMsInterval(le_timer_Ref_t timerRef, uint32_t interval)void * le_timer_GetContextPtr(le_timer_Ref_t timerRef)le_result_t le_timer_SetInterval(le_timer_Ref_t timerRef, le_clk_Time_t interval)le_result_t le_timer_SetHandler(le_timer_Ref_t timerRef, le_timer_ExpiryHandler_t handlerFunc)le_result_t le_timer_Stop(le_timer_Ref_t timerRef)bool le_timer_IsRunning(le_timer_Ref_t timerRef)void le_timer_Restart(le_timer_Ref_t timerRef)le_result_t le_timer_SetContextPtr(le_timer_Ref_t timerRef, void *contextPtr)uint32_t le_timer_GetExpiryCount(le_timer_Ref_t timerRef)void(* le_timer_ExpiryHandler_t)(le_timer_Ref_t timerRef)Definition: le_timer.h:146