IceCube display
LED display to show IceCube event data
frame_timer_backend.h
Go to the documentation of this file.
1 #ifndef FRAME_TIMER_BACKEND_H
2 #define FRAME_TIMER_BACKEND_H
3 
13 #include <stdint.h>
14 #include <stdbool.h>
15 
16 #ifdef __DOXYGEN__
17 
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;
33 #else
34 typedef uint16_t timer_count_t;
35 typedef int16_t timer_diff_t;
36 #endif
37 
42 
45 void init_frame_timer_backend(void (*timer_callback)());
46 
52 int8_t get_counter_direction();
53 
55 timer_count_t get_counts_max();
56 
58 timer_count_t get_counts_current();
59 
65 void correct_counts_max(timer_diff_t diff);
66 
69 
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.