فهرست منبع

driver: sdmmc: add SPI mode R2 response definitions

Ivan Grokhotkov 4 سال پیش
والد
کامیت
17b7981e2e
1فایلهای تغییر یافته به همراه14 افزوده شده و 0 حذف شده
  1. 14 0
      components/driver/include/driver/sdmmc_defs.h

+ 14 - 0
components/driver/include/driver/sdmmc_defs.h

@@ -119,6 +119,20 @@
 
 #define SDIO_R1_FUNC_NUM_ERR            (1<<4)
 
+/* SPI mode R2 response type bits.
+ * The first byte is the same as for R1.
+ * The bits below belong to the second byte.
+ * Bits 10, 11, 12, 15 can also be reported in data error token of a read command response.
+ */
+#define SD_SPI_R2_CARD_LOCKED           (1<<8)  /* Set when the card is locked by the user */
+#define SD_SPI_R2_UNLOCK_FAILED         (1<<9)  /* Host attempts to erase a write-protected sector or makes an error during card lock/unlock operation */
+#define SD_SPI_R2_ERROR                 (1<<10) /* A general or an unknown error occurred during the operation */
+#define SD_SPI_R2_CC_ERROR              (1<<11) /* Internal card controller error */
+#define SD_SPI_R2_ECC_FAILED            (1<<12) /* Card internal ECC was applied but failed to correct the data */
+#define SD_SPI_R2_WP_VIOLATION          (1<<13) /* The command tried to write a write-protected block */
+#define SD_SPI_R2_ERASE_PARAM           (1<<14) /* An invalid selection for erase, sectors or groups */
+#define SD_SPI_R2_OUT_OF_RANGE          (1<<15) /* The command argument was out of the allowed range for this card */
+
 /* 48-bit response decoding (32 bits w/o CRC) */
 #define MMC_R1(resp)                    ((resp)[0])
 #define MMC_R3(resp)                    ((resp)[0])