From 75d2bfcccf04e2740c51c345bc8a3145c2c2c7c7 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 17 Mar 2022 17:08:14 +1100 Subject: [PATCH] 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 --- ports/stm32/sdcard.c | 8 ++++++++ ports/stm32/sdcard.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/ports/stm32/sdcard.c b/ports/stm32/sdcard.c index cdec576dc2..12c9eb4446 100644 --- a/ports/stm32/sdcard.c +++ b/ports/stm32/sdcard.c @@ -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(); diff --git a/ports/stm32/sdcard.h b/ports/stm32/sdcard.h index e436ffffe1..a2e4e4517c 100644 --- a/ports/stm32/sdcard.h +++ b/ports/stm32/sdcard.h @@ -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);