I use NRF51822 and s110. I want to know how to start and stop a timer, to get the time that the timer run. whitch API should I use int S110?
You can get current timer value by triggering CAPTURE task for any Capture/Compare register.
NRF_TIMER2->TASKS_CAPTURE[1] = 1; // trigger TASKS_CAPTURE for Capture/Compare register 1. time = NRF_TIMER2->CC[1]; // Get current timer value
I want to init a timer by using APP_TIMER_INIT(APP_TIMER_PRESCALER, 2, 4, true); but if I set APP_TIMER_PRESCALER to 0, how many ticks equal to 1s ?