Cubelets API Documentation 2.0
C API
Loading...
Searching...
No Matches
timing_api.h
Go to the documentation of this file.
1
9#ifndef IMAGO_TIMING_API_H
10#define IMAGO_TIMING_API_H
11#include <stdint.h>
12
13typedef void (* timer_callback_t)( void );
14
15volatile uint16_t user_timer_counter;
16bit user_timer_interval_enabled;
17uint16_t user_timer_interval_delay;
18bit user_timer_timeout_enabled;
19uint16_t user_timer_timeout_delay;
20
21timer_callback_t user_timer_callback;
22
23
24
34void wait(uint16_t delay);
35
45void set_interval(uint16_t delay, timer_callback_t callback);
46
47
57void set_timeout(uint16_t delay, timer_callback_t callback);
58
65
72
73
74void service_timers(void);
75
76#endif
void wait(uint16_t delay)
Function to delay execution for a specified amount of time.
void clear_interval()
Allows canceling all future callbacks previously initialized by calling set_interval()
void clear_timeout()
Cancels the callback scheduled previously by set_timeout() before it has occurred.
void set_interval(uint16_t delay, timer_callback_t callback)
Allows a function callback to be fired continuously after the specified amount of time.
void set_timeout(uint16_t delay, timer_callback_t callback)
Allows a function callback to be fired a single time after the specified amount of time.