47#include "configuration.h"
68 char name[CONFIG_SD_MAX_NAME_LEN];
System-wide error code definitions.
ERR_te
Standard return type used by all public API functions.
ERR_te sd_start_subsys(void)
Starts the SD card subsystem.
ERR_te sd_stop_subsys(void)
Stops the SD card subsystem.
ERR_te sd_deinit_handle(SD_HANDLE_ts *sd_handle)
Deinitializes an SD card handle and resets the SPI peripheral.
ERR_te sd_ioctl(SD_HANDLE_ts *sd_handle)
Executes an IOCTL control command on the SD card handle.
ERR_te sd_init_subsys(void)
Initializes the SD card subsystem.
ERR_te sd_read(SD_HANDLE_ts *sd_handle, uint8_t *read_buf, uint32_t start_sector, uint32_t num_sectors)
Reads one or more sectors from the SD card.
ERR_te sd_write(SD_HANDLE_ts *sd_handle, uint8_t *write_buf, uint32_t start_sector, uint32_t num_sectors)
Writes one or more sectors to the SD card.
ERR_te sd_init_handle(SD_CFG_ts *sd_cfg, SD_HANDLE_ts **sd_handle_o)
Initializes an SD card handle and performs the full SPI-mode power-up sequence.
ERR_te sd_deinit_subsys(void)
Deinitializes the SD card subsystem.
ERR_te sd_get_sector_size(SD_HANDLE_ts *sd_handle, uint32_t *sector_size_o)
Retrieves the sector (block) size of the SD card in bytes.
ERR_te sd_get_sector_count(SD_HANDLE_ts *sd_handle, uint32_t *sector_count_o)
Retrieves the total sector (block) count of the SD card.
ERR_te sd_get_handle_init(SD_HANDLE_ts *sd_handle, bool *handle_init_o)
Retrieves the initialization state of an SD card handle.
struct sd_handle_s SD_HANDLE_ts
Opaque handle representing an SD card instance.
GPIO_PIN_te
GPIO pin number within a port (0–15).
GPIO_ALTERNATE_FUNCTION_te
GPIO alternate function mapping (AF0–AF15).
STM32F401RE MCU-specific peripheral register definitions and bit position enumerations.
STM32F401RE GPIO driver public API.
GPIO peripheral register map.
Configuration structure for initializing an SD card handle.
GPIO_REGDEF_ts * miso_gpio_port
GPIO_PIN_te sclk_gpio_pin
GPIO_REGDEF_ts * mosi_gpio_port
char name[CONFIG_SD_MAX_NAME_LEN]
GPIO_REGDEF_ts * cs_gpio_port
SPI_REGDEF_ts * spi_instance
GPIO_PIN_te mosi_gpio_pin
GPIO_ALTERNATE_FUNCTION_te gpio_alternate_function
GPIO_REGDEF_ts * sclk_gpio_port
GPIO_PIN_te miso_gpio_pin
SPI peripheral register map.
Internal structure representing a single SD card handle instance.