BURTC - Backup RTC#
Backup Real Time Counter (BURTC) Peripheral API.
This module contains functions to control the BURTC peripheral of Silicon Labs 32-bit MCUs. The Backup Real Time Counter allows timekeeping in all energy modes. The Backup RTC is also available when the system is in backup mode.
Modules#
Functions#
Initialize BURTC.
Enable or Disable BURTC peripheral.
Set BURTC compare channel.
Get the BURTC compare value.
Reset counter.
Restore BURTC to reset state.
Clear one or more pending BURTC interrupts.
Disable one or more BURTC interrupts.
Enable one or more BURTC interrupts.
Get pending BURTC interrupt flags.
Get enabled and pending BURTC interrupt flags.
Set one or more pending BURTC interrupts from SW.
Status of BURTC RAM, timestamp and LP Mode.
Wait for the BURTC to complete all synchronization of register changes and commands.
Start BURTC counter.
Stop the BURTC counter.
Get BURTC counter.
Lock BURTC registers, which will protect from writing new config settings.
Unlock BURTC registers, which will enable write access to change configuration.
Macros#
BURTC clock divisors.
Divide clock by 2.
Divide clock by 4.
Divide clock by 8.
Divide clock by 16.
Divide clock by 32.
Divide clock by 64.
Divide clock by 128.
Default configuration for BURTC init structure.
Function Documentation#
BURTC_Init#
void BURTC_Init (const BURTC_Init_TypeDef * burtcInit)
Initialize BURTC.
[in] | burtcInit | A pointer to the BURTC initialization structure. |
Configures the BURTC peripheral.
Note
Before initialization, BURTC module must first be enabled by clearing the reset bit in the RMU, i.e.,
* RMU_ResetControl(rmuResetBU, rmuResetModeClear); *
Compare channel 0 must be configured outside this function, before initialization if enable is set to true. The counter will always be reset.
123
of file platform/emlib/src/em_burtc.c
BURTC_Enable#
void BURTC_Enable (bool enable)
Enable or Disable BURTC peripheral.
[in] | enable | true to enable, false to disable. |
225
of file platform/emlib/src/em_burtc.c
BURTC_CompareSet#
void BURTC_CompareSet (unsigned int comp, uint32_t value)
Set BURTC compare channel.
[in] | comp | Compare the channel index, must be 0 for current devices. |
[in] | value | New compare value. |
281
of file platform/emlib/src/em_burtc.c
BURTC_CompareGet#
uint32_t BURTC_CompareGet (unsigned int comp)
Get the BURTC compare value.
[in] | comp | Compare the channel index value, must be 0 for Giant/Leopard Gecko. |
Returns
The currently configured value for this compare channel.
311
of file platform/emlib/src/em_burtc.c
BURTC_CounterReset#
void BURTC_CounterReset (void )
Reset counter.
N/A |
326
of file platform/emlib/src/em_burtc.c
BURTC_Reset#
void BURTC_Reset (void )
Restore BURTC to reset state.
N/A |
Note
Before accessing the BURTC, BURSTEN in RMU->CTRL must be cleared. LOCK will not be reset to default value, as this will disable access to core BURTC registers.
347
of file platform/emlib/src/em_burtc.c
BURTC_IntClear#
void BURTC_IntClear (uint32_t flags)
Clear one or more pending BURTC interrupts.
[in] | flags | BURTC interrupt sources to clear. Use a set of interrupt flags OR-ed together to clear multiple interrupt sources for the BURTC module (BURTC_IFS_nnn). |
174
of file platform/emlib/inc/em_burtc.h
BURTC_IntDisable#
void BURTC_IntDisable (uint32_t flags)
Disable one or more BURTC interrupts.
[in] | flags | BURTC interrupt sources to disable. Use a set of interrupt flags OR-ed together to disable multiple interrupt sources for the BURTC module (BURTC_IFS_nnn). |
192
of file platform/emlib/inc/em_burtc.h
BURTC_IntEnable#
void BURTC_IntEnable (uint32_t flags)
Enable one or more BURTC interrupts.
[in] | flags | BURTC interrupt sources to enable. Use a set of interrupt flags OR-ed together to set multiple interrupt sources for the BURTC module (BURTC_IFS_nnn). |
Note
Depending on use, a pending interrupt may already be set prior to enabling the interrupt. Consider using BURTC_IntClear() prior to enabling if a pending interrupt should be ignored.
215
of file platform/emlib/inc/em_burtc.h
BURTC_IntGet#
uint32_t BURTC_IntGet (void )
Get pending BURTC interrupt flags.
N/A |
Note
This function does not clear the event bits.
Returns
Pending BURTC interrupt sources. Returns a set of interrupt flags OR-ed together for multiple interrupt sources in the BURTC module (BURTC_IFS_nnn).
235
of file platform/emlib/inc/em_burtc.h
BURTC_IntGetEnabled#
uint32_t BURTC_IntGetEnabled (void )
Get enabled and pending BURTC interrupt flags.
N/A |
Note
The event bits are not cleared by the use of this function.
Returns
Pending BURTC interrupt sources that is also enabled. Returns a set of interrupt flags OR-ed together for multiple interrupt sources in the BURTC module (BURTC_IFS_nnn).
252
of file platform/emlib/inc/em_burtc.h
BURTC_IntSet#
void BURTC_IntSet (uint32_t flags)
Set one or more pending BURTC interrupts from SW.
[in] | flags | BURTC interrupt sources to set to pending. Use a set of interrupt flags OR-ed together to set multiple interrupt sources for the BURTC module (BURTC_IFS_nnn). |
272
of file platform/emlib/inc/em_burtc.h
BURTC_Status#
uint32_t BURTC_Status (void )
Status of BURTC RAM, timestamp and LP Mode.
N/A |
Returns
A mask logically OR-ed status bits
287
of file platform/emlib/inc/em_burtc.h
BURTC_SyncWait#
void BURTC_SyncWait (void )
Wait for the BURTC to complete all synchronization of register changes and commands.
N/A |
308
of file platform/emlib/inc/em_burtc.h
BURTC_Start#
void BURTC_Start (void )
Start BURTC counter.
N/A |
This function will send a start command to the BURTC peripheral. The BURTC peripheral will use some LF clock ticks before the command is executed. The BURTC_SyncWait() function can be used to wait for the start command to be executed.
Note
This function requires the BURTC to be enabled.
334
of file platform/emlib/inc/em_burtc.h
BURTC_Stop#
void BURTC_Stop (void )
Stop the BURTC counter.
N/A |
This function will send a stop command to the BURTC peripheral. The BURTC peripheral will use some LF clock ticks before the command is executed. The BURTC_SyncWait() function can be used to wait for the stop command to be executed.
Note
This function requires the BURTC to be enabled.
352
of file platform/emlib/inc/em_burtc.h
BURTC_CounterGet#
uint32_t BURTC_CounterGet (void )
Get BURTC counter.
N/A |
Returns
BURTC counter value
365
of file platform/emlib/inc/em_burtc.h
BURTC_Lock#
void BURTC_Lock (void )
Lock BURTC registers, which will protect from writing new config settings.
N/A |
442
of file platform/emlib/inc/em_burtc.h
BURTC_Unlock#
void BURTC_Unlock (void )
Unlock BURTC registers, which will enable write access to change configuration.
N/A |
451
of file platform/emlib/inc/em_burtc.h
Macro Definition Documentation#
burtcClkDiv_1#
#define burtcClkDiv_1Value:
1
BURTC clock divisors.
These values are valid for the BURTC prescaler. Divide clock by 1.
55
of file platform/emlib/inc/em_burtc.h
burtcClkDiv_2#
#define burtcClkDiv_2Value:
2
Divide clock by 2.
56
of file platform/emlib/inc/em_burtc.h
burtcClkDiv_4#
#define burtcClkDiv_4Value:
4
Divide clock by 4.
57
of file platform/emlib/inc/em_burtc.h
burtcClkDiv_8#
#define burtcClkDiv_8Value:
8
Divide clock by 8.
58
of file platform/emlib/inc/em_burtc.h
burtcClkDiv_16#
#define burtcClkDiv_16Value:
16
Divide clock by 16.
59
of file platform/emlib/inc/em_burtc.h
burtcClkDiv_32#
#define burtcClkDiv_32Value:
32
Divide clock by 32.
60
of file platform/emlib/inc/em_burtc.h
burtcClkDiv_64#
#define burtcClkDiv_64Value:
64
Divide clock by 64.
61
of file platform/emlib/inc/em_burtc.h
burtcClkDiv_128#
#define burtcClkDiv_128Value:
128
Divide clock by 128.
62
of file platform/emlib/inc/em_burtc.h
BURTC_INIT_DEFAULT#
#define BURTC_INIT_DEFAULTValue:
Default configuration for BURTC init structure.
150
of file platform/emlib/inc/em_burtc.h