BSB Developer Docs
Loading...
Searching...
No Matches
timers.h File Reference

Low-level timers API. More...

#include <stdint.h>
#include <stdbool.h>
#include <core/common_defines.h>

Go to the source code of this file.

Data Structures

struct  CoarseTimer
 CoarseTimer structure definition. More...
 
struct  PreciseTimer
 PreciseTimer structure definition. More...
 

Typedefs

typedef bool(* TimerConditionCallback) (void *context)
 Condition test function type.
 

Functions

CoarseTimer FURI_WARN_UNUSED coarse_timer_create (uint32_t timeout_ms)
 Create a coarse timer with the designated timeout.
 
uint32_t coarse_timer_get_elapsed (const CoarseTimer timer)
 Get the time elapsed since the timer creation, in milliseconds.
 
bool coarse_timer_is_expired (const CoarseTimer timer)
 Check whether a coarse timer is past its timeout.
 
PreciseTimer FURI_WARN_UNUSED precise_timer_create (uint32_t timeout_us)
 Create a precise timer with the designated timeout.
 
uint32_t precise_timer_get_elapsed (const PreciseTimer timer)
 Get the time elapsed since the timer creation, in microseconds.
 
bool precise_timer_is_expired (const PreciseTimer timer)
 Check whether a precise timer is past its timeout.
 
void precise_timer_wait (const PreciseTimer timer)
 Block the current execution context until the timer is expired.
 
bool precise_timer_wait_for (const PreciseTimer timer, TimerConditionCallback condition_cb, void *context)
 Block the caller until the timer is expired OR a condition is reached.
 

Detailed Description

Low-level timers API.

See also
Simple timers for more information.