Struct stm32_fmc::nand_device::NandDevice

source ·
pub struct NandDevice { /* private fields */ }
Expand description

NAND Device

Implementations§

source§

impl NandDevice

source

pub fn reset(&mut self)

0xFF Reset: ONFI Section 5.3

source

pub fn read_id(&mut self) -> ID

0x90 Read ID: ONFI Section 5.6

source

pub fn read_parameter_page(&mut self) -> ParameterPage

0xEC Read Parameter Page: ONFI Section 5.7

source

pub fn read_unique_id(&mut self) -> u128

0xED Read Unique ID: ONFI Section 5.8

source

pub fn block_erase(&mut self, address: usize) -> Status

0x60 Block Erase: ONFI Section 5.9

source

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.

source

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.

source

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

Methods to allow users to implement their own commands using unsafe.

source

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.

source

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.

source

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.

source

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

source§

fn clone(&self) -> NandDevice

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for NandDevice

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for NandDevice

source§

fn eq(&self, other: &NandDevice) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for NandDevice

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.