SD/MMC Driver

Following API only apply to 4G modems, On 2G modems SD card is mounted automatically if detected on power-up.

API Reference

Header File

Source: include/hw/sdmmc.h

#include <hw/sdmmc.h>

Functions

int sdmmc_mount(uint8_t type)

Mount an SD card.

To support SD card hotplug, Use GPIO for SD card detection Unmount SD card when card is removed and mount again when card is inserted.

On success, SD card is mounted on VFS at path: “/sd”

Parameters

type – card type cardtype_e

Returns

0 on success, negative on error

int sdmmc_unmount(void)

Unmount SD card.

Returns

0 on success, negative on error

Enumerations

enum cardtype_e

Card Type.

Values:

enumerator CARD_TYPE_EMMC

Card is EMMC, (5.0 supported)

enumerator CARD_TYPE_SD

Card is SD or MMC type