/* Select between timer (counts on PCLK) and counter mode (counts on CAP events) */
if (conf->mode & LPC_TIMER_MODE_COUNTER) {
/* Configure the counter */
- timer->regs->count_ctrl = (conf->count_control & 0x0F);
+ timer->regs->count_ctrl = (conf->count_control & 0x03);
timer->regs->count_ctrl |= LPC_COUNTER_INC_INPUT(conf->count_chan);
} else {
/* Timer mode */
* config field in timer_config struct upon timer setup)
* The interrupt flags are passed to the interrupt routine as argument.
*/
+#define TIMER_NO_PRESCALE 0
int timer_on(uint8_t timer_num, uint32_t clkrate, void (*callback)(uint32_t));
/* Removes the main clock from the selected timer block */