Espressif ESP32-S2 Programming Manual page 370

Table of Contents

Advertisement

Chapter 2. API Reference
• out_handle: Output of the handle to the sdspi device.
esp_err_t sdspi_host_remove_device(sdspi_dev_handle_t
Remove an SD SPI device.
Return Always ESP_OK
Parameters
• handle: Handle of the SD SPI device
esp_err_t sdspi_host_do_transaction(sdspi_dev_handle_t
Send command to the card and get response.
This function returns when command is sent and response is received, or data is transferred, or timeout occurs.
Note This function is not thread safe w.r.t. init/deinit functions, and bus width/clock speed configuration
functions. Multiple tasks can call sdspi_host_do_transaction as long as other sdspi_host_* functions are
not called.
Return
• ESP_OK on success
• ESP_ERR_TIMEOUT if response or data transfer has timed out
• ESP_ERR_INVALID_CRC if response or data transfer CRC check has failed
• ESP_ERR_INVALID_RESPONSE if the card has sent an invalid response
Parameters
• handle: Handle of the sdspi device
• cmdinfo: pointer to structure describing command and data to transfer
esp_err_t sdspi_host_set_card_clk(sdspi_dev_handle_t
Set card clock frequency.
Currently only integer fractions of 40MHz clock can be used. For High Speed cards, 40MHz can be used. For
Default Speed cards, 20MHz can be used.
Note This function is not thread safe
Return
• ESP_OK on success
• other error codes may be returned in the future
Parameters
• host: Handle of the sdspi device
• freq_khz: card clock frequency, in kHz
esp_err_t
sdspi_host_deinit(void)
Release resources allocated using sdspi_host_init.
Note This function is not thread safe
Return
• ESP_OK on success
• ESP_ERR_INVALID_STATE if sdspi_host_init function has not been called
esp_err_t sdspi_host_io_int_enable(sdspi_dev_handle_t
Enable SDIO interrupt.
Return
• ESP_OK on success
Parameters
• handle: Handle of the sdspi device
esp_err_t sdspi_host_io_int_wait(sdspi_dev_handle_t
Wait for SDIO interrupt until timeout.
Return
• ESP_OK on success
Parameters
• handle: Handle of the sdspi device
• timeout_ticks: Ticks to wait before timeout.
Espressif Systems
handle, TickType_t timeout_ticks)
359
Submit Document Feedback
handle)
handle,
sdmmc_command_t
host, uint32_t freq_khz)
handle)
*cmdinfo)
Release v4.4

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Subscribe to Our Youtube Channel

Table of Contents

Save PDF