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

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

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

void

Start BURTC counter.

void

Stop the BURTC counter.

uint32_t

Get BURTC counter.

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.

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.

Macros#

#define
burtcClkDiv_1 1

BURTC clock divisors.

#define
burtcClkDiv_2 2

Divide clock by 2.

#define
burtcClkDiv_4 4

Divide clock by 4.

#define
burtcClkDiv_8 8

Divide clock by 8.

#define
burtcClkDiv_16 16

Divide clock by 16.

#define
burtcClkDiv_32 32

Divide clock by 32.

#define
burtcClkDiv_64 64

Divide clock by 64.

#define
burtcClkDiv_128 128

Divide clock by 128.

#define
BURTC_INIT_DEFAULT undefined

Default configuration for BURTC init structure.

Function Documentation#

BURTC_IntClear#

void BURTC_IntClear (uint32_t flags)

Clear one or more pending BURTC interrupts.

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


BURTC_IntDisable#

void BURTC_IntDisable (uint32_t flags)

Disable one or more BURTC interrupts.

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


BURTC_IntEnable#

void BURTC_IntEnable (uint32_t flags)

Enable one or more BURTC interrupts.

Parameters
TypeDirectionArgument NameDescription
uint32_t[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.


BURTC_IntGet#

uint32_t BURTC_IntGet (void )

Get pending BURTC interrupt flags.

Parameters
TypeDirectionArgument NameDescription
voidN/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).


BURTC_IntGetEnabled#

uint32_t BURTC_IntGetEnabled (void )

Get enabled and pending BURTC interrupt flags.

Parameters
TypeDirectionArgument NameDescription
voidN/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).


BURTC_IntSet#

void BURTC_IntSet (uint32_t flags)

Set one or more pending BURTC interrupts from SW.

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


BURTC_Status#

uint32_t BURTC_Status (void )

Status of BURTC RAM, timestamp and LP Mode.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • A mask logically OR-ed status bits


BURTC_SyncWait#

void BURTC_SyncWait (void )

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

Parameters
TypeDirectionArgument NameDescription
voidN/A

BURTC_Start#

void BURTC_Start (void )

Start BURTC counter.

Parameters
TypeDirectionArgument NameDescription
voidN/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.


BURTC_Stop#

void BURTC_Stop (void )

Stop the BURTC counter.

Parameters
TypeDirectionArgument NameDescription
voidN/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.


BURTC_CounterGet#

uint32_t BURTC_CounterGet (void )

Get BURTC counter.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • BURTC counter value


BURTC_Lock#

void BURTC_Lock (void )

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

Parameters
TypeDirectionArgument NameDescription
voidN/A

BURTC_Unlock#

void BURTC_Unlock (void )

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

Parameters
TypeDirectionArgument NameDescription
voidN/A

BURTC_Reset#

void BURTC_Reset (void )

Restore BURTC to reset state.

Parameters
TypeDirectionArgument NameDescription
voidN/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.


BURTC_Init#

void BURTC_Init (const BURTC_Init_TypeDef * burtcInit)

Initialize BURTC.

Parameters
TypeDirectionArgument NameDescription
const BURTC_Init_TypeDef *[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.


BURTC_Enable#

void BURTC_Enable (bool enable)

Enable or Disable BURTC peripheral.

Parameters
TypeDirectionArgument NameDescription
bool[in]enable

true to enable, false to disable.


BURTC_CounterReset#

void BURTC_CounterReset (void )

Reset counter.

Parameters
TypeDirectionArgument NameDescription
voidN/A

BURTC_CompareSet#

void BURTC_CompareSet (unsigned int comp, uint32_t value)

Set BURTC compare channel.

Parameters
TypeDirectionArgument NameDescription
unsigned int[in]comp

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

uint32_t[in]value

New compare value.


BURTC_CompareGet#

uint32_t BURTC_CompareGet (unsigned int comp)

Get the BURTC compare value.

Parameters
TypeDirectionArgument NameDescription
unsigned int[in]comp

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

Returns

  • The currently configured value for this compare channel.