Furi software Timer API.
More...
#include "base.h"
Go to the source code of this file.
|
|
typedef void(* | FuriTimerCallback) (void *context) |
| |
|
typedef struct FuriTimer | FuriTimer |
| |
|
typedef void(* | FuriTimerPendigCallback) (void *context, uint32_t arg) |
| |
◆ FuriTimerThreadPriority
| Enumerator |
|---|
| FuriTimerThreadPriorityNormal | Lower then other threads.
|
| FuriTimerThreadPriorityElevated | Same as other threads.
|
◆ FuriTimerType
| Enumerator |
|---|
| FuriTimerTypeOnce | One-shot timer.
|
| FuriTimerTypePeriodic | Repeating timer.
|
◆ furi_timer_alloc()
Allocate timer.
- Parameters
-
| [in] | func | The callback function |
| [in] | type | The timer type |
| context | The callback context |
- Returns
- The pointer to FuriTimer instance
◆ furi_timer_flush()
| void furi_timer_flush |
( |
void | | ) |
|
Flush timer task control message queue.
Ensures that all commands before this point was processed.
◆ furi_timer_free()
Free timer.
- Parameters
-
| instance | The pointer to FuriTimer instance |
◆ furi_timer_get_expire_time()
| uint32_t furi_timer_get_expire_time |
( |
FuriTimer * | instance | ) |
|
Get timer expire time.
- Parameters
-
| instance | The Timer instance |
- Returns
- expire tick
◆ furi_timer_is_running()
| uint32_t furi_timer_is_running |
( |
FuriTimer * | instance | ) |
|
Is timer running.
- Warning
- This cal may and will return obsolete timer state if timer commands are still in the queue. Please read FreeRTOS timer documentation first.
- Parameters
-
| instance | The pointer to FuriTimer instance |
- Returns
- 0: not running, 1: running
◆ furi_timer_restart()
| FuriStatus furi_timer_restart |
( |
FuriTimer * | instance, |
|
|
uint32_t | ticks ) |
Restart timer with previous timeout value.
- Warning
- This is asynchronous call, real operation will happen as soon as timer service process this request.
- Parameters
-
| instance | The pointer to FuriTimer instance |
| [in] | ticks | The interval in ticks |
- Returns
- The furi status.
◆ furi_timer_set_thread_priority()
Set Timer thread priority.
- Parameters
-
◆ furi_timer_start()
| FuriStatus furi_timer_start |
( |
FuriTimer * | instance, |
|
|
uint32_t | ticks ) |
Start timer.
- Warning
- This is asynchronous call, real operation will happen as soon as timer service process this request.
- Parameters
-
| instance | The pointer to FuriTimer instance |
| [in] | ticks | The interval in ticks |
- Returns
- The furi status.
◆ furi_timer_stop()
| FuriStatus furi_timer_stop |
( |
FuriTimer * | instance | ) |
|
Stop timer.
- Warning
- This is synchronous call that will be blocked till timer queue processed.
- Parameters
-
| instance | The pointer to FuriTimer instance |
- Returns
- The furi status.