aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/include
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-06-25 16:53:21 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-06-25 16:53:21 +0000
commit80443125b286868f18342a9e6884a65b3218bf99 (patch)
tree3dc14eac430738860b4ca9f9c83c1868adb93f6b /os/hal/include
parent1d674cc60375981e361fb9bdce60c4a5adab754f (diff)
downloadChibiOS-80443125b286868f18342a9e6884a65b3218bf99.tar.gz
ChibiOS-80443125b286868f18342a9e6884a65b3218bf99.tar.bz2
ChibiOS-80443125b286868f18342a9e6884a65b3218bf99.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4347 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/include')
-rw-r--r--os/hal/include/mmc_spi.h62
1 files changed, 24 insertions, 38 deletions
diff --git a/os/hal/include/mmc_spi.h b/os/hal/include/mmc_spi.h
index a008292f5..cff70876b 100644
--- a/os/hal/include/mmc_spi.h
+++ b/os/hal/include/mmc_spi.h
@@ -59,21 +59,6 @@
#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__)
#define MMC_NICE_WAITING TRUE
#endif
-
-/**
- * @brief Number of positive insertion queries before generating the
- * insertion event.
- */
-#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__)
-#define MMC_POLLING_INTERVAL 10
-#endif
-
-/**
- * @brief Interval, in milliseconds, between insertion queries.
- */
-#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__)
-#define MMC_POLLING_DELAY 10
-#endif
/** @} */
/*===========================================================================*/
@@ -92,13 +77,14 @@
* @brief Driver state machine possible states.
*/
typedef enum {
- MMC_UNINIT = 0, /**< Not initialized. */
- MMC_STOP = 1, /**< Stopped. */
- MMC_WAIT = 2, /**< Waiting card. */
- MMC_INSERTED = 3, /**< Card inserted. */
- MMC_READY = 4, /**< Card ready. */
- MMC_READING = 5, /**< Reading. */
- MMC_WRITING = 6 /**< Writing. */
+ MMC_UNINIT = 0, /**< Not initialized. */
+ MMC_STOP = 1, /**< Stopped. */
+ MMC_READY = 2, /**< Ready. */
+ MMC_CONNECTING = 3, /**< Card connection in progress. */
+ MMC_DISCONNECTING = 4, /**< Card disconnection in progress. */
+ MMC_ACTIVE = 5, /**< Cart initialized. */
+ MMC_READING = 6, /**< Read operation in progress. */
+ MMC_WRITING = 7, /**< Write operation in progress. */
} mmcstate_t;
/**
@@ -153,22 +139,6 @@ typedef struct {
* @brief Current configuration data.
*/
const MMCConfig *config;
- /**
- * @brief Card insertion event source.
- */
- EventSource inserted_event;
- /**
- * @brief Card removal event source.
- */
- EventSource removed_event;
- /**
- * @brief MMC insertion polling timer.
- */
- VirtualTimer vt;
- /**
- * @brief Insertion counter.
- */
- uint_fast8_t cnt;
/***
* @brief Addresses use blocks instead of bytes.
*/
@@ -194,6 +164,22 @@ typedef struct {
#define mmcGetDriverState(mmcp) ((mmcp)->state)
/**
+ * @brief Returns the card insertion status.
+ * @note This macro wraps a low level function named
+ * @p sdc_lld_is_card_inserted(), this function must be
+ * provided by the application because it is not part of the
+ * SDC driver.
+ *
+ * @param[in] mmcp pointer to the @p MMCDriver object
+ * @return The card state.
+ * @retval FALSE card not inserted.
+ * @retval TRUE card inserted.
+ *
+ * @api
+ */
+#define mmcIsCardInserted(mmcp) mmc_lld_is_card_inserted(mmcp)
+
+/**
* @brief Returns the write protect status.
*
* @param[in] mmcp pointer to the @p MMCDriver object