#[repr(C)]
pub struct esp_flash_t { pub host: *mut spi_flash_host_inst_t, pub chip_drv: *const spi_flash_chip_t, pub os_func: *const esp_flash_os_functions_t, pub os_func_data: *mut c_void, pub read_mode: esp_flash_io_mode_t, pub size: u32, pub chip_id: u32, pub _bitfield_align_1: [u32; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4]>, }
Expand description

@brief Structure to describe a SPI flash chip connected to the system.

Structure must be initialized before use (passed to esp_flash_init()). It’s in the public header because some instances should be allocated statically in the startup code. May be updated according to hardware version and new flash chip feature requirements, shouldn’t be treated as public API.

For advanced developers, you may replace some of them with your implementations at your own risk.

Fields§

§host: *mut spi_flash_host_inst_t

< Pointer to hardware-specific “host_driver” structure. Must be initialized before used.

§chip_drv: *const spi_flash_chip_t

< Pointer to chip-model-specific “adapter” structure. If NULL, will be detected during initialisation.

§os_func: *const esp_flash_os_functions_t

< Pointer to os-specific hook structure. Call esp_flash_init_os_functions() to setup this field, after the host is properly initialized.

§os_func_data: *mut c_void

< Pointer to argument for os-specific hooks. Left NULL and will be initialized with os_func.

§read_mode: esp_flash_io_mode_t

< Configured SPI flash read mode. Set before esp_flash_init is called.

§size: u32

< Size of SPI flash in bytes. If 0, size will be detected during initialisation. Note: this stands for the size in the binary image header. If you want to get the flash physical size, please call esp_flash_get_physical_size.

§chip_id: u32

< Detected chip id.

§_bitfield_align_1: [u32; 0]§_bitfield_1: __BindgenBitfieldUnit<[u8; 4]>

Implementations§

source§

impl esp_flash_t

source

pub fn busy(&self) -> u32

source

pub fn set_busy(&mut self, val: u32)

source

pub fn hpm_dummy_ena(&self) -> u32

source

pub fn set_hpm_dummy_ena(&mut self, val: u32)

source

pub fn reserved_flags(&self) -> u32

source

pub fn set_reserved_flags(&mut self, val: u32)

source

pub fn new_bitfield_1( busy: u32, hpm_dummy_ena: u32, reserved_flags: u32 ) -> __BindgenBitfieldUnit<[u8; 4]>

Trait Implementations§

source§

impl Clone for esp_flash_t

source§

fn clone(&self) -> esp_flash_t

Returns a copy of the value. Read more
1.0.0§

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

Performs copy-assignment from source. Read more
source§

impl Debug for esp_flash_t

source§

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

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

impl Default for esp_flash_t

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Copy for esp_flash_t

Auto Trait Implementations§

§

impl RefUnwindSafe for esp_flash_t

§

impl !Send for esp_flash_t

§

impl !Sync for esp_flash_t

§

impl Unpin for esp_flash_t

§

impl UnwindSafe for esp_flash_t

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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.
§

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

Performs the conversion.