mirror of
https://github.com/micropython/micropython.git
synced 2025-12-16 09:50:15 +01:00
stm32/sdio: Add functions to re/enable SDIO/SDIOIT.
This commit is contained in:
committed by
Damien George
parent
4d96786823
commit
80788154b3
@@ -93,6 +93,21 @@ void sdio_deinit(void) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void sdio_reenable(void) {
|
||||
if (__HAL_RCC_SDMMC1_IS_CLK_DISABLED()) {
|
||||
__HAL_RCC_SDMMC1_CLK_ENABLE(); // enable SDIO peripheral
|
||||
sdio_enable_high_speed_4bit();
|
||||
}
|
||||
}
|
||||
|
||||
void sdio_enable_irq(bool enable) {
|
||||
if (enable) {
|
||||
SDMMC1->MASK |= SDMMC_MASK_SDIOITIE;
|
||||
} else {
|
||||
SDMMC1->MASK &= ~SDMMC_MASK_SDIOITIE;
|
||||
}
|
||||
}
|
||||
|
||||
void sdio_enable_high_speed_4bit(void) {
|
||||
SDMMC_TypeDef *SDIO = SDMMC1;
|
||||
SDIO->POWER = 0; // power off
|
||||
|
||||
Reference in New Issue
Block a user