STM32 core 3.0.1-dev
Arduino core for STM32 based boards: API reference
← STM32duino documentation
Loading...
Searching...
No Matches
backup.h File Reference

Header for backup domain driver. More...

#include "stm32_def.h"
#include "stm32yyxx_ll_pwr.h"
#include "stm32yyxx_ll_rtc.h"
#include "stm32yyxx_ll_tamp.h"

Macros

#define RTC_BKP_INDEX   0
 
#define RTC_BKP_VALUE   0x32F2
 Default value written in an RTC backup register.
 

Functions

static void resetBackupDomain (void)
 Reset the backup domain (RTC and backup registers).
 
static void enableBackupDomain (void)
 Enable access to the backup domain and its clocks (RTC, backup registers and SRAM).
 
static void disableBackupDomain (void)
 Disable the backup domain clocks (RTC, backup registers and SRAM).
 
static void setBackupRegister (uint32_t index, uint32_t value)
 Write a value in a backup register.
 
static uint32_t getBackupRegister (uint32_t index)
 Read a value from a backup register.
 
static void writeBackupSRAM (uint32_t offset, uint32_t *data, uint32_t length)
 Write 32-bit words to the backup SRAM.
 
static void readBackupSRAM (uint32_t offset, uint32_t *data, uint32_t length)
 Read 32-bit words from the backup SRAM.
 

Detailed Description

Header for backup domain driver.

Author
fpistm
Attention

Copyright (c) 2017 STMicroelectronics. All rights reserved.

This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this file except in compliance with the License. You may obtain a copy of the License at: opensource.org/licenses/BSD-3-Clause

Function Documentation

◆ getBackupRegister()

static uint32_t getBackupRegister ( uint32_t  index)
inlinestatic

Read a value from a backup register.

Parameters
indexBackup register index.
Returns
The value stored in the backup register, or 0 if backup registers are not available.

◆ readBackupSRAM()

static void readBackupSRAM ( uint32_t  offset,
uint32_t *  data,
uint32_t  length 
)
inlinestatic

Read 32-bit words from the backup SRAM.

Parameters
offsetOffset, in 32-bit words, from the start of the backup SRAM.
dataPointer to the buffer receiving the data.
lengthNumber of 32-bit words to read.
Note
Does nothing if backup SRAM is not available.

◆ resetBackupDomain()

static void resetBackupDomain ( void  )
inlinestatic

Reset the backup domain (RTC and backup registers).

Note
Backup domain write access is enabled as part of the reset.

◆ setBackupRegister()

static void setBackupRegister ( uint32_t  index,
uint32_t  value 
)
inlinestatic

Write a value in a backup register.

Parameters
indexBackup register index.
valueValue to write.
Note
Does nothing if backup registers are not available.

◆ writeBackupSRAM()

static void writeBackupSRAM ( uint32_t  offset,
uint32_t *  data,
uint32_t  length 
)
inlinestatic

Write 32-bit words to the backup SRAM.

Parameters
offsetOffset, in 32-bit words, from the start of the backup SRAM.
dataPointer to the data to write.
lengthNumber of 32-bit words to write.
Note
Does nothing if backup SRAM is not available.