RTC - Real Time Counter

Description

Real Time Counter (RTC) Peripheral API.

This module contains functions to control the RTC peripheral of Silicon Labs 32-bit MCUs and SoCs. The RTC ensures timekeeping in low energy modes.

Data Structures

struct RTC_Init_TypeDef
RTC initialization structure.

Functions

uint32_t RTC_CompareGet (unsigned int comp)
Get the RTC compare register value.
void RTC_CompareSet (unsigned int comp, uint32_t value)
Set the RTC compare register value.
uint32_t RTC_CounterGet (void)
Get RTC counter value.
void RTC_CounterSet (uint32_t value)
Set the RTC counter value.
void RTC_CounterReset (void)
Restart the RTC counter from zero.
void RTC_Enable (bool enable)
Enable/disable RTC.
void RTC_FreezeEnable (bool enable)
RTC register synchronization freeze control.
void RTC_Init (const RTC_Init_TypeDef *init)
Initialize RTC.
void RTC_IntClear (uint32_t flags)
Clear one or more pending RTC interrupts.
void RTC_IntDisable (uint32_t flags)
Disable one or more RTC interrupts.
void RTC_IntEnable (uint32_t flags)
Enable one or more RTC interrupts.
uint32_t RTC_IntGet (void)
Get pending RTC interrupt flags.
uint32_t RTC_IntGetEnabled (void)
Get enabled and pending RTC interrupt flags.
void RTC_IntSet (uint32_t flags)
Set one or more pending RTC interrupts from SW.
void RTC_Reset (void)
Restore RTC to reset state.

Macros

#define NUM_RTC_CHANNELS 2U
The RTC peripheral on series 0 devices support 2 compare channels while the RTC peripheral on series 1 devices support 6 compare channels.
#define RTC_INIT_DEFAULT
Suggested default configuration for RTC initialization structure.

Function Documentation

RTC_CompareGet()

uint32_t RTC_CompareGet ( unsigned int comp )

Get the RTC compare register value.

Parameters
[in] comp A compare register to get. This value must be less than NUM_RTC_CHANNELS .
Returns
A compare register value, 0 if invalid register selected.

RTC_CompareSet()

void RTC_CompareSet ( unsigned int comp,
uint32_t value
)

Set the RTC compare register value.

Note
The setting of a compare register requires synchronization into the low-frequency domain. If the same register is modified before a previous update has completed, this function will stall until the previous synchronization has completed. This only applies to the Gecko Family. See comments in the regSync() internal function call.
Parameters
[in] comp