EasyManuals Logo

Espressif ESP32-S2 User Manual

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
Page #795 background imageLoading...
Page #795 background image
Chapter 2. API Reference
Return
• ESP_OK, if the range was erased successfully;
• ESP_ERR_INVALID_ARG, if iterator or dst are NULL;
• ESP_ERR_INVALID_SIZE, if erase would go out of bounds of the partition;
• or one of error codes from lower-level flash driver.
Parameters
• handle: WL handle that are related to the partition
• start_addr: Address where erase operation should start. Must be aligned to the result of function
wl_sector_size(…).
• size: Size of the range which should be erased, in bytes. Must be divisible by result of function
wl_sector_size(…)..
esp_err_t wl_write(wl_handle_t handle, size_t dest_addr, const void *src, size_t size)
Write data to the WL storage.
Before writing data to flash, corresponding region of flash needs to be erased. This can be done using
wl_erase_range function.
Note Prior to writing to WL storage, make sure it has been erased with wl_erase_range call.
Return
• ESP_OK, if data was written successfully;
• ESP_ERR_INVALID_ARG, if dst_offset exceeds partition size;
• ESP_ERR_INVALID_SIZE, if write would go out of bounds of the partition;
• or one of error codes from lower-level flash driver.
Parameters
• handle: WL handle that are related to the partition
• dest_addr: Address where the data should be written, relative to the beginning of the partition.
• src: Pointer to the source buffer. Pointer must be non-NULL and buffer must be at least ‘size’
bytes long.
• size: Size of data to be written, in bytes.
esp_err_t wl_read(wl_handle_t handle, size_t src_addr, void *dest, size_t size)
Read data from the WL storage.
Return
• ESP_OK, if data was read successfully;
• ESP_ERR_INVALID_ARG, if src_offset exceeds partition size;
• ESP_ERR_INVALID_SIZE, if read would go out of bounds of the partition;
• or one of error codes from lower-level flash driver.
Parameters
• handle: WL module instance that was initialized before
• dest: Pointer to the buffer where data should be stored. Pointer must be non-NULL and buffer
must be at least ‘size’bytes long.
• src_addr: Address of the data to be read, relative to the beginning of the partition.
• size: Size of data to be read, in bytes.
size_t wl_size(wl_handle_t handle)
Get size of the WL storage.
Return usable size, in bytes
Parameters
• handle: WL module handle that was initialized before
size_t wl_sector_size(wl_handle_t handle)
Get sector size of the WL instance.
Return sector size, in bytes
Parameters
• handle: WL module handle that was initialized before
Macros
WL_INVALID_HANDLE
Espressif Systems 784
Submit Document Feedback
Release v4.4

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Espressif ESP32-S2 and is the answer not in the manual?

Espressif ESP32-S2 Specifications

General IconGeneral
BrandEspressif
ModelESP32-S2
CategorySingle board computers
LanguageEnglish