Struct stm32_metapac::flash::regs::Nscr
#[repr(transparent)]pub struct Nscr(pub u32);
Expand description
FLASH non-secure control register
Tuple Fields§
§0: u32
Implementations§
§impl Nscr
impl Nscr
pub const fn lock(&self) -> bool
pub const fn lock(&self) -> bool
configuration lock bit This bit locks the FLASH_NSCR register. The correct write sequence to FLASH_NSKEYR 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_NSCR 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_NSCR register. The correct write sequence to FLASH_NSKEYR 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_NSCR 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 MER and SER 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 MER and SER 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 non-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 non-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 reset at the end of the operation or when an error occurs. It cannot be reseted 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 reset at the end of the operation or when an error occurs. It cannot be reseted 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 both 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 both 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 or 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 or 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 this 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 this 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 this 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 this 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. This bit can be programmed only when LOCK bit 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. This bit can be programmed only when LOCK bit 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. This bit can be programmed only when LOCK bit 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. This bit can be programmed only when LOCK bit is cleared to 0.
pub const fn optchangeerrie(&self) -> bool
pub const fn optchangeerrie(&self) -> bool
Option byte change error interrupt enable bit This bit controls if an interrupt must be generated when an error occurs during an option byte change. It can be programmed only when LOCK bit is cleared to 0.
pub fn set_optchangeerrie(&mut self, val: bool)
pub fn set_optchangeerrie(&mut self, val: bool)
Option byte change error interrupt enable bit This bit controls if an interrupt must be generated when an error occurs during an option byte change. It can be programmed only when LOCK bit is cleared to 0.
Trait Implementations§
impl Copy for Nscr
impl Eq for Nscr
impl StructuralPartialEq for Nscr
Auto Trait Implementations§
impl Freeze for Nscr
impl RefUnwindSafe for Nscr
impl Send for Nscr
impl Sync for Nscr
impl Unpin for Nscr
impl UnwindSafe for Nscr
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
)