stm32:l4: pwr: Add en/disable_backup_domain_write_protect()

This commit is contained in:
Bruno Randolf 2018-01-05 13:36:05 +00:00 committed by Karl Palsson
parent a1f58ea8ae
commit 2c1823f7bb
2 changed files with 22 additions and 0 deletions

View File

@ -170,6 +170,8 @@ enum pwr_vos_scale {
BEGIN_DECLS
void pwr_set_vos_scale(enum pwr_vos_scale scale);
void pwr_disable_backup_domain_write_protect(void);
void pwr_enable_backup_domain_write_protect(void);
END_DECLS

View File

@ -52,4 +52,24 @@ void pwr_set_vos_scale(enum pwr_vos_scale scale)
}
PWR_CR1 = reg32;
}
/** Disable Backup Domain Write Protection
*
* This allows backup domain registers to be changed. These registers are write
* protected after a reset.
*/
void pwr_disable_backup_domain_write_protect(void)
{
PWR_CR1 |= PWR_CR1_DBP;
}
/** Re-enable Backup Domain Write Protection
*
* This protects backup domain registers from inadvertent change.
*/
void pwr_enable_backup_domain_write_protect(void)
{
PWR_CR1 &= ~PWR_CR1_DBP;
}
/**@}*/