diff options
-rwxr-xr-x | nuttx/arch/arm/src/stm32/stm32_sdio.c | 21 | ||||
-rwxr-xr-x | nuttx/drivers/mmcsd/Kconfig | 26 |
2 files changed, 42 insertions, 5 deletions
diff --git a/nuttx/arch/arm/src/stm32/stm32_sdio.c b/nuttx/arch/arm/src/stm32/stm32_sdio.c index 8d44f8e9b..56b498153 100755 --- a/nuttx/arch/arm/src/stm32/stm32_sdio.c +++ b/nuttx/arch/arm/src/stm32/stm32_sdio.c @@ -1267,7 +1267,28 @@ static void stm32_endtransfer(struct stm32_dev_s *priv, sdio_eventset_t wkupeven /**************************************************************************** * Interrupt Handling ****************************************************************************/ +#ifdef CONFIG_MMCSD_HAVE_SDIOWAIT_WRCOMPLETE +/**************************************************************************** + * Name: stm32_rdyinterrupt + * + * Description: + * SDIO ready interrupt handler + * + * Input Parameters: + * dev - An instance of the SDIO device interface + * + * Returned Value: + * None + * + ****************************************************************************/ +static int stm32_rdyinterrupt(int irq, void *context) +{ + struct stm32_dev_s *priv = &g_sdiodev; + stm32_endwait(priv, SDIOWAIT_WRCOMPLETE); + return OK; +} +#endif /**************************************************************************** * Name: stm32_rdyinterrupt * diff --git a/nuttx/drivers/mmcsd/Kconfig b/nuttx/drivers/mmcsd/Kconfig index 88dd4fe79..5263c21bf 100755 --- a/nuttx/drivers/mmcsd/Kconfig +++ b/nuttx/drivers/mmcsd/Kconfig @@ -32,11 +32,27 @@ config MMCSD_MMCSUPPORT Enable support for MMC cards config MMCSD_HAVECARDDETECT - bool "MMC/SD card detection" - default y - ---help--- - SDIO driver card detection is - 100% accurate + bool "MMC/SD card detection" + default y + ---help--- + SDIO driver card detection is + 100% accurate + +config MMCSD_HAVE_SDIOWAIT_WRCOMPLETE + bool "Use SDIO_D Busy to detect Write Complete" + default n + ---help--- + SDIO driver will use SDIO_D Busy signaling to detect Write Complete. + This option when selected, will enable the MMCSD driver to use the + underlying (stm32_sdio only) drivers implementation of the SD specs + SDIO_D Busy signaling to detect Write Complete. This will avoid + potentially very long (600Ms+) busy waiting in the MMCSD driver. + To implement SDIO_D Busy signaling, the underlying driver must + be capable of switching the GPIO_SDIO_D0 to be a rising edge sensitive + interrupt pin. It must then, condition that pin to detect the rising edge + on recipet of SDWAIT_WRCOMPLETE in the SDIO_WAITENABLE call and + return it back to regular SDIO mode, when either the ISR fires or pin is + found to be high in the SDIO_EVENTWAIT call. config MMCSD_SPI bool "MMC/SD SPI transfer support" |