24 #ifndef __RFLPC_TIMER_H__
25 #define __RFLPC_TIMER_H__
27 #ifdef RFLPC_CONFIG_ENABLE_TIMERS
29 #include "../nxp/LPC17xx.h"
32 #include "../interrupt.h"
uint32_t rflpc_timer_get_pre_scale_counter(rflpc_timer_t timer)
Returns the prescale counter value.
void rflpc_timer_reset_irq(rflpc_timer_t timer, rflpc_timer_match_t match_register)
Reset the irq for a given match register.
uint32_t rflpc_timer_get_counter(rflpc_timer_t timer)
Returns the timer counter value.
void rflpc_timer_enable(rflpc_timer_t timer)
Power and clock the given timer.
void rflpc_timer_set_callback(rflpc_timer_t timer, rflpc_irq_handler_t callback)
Sets the timer interrupt callback.
int rflpc_timer_running(rflpc_timer_t timer)
Query the running state of the timer.
void rflpc_timer_disable(rflpc_timer_t timer)
disable the given timer
uint32_t rflpc_timer_get_pre_scale_register(rflpc_timer_t timer)
Returns the value of the prescale register.
int rflpc_timer_test_irq(rflpc_timer_t timer, rflpc_timer_match_t match_register)
Check if an interrupt has been generated for a given match register.
void rflpc_timer_set_match_value(rflpc_timer_t timer, rflpc_timer_match_t match_register, uint32_t match_value)
Set the match register value for a given timer.
rflpc_timer_match_t
Match registers for interrupt generation.
void rflpc_timer_reset(rflpc_timer_t timer)
Resets the timer.
rflpc_clock_divider_t
This enums defines the different cpu clock dividers for use as peripheral clocks. ...
Trigger an interrupt when counter matches the match register.
void rflpc_timer_stop(rflpc_timer_t timer)
Stops the timer.
void rflpc_timer_set_clock(rflpc_timer_t timer, rflpc_clock_divider_t divider)
Sets the cpu clock divider for a given timer.
void rflpc_timer_set_pre_scale_counter(rflpc_timer_t timer, uint32_t value)
Sets the prescale counter value.
void rflpc_timer_set_pre_scale_register(rflpc_timer_t timer, uint32_t value)
Sets the value of the prescale register.
void rflpc_timer_start(rflpc_timer_t timer)
starts the given timer.
void rflpc_timer_set_irq_on_match(rflpc_timer_t timer, rflpc_timer_match_t match_register, uint32_t options)
Enable IRQ generation when the timer counter reaches the value of a match register.
rflpc_timer_t
Value to use for the timer value in functions.
Stop the timer when the counter matches the match register.
Reset the timer when counter matches the match register.
void rflpc_timer_set_counter(rflpc_timer_t timer, uint32_t value)
Sets the timer counter value.
void(* rflpc_irq_handler_t)(void)
Interrupt handler type.