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 le_timer_Create(). The timer name is used for diagnostic purposes only.31 * attributes must be explicitly set. At a minimum, the interval must be set before the timer can be32 * used. Note that these attributes can only be set if the timer is not currently running; otherwise,37 * context pointer is allocated memory, then the context pointer must be freed when deleting the timer.64 * handler will be called with a reference to the expired timer. If additional data is required in the65 * handler, le_timer_SetContextPtr() can be used to set the appropriate context before starting the67 * In addition, a suspended system will also wake up by default if the timer expires. If this behaviour70 * The number of times that a timer has expired can be retrieved by le_timer_GetExpiryCount(). This76 * or manipulate a timer that belongs to another thread. The timer expiry handler is called by the79 * The call to the timer expiry handler may not occur immediately after the timer expires, depending83 * dropped expiries, the combined execution time of all handlers called from the event loop should126 //--------------------------------------------------------------------------------------------------135 //--------------------------------------------------------------------------------------------------141 //--------------------------------------------------------------------------------------------------145 //--------------------------------------------------------------------------------------------------149 //--------------------------------------------------------------------------------------------------156 //--------------------------------------------------------------------------------------------------158 (163 //--------------------------------------------------------------------------------------------------170 //--------------------------------------------------------------------------------------------------177 //--------------------------------------------------------------------------------------------------184 //--------------------------------------------------------------------------------------------------191 //--------------------------------------------------------------------------------------------------204 //--------------------------------------------------------------------------------------------------212 //--------------------------------------------------------------------------------------------------227 //--------------------------------------------------------------------------------------------------235 //--------------------------------------------------------------------------------------------------245 //--------------------------------------------------------------------------------------------------252 //--------------------------------------------------------------------------------------------------267 //--------------------------------------------------------------------------------------------------275 //--------------------------------------------------------------------------------------------------285 //--------------------------------------------------------------------------------------------------292 //--------------------------------------------------------------------------------------------------306 //--------------------------------------------------------------------------------------------------314 //--------------------------------------------------------------------------------------------------326 //--------------------------------------------------------------------------------------------------334 //--------------------------------------------------------------------------------------------------347 //--------------------------------------------------------------------------------------------------355 //--------------------------------------------------------------------------------------------------367 //--------------------------------------------------------------------------------------------------374 //--------------------------------------------------------------------------------------------------387 //--------------------------------------------------------------------------------------------------394 //--------------------------------------------------------------------------------------------------405 //--------------------------------------------------------------------------------------------------412 //--------------------------------------------------------------------------------------------------423 //--------------------------------------------------------------------------------------------------430 //--------------------------------------------------------------------------------------------------443 //--------------------------------------------------------------------------------------------------450 //--------------------------------------------------------------------------------------------------463 //--------------------------------------------------------------------------------------------------470 //--------------------------------------------------------------------------------------------------474 * Start the given timer. If the timer is currently running, it will be stopped and then started.480 //--------------------------------------------------------------------------------------------------487 //--------------------------------------------------------------------------------------------------494 //--------------------------------------------------------------------------------------------------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)Definition: le_clock.h:98le_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)le_result_t le_timer_SetMsInterval(le_timer_Ref_t timerRef, uint32_t interval)uint32_t le_timer_GetMsTimeRemaining(le_timer_Ref_t timerRef)le_clk_Time_t le_timer_GetTimeRemaining(le_timer_Ref_t timerRef)le_clk_Time_t le_timer_GetInterval(le_timer_Ref_t timerRef)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)uint32_t le_timer_GetMsInterval(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:158