Struct stm32_fmc::nand_device::NandDevice
source · pub struct NandDevice { /* private fields */ }
Expand description
NAND Device
Implementations§
source§impl NandDevice
impl NandDevice
sourcepub fn read_parameter_page(&mut self) -> ParameterPage
pub fn read_parameter_page(&mut self) -> ParameterPage
0xEC Read Parameter Page: ONFI Section 5.7
sourcepub fn read_unique_id(&mut self) -> u128
pub fn read_unique_id(&mut self) -> u128
0xED Read Unique ID: ONFI Section 5.8
sourcepub fn block_erase(&mut self, address: usize) -> Status
pub fn block_erase(&mut self, address: usize) -> Status
0x60 Block Erase: ONFI Section 5.9
sourcepub fn start_page_read(&mut self, address: usize, spare: bool)
pub fn start_page_read(&mut self, address: usize, spare: bool)
Page Read: ONFI Section 5.14
This method starts a Page Read operation but does not include the data phase. This method is useful when DMA is used for the data phase.
For a method that completes the entire transaction see
page_read
.
sourcepub fn page_read(&mut self, address: usize, spare: bool, page: &mut [u8])
pub fn page_read(&mut self, address: usize, spare: bool, page: &mut [u8])
Page Read: ONFI Section 5.14
Executes a Page Read operation from the specified address. Data is
copied to the slice page
. The length of page
determines the read
length. The read length should not exceed the number of bytes between
the specified address and the end of the page. Reading beyond the end of
the page results in indeterminate values being returned.
If spare
is true, then the read occours from the spare area. The
address offset from the start of the page plus the slice length should
not exceed the spare area size.
sourcepub fn page_program(
&mut self,
address: usize,
spare: bool,
page: &[u8],
) -> Status
pub fn page_program( &mut self, address: usize, spare: bool, page: &[u8], ) -> Status
Page Program: ONFI Section 5.16
Executes a page program to the specified address and waits for it to
complete. The length of page
determines the write length. The write
length should not exceed the number of bytes between the specified
address and the end of the page. Writing beyond this length is
undefined.
source§impl NandDevice
impl NandDevice
Methods to allow users to implement their own commands using unsafe
.
sourcepub fn common_command(&mut self) -> *mut u8
pub fn common_command(&mut self) -> *mut u8
Return a Raw Pointer to the common command space. This memory-mapped address is used to write command phase of NAND device transactions.
It is recommended to use
ptr::write_volatile
to write to this pointer. Depending on the memory map in use, you may
need to ensure the write is committed by using
core::atomic::sync::fence
.
sourcepub fn attribute_command(&mut self) -> *mut u8
pub fn attribute_command(&mut self) -> *mut u8
Return a Raw Pointer to the attribute command space. This memory-mapped address is used to write command phase of NAND device transactions.
It is recommended to use
ptr::write_volatile
to write to this pointer. Depending on the memory map in use, you may
need to ensure the write is committed by using
core::atomic::sync::fence
.
sourcepub fn common_address(&mut self) -> *mut u8
pub fn common_address(&mut self) -> *mut u8
Return a Raw Pointer to the common address space. This memory-mapped address is used to write the address phase of NAND device transactions.
It is recommended to use
ptr::write_volatile
to write to this pointer. Depending on the memory map in use, you may
need to ensure the write is committed by using
core::atomic::sync::fence
.
sourcepub fn common_data(&mut self) -> *mut u8
pub fn common_data(&mut self) -> *mut u8
Return a Raw Pointer to the common data space. This memory-mapped address is used to write or read the data phase of NAND device transactions.
It is recommended to use
ptr::write_volatile
to write to this pointer. Depending on the memory map in use, you may
need to ensure the write is committed by using
core::atomic::sync::fence
.
Trait Implementations§
source§impl Clone for NandDevice
impl Clone for NandDevice
source§fn clone(&self) -> NandDevice
fn clone(&self) -> NandDevice
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for NandDevice
impl Debug for NandDevice
source§impl PartialEq for NandDevice
impl PartialEq for NandDevice
impl StructuralPartialEq for NandDevice
Auto Trait Implementations§
impl Freeze for NandDevice
impl RefUnwindSafe for NandDevice
impl !Send for NandDevice
impl !Sync for NandDevice
impl Unpin for NandDevice
impl UnwindSafe for NandDevice
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)