40#define TIMER0 TIMER0_BASE
41#define TIMER1 TIMER1_BASE
42#define TIMER2 TIMER2_BASE
48#define TIMER_TASK_START(T) MMIO32((T) + 0x000)
49#define TIMER_TASK_STOP(T) MMIO32((T) + 0x004)
50#define TIMER_TASK_COUNT(T) MMIO32((T) + 0x008)
51#define TIMER_TASK_CLEAR(T) MMIO32((T) + 0x00C)
52#define TIMER_TASK_SHUTDOWN(T) MMIO32((T) + 0x010)
53#define TIMER_TASK_CAPTURE(T, C) MMIO32((T) + 0x040 + (uint32_t)(0x4 * (C)))
60#define TIMER_EVENT_COMPARE(T, C) MMIO32((T) + 0x140 + (uint32_t)(0x4 * (C)))
64#define TIMER_SHORTS(T) _PERIPH_SHORTS(T)
65#define TIMER_INTENSET(T) _PERIPH_INTENSET(T)
66#define TIMER_INTENCLR(T) _PERIPH_INTENCLR(T)
67#define TIMER_MODE(T) MMIO32((T) + 0x504)
68#define TIMER_BITMODE(T) MMIO32((T) + 0x508)
69#define TIMER_PRESCALER(T) MMIO32((T) + 0x510)
70#define TIMER_PRESCALER_MASK (0xf)
72#define TIMER_CC(T, C) MMIO32((T) + 0x540 + 0x4 * (C))
83#define TIMER_SHORTS_COMPARE_CLEAR(C) (1 << (C))
84#define TIMER_SHORTS_COMPARE_STOP(C) (1 << (8 + (C)))
87#define TIMER_INTEN_COMPARE(C) (1 << (16 + (C)))
89#define TIMER_MODE_SELECT (1 << 0)
114void timer_set_compare(uint32_t timer, uint8_t compare_num, uint32_t compare_val);
115uint32_t
timer_get_cc(uint32_t timer, uint8_t compare_num);
uint32_t timer_get_ticks(uint32_t timer)
Get timer ticks.
void timer_set_mode(uint32_t timer, enum timer_mode mode)
Set timer mode (counter/timer)
void timer_set_bitmode(uint32_t timer, enum timer_bitmode bitmode)
Set timer bit mode (width)
uint32_t timer_get_freq(uint32_t timer)
Get the timer tick frequency.
void timer_set_prescaler(uint32_t timer, uint8_t presc)
Set prescaler value.
void timer_clear(uint32_t timer)
Clear the timer.
void timer_set_compare(uint32_t timer, uint8_t compare_num, uint32_t compare_val)
Set compare register.
uint32_t timer_get_cc(uint32_t timer, uint8_t compare_num)
Get compare register.
void timer_start(uint32_t timer)
Start the timer.
void timer_stop(uint32_t timer)
Stop the timer.