GPS Device
Loading...
Searching...
No Matches
sd_handle_s Struct Reference

Internal structure representing a single SD card handle instance. More...

Collaboration diagram for sd_handle_s:

Public Attributes

char name [CONFIG_SD_MAX_NAME_LEN]
SPI_REGDEF_tsspi_instance
GPIO_REGDEF_tssclk_gpio_port
GPIO_REGDEF_tscs_gpio_port
GPIO_REGDEF_tsmiso_gpio_port
GPIO_REGDEF_tsmosi_gpio_port
GPIO_PIN_te sclk_gpio_pin
GPIO_PIN_te cs_gpio_pin
GPIO_PIN_te miso_gpio_pin
GPIO_PIN_te mosi_gpio_pin
GPIO_ALTERNATE_FUNCTION_te gpio_alternate_function
SD_PWRUP_STATUS_te pwrup_status
SD_ADDR_MODE_te addr_mode
SD_TYPE_te type
SD_MIN_OPERATING_VOLTAGE_te min_operating_voltage
SD_MAX_OPERATIING_VOLTAGE_te max_operating_voltage
uint32_t block_len
uint32_t block_count
uint32_t capacity_mb
bool initialized
bool in_use

Detailed Description

Internal structure representing a single SD card handle instance.

Mirrors the SD_CFG_ts fields and adds runtime state populated during sd_init_handle: card type, addressing mode, power-up status, and capacity information decoded from the CSD register.

Definition at line 214 of file sd.c.

Member Data Documentation

◆ name

char sd_handle_s::name[CONFIG_SD_MAX_NAME_LEN]

Human-readable name (null-terminated).

Definition at line 215 of file sd.c.

◆ spi_instance

SPI_REGDEF_ts* sd_handle_s::spi_instance

SPI peripheral used for this card.

Definition at line 216 of file sd.c.

◆ sclk_gpio_port

GPIO_REGDEF_ts* sd_handle_s::sclk_gpio_port

GPIO port of the SCLK pin.

Definition at line 217 of file sd.c.

◆ cs_gpio_port

GPIO_REGDEF_ts* sd_handle_s::cs_gpio_port

GPIO port of the CS pin.

Definition at line 218 of file sd.c.

◆ miso_gpio_port

GPIO_REGDEF_ts* sd_handle_s::miso_gpio_port

GPIO port of the MISO pin.

Definition at line 219 of file sd.c.

◆ mosi_gpio_port

GPIO_REGDEF_ts* sd_handle_s::mosi_gpio_port

GPIO port of the MOSI pin.

Definition at line 220 of file sd.c.

◆ sclk_gpio_pin

GPIO_PIN_te sd_handle_s::sclk_gpio_pin

GPIO pin number of SCLK.

Definition at line 221 of file sd.c.

◆ cs_gpio_pin

GPIO_PIN_te sd_handle_s::cs_gpio_pin

GPIO pin number of CS.

Definition at line 222 of file sd.c.

◆ miso_gpio_pin

GPIO_PIN_te sd_handle_s::miso_gpio_pin

GPIO pin number of MISO.

Definition at line 223 of file sd.c.

◆ mosi_gpio_pin

GPIO_PIN_te sd_handle_s::mosi_gpio_pin

GPIO pin number of MOSI.

Definition at line 224 of file sd.c.

◆ gpio_alternate_function

GPIO_ALTERNATE_FUNCTION_te sd_handle_s::gpio_alternate_function

Alternate function for SCLK/MISO/MOSI.

Definition at line 225 of file sd.c.

◆ pwrup_status

SD_PWRUP_STATUS_te sd_handle_s::pwrup_status

Power-up completion status from OCR.

Definition at line 226 of file sd.c.

◆ addr_mode

SD_ADDR_MODE_te sd_handle_s::addr_mode

Addressing mode determined from OCR.

Definition at line 227 of file sd.c.

◆ type

SD_TYPE_te sd_handle_s::type

Card type (SDSC or SDHC).

Definition at line 228 of file sd.c.

◆ min_operating_voltage

SD_MIN_OPERATING_VOLTAGE_te sd_handle_s::min_operating_voltage

Minimum operating voltage from OCR (not used).

Definition at line 229 of file sd.c.

◆ max_operating_voltage

SD_MAX_OPERATIING_VOLTAGE_te sd_handle_s::max_operating_voltage

Maximum operating voltage from OCR (not used).

Definition at line 230 of file sd.c.

◆ block_len

uint32_t sd_handle_s::block_len

Block (sector) size in bytes, from CSD.

Definition at line 231 of file sd.c.

◆ block_count

uint32_t sd_handle_s::block_count

Total number of blocks, from CSD.

Definition at line 232 of file sd.c.

◆ capacity_mb

uint32_t sd_handle_s::capacity_mb

Total capacity in megabytes, from CSD.

Definition at line 233 of file sd.c.

◆ initialized

bool sd_handle_s::initialized

True after successful sd_init_handle.

Definition at line 234 of file sd.c.

◆ in_use

bool sd_handle_s::in_use

True when this pool slot is occupied.

Definition at line 235 of file sd.c.


The documentation for this struct was generated from the following file: