summaryrefslogtreecommitdiff
path: root/nuttx/include/nuttx/sdio.h
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/include/nuttx/sdio.h')
-rwxr-xr-x[-rw-r--r--]nuttx/include/nuttx/sdio.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/nuttx/include/nuttx/sdio.h b/nuttx/include/nuttx/sdio.h
index 5bd80329c..258fe14c8 100644..100755
--- a/nuttx/include/nuttx/sdio.h
+++ b/nuttx/include/nuttx/sdio.h
@@ -63,7 +63,27 @@
#define SDIOWAIT_TIMEOUT (1 << 3) /* Bit 3: Timeout */
#define SDIOWAIT_ERROR (1 << 4) /* Bit 4: Some other error occurred */
-#define SDIOWAIT_ALLEVENTS 0x1f
+/* SDIOWAIT_WRCOMPLETE (optional) : SDIO driver will use SDIO_D Busy
+ * signalling 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 signalling to detect Write
+ * Complete. This will avoid potentially very long (600Ms+) busy waiting
+ * in the MMCSD driver.
+ *
+ * To implement SDIO_D Busy signalling, 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 receipt 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.
+ */
+
+#if defined(CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE)
+# define SDIOWAIT_WRCOMPLETE (1 << 5) /* Bit 5: Hardware Write Completion */
+# define SDIOWAIT_ALLEVENTS 0x3f
+#else
+# define SDIOWAIT_ALLEVENTS 0x1f
+#endif
/* Media events are used for enable/disable registered event callbacks */