关于备份寄存器初始化函数的问题BKP_DeInit()
BKP)DEINIT()函数是将BKP外设寄存器复位到默认值,会不会把存放在BKP_DR1~DR10的数据一块清掉呢?RE:关于备份寄存器初始化函数的问题BKP_DeInit()
按照参考手册上的说明,应该是不影响:Bit 16 BDRST: Backup domain software reset
Set and cleared by software.
0: Reset not activated
1: Resets the entire Backup domain
Note: The BKPSRAM is not affected by this reset, the only way of resetting the BKPSRAM is
through the Flash interface when a protection level change from level 1 to level 0 is
requested.
函数原型如下:
void BKP_DeInit(void)
{
RCC_BackupResetCmd(ENABLE);
RCC_BackupResetCmd(DISABLE);
}
void RCC_BackupResetCmd(FunctionalState NewState)
{
/* Check the parameters */
assert_param(IS_FUNCTIONAL_STATE(NewState));
*(__IO uint32_t *) BDCR_BDRST_BB = (uint32_t)NewState;
}
#define BDCR_BDRST_BB (PERIPH_BB_BASE + (BDCR_OFFSET * 32) + (BDRST_BitNumber * 4))
RE:关于备份寄存器初始化函数的问题BKP_DeInit()
不会,这个只是关闭了BKP的功能。回复:关于备份寄存器初始化函数的问题BKP_DeInit()
试过了,对备份数据区有影响,会把备份数据清掉的
页:
[1]