Low Level Timer¶
typedef void(* miramesh_timer_callback_t) (miracore_timer_time_t now, void *storage);
void miramesh_timer_schedule(miracore_timer_time_t time, miramesh_timer_callback_t callback, void *storage);
Schedule a timer.
If scheduled to the past, the execution will be done immediately.
Previous scheduling for the given channel is replaced.
The callback is called from an interrupt context. The function may only be called from the callback or from an application context.
Use miramesh_timer_get_time_now to get the current time.
|When the callback should be called
|The function being called
|This argument is passed to the callback function
Remove a scheduled timer.
The function can be called from any IRQ level. It is still possible the timer will be called after the current IRQ finishes or that the timer callback is called during the call.
Gets the current time.
miracore_timer_time_t miramesh_timer_time_add_us(miracore_timer_time_t time, int32_t interval);
Add an interval in microseconds to the given time.
|The time to be added to.
|How much (in microseconds) the time should change.