1 #ifndef FRAME_TIMER_BACKEND_H 2 #define FRAME_TIMER_BACKEND_H 22 #define FRAME_TIMER_RESOLUTION 23 #elif !defined(FRAME_TIMER_RESOLUTION) 24 #warning FRAME_TIMER_RESOLUTION not defined 25 typedef unsigned int timer_count_t;
26 typedef signed int timer_diff_t;
27 #elif FRAME_TIMER_RESOLUTION < 32 28 typedef uint64_t timer_count_t;
29 typedef int64_t timer_diff_t;
30 #elif FRAME_TIMER_RESOLUTION < 16 31 typedef uint32_t timer_count_t;
32 typedef int32_t timer_diff_t;
34 typedef uint16_t timer_count_t;
35 typedef int16_t timer_diff_t;
70 #endif //FRAME_TIMER_BACKEND_H int8_t get_counter_direction()
Counter direction.
timer_count_t get_counts_max()
The maximum (roll-over/reset) value of the timer.
void init_frame_timer_backend(void(*timer_callback)())
Initialise the frame timer.
timer_count_t get_counts_current()
Get the current counter value of the timer.
void correct_counts_max(timer_diff_t diff)
Add diff to the current maximum value of the counter.