aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/include/mmcsd.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/include/mmcsd.h')
-rw-r--r--os/hal/include/mmcsd.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/os/hal/include/mmcsd.h b/os/hal/include/mmcsd.h
index c782ab7a2..5ff3082c7 100644
--- a/os/hal/include/mmcsd.h
+++ b/os/hal/include/mmcsd.h
@@ -219,6 +219,32 @@ typedef struct {
/*===========================================================================*/
/**
+ * @name R1 response utilities
+ * @{
+ */
+/**
+ * @brief Evaluates to @p TRUE if the R1 response contains error flags.
+ *
+ * @param[in] r1 the r1 response
+ */
+#define MMCSD_R1_ERROR(r1) (((r1) & MMCSD_R1_ERROR_MASK) != 0)
+
+/**
+ * @brief Returns the status field of an R1 response.
+ *
+ * @param[in] r1 the r1 response
+ */
+#define MMCSD_R1_STS(r1) (((r1) >> 9) & 15)
+
+/**
+ * @brief Evaluates to @p TRUE if the R1 response indicates a locked card.
+ *
+ * @param[in] r1 the r1 response
+ */
+#define MMCSD_R1_IS_CARD_LOCKED(r1) (((r1) >> 21) & 1)
+/** @} */
+
+/**
* @name Macro Functions
* @{
*/