SD/MMC/SDIO basic APIs used by SD/MMC/SDIO memory APIs (sd_mmc_stack_mem_group). Also, it can be used by application which use the SDIO card or specific application which does not need of File System.
For usual application which use the SD/MMC card in memory mode with a file system, please refer to sd_mmc_stack_mem_group.
◆ CARD_TYPE_HC
#define CARD_TYPE_HC (1 << 3) |
High capacity card
Definition at line 84 of file sd_mmc.h.
◆ CARD_TYPE_MMC
#define CARD_TYPE_MMC (1 << 1) |
◆ CARD_TYPE_SD
#define CARD_TYPE_SD (1 << 0) |
◆ CARD_TYPE_SD_COMBO
SD combo card (io + memory)
Definition at line 86 of file sd_mmc.h.
◆ CARD_TYPE_SDIO
#define CARD_TYPE_SDIO (1 << 2) |
SDIO card.
Definition at line 83 of file sd_mmc.h.
◆ CARD_TYPE_UNKNOWN
#define CARD_TYPE_UNKNOWN (0) |
Unknown type card.
Definition at line 80 of file sd_mmc.h.
◆ CARD_VER_MMC_1_2
#define CARD_VER_MMC_1_2 (0x12) |
◆ CARD_VER_MMC_1_4
#define CARD_VER_MMC_1_4 (0x14) |
◆ CARD_VER_MMC_2_2
#define CARD_VER_MMC_2_2 (0x22) |
◆ CARD_VER_MMC_3
#define CARD_VER_MMC_3 (0x30) |
◆ CARD_VER_MMC_4
#define CARD_VER_MMC_4 (0x40) |
◆ CARD_VER_SD_1_0
#define CARD_VER_SD_1_0 (0x10) |
◆ CARD_VER_SD_1_10
#define CARD_VER_SD_1_10 (0x1A) |
◆ CARD_VER_SD_2_0
#define CARD_VER_SD_2_0 (0X20) |
◆ CARD_VER_SD_3_0
#define CARD_VER_SD_3_0 (0X30) |
◆ CARD_VER_UNKNOWN
#define CARD_VER_UNKNOWN (0) |
◆ SD_MMC_BLOCK_SIZE
#define SD_MMC_BLOCK_SIZE 512 |
This SD MMC stack uses the maximum block size autorized (512 bytes)
Definition at line 106 of file sd_mmc.h.
◆ SD_MMC_ERR_COMM
#define SD_MMC_ERR_COMM 5 |
◆ SD_MMC_ERR_NO_CARD
#define SD_MMC_ERR_NO_CARD 2 |
◆ SD_MMC_ERR_PARAM
#define SD_MMC_ERR_PARAM 6 |
◆ SD_MMC_ERR_SLOT
#define SD_MMC_ERR_SLOT 4 |
◆ SD_MMC_ERR_UNUSABLE
#define SD_MMC_ERR_UNUSABLE 3 |
◆ SD_MMC_ERR_WP
◆ SD_MMC_INIT_ONGOING
#define SD_MMC_INIT_ONGOING 1 |
◆ SD_MMC_OK
◆ card_type_t
Type of card type.
Definition at line 76 of file sd_mmc.h.
◆ card_version_t
Type of card version.
Definition at line 89 of file sd_mmc.h.
◆ sd_mmc_err_t
Type of return error code.
Definition at line 62 of file sd_mmc.h.
◆ sd_mmc_check()
Performs a card checks.
- Parameters
-
- Return values
-
SD_MMC_OK | Card ready |
SD_MMC_INIT_ONGOING | Initialization on going |
SD_MMC_ERR_NO_CARD | Card not present in slot |
Other | value for error cases, see sd_mmc_err_t |
Definition at line 1776 of file sd_mmc.c.
◆ sd_mmc_get_capacity()
uint32_t sd_mmc_get_capacity |
( |
uint8_t |
slot | ) |
|
Get the memory capacity.
- Parameters
-
- Returns
- Capacity (unit KB)
Definition at line 1820 of file sd_mmc.c.
◆ sd_mmc_get_type()
◆ sd_mmc_get_version()
◆ sd_mmc_init()
void sd_mmc_init |
( |
void |
| ) |
|
Initialize the SD/MMC stack and low level driver required.
Enable the PMC clock for the card detect pins
Enable the PMC clock for the card write protection pins
Definition at line 1746 of file sd_mmc.c.
◆ sd_mmc_init_read_blocks()
sd_mmc_err_t sd_mmc_init_read_blocks |
( |
uint8_t |
slot, |
|
|
uint32_t |
start, |
|
|
uint16_t |
nb_block |
|
) |
| |
Initialize the read blocks of data from the card.
- Parameters
-
slot | Card slot to use |
start | Start block number to to read. |
nb_block | Total number of blocks to be read. |
- Returns
- return SD_MMC_OK if success, otherwise return an error code (sd_mmc_err_t).
Definition at line 1842 of file sd_mmc.c.
◆ sd_mmc_init_write_blocks()
sd_mmc_err_t sd_mmc_init_write_blocks |
( |
uint8_t |
slot, |
|
|
uint32_t |
start, |
|
|
uint16_t |
nb_block |
|
) |
| |
Initialize the write blocks of data.
- Parameters
-
slot | Card slot to use |
start | Start block number to be written. |
nb_block | Total number of blocks to be written. |
- Returns
- return SD_MMC_OK if success, otherwise return an error code (sd_mmc_err_t).
Definition at line 1932 of file sd_mmc.c.
◆ sd_mmc_is_write_protected()
bool sd_mmc_is_write_protected |
( |
uint8_t |
slot | ) |
|
Get the card write protection status.
- Parameters
-
- Returns
- true, if write portected
Definition at line 1829 of file sd_mmc.c.
◆ sd_mmc_nb_slot()
uint8_t sd_mmc_nb_slot |
( |
void |
| ) |
|
Return the number of slot available.
- Returns
- Number of card slot available
Definition at line 1771 of file sd_mmc.c.
◆ sd_mmc_start_read_blocks()
sd_mmc_err_t sd_mmc_start_read_blocks |
( |
void * |
dest, |
|
|
uint16_t |
nb_block |
|
) |
| |
Start the read blocks of data from the card.
- Parameters
-
dest | Pointer to read buffer. |
nb_block | Number of blocks to be read. |
- Returns
- return SD_MMC_OK if started, otherwise return an error code (sd_mmc_err_t).
Definition at line 1893 of file sd_mmc.c.
◆ sd_mmc_start_write_blocks()
sd_mmc_err_t sd_mmc_start_write_blocks |
( |
const void * |
src, |
|
|
uint16_t |
nb_block |
|
) |
| |
Start the write blocks of data.
- Parameters
-
src | Pointer to write buffer. |
nb_block | Number of blocks to be written. |
- Returns
- return SD_MMC_OK if started, otherwise return an error code (sd_mmc_err_t).
Definition at line 1980 of file sd_mmc.c.
◆ sd_mmc_wait_end_of_read_blocks()
Wait the end of read blocks of data from the card.
- Parameters
-
- Returns
- return SD_MMC_OK if success, otherwise return an error code (sd_mmc_err_t).
Definition at line 1905 of file sd_mmc.c.
◆ sd_mmc_wait_end_of_write_blocks()
Wait the end of write blocks of data.
- Parameters
-
- Returns
- return SD_MMC_OK if success, otherwise return an error code (sd_mmc_err_t).
Definition at line 1991 of file sd_mmc.c.