Skip to content

Commit 57fd66e

Browse files
committed
drivers: disk: sdmmc_stm32: Add compatibility macros for STM32F4 SDIO
Add compatibility macros to map SDMMC constants to SDIO equivalents for STM32F4 series MCUs. STM32F4 uses SDIO peripheral with SDIO_* constants while newer STM32F7/H7 series use SDMMC peripheral with SDMMC_* constants. This fixes compilation errors on STM32F4 platforms where SDMMC_* constants are undefined: - SDMMC_CLOCK_EDGE_RISING - SDMMC_CLOCK_BYPASS_ENABLE/DISABLE - SDMMC_CLOCK_POWER_SAVE_ENABLE/DISABLE - SDMMC_HARDWARE_FLOW_CONTROL_DISABLE Fixes Fixes #94896 Signed-off-by: Shan Pen <[email protected]>
1 parent 5945a3f commit 57fd66e

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

drivers/disk/sdmmc_stm32.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,30 @@ LOG_MODULE_REGISTER(stm32_sdmmc, CONFIG_SDMMC_LOG_LEVEL);
4747
#define SDMMC_BUS_WIDE_8B SDIO_BUS_WIDE_8B
4848
#endif
4949

50+
#ifndef SDMMC_CLOCK_EDGE_RISING
51+
#define SDMMC_CLOCK_EDGE_RISING SDIO_CLOCK_EDGE_RISING
52+
#endif
53+
54+
#ifndef SDMMC_CLOCK_BYPASS_ENABLE
55+
#define SDMMC_CLOCK_BYPASS_ENABLE SDIO_CLOCK_BYPASS_ENABLE
56+
#endif
57+
58+
#ifndef SDMMC_CLOCK_BYPASS_DISABLE
59+
#define SDMMC_CLOCK_BYPASS_DISABLE SDIO_CLOCK_BYPASS_DISABLE
60+
#endif
61+
62+
#ifndef SDMMC_CLOCK_POWER_SAVE_ENABLE
63+
#define SDMMC_CLOCK_POWER_SAVE_ENABLE SDIO_CLOCK_POWER_SAVE_ENABLE
64+
#endif
65+
66+
#ifndef SDMMC_CLOCK_POWER_SAVE_DISABLE
67+
#define SDMMC_CLOCK_POWER_SAVE_DISABLE SDIO_CLOCK_POWER_SAVE_DISABLE
68+
#endif
69+
70+
#ifndef SDMMC_HARDWARE_FLOW_CONTROL_DISABLE
71+
#define SDMMC_HARDWARE_FLOW_CONTROL_DISABLE SDIO_HARDWARE_FLOW_CONTROL_DISABLE
72+
#endif
73+
5074
typedef void (*irq_config_func_t)(const struct device *dev);
5175

5276
#if STM32_SDMMC_USE_DMA

0 commit comments

Comments
 (0)