Espressif ESP32-S2 Programming Manual page 744

Table of Contents

Advertisement

Chapter 2. API Reference
Return
• ESP_OK on success
• One of the error codes from SDMMC host controller
Parameters
• card: pointer to card information structure previously initialized using sdmmc_card_init
• src: pointer to data buffer to read data from; data size must be equal to sector_count * card-
>csd.sector_size
• start_sector: sector where to start writing
• sector_count: number of sectors to write
esp_err_t sdmmc_read_sectors(sdmmc_card_t
Read given number of sectors from the SD/MMC card
Return
• ESP_OK on success
• One of the error codes from SDMMC host controller
Parameters
• card: pointer to card information structure previously initialized using sdmmc_card_init
• dst: pointer to data buffer to write into; buffer size must be at least sector_count * card-
>csd.sector_size
• start_sector: sector where to start reading
• sector_count: number of sectors to read
esp_err_t sdmmc_io_read_byte(sdmmc_card_t
Read one byte from an SDIO card using IO_RW_DIRECT (CMD52)
Return
• ESP_OK on success
• One of the error codes from SDMMC host controller
Parameters
• card: pointer to card information structure previously initialized using sdmmc_card_init
• function: IO function number
• reg: byte address within IO function
• [out] out_byte: output, receives the value read from the card
esp_err_t sdmmc_io_write_byte(sdmmc_card_t
Write one byte to an SDIO card using IO_RW_DIRECT (CMD52)
Return
• ESP_OK on success
• One of the error codes from SDMMC host controller
Parameters
• card: pointer to card information structure previously initialized using sdmmc_card_init
• function: IO function number
• reg: byte address within IO function
• in_byte: value to be written
• [out] out_byte: if not NULL, receives new byte value read from the card (read-after-write).
esp_err_t sdmmc_io_read_bytes(sdmmc_card_t
Read multiple bytes from an SDIO card using IO_RW_EXTENDED (CMD53)
This function performs read operation using CMD53 in byte mode.
mmc_io_read_blocks.
Return
• ESP_OK on success
• ESP_ERR_INVALID_SIZE if size exceeds 512 bytes
• One of the error codes from SDMMC host controller
Parameters
Espressif Systems
*card, void *dst, size_t start_sector, size_t sec-
tor_count)
*card, uint32_t function, uint32_t reg, uint8_t
*out_byte)
*card, uint32_t function, uint32_t reg, uint8_t in_byte,
uint8_t *out_byte)
*card, uint32_t function, uint32_t addr, void *dst,
size_t size)
733
Submit Document Feedback
For block mode, see sd-
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?

Questions and answers

Table of Contents

Save PDF