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#

BURTC_Init_TypeDef

Enumerations#

enum
burtcClkSelULFRCO = BURTC_CTRL_CLKSEL_ULFRCO
burtcClkSelLFRCO = BURTC_CTRL_CLKSEL_LFRCO
burtcClkSelLFXO = BURTC_CTRL_CLKSEL_LFXO
}

BURTC clock selection.

enum
burtcModeDisable = BURTC_CTRL_MODE_DISABLE
burtcModeEM2 = BURTC_CTRL_MODE_EM2EN
burtcModeEM3 = BURTC_CTRL_MODE_EM3EN
burtcModeEM4 = BURTC_CTRL_MODE_EM4EN
}

BURTC mode of operation.

enum
burtcLPDisable = BURTC_LPMODE_LPMODE_DISABLE
burtcLPEnable = BURTC_LPMODE_LPMODE_ENABLE
burtcLPBU = BURTC_LPMODE_LPMODE_BUEN
}

BURTC low power mode.

Functions#

void
BURTC_IntClear(uint32_t flags)

Clear one or more pending BURTC interrupts.

void
BURTC_IntDisable(uint32_t flags)

Disable one or more BURTC interrupts.

void
BURTC_IntEnable(uint32_t flags)

Enable one or more BURTC interrupts.

uint32_t

Get pending BURTC interrupt flags.

uint32_t

Get enabled and pending BURTC interrupt flags.

void
BURTC_IntSet(uint32_t flags)

Set one or more pending BURTC interrupts from SW.

uint32_t

Status of BURTC RAM, timestamp and LP Mode.

void

Clear and reset BURTC status register.

void

Wait for the BURTC to complete all synchronization of register changes and commands.

uint32_t

Get BURTC counter.

uint32_t

Get BURTC timestamp for entering BU.

void
BURTC_FreezeEnable(bool enable)

Freeze register updates until enabled.

void
BURTC_Powerdown(bool enable)

Shut down power to retention register bank.

void
BURTC_RetRegSet(uint32_t num, uint32_t data)

Set a value in one of the retention registers.

uint32_t
BURTC_RetRegGet(uint32_t num)

Read a value from one of the retention registers.

void

Lock BURTC registers, which will protect from writing new config settings.

void

Unlock BURTC registers, which will enable write access to change configuration.

void

Restore BURTC to reset state.

void
BURTC_Init(const BURTC_Init_TypeDef *burtcInit)

Initialize BURTC.

void
BURTC_Enable(bool enable)

Enable or Disable BURTC peripheral reset and start counter.

void

Reset counter.

void
BURTC_CompareSet(unsigned int comp, uint32_t value)

Set BURTC compare channel.

uint32_t
BURTC_CompareGet(unsigned int comp)

Get the BURTC compare value.

uint32_t

Get the clock frequency of the BURTC.

Macros#

#define

BURTC clock divisors.

#define

Divide clock by 2.

#define

Divide clock by 4.

#define

Divide clock by 8.

#define

Divide clock by 16.

#define

Divide clock by 32.

#define

Divide clock by 64.

#define

Divide clock by 128.

#define

Default configuration for BURTC initialization structure.

Enumeration Documentation#

BURTC_ClkSel_TypeDef#

BURTC_ClkSel_TypeDef

BURTC clock selection.

Enumerator
burtcClkSelULFRCO

Ultra low frequency (1 kHz) clock.

burtcClkSelLFRCO

Low frequency RC oscillator.

burtcClkSelLFXO

Low frequency crystal oscillator.


Definition at line 70 of file platform/emlib/inc/em_burtc.h

BURTC_Mode_TypeDef#

BURTC_Mode_TypeDef

BURTC mode of operation.

Enumerator
burtcModeDisable

Disable BURTC.

burtcModeEM2

Enable and start BURTC counter in EM0 to EM2.

burtcModeEM3

Enable and start BURTC counter in EM0 to EM3.

burtcModeEM4

Enable and start BURTC counter in EM0 to EM4.


Definition at line 80 of file platform/emlib/inc/em_burtc.h

BURTC_LP_TypeDef#

BURTC_LP_TypeDef

BURTC low power mode.

Enumerator
burtcLPDisable

Low Power Mode is disabled.

burtcLPEnable

Low Power Mode is always enabled.

burtcLPBU

Low Power Mode when system enters backup mode.


Definition at line 92 of file platform/emlib/inc/em_burtc.h

Function Documentation#

BURTC_IntClear#

void BURTC_IntClear (uint32_t flags)

Clear one or more pending BURTC interrupts.

Parameters
[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).


Definition at line 174 of file platform/emlib/inc/em_burtc.h

BURTC_IntDisable#

void BURTC_IntDisable (uint32_t flags)

Disable one or more BURTC interrupts.

Parameters
[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).


Definition at line 192 of file platform/emlib/inc/em_burtc.h

BURTC_IntEnable#

void BURTC_IntEnable (uint32_t flags)

Enable one or more BURTC interrupts.

Parameters
[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.


Definition at line 215 of file platform/emlib/inc/em_burtc.h

BURTC_IntGet#

uint32_t BURTC_IntGet (void )

Get pending BURTC interrupt flags.

Parameters
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).


Definition at line 235 of file platform/emlib/inc/em_burtc.h

BURTC_IntGetEnabled#

uint32_t BURTC_IntGetEnabled (void )

Get enabled and pending BURTC interrupt flags.

Parameters
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).


Definition at line 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.

Parameters
[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).


Definition at line 272 of file platform/emlib/inc/em_burtc.h

BURTC_Status#

uint32_t BURTC_Status (void )

Status of BURTC RAM, timestamp and LP Mode.

Parameters
N/A

Returns

  • A mask logically OR-ed status bits


Definition at line 287 of file platform/emlib/inc/em_burtc.h

BURTC_StatusClear#

void BURTC_StatusClear (void )

Clear and reset BURTC status register.

Parameters
N/A

Definition at line 297 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.

Parameters
N/A

Definition at line 308 of file platform/emlib/inc/em_burtc.h

BURTC_CounterGet#

uint32_t BURTC_CounterGet (void )

Get BURTC counter.

Parameters
N/A

Returns

  • BURTC counter value


Definition at line 365 of file platform/emlib/inc/em_burtc.h

BURTC_TimestampGet#

uint32_t BURTC_TimestampGet (void )

Get BURTC timestamp for entering BU.

Parameters
N/A

Returns

  • BURTC Time Stamp value


Definition at line 377 of file platform/emlib/inc/em_burtc.h

BURTC_FreezeEnable#

void BURTC_FreezeEnable (bool enable)

Freeze register updates until enabled.

Parameters
[in]enable

If true, registers are not updated until enabled again.


Definition at line 386 of file platform/emlib/inc/em_burtc.h

BURTC_Powerdown#

void BURTC_Powerdown (bool enable)

Shut down power to retention register bank.

Parameters
[in]enable

If true, shuts off power to retention registers.

Note

  • When power retention is disabled, it can't be enabled again (until reset).


Definition at line 399 of file platform/emlib/inc/em_burtc.h

BURTC_RetRegSet#

void BURTC_RetRegSet (uint32_t num, uint32_t data)

Set a value in one of the retention registers.

Parameters
[in]num

Register to set

[in]data

Value to put into register


Definition at line 413 of file platform/emlib/inc/em_burtc.h

BURTC_RetRegGet#

uint32_t BURTC_RetRegGet (uint32_t num)

Read a value from one of the retention registers.

Parameters
[in]num

Retention Register to read

Returns

  • Value of the retention register


Definition at line 430 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.

Parameters
N/A

Definition at line 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.

Parameters
N/A

Definition at line 451 of file platform/emlib/inc/em_burtc.h

BURTC_Reset#

void BURTC_Reset (void )

Restore BURTC to reset state.

Parameters
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.


Definition at line 345 of file platform/emlib/src/em_burtc.c

BURTC_Init#

void BURTC_Init (const BURTC_Init_TypeDef * burtcInit)

Initialize BURTC.

Parameters
[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.


Definition at line 123 of file platform/emlib/src/em_burtc.c

BURTC_Enable#

void BURTC_Enable (bool enable)

Enable or Disable BURTC peripheral reset and start counter.

Parameters
[in]enable

If true; asserts reset to BURTC, halts counter, if false; deassert reset


Definition at line 261 of file platform/emlib/src/em_burtc.c

BURTC_CounterReset#

void BURTC_CounterReset (void )

Reset counter.

Parameters
N/A

Definition at line 324 of file platform/emlib/src/em_burtc.c

BURTC_CompareSet#

void BURTC_CompareSet (unsigned int comp, uint32_t value)

Set BURTC compare channel.

Parameters
[in]comp

Compare the channel index, must be 0 for current devices.

[in]value

New compare value.


Definition at line 279 of file platform/emlib/src/em_burtc.c

BURTC_CompareGet#

uint32_t BURTC_CompareGet (unsigned int comp)

Get the BURTC compare value.

Parameters
[in]comp

Compare the channel index value, must be 0 for Giant/Leopard Gecko.

Returns

  • The currently configured value for this compare channel.


Definition at line 309 of file platform/emlib/src/em_burtc.c

BURTC_ClockFreqGet#

uint32_t BURTC_ClockFreqGet (void )

Get the clock frequency of the BURTC.

Parameters
N/A

Returns

  • The current frequency in Hz.


Definition at line 391 of file platform/emlib/src/em_burtc.c

Macro Definition Documentation#

burtcClkDiv_1#

#define burtcClkDiv_1
Value:
1

BURTC clock divisors.

These values are valid for the BURTC prescaler. Divide clock by 1.


Definition at line 55 of file platform/emlib/inc/em_burtc.h

burtcClkDiv_2#

#define burtcClkDiv_2
Value:
2

Divide clock by 2.


Definition at line 56 of file platform/emlib/inc/em_burtc.h

burtcClkDiv_4#

#define burtcClkDiv_4
Value:
4

Divide clock by 4.


Definition at line 57 of file platform/emlib/inc/em_burtc.h

burtcClkDiv_8#

#define burtcClkDiv_8
Value:
8

Divide clock by 8.


Definition at line 58 of file platform/emlib/inc/em_burtc.h

burtcClkDiv_16#

#define burtcClkDiv_16
Value:
16

Divide clock by 16.


Definition at line 59 of file platform/emlib/inc/em_burtc.h

burtcClkDiv_32#

#define burtcClkDiv_32
Value:
32

Divide clock by 32.


Definition at line 60 of file platform/emlib/inc/em_burtc.h

burtcClkDiv_64#

#define burtcClkDiv_64
Value:
64

Divide clock by 64.


Definition at line 61 of file platform/emlib/inc/em_burtc.h

burtcClkDiv_128#

#define burtcClkDiv_128
Value:
128

Divide clock by 128.


Definition at line 62 of file platform/emlib/inc/em_burtc.h

BURTC_INIT_DEFAULT#

#define BURTC_INIT_DEFAULT
Value:
{ \
true, \
burtcModeEM2, \
false, \
burtcClkSelULFRCO, \
burtcClkDiv_1, \
0, \
true, \
false, \
burtcLPDisable, \
}

Default configuration for BURTC initialization structure.


Definition at line 125 of file platform/emlib/inc/em_burtc.h