pub struct Sram2<'a>(/* private fields */);Expand description
SRAM2 bank handle. See RamCfg::sram2().
Implementations§
Source§impl Sram2<'_>
impl Sram2<'_>
Sourcepub fn erase(&mut self)
pub fn erase(&mut self)
Launch a mass erase (fills the bank with zeros, including write-protected pages) and block until it completes.
Sourcepub fn set_wait_states(&mut self, wait_states: u8)
pub fn set_wait_states(&mut self, wait_states: u8)
Set the wait-state count (0-7) for accesses to this bank.
Sourcepub fn enable_write_protection(&mut self, start_page: u8, count: u8)
pub fn enable_write_protection(&mut self, start_page: u8, count: u8)
Enable write protection for count consecutive 1 KB pages starting at start_page.
There is no way to disable write protection once enabled, other than a peripheral or
system reset. Any write to a protected page causes a HardFault.
Panics if start_page + count exceeds 64. Chips with a smaller SRAM2 (and thus fewer
pages) simply ignore page numbers past their actual page count.
Sourcepub fn set_latch_parity_error_address(&mut self, enable: bool)
pub fn set_latch_parity_error_address(&mut self, enable: bool)
Enable or disable latching of the failing address on a parity error (M2PEAR). Without
this, parity errors are still detected and flagged, but the address isn’t recorded.
Sourcepub fn set_interrupts(&mut self, error: bool, nmi: bool)
pub fn set_interrupts(&mut self, error: bool, nmi: bool)
Enable or disable parity-error interrupt sources: error for a regular interrupt, nmi
to instead (or additionally) redirect it to the NMI.
Sourcepub fn parity_error(&self) -> bool
pub fn parity_error(&self) -> bool
Returns true if a parity error has been detected.
Sourcepub fn clear_parity_error(&mut self)
pub fn clear_parity_error(&mut self)
Clear the parity-error flag. Once cleared, a new failing address can be latched (see
Self::set_latch_parity_error_address()).
Sourcepub fn parity_error_address(&self) -> ParityErrorAddress
pub fn parity_error_address(&self) -> ParityErrorAddress
Get the address (and metadata) of the latched parity error.
Only meaningful once Self::parity_error() is true and address latching is enabled.