mmcsd_cmd.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. * File : mmcsd_cmd.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006, RT-Thread Development Team
  5. *
  6. * The license and distribution terms for this file may be
  7. * found in the file LICENSE in this distribution or at
  8. * http://www.rt-thread.org/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 2011-07-25 weety first version
  13. */
  14. #ifndef __CMD_H__
  15. #define __CMD_H__
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. /* class 1 */
  20. #define GO_IDLE_STATE 0 /* bc */
  21. #define SEND_OP_COND 1 /* bcr [31:0] OCR R3 */
  22. #define ALL_SEND_CID 2 /* bcr R2 */
  23. #define SET_RELATIVE_ADDR 3 /* ac [31:16] RCA R1 */
  24. #define SET_DSR 4 /* bc [31:16] RCA */
  25. #define SWITCH 6 /* ac [31:0] See below R1b */
  26. #define SELECT_CARD 7 /* ac [31:16] RCA R1 */
  27. #define SEND_EXT_CSD 8 /* adtc R1 */
  28. #define SEND_CSD 9 /* ac [31:16] RCA R2 */
  29. #define SEND_CID 10 /* ac [31:16] RCA R2 */
  30. #define READ_DAT_UNTIL_STOP 11 /* adtc [31:0] dadr R1 */
  31. #define STOP_TRANSMISSION 12 /* ac R1b */
  32. #define SEND_STATUS 13 /* ac [31:16] RCA R1 */
  33. #define GO_INACTIVE_STATE 15 /* ac [31:16] RCA */
  34. #define SPI_READ_OCR 58 /* spi spi_R3 */
  35. #define SPI_CRC_ON_OFF 59 /* spi [0:0] flag spi_R1 */
  36. /* class 2 */
  37. #define SET_BLOCKLEN 16 /* ac [31:0] block len R1 */
  38. #define READ_SINGLE_BLOCK 17 /* adtc [31:0] data addr R1 */
  39. #define READ_MULTIPLE_BLOCK 18 /* adtc [31:0] data addr R1 */
  40. /* class 3 */
  41. #define WRITE_DAT_UNTIL_STOP 20 /* adtc [31:0] data addr R1 */
  42. /* class 4 */
  43. #define SET_BLOCK_COUNT 23 /* adtc [31:0] data addr R1 */
  44. #define WRITE_BLOCK 24 /* adtc [31:0] data addr R1 */
  45. #define WRITE_MULTIPLE_BLOCK 25 /* adtc R1 */
  46. #define PROGRAM_CID 26 /* adtc R1 */
  47. #define PROGRAM_CSD 27 /* adtc R1 */
  48. /* class 6 */
  49. #define SET_WRITE_PROT 28 /* ac [31:0] data addr R1b */
  50. #define CLR_WRITE_PROT 29 /* ac [31:0] data addr R1b */
  51. #define SEND_WRITE_PROT 30 /* adtc [31:0] wpdata addr R1 */
  52. /* class 5 */
  53. #define ERASE_GROUP_START 35 /* ac [31:0] data addr R1 */
  54. #define ERASE_GROUP_END 36 /* ac [31:0] data addr R1 */
  55. #define ERASE 38 /* ac R1b */
  56. /* class 9 */
  57. #define FAST_IO 39 /* ac <Complex> R4 */
  58. #define GO_IRQ_STATE 40 /* bcr R5 */
  59. /* class 7 */
  60. #define LOCK_UNLOCK 42 /* adtc R1b */
  61. /* class 8 */
  62. #define APP_CMD 55 /* ac [31:16] RCA R1 */
  63. #define GEN_CMD 56 /* adtc [0] RD/WR R1 */
  64. /* SD commands type argument response */
  65. /* class 0 */
  66. /* This is basically the same command as for MMC with some quirks. */
  67. #define SD_SEND_RELATIVE_ADDR 3 /* bcr R6 */
  68. #define SD_SEND_IF_COND 8 /* bcr [11:0] See below R7 */
  69. /* class 10 */
  70. #define SD_SWITCH 6 /* adtc [31:0] See below R1 */
  71. /* Application commands */
  72. #define SD_APP_SET_BUS_WIDTH 6 /* ac [1:0] bus width R1 */
  73. #define SD_APP_SEND_NUM_WR_BLKS 22 /* adtc R1 */
  74. #define SD_APP_OP_COND 41 /* bcr [31:0] OCR R3 */
  75. #define SD_APP_SEND_SCR 51 /* adtc R1 */
  76. #define SCR_SPEC_VER_0 0 /* Implements system specification 1.0 - 1.01 */
  77. #define SCR_SPEC_VER_1 1 /* Implements system specification 1.10 */
  78. #define SCR_SPEC_VER_2 2 /* Implements system specification 2.00 */
  79. #ifdef __cplusplus
  80. }
  81. #endif
  82. #endif