49#define TIMER_INSTANCE NRF_TIMER0
54 nrf_timer_event_clear(TIMER_INSTANCE, NRF_TIMER_EVENT_COMPARE0);
56 nrf_timer_frequency_set(TIMER_INSTANCE, NRF_TIMER_FREQ_62500Hz);
57 nrf_timer_bit_width_set(TIMER_INSTANCE, NRF_TIMER_BIT_WIDTH_32);
58 nrf_timer_mode_set(TIMER_INSTANCE, NRF_TIMER_MODE_TIMER);
59 nrf_timer_int_enable(TIMER_INSTANCE, NRF_TIMER_INT_COMPARE0_MASK);
60 NVIC_ClearPendingIRQ(TIMER0_IRQn);
61 NVIC_EnableIRQ(TIMER0_IRQn);
62 nrf_timer_task_trigger(TIMER_INSTANCE, NRF_TIMER_TASK_START);
72 nrf_timer_cc_write(TIMER_INSTANCE, NRF_TIMER_CC_CHANNEL0, t);
78 nrf_timer_task_trigger(TIMER_INSTANCE, NRF_TIMER_TASK_CAPTURE1);
79 return nrf_timer_cc_read(TIMER_INSTANCE, NRF_TIMER_CC_CHANNEL1);
83TIMER0_IRQHandler(
void)
85 if(nrf_timer_event_check(TIMER_INSTANCE, NRF_TIMER_EVENT_COMPARE0)) {
86 nrf_timer_event_clear(TIMER_INSTANCE, NRF_TIMER_EVENT_COMPARE0);
void rtimer_arch_init(void)
We don't need to explicitly initialise anything but this routine is required by the API.
rtimer_clock_t rtimer_arch_now()
Returns the current real-time clock time.
void rtimer_arch_schedule(rtimer_clock_t t)
Schedules an rtimer task to be triggered at time t.
void rtimer_run_next(void)
Execute the next real-time task and schedule the next task, if any.