[−][src]Struct esp_idf_bindgen::spi_flash_guard_funcs_t
Structure holding SPI flash access critical sections management functions.
Flash API uses two types of flash access management functions:
- Functions which prepare/restore flash cache and interrupts before calling appropriate ROM functions (SPIWrite, SPIRead and SPIEraseBlock):
- 'start' function should disables flash cache and non-IRAM interrupts and is invoked before the call to one of ROM function above.
- 'end' function should restore state of flash cache and non-IRAM interrupts and is invoked after the call to one of ROM function above. These two functions are not recursive.
- 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:
- 'op_lock' locks access to flash API internal data.
- 'op_unlock' unlocks access to flash API internal data. These two functions are recursive and can be used around the outside of multiple calls to 'start' & 'end', in order to create atomic multi-part flash operations.
- 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]
fn clone(&self) -> spi_flash_guard_funcs_t
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
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>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,