Browse Source

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>
pull/8441/head
Damien George 3 years ago
parent
commit
75d2bfcccf
  1. 8
      ports/stm32/sdcard.c
  2. 2
      ports/stm32/sdcard.h

8
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();

2
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);

Loading…
Cancel
Save