Backup Real Time Counter (BURTC) Peripheral API. More...
![]() |
Data Structures | |
struct | BURTC_Init_TypeDef |
Defines | |
#define | burtcClkDiv_1 1 |
#define | burtcClkDiv_2 2 |
#define | burtcClkDiv_4 4 |
#define | burtcClkDiv_8 8 |
#define | burtcClkDiv_16 16 |
#define | burtcClkDiv_32 32 |
#define | burtcClkDiv_64 64 |
#define | burtcClkDiv_128 128 |
#define | BURTC_INIT_DEFAULT |
Enumerations | |
enum | BURTC_ClkSel_TypeDef { burtcClkSelULFRCO = BURTC_CTRL_CLKSEL_ULFRCO, burtcClkSelLFRCO = BURTC_CTRL_CLKSEL_LFRCO, burtcClkSelLFXO = BURTC_CTRL_CLKSEL_LFXO } |
enum | BURTC_Mode_TypeDef { burtcModeDisable = BURTC_CTRL_MODE_DISABLE, burtcModeEM2 = BURTC_CTRL_MODE_EM2EN, burtcModeEM3 = BURTC_CTRL_MODE_EM3EN, burtcModeEM4 = BURTC_CTRL_MODE_EM4EN } |
enum | BURTC_LP_TypeDef { burtcLPDisable = BURTC_LPMODE_LPMODE_DISABLE, burtcLPEnable = BURTC_LPMODE_LPMODE_ENABLE, burtcLPBU = BURTC_LPMODE_LPMODE_BUEN } |
Functions | |
__STATIC_INLINE void | BURTC_IntClear (uint32_t flags) |
Clear one or more pending BURTC interrupts. | |
__STATIC_INLINE void | BURTC_IntDisable (uint32_t flags) |
Disable one or more BURTC interrupts. | |
__STATIC_INLINE void | BURTC_IntEnable (uint32_t flags) |
Enable one or more BURTC interrupts. | |
__STATIC_INLINE uint32_t | BURTC_IntGet (void) |
Get pending BURTC interrupt flags. | |
__STATIC_INLINE uint32_t | BURTC_IntGetEnabled (void) |
Get enabled and pending BURTC interrupt flags. | |
__STATIC_INLINE void | BURTC_IntSet (uint32_t flags) |
Set one or more pending BURTC interrupts from SW. | |
__STATIC_INLINE uint32_t | BURTC_Status (void) |
Status of BURTC RAM, timestamp and LP Mode. | |
__STATIC_INLINE void | BURTC_StatusClear (void) |
Clear and reset BURTC status register. | |
__STATIC_INLINE void | BURTC_Enable (bool enable) |
Enable or Disable BURTC peripheral reset and start counter. | |
__STATIC_INLINE uint32_t | BURTC_CounterGet (void) |
Get BURTC counter. | |
__STATIC_INLINE uint32_t | BURTC_TimestampGet (void) |
Get BURTC timestamp for entering BU. | |
__STATIC_INLINE void | BURTC_FreezeEnable (bool enable) |
Freeze register updates until enabled. | |
__STATIC_INLINE void | BURTC_Powerdown (bool enable) |
Shut down power to rentention register bank. | |
__STATIC_INLINE void | BURTC_RetRegSet (uint32_t num, uint32_t data) |
Set a value in one of the retention registers. | |
__STATIC_INLINE uint32_t | BURTC_RetRegGet (uint32_t num) |
Read a value from one of the retention registers. | |
__STATIC_INLINE void | BURTC_Lock (void) |
Lock BURTC registers, will protect from writing new config settings. | |
__STATIC_INLINE void | BURTC_Unlock (void) |
Unlock BURTC registers, enable write access to change configuration. | |
void | BURTC_Reset (void) |
Restore BURTC to reset state. | |
void | BURTC_Init (const BURTC_Init_TypeDef *burtcInit) |
Initialize BURTC. | |
void | BURTC_CounterReset (void) |
Reset counter. | |
void | BURTC_CompareSet (unsigned int comp, uint32_t value) |
Set BURTC compare channel. | |
uint32_t | BURTC_CompareGet (unsigned int comp) |
Get BURTC compare value. | |
uint32_t | BURTC_ClockFreqGet (void) |
Get clock frequency of the BURTC. | |
__STATIC_INLINE uint32_t | BURTC_DivToLog2 (uint32_t div) |
Convert dividend to prescaler logarithmic value. Only works for even numbers equal to 2^n. | |
__STATIC_INLINE void | BURTC_Sync (uint32_t mask) |
Wait for ongoing sync of register(s) to low frequency domain to complete. |
Backup Real Time Counter (BURTC) Peripheral API.
#define BURTC_INIT_DEFAULT |
{ true, \ burtcModeEM2, \ false, \ burtcClkSelULFRCO, \ burtcClkDiv_1, \ 0, \ true, \ false, \ burtcLPDisable, \ }
Default configuration for BURTC init structure
Definition at line 136 of file em_burtc.h.
#define burtcClkDiv_1 1 |
BURTC clock divisors. These values are valid for the BURTC prescaler. Divide clock by 1.
Definition at line 64 of file em_burtc.h.
#define burtcClkDiv_128 128 |
Divide clock by 128.
Definition at line 71 of file em_burtc.h.
#define burtcClkDiv_16 16 |
Divide clock by 16.
Definition at line 68 of file em_burtc.h.
#define burtcClkDiv_2 2 |
Divide clock by 2.
Definition at line 65 of file em_burtc.h.
#define burtcClkDiv_32 32 |
Divide clock by 32.
Definition at line 69 of file em_burtc.h.
#define burtcClkDiv_4 4 |
Divide clock by 4.
Definition at line 66 of file em_burtc.h.
#define burtcClkDiv_64 64 |
Divide clock by 64.
Definition at line 70 of file em_burtc.h.
#define burtcClkDiv_8 8 |
Divide clock by 8.
Definition at line 67 of file em_burtc.h.
enum BURTC_ClkSel_TypeDef |
BURTC clock selection
burtcClkSelULFRCO |
Ultra low frequency (1 kHz) clock |
burtcClkSelLFRCO |
Low frequency RC oscillator |
burtcClkSelLFXO |
Low frequency crystal osciallator |
Definition at line 78 of file em_burtc.h.
enum BURTC_LP_TypeDef |
BURTC low power mode
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 103 of file em_burtc.h.
enum BURTC_Mode_TypeDef |
BURTC mode of operation
Definition at line 90 of file em_burtc.h.
uint32_t BURTC_ClockFreqGet | ( | void | ) |
Get clock frequency of the BURTC.
Ultra low frequency (1 kHz) clock
Low frequency RC oscillator
Low frequency crystal osciallator
Definition at line 269 of file em_burtc.c.
uint32_t BURTC_CompareGet | ( | unsigned int | comp | ) |
Get BURTC compare value.
[in] | comp | Compare channel index value, must be 0 for Giant/Leopard. |
Definition at line 222 of file em_burtc.c.
void BURTC_CompareSet | ( | unsigned int | comp, | |
uint32_t | value | |||
) |
Set BURTC compare channel.
[in] | comp | Compare channel index, must be 0 for Giant / Leopard Gecko |
[in] | value | New compare value |
Definition at line 200 of file em_burtc.c.
References BURTC_Sync().
__STATIC_INLINE uint32_t BURTC_CounterGet | ( | void | ) |
void BURTC_CounterReset | ( | void | ) |
Reset counter.
Definition at line 235 of file em_burtc.c.
References BITBAND_Peripheral().
__STATIC_INLINE uint32_t BURTC_DivToLog2 | ( | uint32_t | div | ) |
Convert dividend to prescaler logarithmic value. Only works for even numbers equal to 2^n.
[in] | div | Unscaled dividend, |
Definition at line 66 of file em_burtc.c.
Referenced by BURTC_Init().
__STATIC_INLINE void BURTC_Enable | ( | bool | enable | ) |
Enable or Disable BURTC peripheral reset and start counter.
[in] | enable | If true; asserts reset to BURTC, halts counter, if false; deassert reset |
Definition at line 286 of file em_burtc.h.
References BITBAND_Peripheral().
Referenced by BURTC_Init().
__STATIC_INLINE void BURTC_FreezeEnable | ( | bool | enable | ) |
Freeze register updates until enabled.
[in] | enable | If true, registers are not updated until enabled again. |
Definition at line 330 of file em_burtc.h.
References BITBAND_Peripheral().
Referenced by BURTC_Init().
void BURTC_Init | ( | const BURTC_Init_TypeDef * | burtcInit | ) |
Initialize BURTC.
Configures the BURTC peripheral.
* RMU_ResetControl(rmuResetBU, false); *
[in] | burtcInit | Pointer to BURTC initialization structure |
Definition at line 127 of file em_burtc.c.
References BURTC_DivToLog2(), BURTC_Enable(), BURTC_FreezeEnable(), BURTC_IntClear(), BURTC_Sync(), burtcClkSelULFRCO, burtcLPDisable, burtcModeDisable, BURTC_Init_TypeDef::clkDiv, BURTC_Init_TypeDef::clkSel, BURTC_Init_TypeDef::compare0Top, BURTC_Init_TypeDef::debugRun, BURTC_Init_TypeDef::enable, BURTC_Init_TypeDef::lowPowerComp, BURTC_Init_TypeDef::lowPowerMode, BURTC_Init_TypeDef::mode, and BURTC_Init_TypeDef::timeStamp.
__STATIC_INLINE 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). |
Definition at line 161 of file em_burtc.h.
Referenced by BURTC_Init().
__STATIC_INLINE 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). |
Definition at line 176 of file em_burtc.h.
__STATIC_INLINE 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). |
Definition at line 196 of file em_burtc.h.
__STATIC_INLINE uint32_t BURTC_IntGet | ( | void | ) |
Get pending BURTC interrupt flags.
Definition at line 213 of file em_burtc.h.
__STATIC_INLINE uint32_t BURTC_IntGetEnabled | ( | void | ) |
Get enabled and pending BURTC interrupt flags.
Definition at line 231 of file em_burtc.h.
__STATIC_INLINE 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). |
Definition at line 252 of file em_burtc.h.
__STATIC_INLINE void BURTC_Lock | ( | void | ) |
Lock BURTC registers, will protect from writing new config settings.
Definition at line 386 of file em_burtc.h.
__STATIC_INLINE void BURTC_Powerdown | ( | bool | enable | ) |
Shut down power to rentention register bank.
[in] | enable | If true, shuts off power to retention registers. |
Definition at line 344 of file em_burtc.h.
References BITBAND_Peripheral().
void BURTC_Reset | ( | void | ) |
Restore BURTC to reset state.
Definition at line 251 of file em_burtc.c.
References BITBAND_Peripheral(), and BITBAND_PeripheralRead().
__STATIC_INLINE uint32_t BURTC_RetRegGet | ( | uint32_t | num | ) |
Read a value from one of the retention registers.
[in] | num | Retention Register to read |
Definition at line 374 of file em_burtc.h.
__STATIC_INLINE void BURTC_RetRegSet | ( | uint32_t | num, | |
uint32_t | data | |||
) |
Set a value in one of the retention registers.
[in] | num | Register to set |
[in] | data | Value to put into register |
Definition at line 359 of file em_burtc.h.
__STATIC_INLINE uint32_t BURTC_Status | ( | void | ) |
Status of BURTC RAM, timestamp and LP Mode.
Definition at line 264 of file em_burtc.h.
__STATIC_INLINE void BURTC_StatusClear | ( | void | ) |
Clear and reset BURTC status register.
Definition at line 274 of file em_burtc.h.
__STATIC_INLINE void BURTC_Sync | ( | uint32_t | mask | ) |
Wait for ongoing sync of register(s) to low frequency domain to complete.
[in] | mask | Bitmask corresponding to SYNCBUSY register defined bits, indicating registers that must complete any ongoing synchronization. |
Definition at line 88 of file em_burtc.c.
Referenced by BURTC_CompareSet(), and BURTC_Init().
__STATIC_INLINE uint32_t BURTC_TimestampGet | ( | void | ) |
Get BURTC timestamp for entering BU.
Definition at line 320 of file em_burtc.h.
__STATIC_INLINE void BURTC_Unlock | ( | void | ) |
Unlock BURTC registers, enable write access to change configuration.
Definition at line 396 of file em_burtc.h.