42 static int initialized = 0;
if (initialized) {
return; } initialized = 1;
45 rtt_sel_source(
RTT,
false);
#define RTT_MR_RTTINCIEN
(RTT_MR) Real-time Timer Increment Interrupt Enable
#define RTT_SR_ALMS
(RTT_SR) Real-time Alarm Status (cleared on read)
#define TIME_US_PER_TICK_F
#define TIME_MS_PER_TICK_LF
uint32_t rtt_init(Rtt *p_rtt, uint16_t us_prescaler)
Initialize the given RTT.
void rtt_enable_interrupt(Rtt *p_rtt, uint32_t ul_sources)
Enable RTT interrupts.
#define TIME_TICKS_PER_MS
__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
Set Interrupt Priority.
#define TIME_US_PER_TICK_LF
static volatile uint32_t g_timer
__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn)
Disable External Interrupt.
uint32_t rtt_read_timer_value(Rtt *p_rtt)
Read the current value of the RTT timer value.
#define RTT
(RTT ) Base Address
#define TIME_SECS_PER_TICK_F
volatile uint64_t time_ticks(void)
#define RTT_SR_RTTINC
(RTT_SR) Prescaler Roll-over Status (cleared on read)
__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn)
Enable External Interrupt.
uint32_t rtt_write_alarm_time(Rtt *p_rtt, uint32_t ul_alarm_time)
Configure the RTT to generate an alarm at the given time. alarm happens when CRTV value equals ALMV+1...
__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn)
Clear Pending Interrupt.
#define TIME_SECS_PER_TICK_LF
#define TIME_MS_PER_TICK_F
uint32_t rtt_get_status(Rtt *p_rtt)
Get the status register value of the given RTT.
void time_delay(uint32_t ms)
Autogenerated API include file for the Atmel Software Framework (ASF)
static volatile uint32_t g_rollover