Skip to content

Commit c16557b

Browse files
committed
include:hw: add sdmmc driver header file
Signed-off-by: Ajay Bhargav <[email protected]>
1 parent eb147a6 commit c16557b

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

include/hw/sdmmc.h

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* sdmmc.h
3+
*
4+
*/
5+
6+
#ifndef INCLUDE_HW_SDMMC_H_
7+
#define INCLUDE_HW_SDMMC_H_
8+
9+
#include <stdint.h>
10+
11+
#ifdef __cplusplus
12+
extern "C" {
13+
#endif
14+
15+
/**
16+
* @brief Card Type
17+
*
18+
*/
19+
enum cardtype_e {
20+
CARD_TYPE_EMMC, /**< Card is EMMC, (5.0 supported) */
21+
CARD_TYPE_SD, /**< Card is SD or MMC type */
22+
};
23+
24+
/**
25+
* @brief Mount an SD card
26+
*
27+
* To support SD card hotplug, Use GPIO for SD card detection
28+
* Unmount SD card when card is removed and mount again when
29+
* card is inserted.
30+
*
31+
* On success, SD card is mounted on VFS at path: "/sd"
32+
*
33+
* @param type card type @ref cardtype_e
34+
* @return 0 on success, negative on error
35+
*/
36+
int sdmmc_mount(uint8_t type);
37+
38+
/**
39+
* @brief Unmount SD card
40+
*
41+
* @return 0 on success, negative on error
42+
*/
43+
int sdmmc_unmount(void);
44+
45+
#ifdef __cplusplus
46+
}
47+
#endif
48+
49+
#endif /* INCLUDE_HW_SDMMC_H_ */

0 commit comments

Comments
 (0)