Zephyr API Documentation  3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
sdmmc.h File Reference

Public API for SD memory card subsystem. More...

#include <zephyr/device.h>
#include <zephyr/drivers/sdhc.h>
#include <zephyr/sd/sd.h>

Go to the source code of this file.

Functions

int sdmmc_write_blocks (struct sd_card *card, const uint8_t *wbuf, uint32_t start_block, uint32_t num_blocks)
 Write blocks to SD card from buffer.
 
int sdmmc_read_blocks (struct sd_card *card, uint8_t *rbuf, uint32_t start_block, uint32_t num_blocks)
 Read block from SD card to buffer.
 
int sdmmc_ioctl (struct sd_card *card, uint8_t cmd, void *buf)
 Get I/O control data from SD card.
 

Detailed Description

Public API for SD memory card subsystem.

Function Documentation

◆ sdmmc_ioctl()

int sdmmc_ioctl ( struct sd_card card,
uint8_t  cmd,
void *  buf 
)

Get I/O control data from SD card.

Sends I/O control commands to SD card.

Parameters
cardSD card
cmdI/O control command
bufI/O control buf
Return values
0IOCTL command succeeded
-ENOTSUPIOCTL command not supported
-EIOI/O failure

◆ sdmmc_read_blocks()

int sdmmc_read_blocks ( struct sd_card card,
uint8_t rbuf,
uint32_t  start_block,
uint32_t  num_blocks 
)

Read block from SD card to buffer.

Reads blocks into SD buffer from SD card. For best performance, this buffer should be aligned to CONFIG_SDHC_BUFFER_ALIGNMENT

Parameters
cardSD card to read from
rbufread buffer
start_blockfirst block to read from
num_blocksnumber of blocks to read
Return values
0read succeeded
-EBUSYcard is busy with another request
-ETIMEDOUTcard read timed out
-EIOI/O error

◆ sdmmc_write_blocks()

int sdmmc_write_blocks ( struct sd_card card,
const uint8_t wbuf,
uint32_t  start_block,
uint32_t  num_blocks 
)

Write blocks to SD card from buffer.

Writes blocks from SD buffer to SD card. For best performance, this buffer should be aligned to CONFIG_SDHC_BUFFER_ALIGNMENT

Parameters
cardSD card to write from
wbufwrite buffer
start_blockfirst block to write to
num_blocksnumber of blocks to write
Return values
0write succeeded
-EBUSYcard is busy with another request
-ETIMEDOUTcard write timed out
-EIOI/O error