lpc_timers.h File Reference
Include dependency graph for lpc_timers.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Enumerations | |
enum | lpc_timer_t { lpc_timer0, lpc_timer1, lpc_timer2, lpc_timer3 } |
Functions | |
void | lpc_timer_enable (const lpc_timer_t timer, const uint32_t us_per_tick) |
uint32_t | lpc_timer_get_value (const lpc_timer_t timer) |
void | lpc_timer_set_value (const lpc_timer_t timer, const uint32_t value) |
Detailed Description
This API provides a means to start a simple timer, and get/set the timer value 20140610: Initial
Enumeration Type Documentation
enum lpc_timer_t |
Function Documentation
void lpc_timer_enable | ( | const lpc_timer_t | timer, |
const uint32_t | us_per_tick | ||
) |
Enables and starts the timer with the given tick rate
- Parameters
-
[in] timer The timer type [in] us_per_tick The resolution of each tick
- Note
- The logic requires the CPU to be running at greater than or equal to 1Mhz
- Postcondition
- The timer's clock divider is set to (CPU clock)/1
uint32_t lpc_timer_get_value | ( | const lpc_timer_t | timer | ) |
Get the value of the timer
- Parameters
-
[in] timer The timer type
- Returns
- The value of the timer
void lpc_timer_set_value | ( | const lpc_timer_t | timer, |
const uint32_t | value | ||
) |
Set the value of the timer; you normally shouldn't do this as the hardware is ticking the timer in the background but you can use it to reset it to zero.
- Parameters
-
[in] timer The timer type [in] value The value to set.