From da47b386c69cfab49ac16b7d64a9a264b0a96687 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 10 Apr 2010 21:57:43 +0000 Subject: [PATCH] Extensions for SAM3U git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2583 42af7a65-404d-4744-a932-0658087f49c3 --- include/nuttx/sdio.h | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/include/nuttx/sdio.h b/include/nuttx/sdio.h index 6723c47d1f..15cb6a4a2b 100755 --- a/include/nuttx/sdio.h +++ b/include/nuttx/sdio.h @@ -196,7 +196,18 @@ # define SDIO_ACMDIDX53 53 /* IO_RW_EXTENDED: (SDIO only) * -R5 response, 23:16=status */ -/* Response Encodings */ +/* Response Encodings: + * + * xxxx xxxx xxxx xxxx OSMX XXRR RRCC CCCC + * + * x - Bit not used + * C - Bits 0-5: Command index + * R - Bits 6-9: Response type + * X - Bits 10-12: Data transfer type + * M - Bit 13: Multiple block transfer + * S - Bit 14: Stop data transfer + * O - Bit 15: Open drain + */ #define MMCSD_RESPONSE_SHIFT (6) #define MMCSD_RESPONSE_MASK (15 << MMCSD_RESPONSE_SHIFT) @@ -224,34 +235,41 @@ # define MMCSD_RDDATAXFR (MMCSD_DATAXFR) # define MMCSD_WRDATAXFR (MMCSD_DATAXFR|MMCSD_WRXFR) +#define MMCSD_MULTIBLOCK (1 << 13) +#define MMCSD_STOPXFR (1 << 14) + +/* Other options */ + +#define MMCSD_OPENDRAN (1 << 15) + /* Fully decorated MMC, SD, SDIO commands */ #define MMCSD_CMD0 (MMCSD_CMDIDX0 |MMCSD_NO_RESPONSE |MMCSD_NODATAXFR) -#define MMC_CMD1 (MMC_CMDIDX1 |MMCSD_R3_RESPONSE |MMCSD_NODATAXFR) +#define MMC_CMD1 (MMC_CMDIDX1 |MMCSD_R3_RESPONSE |MMCSD_NODATAXFR |MMCSD_OPENDRAIN) #define MMCSD_CMD2 (MMCSD_CMDIDX2 |MMCSD_R2_RESPONSE |MMCSD_NODATAXFR) #define MMC_CMD3 (MMC_CMDIDX3 |MMCSD_R1_RESPONSE |MMCSD_NODATAXFR) #define SD_CMD3 (SD_CMDIDX3 |MMCSD_R6_RESPONSE |MMCSD_NODATAXFR) #define MMCSD_CMD4 (MMCSD_CMDIDX4 |MMCSD_NO_RESPONSE |MMCSD_NODATAXFR) #define SDIO_CMD5 (SDIO_CMDIDX5 |MMCSD_R4_RESPONSE |MMCSD_NODATAXFR) -#define MMCSD_CMD6 (MMCSD_CMDIDX6 |MMCSD_R1_RESPONSE |MMCSD_NODATAXFR) +#define MMCSD_CMD6 (MMCSD_CMDIDX6 |MMCSD_R1_RESPONSE |MMCSD_RDDATAXFR) #define MMCSD_CMD7S (MMCSD_CMDIDX7 |MMCSD_R1B_RESPONSE|MMCSD_NODATAXFR) #define MMCSD_CMD7D (MMCSD_CMDIDX7 |MMCSD_NO_RESPONSE |MMCSD_NODATAXFR) /* No response when de-selecting card */ #define SD_CMD8 (SD_CMDIDX8 |MMCSD_R7_RESPONSE |MMCSD_NODATAXFR) #define MMCSD_CMD9 (MMCSD_CMDIDX9 |MMCSD_R2_RESPONSE |MMCSD_NODATAXFR) #define MMCSD_CMD10 (MMCSD_CMDIDX10|MMCSD_R2_RESPONSE |MMCSD_NODATAXFR) #define MMC_CMD11 (MMC_CMDIDX11 |MMCSD_R1_RESPONSE |MMCSD_RDSTREAM ) -#define MMCSD_CMD12 (MMCSD_CMDIDX12|MMCSD_R1B_RESPONSE|MMCSD_NODATAXFR) +#define MMCSD_CMD12 (MMCSD_CMDIDX12|MMCSD_R1B_RESPONSE|MMCSD_NODATAXFR |MMCSD_STOPXFR) #define MMCSD_CMD13 (MMCSD_CMDIDX13|MMCSD_R1_RESPONSE |MMCSD_NODATAXFR) #define MMCSD_CMD14 (MMCSD_CMDIDX14|MMCSD_R1_RESPONSE |MMCSD_NODATAXFR) -#define MMCSD_CMD15 (MMCSD_CMDIDX15|MMCSD_R1_RESPONSE |MMCSD_NODATAXFR) +#define MMCSD_CMD15 (MMCSD_CMDIDX15|MMCSD_NO_RESPONSE |MMCSD_NODATAXFR) #define MMCSD_CMD16 (MMCSD_CMDIDX16|MMCSD_R1_RESPONSE |MMCSD_NODATAXFR) #define MMCSD_CMD17 (MMCSD_CMDIDX17|MMCSD_R1_RESPONSE |MMCSD_RDDATAXFR) -#define MMCSD_CMD18 (MMCSD_CMDIDX18|MMCSD_R1_RESPONSE |MMCSD_RDDATAXFR) +#define MMCSD_CMD18 (MMCSD_CMDIDX18|MMCSD_R1_RESPONSE |MMCSD_RDDATAXFR |MMCSD_MULTIBLOCK) #define MMCSD_CMD19 (MMCSD_CMDIDX19|MMCSD_R1_RESPONSE |MMCSD_NODATAXFR) #define MMC_CMD20 (MMC_CMDIDX20 |MMCSD_R1B_RESPONSE|MMCSD_WRSTREAM ) #define MMC_CMD23 (MMC_CMDIDX23 |MMCSD_R1_RESPONSE |MMCSD_NODATAXFR) #define MMCSD_CMD24 (MMCSD_CMDIDX24|MMCSD_R1_RESPONSE |MMCSD_WRDATAXFR) -#define MMCSD_CMD25 (MMCSD_CMDIDX25|MMCSD_R1_RESPONSE |MMCSD_WRDATAXFR) +#define MMCSD_CMD25 (MMCSD_CMDIDX25|MMCSD_R1_RESPONSE |MMCSD_WRDATAXFR |MMCSD_MULTIBLOCK) #define MMCSD_CMD26 (MMCSD_CMDIDX26|MMCSD_R1_RESPONSE |MMCSD_WRDATAXFR) #define MMCSD_CMD27 (MMCSD_CMDIDX27|MMCSD_R1_RESPONSE |MMCSD_WRDATAXFR) #define MMCSD_CMD28 (MMCSD_CMDIDX28|MMCSD_R1B_RESPONSE|MMCSD_NODATAXFR)