stm32/sdcard: Add sdcard_select_sd/mmc functions.

So that C code can select which of SD or MMC to use.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George 2022-03-17 17:08:14 +11:00
parent 7a9cf1f0fb
commit 75d2bfcccf
2 changed files with 10 additions and 0 deletions

View File

@ -200,6 +200,14 @@ void sdcard_init(void) {
#endif
}
void sdcard_select_sd(void) {
pyb_sdmmc_flags |= PYB_SDMMC_FLAG_SD;
}
void sdcard_select_mmc(void) {
pyb_sdmmc_flags |= PYB_SDMMC_FLAG_MMC;
}
STATIC void sdmmc_msp_init(void) {
// enable SDIO clock
SDMMC_CLK_ENABLE();

View File

@ -30,6 +30,8 @@
#define SDCARD_BLOCK_SIZE (512)
void sdcard_init(void);
void sdcard_select_sd(void);
void sdcard_select_mmc(void);
bool sdcard_is_present(void);
bool sdcard_power_on(void);
void sdcard_power_off(void);