Struct stm32_metapac::flash::regs::Seccr
#[repr(transparent)]pub struct Seccr(pub u32);
Expand description
FLASH secure control register
Tuple Fields§
§0: u32
Implementations§
§impl Seccr
impl Seccr
pub const fn lock(&self) -> bool
pub const fn lock(&self) -> bool
configuration lock bit This bit locks the FLASH_SECCR register. The correct write sequence to FLASH_SECKEYR register unlocks this bit. If a wrong sequence is executed, or if the unlock sequence to FLASH_NSKEYR is performed twice, this bit remains locked until the next system reset. LOCK can be set by programming it to 1. When set to 1, a new unlock sequence is mandatory to unlock it. When LOCK changes from 0 to 1, the other bits of FLASH_SECCR register do not change.
pub fn set_lock(&mut self, val: bool)
pub fn set_lock(&mut self, val: bool)
configuration lock bit This bit locks the FLASH_SECCR register. The correct write sequence to FLASH_SECKEYR register unlocks this bit. If a wrong sequence is executed, or if the unlock sequence to FLASH_NSKEYR is performed twice, this bit remains locked until the next system reset. LOCK can be set by programming it to 1. When set to 1, a new unlock sequence is mandatory to unlock it. When LOCK changes from 0 to 1, the other bits of FLASH_SECCR register do not change.
pub const fn pg(&self) -> bool
pub const fn pg(&self) -> bool
programming control bit PG can be programmed only when LOCK is cleared to 0. PG allows programming in Bank1 and Bank2.
pub fn set_pg(&mut self, val: bool)
pub fn set_pg(&mut self, val: bool)
programming control bit PG can be programmed only when LOCK is cleared to 0. PG allows programming in Bank1 and Bank2.
pub const fn ser(&self) -> bool
pub const fn ser(&self) -> bool
sector erase request Setting SER bit to 1 requests a sector erase. SER can be programmed only when LOCK is cleared to 0. If BER and MER are also set, a PGSERR is raised.
pub fn set_ser(&mut self, val: bool)
pub fn set_ser(&mut self, val: bool)
sector erase request Setting SER bit to 1 requests a sector erase. SER can be programmed only when LOCK is cleared to 0. If BER and MER are also set, a PGSERR is raised.
pub const fn ber(&self) -> bool
pub const fn ber(&self) -> bool
erase request Setting BER bit to 1 requests a bank erase operation (user flash memory only). BER can be programmed only when LOCK is cleared to 0. If MER and SER are also set, a PGSERR is raised. Note: Write protection error is triggered when a bank erase is required and some sectors are protected.
pub fn set_ber(&mut self, val: bool)
pub fn set_ber(&mut self, val: bool)
erase request Setting BER bit to 1 requests a bank erase operation (user flash memory only). BER can be programmed only when LOCK is cleared to 0. If MER and SER are also set, a PGSERR is raised. Note: Write protection error is triggered when a bank erase is required and some sectors are protected.
pub const fn fw(&self) -> bool
pub const fn fw(&self) -> bool
write forcing control bit FW forces a write operation even if the write buffer is not full. In this case all bits not written are set to 1 by hardware. FW can be programmed only when LOCK is cleared to 0. The embedded flash memory resets FW when the corresponding operation has been acknowledged. Note: Using a force-write operation prevents the application from updating later the missing bits with something else than 1, because it is likely that it leads to permanent ECC error. Write forcing is effective only if the write buffer is not empty and was filled by secure access (in particular, FW does not start several write operations when the force-write operations are performed consecutively). Since there is just one write buffer, FW can force a write in bank1 or bank2.
pub fn set_fw(&mut self, val: bool)
pub fn set_fw(&mut self, val: bool)
write forcing control bit FW forces a write operation even if the write buffer is not full. In this case all bits not written are set to 1 by hardware. FW can be programmed only when LOCK is cleared to 0. The embedded flash memory resets FW when the corresponding operation has been acknowledged. Note: Using a force-write operation prevents the application from updating later the missing bits with something else than 1, because it is likely that it leads to permanent ECC error. Write forcing is effective only if the write buffer is not empty and was filled by secure access (in particular, FW does not start several write operations when the force-write operations are performed consecutively). Since there is just one write buffer, FW can force a write in bank1 or bank2.
pub const fn strt(&self) -> bool
pub const fn strt(&self) -> bool
erase start control bit STRT bit is used to start a sector erase or a bank erase operation. STRT can be programmed only when LOCK is cleared to 0. STRT is reseted at the end of the operation or when an error occurs. It cannot be reset by software.
pub fn set_strt(&mut self, val: bool)
pub fn set_strt(&mut self, val: bool)
erase start control bit STRT bit is used to start a sector erase or a bank erase operation. STRT can be programmed only when LOCK is cleared to 0. STRT is reseted at the end of the operation or when an error occurs. It cannot be reset by software.
pub const fn snb(&self) -> u8
pub const fn snb(&self) -> u8
sector erase selection number These bits are used to select the target sector for an erase operation (they are unused otherwise). SNB can be programmed only when LOCK is cleared to 0. ..
pub fn set_snb(&mut self, val: u8)
pub fn set_snb(&mut self, val: u8)
sector erase selection number These bits are used to select the target sector for an erase operation (they are unused otherwise). SNB can be programmed only when LOCK is cleared to 0. ..
pub const fn mer(&self) -> bool
pub const fn mer(&self) -> bool
mass erase request Setting MER bit to 1 requests a mass erase operation (user flash memory only). MER can be programmed only when LOCK is cleared to 0. If BER or SER are also set, a PGSERR is raised. Error is triggered when a mass erase is required and some sectors are protected.
pub fn set_mer(&mut self, val: bool)
pub fn set_mer(&mut self, val: bool)
mass erase request Setting MER bit to 1 requests a mass erase operation (user flash memory only). MER can be programmed only when LOCK is cleared to 0. If BER or SER are also set, a PGSERR is raised. Error is triggered when a mass erase is required and some sectors are protected.
pub const fn eopie(&self) -> bool
pub const fn eopie(&self) -> bool
end of operation interrupt control bit Setting EOPIE bit to 1 enables the generation of an interrupt at the end of a program/erase operation. EOPIE can be programmed only when LOCK is cleared to 0.
pub fn set_eopie(&mut self, val: bool)
pub fn set_eopie(&mut self, val: bool)
end of operation interrupt control bit Setting EOPIE bit to 1 enables the generation of an interrupt at the end of a program/erase operation. EOPIE can be programmed only when LOCK is cleared to 0.
pub const fn wrperrie(&self) -> bool
pub const fn wrperrie(&self) -> bool
write protection error interrupt enable bit When WRPERRIE bit is set to 1, an interrupt is generated when a protection error occurs during a program operation. WRPERRIE can be programmed only when LOCK is cleared to 0.
pub fn set_wrperrie(&mut self, val: bool)
pub fn set_wrperrie(&mut self, val: bool)
write protection error interrupt enable bit When WRPERRIE bit is set to 1, an interrupt is generated when a protection error occurs during a program operation. WRPERRIE can be programmed only when LOCK is cleared to 0.
pub const fn pgserrie(&self) -> bool
pub const fn pgserrie(&self) -> bool
programming sequence error interrupt enable bit When PGSERRIE bit is set to 1, an interrupt is generated when a sequence error occurs during a program operation. PGSERRIE can be programmed only when LOCK is cleared to 0.
pub fn set_pgserrie(&mut self, val: bool)
pub fn set_pgserrie(&mut self, val: bool)
programming sequence error interrupt enable bit When PGSERRIE bit is set to 1, an interrupt is generated when a sequence error occurs during a program operation. PGSERRIE can be programmed only when LOCK is cleared to 0.
pub const fn strberrie(&self) -> bool
pub const fn strberrie(&self) -> bool
strobe error interrupt enable bit When STRBERRIE bit is set to 1, an interrupt is generated when a strobe error occurs (the master programs several times the same byte in the write buffer) during a write operation. STRBERRIE can be programmed only when LOCK is cleared to 0.
pub fn set_strberrie(&mut self, val: bool)
pub fn set_strberrie(&mut self, val: bool)
strobe error interrupt enable bit When STRBERRIE bit is set to 1, an interrupt is generated when a strobe error occurs (the master programs several times the same byte in the write buffer) during a write operation. STRBERRIE can be programmed only when LOCK is cleared to 0.
pub const fn incerrie(&self) -> bool
pub const fn incerrie(&self) -> bool
inconsistency error interrupt enable bit When INCERRIE bit is set to 1, an interrupt is generated when an inconsistency error occurs during a write operation. INCERRIE can be programmed only when LOCK is cleared to 0.
pub fn set_incerrie(&mut self, val: bool)
pub fn set_incerrie(&mut self, val: bool)
inconsistency error interrupt enable bit When INCERRIE bit is set to 1, an interrupt is generated when an inconsistency error occurs during a write operation. INCERRIE can be programmed only when LOCK is cleared to 0.
pub const fn obkerrie(&self) -> bool
pub const fn obkerrie(&self) -> bool
OBK general error interrupt enable bit OBKERRIE enables generating an interrupt in case of OBK specific access error. OBKERRIE can be programmed only when LOCK is cleared to 0.
pub fn set_obkerrie(&mut self, val: bool)
pub fn set_obkerrie(&mut self, val: bool)
OBK general error interrupt enable bit OBKERRIE enables generating an interrupt in case of OBK specific access error. OBKERRIE can be programmed only when LOCK is cleared to 0.
pub const fn obkwerrie(&self) -> bool
pub const fn obkwerrie(&self) -> bool
OBK write error interrupt enable bit OBKWERRIE enables generation of interrupt in case of OBK specific write error. OBKWERRIE can be programmed only when LOCK is cleared to 0.
pub fn set_obkwerrie(&mut self, val: bool)
pub fn set_obkwerrie(&mut self, val: bool)
OBK write error interrupt enable bit OBKWERRIE enables generation of interrupt in case of OBK specific write error. OBKWERRIE can be programmed only when LOCK is cleared to 0.
pub const fn inv(&self) -> bool
pub const fn inv(&self) -> bool
Flash memory security state invert. This bit inverts the flash memory security state.
pub fn set_inv(&mut self, val: bool)
pub fn set_inv(&mut self, val: bool)
Flash memory security state invert. This bit inverts the flash memory security state.
pub const fn bksel(&self) -> SeccrBksel
pub const fn bksel(&self) -> SeccrBksel
bank selector bit BKSEL can only be programmed when LOCK is cleared to 0. The bit selects physical bank, SWAP_BANK setting is ignored.
pub fn set_bksel(&mut self, val: SeccrBksel)
pub fn set_bksel(&mut self, val: SeccrBksel)
bank selector bit BKSEL can only be programmed when LOCK is cleared to 0. The bit selects physical bank, SWAP_BANK setting is ignored.
Trait Implementations§
impl Copy for Seccr
impl Eq for Seccr
impl StructuralPartialEq for Seccr
Auto Trait Implementations§
impl Freeze for Seccr
impl RefUnwindSafe for Seccr
impl Send for Seccr
impl Sync for Seccr
impl Unpin for Seccr
impl UnwindSafe for Seccr
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
)