rfLPC
A low level library for using NXP's LPC17xx SoC. Config is given for MBED prototyping board
System tick timer

This driver allows the use of the system tick timer. More...

Functions

void rflpc_sys_timer_init ()
 initializes the system timer
 
static void rflpc_sys_timer_start ()
 starts the system timer
 
static void rflpc_sys_timer_stop ()
 stops the system timer
 
static void rflpc_sys_timer_set_callback (rflpc_irq_handler_t c)
 sets the callback for the timer interrupt
 
void rflpc_sys_timer_set_period (uint32_t micros_time)
 initializes the timer with a given period (in µs) This automatically starts the timer even if it was stopped.
 
void rflpc_sys_timer_set_tick_period (uint32_t ticks)
 initializes the timer with a given tick count This automatically starts the timer even if it was stopped. More...
 

Detailed Description

This driver allows the use of the system tick timer.

This timer is intended to generate a precise 10ms timer, however it can be used to count different times. But, the tick count is only on 24bits so, at 96Mhz, the maximum wait time is 2^24 ticks (around 170ms)

Its counter is decremented at each clock tick, and when the counter reaches 0, an interrupt can be generated. The time between interrupts thus depends on the counter value and the clock speed.

This driver uses the cpu clock as the reference clock for the timer.

user manual p. 504

Function Documentation

void rflpc_sys_timer_set_tick_period ( uint32_t  ticks)

initializes the timer with a given tick count This automatically starts the timer even if it was stopped.

Parameters
ticksOnly the 24 lower bits are used.