SD/MMC Driver
Following API only apply to RDA8910 and RDA8955 based modems, On 2G modems based on MT2503/MT6261 SD card is mounted automatically if detected during power-up.
Once card is mounted, it is available on VFS path /sd. All standard file
IO operations (open, close, read, write etc.) can be performed.
Example use
#include <hw/sdmmc.h>
/* To Mount SD Card */
sdmmc_mount(CARD_TYPE_SD);
/* To Mount EMMC */
sdmmc_mount(CARD_TYPE_EMMC);
/* To Unmount card */
sdmmc_unmount();
Read More
Standard IO <../system/syscall/stdio> Directory <../system/syscall/dirent> Fileystem <../system/syscall/statvfs>
API Reference
Header File
Source: include/hw/sdmmc.h
#include <hw/sdmmc.h>
Functions
-
int sdmmc_mount(struct sdmmc_cfg_t *cfg)
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”
Note
Only supported on 4G Modules
- Parameters:
cfg – SDMMC Configuration sdmmc_cfg_t
- Returns:
0 on success, negative on error
-
int sdmmc_unmount(void)
Unmount SD card.
Note
Only supported on 4G Modules
- Returns:
0 on success, negative on error
Structures
-
struct sdmmc_cfg_t
SDMMC Configuration.
Public Members
-
uint8_t card_type
Card type cardtype_e
-
uint8_t data_mode
Data mode data_mode_e
-
uint32_t reserved
Reserved, keep as 0
-
uint32_t reserved1
Reserved, keep as 0
-
uint8_t card_type
