EasyManua.ls Logo

Espressif ESP32-S2 - Page 761

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 2. API Reference
chip: Pointer to identify flash chip. Must have been successfully initialised via esp_flash_init()
address: Address on flash to write to. Must be previously erased (SPI NOR flash can only write
bits 1->0).
buffer: Pointer to a buffer with the data to write. To get better performance, this should be in the
DRAM and word aligned.
length: Length (in bytes) of data to write.
Return
ESP_OK on success,
ESP_ERR_NOT_SUPPORTED if the chip is not able to perform the operation. This is indicated
by WREN = 1 after the command is sent.
Other flash error code if operation failed.
esp_err_t esp_flash_write_encrypted(esp_flash_t *chip, uint32_t address, const void *buer,
uint32_t length)
Encrypted and write data to the SPI flash chip using on-chip hardware flash encryption.
Note Both address & length must be 16 byte aligned, as this is the encryption block size
Return
ESP_OK: on success
ESP_ERR_NOT_SUPPORTED: encrypted write not supported for this chip.
ESP_ERR_INVALID_ARG: Either the address, buffer or length is invalid.
or other flash error code from spi_flash_write_encrypted().
Parameters
chip: Pointer to identify flash chip. Must be NULL (the main flash chip). For other chips, en-
crypted write is not supported.
address: Address on flash to write to. 16 byte aligned. Must be previously erased (SPI NOR flash
can only write bits 1->0).
buffer: Pointer to a buffer with the data to write.
length: Length (in bytes) of data to write. 16 byte aligned.
esp_err_t esp_flash_read_encrypted(esp_flash_t *chip, uint32_t address, void *out_buer,
uint32_t length)
Read and decrypt data from the SPI flash chip using on-chip hardware flash encryption.
Return
ESP_OK: on success
ESP_ERR_NOT_SUPPORTED: encrypted read not supported for this chip.
or other flash error code from spi_flash_read_encrypted().
Parameters
chip: Pointer to identify flash chip. Must be NULL (the main flash chip). For other chips, en-
crypted read is not supported.
address: Address on flash to read from.
out_buffer: Pointer to a buffer for the data to read to.
length: Length (in bytes) of data to read.
static bool esp_flash_is_quad_mode(const esp_flash_t *chip)
Returns true if chip is configured for Quad I/O or Quad Fast Read.
Return true if flash works in quad mode, otherwise false
Parameters
chip: Pointer to SPI flash chip to use. If NULL, esp_flash_default_chip is substituted.
Structures
struct esp_flash_region_t
Structure for describing a region of flash.
Public Members
uint32_t offset
Start address of this region.
Espressif Systems 750
Submit Document Feedback
Release v4.4

Table of Contents