ESP32-S3 SD card storage port implementation. More...
#include "storagePort.h"#include "macrosEsp32.h"#include "../spi/spiPort.h"#include "driver/spi_common.h"#include "driver/gpio.h"#include "driver/sdspi_host.h"#include "sdmmc_cmd.h"#include "freertos/FreeRTOS.h"#include "freertos/task.h"Go to the source code of this file.
Functions | |
| SPP_RetVal_t | SPP_PORTS_HAL_ESP32_storageInit (void) |
| Initializes the SD card using SDSPI. | |
| SPP_RetVal_t | SPP_PORTS_HAL_ESP32_storageWrite (const void *p_buffer, spp_uint32_t first_block, spp_uint16_t count) |
| Writes raw 512-byte sectors directly to the SD card. | |
Variables | |
| static sdspi_dev_handle_t | sdHandle |
| static sdmmc_card_t | sdCard |
| static spp_bool_t | s_storageInitialized = false |
ESP32-S3 SD card storage port implementation.
Definition in file storagePort.c.
| SPP_RetVal_t SPP_PORTS_HAL_ESP32_storageInit | ( | void | ) |
Initializes the SD card using SDSPI.
Requires the SPI bus to be initialized. Attempts SD card initialization up to five times.
Definition at line 33 of file storagePort.c.
References K_ESP32_PIN_CS_BMP, K_ESP32_PIN_CS_ICM, K_ESP32_PIN_CS_SDC, K_ESP32_PIN_CS_SX1262, K_ESP32_SPI_HOST, K_SPP_ERROR, K_SPP_OK, s_storageInitialized, sdCard, sdHandle, SPP_PORTS_HAL_ESP32_spiIsBusInitialized(), and SPP_PORTS_HAL_ESP32_storageInit().
Referenced by SPP_PORTS_HAL_ESP32_storageInit().
| SPP_RetVal_t SPP_PORTS_HAL_ESP32_storageWrite | ( | const void * | p_buffer, |
| spp_uint32_t | first_block, | ||
| spp_uint16_t | count ) |
Writes raw 512-byte sectors directly to the SD card.
| p_buffer | Pointer to the data to write. |
| first_block | First sector to write. |
| count | Number of consecutive sectors. |
Definition at line 90 of file storagePort.c.
References K_SPP_ERROR, K_SPP_ERROR_NULL_POINTER, K_SPP_OK, s_storageInitialized, sdCard, and SPP_PORTS_HAL_ESP32_storageWrite().
Referenced by SPP_PORTS_HAL_ESP32_storageWrite().
|
static |
Definition at line 25 of file storagePort.c.
Referenced by SPP_PORTS_HAL_ESP32_storageInit().
|
static |
Definition at line 26 of file storagePort.c.
Referenced by SPP_PORTS_HAL_ESP32_storageInit(), and SPP_PORTS_HAL_ESP32_storageWrite().
|
static |
Definition at line 27 of file storagePort.c.
Referenced by SPP_PORTS_HAL_ESP32_storageInit(), and SPP_PORTS_HAL_ESP32_storageWrite().