37 lines
848 B
C
37 lines
848 B
C
|
|
#ifndef __HARDWARE_TIMER_H__
|
||
|
|
#define __HARDWARE_TIMER_H__
|
||
|
|
|
||
|
|
#include "reg.h"
|
||
|
|
#include "timer_reg.h"
|
||
|
|
|
||
|
|
#define TIMER_ALARM_0 (0)
|
||
|
|
#define TIMER_ALARM_1 (1)
|
||
|
|
#define TIMER_ALARM_2 (2)
|
||
|
|
#define TIMER_ALARM_3 (3)
|
||
|
|
|
||
|
|
#ifdef __cplusplus
|
||
|
|
extern "C" {
|
||
|
|
#endif
|
||
|
|
|
||
|
|
void timer_count_write(uint64_t count);
|
||
|
|
uint64_t timer_count_read(void);
|
||
|
|
uint32_t timer_count_l_read_raw(void);
|
||
|
|
uint32_t timer_count_h_read_raw(void);
|
||
|
|
void timer_start(void);
|
||
|
|
void timer_stop(void);
|
||
|
|
int timer_is_stopped(void);
|
||
|
|
|
||
|
|
void timer_alarm_set(uint8_t alarm_id, uint32_t alarm_count);
|
||
|
|
uint32_t timer_alarm_get(uint8_t alarm_id);
|
||
|
|
|
||
|
|
void timer_alarm_disarm(uint8_t alarm_id);
|
||
|
|
void timer_alarm_disarm_multi(uint32_t alarm_id_multi);
|
||
|
|
int timer_alarm_is_armed(uint8_t alarm_id);
|
||
|
|
uint32_t timer_alarm_is_armed_multi(uint32_t alarm_id_multi);
|
||
|
|
|
||
|
|
#ifdef __cplusplus
|
||
|
|
}
|
||
|
|
#endif
|
||
|
|
|
||
|
|
#endif /* __HARDWARE_TIMER_H__ */
|