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.61 * The number of times that a timer has expired can be retrieved by @ref le_timer_GetExpiryCount. This67 * or manipulate a timer that belongs to another thread. The timer expiry handler is called by the70 * The call to the timer expiry handler may not occur immediately after the timer expires, depending74 * dropped expiries, the combined execution time of all handlers called from the event loop should111 //--------------------------------------------------------------------------------------------------120 //--------------------------------------------------------------------------------------------------126 //--------------------------------------------------------------------------------------------------130 //--------------------------------------------------------------------------------------------------134 //--------------------------------------------------------------------------------------------------141 //--------------------------------------------------------------------------------------------------143 (148 //--------------------------------------------------------------------------------------------------155 //--------------------------------------------------------------------------------------------------162 //--------------------------------------------------------------------------------------------------169 //--------------------------------------------------------------------------------------------------176 //--------------------------------------------------------------------------------------------------189 //--------------------------------------------------------------------------------------------------197 //--------------------------------------------------------------------------------------------------210 //--------------------------------------------------------------------------------------------------218 //--------------------------------------------------------------------------------------------------231 //--------------------------------------------------------------------------------------------------239 //--------------------------------------------------------------------------------------------------253 //--------------------------------------------------------------------------------------------------261 //--------------------------------------------------------------------------------------------------274 //--------------------------------------------------------------------------------------------------282 //--------------------------------------------------------------------------------------------------294 //--------------------------------------------------------------------------------------------------301 //--------------------------------------------------------------------------------------------------314 //--------------------------------------------------------------------------------------------------321 //--------------------------------------------------------------------------------------------------334 //--------------------------------------------------------------------------------------------------341 //--------------------------------------------------------------------------------------------------354 //--------------------------------------------------------------------------------------------------361 //--------------------------------------------------------------------------------------------------365 * Start the given timer. If the timer is currently running, it will be stopped and then started.371 //--------------------------------------------------------------------------------------------------378 //--------------------------------------------------------------------------------------------------385 //--------------------------------------------------------------------------------------------------le_result_t le_timer_SetRepeat(le_timer_Ref_t timerRef, uint32_t repeatCount)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:92void * 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:143le_result_t le_timer_SetMsInterval(le_timer_Ref_t timerRef, size_t interval)