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 #370 background imageLoading...
Page #370 background image
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 handle)
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 handle, sdmmc_command_t *cmdinfo)
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 host, uint32_t freq_khz)
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 handle)
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 handle, TickType_t timeout_ticks)
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 359
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