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

Public API for MMC 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 mmc_write_blocks (struct sd_card *card, const uint8_t *wbuf, uint32_t start_block, uint32_t num_blocks)
 Write blocks to MMC card from buffer.
 
int mmc_read_blocks (struct sd_card *card, uint8_t *rbuf, uint32_t start_block, uint32_t num_blocks)
 Read block from MMC card to buffer.
 
int mmc_ioctl (struct sd_card *card, uint8_t cmd, void *buf)
 Get I/O control data from MMC card.
 

Detailed Description

Public API for MMC memory card subsystem.

Function Documentation

◆ mmc_ioctl()

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

Get I/O control data from MMC card.

Sends I/O control commands to MMC card.

Parameters
cardMMC card
cmdI/O control command Mirrors disk subsystem, see include/zephyr/drivers/disk.h for list of possible commands.
bufI/O control buf
Return values
0IOCTL command succeeded
-ENOTSUPIOCTL command not supported
-EIOI/O failure

◆ mmc_read_blocks()

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

Read block from MMC card to buffer.

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

Parameters
cardMMC 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

◆ mmc_write_blocks()

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

Write blocks to MMC card from buffer.

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

Parameters
cardMMC 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