2024-11-02 11:31:51 +00:00
|
|
|
#ifndef MANGO_CLOCK_H_
|
|
|
|
|
#define MANGO_CLOCK_H_
|
2023-04-28 20:51:51 +01:00
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define HZ (clock_hz())
|
|
|
|
|
|
|
|
|
|
typedef uint64_t clock_ticks_t;
|
|
|
|
|
|
|
|
|
|
extern volatile clock_ticks_t clock_ticks;
|
|
|
|
|
|
|
|
|
|
extern clock_ticks_t clock_hz(void);
|
|
|
|
|
|
|
|
|
|
extern void clock_calibrate(clock_ticks_t hz);
|
|
|
|
|
extern void clock_advance(clock_ticks_t ticks);
|
|
|
|
|
extern void clock_wait(clock_ticks_t ticks);
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif
|