EasyManua.ls Logo

Espressif ESP32-S2 - Page 666

Espressif ESP32-S2
1695 pages
Print Icon
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
esp_err_t essl_send_packet(essl_handle_t handle, const void *start, size_t length, uint32_t wait_ms)
Send a packet to the ESSL Slave. The Slave receives the packet into buffers whose size is buffer_size
(configured during initialization).
Return
ESP_OK Success
ESP_ERR_INVALID_ARG: Invalid argument, handle is not init or other argument is not valid.
ESP_ERR_TIMEOUT: No buffer to use, or error ftrom SDMMC host controller.
ESP_ERR_NOT_FOUND: Slave is not ready for receiving.
ESP_ERR_NOT_SUPPORTED: This API is not supported in this mode
One of the error codes from SDMMC/SPI host controller.
Parameters
handle: Handle of an ESSL device.
start: Start address of the packet to send
length: Length of data to send, if the packet is over-size, the it will be divided into blocks and
hold into different buffers automatically.
wait_ms: Millisecond to wait before timeout, will not wait at all if set to 0-9.
esp_err_t essl_get_packet(essl_handle_t handle, void *out_data, size_t size, size_t *out_length,
uint32_t wait_ms)
Get a packet from ESSL slave.
Return
ESP_OK Success: All the data has been read from the slave.
ESP_ERR_INVALID_ARG: Invalid argument, The handle is not initialized or the other arguments
are invalid.
ESP_ERR_NOT_FINISHED: Read was successful, but there is still data remaining.
ESP_ERR_NOT_FOUND: Slave is not ready to send data.
ESP_ERR_NOT_SUPPORTED: This API is not supported in this mode
One of the error codes from SDMMC/SPI host controller.
Parameters
handle: Handle of an ESSL device.
[out] out_data: Data output address
size: The size of the output buffer, if the buffer is smaller than the size of data to receive from
slave, the driver returns ESP_ERR_NOT_FINISHED
[out] out_length: Output of length the data actually received from slave.
wait_ms: Millisecond to wait before timeout, will not wait at all if set to 0-9.
esp_err_t essl_write_reg(essl_handle_t handle, uint8_t addr, uint8_t value, uint8_t *value_o, uint32_t
wait_ms)
Write general purpose R/W registers (8-bit) of ESSL slave.
Note sdio 28-31 are reserved, the lower API helps to skip.
Return
ESP_OK Success
One of the error codes from SDMMC/SPI host controller
Parameters
handle: Handle of an ESSL device.
addr: Address of register to write. For SDIO, valid address: 0-59. For SPI, see essl_spi.h
value: Value to write to the register.
value_o: Output of the returned written value.
wait_ms: Millisecond to wait before timeout, will not wait at all if set to 0-9.
esp_err_t essl_read_reg(essl_handle_t handle, uint8_t add, uint8_t *value_o, uint32_t wait_ms)
Read general purpose R/W registers (8-bit) of ESSL slave.
Return
ESP_OK Success
One of the error codes from SDMMC/SPI host controller
Parameters
handle: Handle of a essl device.
Espressif Systems 655
Submit Document Feedback
Release v4.4

Table of Contents