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
42void furi_timer_flush(void);
43
54FuriStatus furi_timer_start(FuriTimer* instance, uint32_t ticks);
55
66FuriStatus furi_timer_restart(FuriTimer* instance, uint32_t ticks);
67
76FuriStatus furi_timer_stop(FuriTimer* instance);
77
88uint32_t furi_timer_is_running(FuriTimer* instance);
89
96uint32_t furi_timer_get_expire_time(FuriTimer* instance);
97
98typedef void (*FuriTimerPendigCallback)(void* context, uint32_t arg);
99
100void furi_timer_pending_callback(FuriTimerPendigCallback callback, void* context, uint32_t arg);
101
106
112
113#ifdef __cplusplus
114}
115#endif
Definition timer.c:9
uint32_t furi_timer_is_running(FuriTimer *instance)
Is timer running.
Definition timer.c:125
FuriStatus furi_timer_stop(FuriTimer *instance)
Stop timer.
Definition timer.c:114
FuriStatus furi_timer_restart(FuriTimer *instance, uint32_t ticks)
Restart timer with previous timeout value.
Definition timer.c:96
FuriTimerThreadPriority
Definition timer.h:102
@ FuriTimerThreadPriorityNormal
Lower then other threads.
Definition timer.h:103
@ FuriTimerThreadPriorityElevated
Same as other threads.
Definition timer.h:104
void furi_timer_set_thread_priority(FuriTimerThreadPriority priority)
Set Timer thread priority.
Definition timer.c:157
uint32_t furi_timer_get_expire_time(FuriTimer *instance)
Get timer expire time.
Definition timer.c:135
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:55
FuriTimer * furi_timer_alloc(FuriTimerCallback func, FuriTimerType type, void *context)
Allocate timer.
Definition timer.c:38
void furi_timer_flush(void)
Flush timer task control message queue.
Definition timer.c:67
FuriStatus furi_timer_start(FuriTimer *instance, uint32_t ticks)
Start timer.
Definition timer.c:79