Struct stm32_metapac::flash::regs::Cr
#[repr(transparent)]pub struct Cr(pub u32);
Expand description
FLASH control register
Tuple Fields§
§0: u32
Implementations§
§impl Cr
impl Cr
pub const fn mer1(&self) -> bool
pub const fn mer1(&self) -> bool
Mass erase When set, this bit triggers the mass erase, that is, all user pages.
pub fn set_mer1(&mut self, val: bool)
pub fn set_mer1(&mut self, val: bool)
Mass erase When set, this bit triggers the mass erase, that is, all user pages.
pub const fn pnb(&self) -> u8
pub const fn pnb(&self) -> u8
Page number selection These bits select the page to erase: … Note: Values corresponding to addresses outside the main memory are not allowed.
pub fn set_pnb(&mut self, val: u8)
pub fn set_pnb(&mut self, val: u8)
Page number selection These bits select the page to erase: … Note: Values corresponding to addresses outside the main memory are not allowed.
pub const fn strt(&self) -> bool
pub const fn strt(&self) -> bool
Start erase operation This bit triggers an erase operation when set. This bit is possible to set only by software and to clear only by hardware. The hardware clears it when one of BSY1 and BSY2 flags in the FLASH_SR register transits to zero.
pub fn set_strt(&mut self, val: bool)
pub fn set_strt(&mut self, val: bool)
Start erase operation This bit triggers an erase operation when set. This bit is possible to set only by software and to clear only by hardware. The hardware clears it when one of BSY1 and BSY2 flags in the FLASH_SR register transits to zero.
pub const fn optstrt(&self) -> bool
pub const fn optstrt(&self) -> bool
Start of modification of option bytes This bit triggers an options operation when set. This bit is set only by software, and is cleared when the BSY1 bit is cleared in FLASH_SR.
pub fn set_optstrt(&mut self, val: bool)
pub fn set_optstrt(&mut self, val: bool)
Start of modification of option bytes This bit triggers an options operation when set. This bit is set only by software, and is cleared when the BSY1 bit is cleared in FLASH_SR.
pub const fn eopie(&self) -> bool
pub const fn eopie(&self) -> bool
End-of-operation interrupt enable This bit enables the interrupt generation upon setting the EOP flag in the FLASH_SR register.
pub fn set_eopie(&mut self, val: bool)
pub fn set_eopie(&mut self, val: bool)
End-of-operation interrupt enable This bit enables the interrupt generation upon setting the EOP flag in the FLASH_SR register.
pub const fn errie(&self) -> bool
pub const fn errie(&self) -> bool
Error interrupt enable This bit enables the interrupt generation upon setting the OPERR flag in the FLASH_SR register.
pub fn set_errie(&mut self, val: bool)
pub fn set_errie(&mut self, val: bool)
Error interrupt enable This bit enables the interrupt generation upon setting the OPERR flag in the FLASH_SR register.
pub const fn rderrie(&self) -> bool
pub const fn rderrie(&self) -> bool
PCROP read error interrupt enable This bit enables the interrupt generation upon setting the RDERR flag in the FLASH_SR register.
pub fn set_rderrie(&mut self, val: bool)
pub fn set_rderrie(&mut self, val: bool)
PCROP read error interrupt enable This bit enables the interrupt generation upon setting the RDERR flag in the FLASH_SR register.
pub const fn obl_launch(&self) -> bool
pub const fn obl_launch(&self) -> bool
Option byte load launch When set, this bit triggers the load of option bytes into option registers. It is automatically cleared upon the completion of the load. The high state of the bit indicates pending option byte load. The bit cannot be cleared by software. It cannot be written as long as OPTLOCK is set.
pub fn set_obl_launch(&mut self, val: bool)
pub fn set_obl_launch(&mut self, val: bool)
Option byte load launch When set, this bit triggers the load of option bytes into option registers. It is automatically cleared upon the completion of the load. The high state of the bit indicates pending option byte load. The bit cannot be cleared by software. It cannot be written as long as OPTLOCK is set.
pub const fn sec_prot(&self) -> bool
pub const fn sec_prot(&self) -> bool
Securable memory area protection enable This bit enables the protection on securable area, provided that a non-null securable memory area size (SEC_SIZE[4:0]) is defined in option bytes. This bit is possible to set only by software and to clear only through a system reset.
pub fn set_sec_prot(&mut self, val: bool)
pub fn set_sec_prot(&mut self, val: bool)
Securable memory area protection enable This bit enables the protection on securable area, provided that a non-null securable memory area size (SEC_SIZE[4:0]) is defined in option bytes. This bit is possible to set only by software and to clear only through a system reset.
pub const fn optlock(&self) -> bool
pub const fn optlock(&self) -> bool
Options Lock This bit is set only. When set, all bits concerning user option in FLASH_CR register and so option page are locked. This bit is cleared by hardware after detecting the unlock sequence. The LOCK bit must be cleared before doing the unlock sequence for OPTLOCK bit. In case of an unsuccessful unlock operation, this bit remains set until the next reset.
pub fn set_optlock(&mut self, val: bool)
pub fn set_optlock(&mut self, val: bool)
Options Lock This bit is set only. When set, all bits concerning user option in FLASH_CR register and so option page are locked. This bit is cleared by hardware after detecting the unlock sequence. The LOCK bit must be cleared before doing the unlock sequence for OPTLOCK bit. In case of an unsuccessful unlock operation, this bit remains set until the next reset.
Trait Implementations§
impl Copy for Cr
impl Eq for Cr
impl StructuralPartialEq for Cr
Auto Trait Implementations§
impl Freeze for Cr
impl RefUnwindSafe for Cr
impl Send for Cr
impl Sync for Cr
impl Unpin for Cr
impl UnwindSafe for Cr
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)