Solaris Software
Loading...
Searching...
No Matches
storagePort.h
Go to the documentation of this file.
1/**
2 * @file storagePort.h
3 * @brief ESP32-S3 SD card storage port implementation.
4 */
5
6#ifndef SPP_PORTS_HAL_ESP32_STORAGE_PORT_H
7#define SPP_PORTS_HAL_ESP32_STORAGE_PORT_H
8
9#include "spp/core/types.h"
11
12/* ----------------------------------------------------------------
13 * PUBLIC FUNCTIONS
14 * ---------------------------------------------------------------- */
15
16/**
17 * @brief Initializes the SD card using SDSPI.
18 *
19 * Requires the SPI bus to be initialized.
20 * Attempts SD card initialization up to five times.
21 *
22 * @return K_SPP_OK on success, K_SPP_ERROR otherwise.
23 */
25
26/**
27 * @brief Writes raw 512-byte sectors directly to the SD card.
28 *
29 * @param p_buffer Pointer to the data to write.
30 * @param first_block First sector to write.
31 * @param count Number of consecutive sectors.
32 * @return K_SPP_OK on success, K_SPP_ERROR_NULL_POINTER
33 * for a NULL buffer, K_SPP_ERROR otherwise.
34 */
35SPP_RetVal_t SPP_PORTS_HAL_ESP32_storageWrite(const void *p_buffer, spp_uint32_t first_block, spp_uint16_t count);
36
37#endif /* SPP_PORTS_HAL_ESP32_STORAGE_PORT_H */
Standard return-value type used across all SPP modules.
SPP_RetVal_t
Unified return type for all SPP API functions.
Definition returnTypes.h:24
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.
Definition storagePort.c:90
SPP_RetVal_t SPP_PORTS_HAL_ESP32_storageInit(void)
Initializes the SD card using SDSPI.
Definition storagePort.c:33
Portable integer types and SPI/storage configuration types for SPP.
uint16_t spp_uint16_t
Definition types.h:29
uint32_t spp_uint32_t
Definition types.h:31