libdragon
|
Timer Subsystem. More...
Go to the source code of this file.
Data Structures | |
struct | timer_link |
Timer structure. More... | |
Defines | |
#define | TF_ONE_SHOT 0 |
Timer should fire only once. | |
#define | TF_CONTINUOUS 1 |
Timer should fire at a regular interval. | |
#define | TIMER_TICKS(us) ((int)((long long)(us) * 46875LL / 1000LL)) |
Calculate timer ticks based on microseconds. | |
#define | TIMER_MICROS(tk) ((int)((long long)(tk) * 1000LL / 46875LL)) |
Calculate microseconds based on timer ticks. | |
#define | TIMER_TICKS_LL(us) ((long long)(us) * 46875LL / 1000LL) |
Calculate timer ticks based on microseconds. | |
#define | TIMER_MICROS_LL(tk) ((long long)(tk) * 1000LL / 46875LL) |
Calculate microseconds based on timer ticks. | |
Typedefs | |
typedef struct timer_link | timer_link_t |
Timer structure. | |
Functions | |
void | timer_init (void) |
Initialize the timer subsystem. | |
timer_link_t * | new_timer (int ticks, int flags, void(*callback)(int ovfl)) |
Create a new timer and add to list. | |
void | start_timer (timer_link_t *timer, int ticks, int flags, void(*callback)(int ovfl)) |
Start a timer not currently in the list. | |
void | stop_timer (timer_link_t *timer) |
Stop a timer and remove it from the list. | |
void | delete_timer (timer_link_t *timer) |
Remove a timer from the list and delete it. | |
void | timer_close (void) |
Free and close the timer subsystem. | |
long long | timer_ticks (void) |
Return total ticks since timer was initialized. |
Timer Subsystem.