Flipper Zero Firmware
Loading...
Searching...
No Matches
timer.h
Go to the documentation of this file.
1
5#pragma once
6
7#include "base.h"
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13typedef void (*FuriTimerCallback)(void* context);
14
19
20typedef struct FuriTimer FuriTimer;
21
30FuriTimer* furi_timer_alloc(FuriTimerCallback func, FuriTimerType type, void* context);
31
36void furi_timer_free(FuriTimer* instance);
37
48FuriStatus furi_timer_start(FuriTimer* instance, uint32_t ticks);
49
60FuriStatus furi_timer_restart(FuriTimer* instance, uint32_t ticks);
61
71FuriStatus furi_timer_stop(FuriTimer* instance);
72
83uint32_t furi_timer_is_running(FuriTimer* instance);
84
91uint32_t furi_timer_get_expire_time(FuriTimer* instance);
92
93typedef void (*FuriTimerPendigCallback)(void* context, uint32_t arg);
94
95void furi_timer_pending_callback(FuriTimerPendigCallback callback, void* context, uint32_t arg);
96
101
107
108#ifdef __cplusplus
109}
110#endif
Definition timer.c:8
uint32_t furi_timer_is_running(FuriTimer *instance)
Is timer running.
Definition timer.c:111
FuriStatus furi_timer_stop(FuriTimer *instance)
Stop timer.
Definition timer.c:100
FuriStatus furi_timer_restart(FuriTimer *instance, uint32_t ticks)
Restart timer with previous timeout value.
Definition timer.c:82
FuriTimerThreadPriority
Definition timer.h:97
@ FuriTimerThreadPriorityNormal
Lower then other threads.
Definition timer.h:98
@ FuriTimerThreadPriorityElevated
Same as other threads.
Definition timer.h:99
void furi_timer_set_thread_priority(FuriTimerThreadPriority priority)
Set Timer thread priority.
Definition timer.c:143
uint32_t furi_timer_get_expire_time(FuriTimer *instance)
Get timer expire time.
Definition timer.c:121
FuriTimerType
Definition timer.h:15
@ FuriTimerTypeOnce
One-shot timer.
Definition timer.h:16
@ FuriTimerTypePeriodic
Repeating timer.
Definition timer.h:17
void furi_timer_free(FuriTimer *instance)
Free timer.
Definition timer.c:50
FuriTimer * furi_timer_alloc(FuriTimerCallback func, FuriTimerType type, void *context)
Allocate timer.
Definition timer.c:24
FuriStatus furi_timer_start(FuriTimer *instance, uint32_t ticks)
Start timer.
Definition timer.c:65