[][src]Struct esp_idf_bindgen::spi_flash_guard_funcs_t

#[repr(C)]pub struct spi_flash_guard_funcs_t {
    pub start: spi_flash_guard_start_func_t,
    pub end: spi_flash_guard_end_func_t,
    pub op_lock: spi_flash_op_lock_func_t,
    pub op_unlock: spi_flash_op_unlock_func_t,
    pub is_safe_write_address: spi_flash_is_safe_write_address_t,
}

Structure holding SPI flash access critical sections management functions.

Flash API uses two types of flash access management functions:

  1. Functions which prepare/restore flash cache and interrupts before calling appropriate ROM functions (SPIWrite, SPIRead and SPIEraseBlock):
  1. Functions which synchronizes access to internal data used by flash API. This functions are mostly intended to synchronize access to flash API internal data in multithreaded environment and use OS primitives:
  1. When CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED is disabled, flash writing/erasing API checks for addresses provided by user to avoid corruption of critical flash regions (bootloader, partition table, running application etc.).

Different versions of the guarding functions should be used depending on the context of execution (with or without functional OS). In normal conditions when flash API is called from task the functions use OS primitives. When there is no OS at all or when it is not guaranteed that OS is functional (accessing flash from exception handler) these functions cannot use OS primitives or even does not need them (multithreaded access is not possible).

@note Structure and corresponding guard functions should not reside in flash. For example structure can be placed in DRAM and functions in IRAM sections.

Fields

start: spi_flash_guard_start_func_t

< critical section start function.

end: spi_flash_guard_end_func_t

< critical section end function.

op_lock: spi_flash_op_lock_func_t

< flash access API lock function.

op_unlock: spi_flash_op_unlock_func_t

< flash access API unlock function.

is_safe_write_address: spi_flash_is_safe_write_address_t

< checks flash write addresses.

Trait Implementations

impl Clone for spi_flash_guard_funcs_t[src]

impl Copy for spi_flash_guard_funcs_t[src]

impl Debug for spi_flash_guard_funcs_t[src]

Auto Trait Implementations

impl Send for spi_flash_guard_funcs_t

impl Sync for spi_flash_guard_funcs_t

impl Unpin for spi_flash_guard_funcs_t

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.