The Real-time Timer is built around a 32-bit counter used to count roll-over events of the programmable 16-bit prescaler, which enables counting elapsed seconds from a 32 kHz slow clock source.
This is a driver for configuration and use of the RTT peripheral.
Modules | |
Related Project(s) | |
In this section you can find all the projects related to the Real-time Timer (RTT). | |
Functions | |
void | rtt_disable_interrupt (Rtt *p_rtt, uint32_t ul_sources) |
Disable RTT interrupts. More... | |
void | rtt_enable_interrupt (Rtt *p_rtt, uint32_t ul_sources) |
Enable RTT interrupts. More... | |
uint32_t | rtt_get_status (Rtt *p_rtt) |
Get the status register value of the given RTT. More... | |
uint32_t | rtt_init (Rtt *p_rtt, uint16_t us_prescaler) |
Initialize the given RTT. More... | |
uint32_t | rtt_read_timer_value (Rtt *p_rtt) |
Read the current value of the RTT timer value. More... | |
uint32_t | rtt_write_alarm_time (Rtt *p_rtt, uint32_t ul_alarm_time) |
Configure the RTT to generate an alarm at the given time. More... | |
void rtt_disable_interrupt | ( | Rtt * | p_rtt, |
uint32_t | ul_sources | ||
) |
Disable RTT interrupts.
p_rtt | Pointer to an RTT instance. |
ul_sources | Interrupts to be disabled. |
Referenced by rtt_write_alarm_time().
void rtt_enable_interrupt | ( | Rtt * | p_rtt, |
uint32_t | ul_sources | ||
) |
Enable RTT interrupts.
p_rtt | Pointer to an RTT instance. |
ul_sources | Interrupts to be enabled. |
Referenced by configure_rtt(), gpbr_test_configure_rtt(), main(), and rtt_write_alarm_time().
uint32_t rtt_get_status | ( | Rtt * | p_rtt | ) |
Get the status register value of the given RTT.
p_rtt | Pointer to an RTT instance. |
Referenced by RTT_Handler().
uint32_t rtt_init | ( | Rtt * | p_rtt, |
uint16_t | us_prescaler | ||
) |
Initialize the given RTT.
p_rtt | Pointer to an RTT instance. |
us_prescaler | Prescaler value for the RTT. |
Referenced by configure_rtt(), gpbr_test_configure_rtt(), and main().
uint32_t rtt_read_timer_value | ( | Rtt * | p_rtt | ) |
Read the current value of the RTT timer value.
p_rtt | Pointer to an RTT instance. |
Referenced by configure_rtt(), gpbr_test_configure_rtt(), main(), and refresh_display().
uint32_t rtt_write_alarm_time | ( | Rtt * | p_rtt, |
uint32_t | ul_alarm_time | ||
) |
Configure the RTT to generate an alarm at the given time.
alarm happens when CRTV value equals ALMV+1, so RTT_AR should be alarmtime - 1. if you want to get alarm when rtt hit 0 , ALMV should be set to 0xFFFFFFFF.
p_rtt | Pointer to an RTT instance. |
ul_alarm_time | Alarm time,Alarm time = ALMV + 1. |
0 | Configuration is done. |
Alarm time = ALMV + 1,If the incoming parameter is 0, the ALMV is set to 0xFFFFFFFF.
References flag, rtt_disable_interrupt(), and rtt_enable_interrupt().
Referenced by main(), and run_gpbr_test().