Annotation of funnyos/dev/sdmmc/sdmmcvar.h, Revision 1.1
1.1 ! nbrk 1: /*
! 2: * $Id$
! 3: */
! 4: #ifndef _DEV_SDMMC_SDMMCVAR_H
! 5: #define _DEV_SDMMC_SDMMCVAR_H
! 6:
! 7: /*
! 8: * SD/MMC simplified commands set.
! 9: */
! 10: #define CMD0_GO_IDLE_STATE 0
! 11: #define CMD1_SEND_OP_COND 1
! 12: #define CMD8_SEND_IF_COND 8
! 13: #define CMD9_SEND_CSD 9
! 14: #define CMD10_SEND_CID 10
! 15: #define CMD12_STOP_TRANSMISSION 12
! 16: #define CMD16_SET_BLOCKLEN 16
! 17: #define CMD17_READ_SINGLE_BLOCK 17
! 18: #define CMD18_READ_MULTIPLE_BLOCK 18
! 19: #define CMD23_SET_BLOCK_COUNT 23
! 20: #define CMD24_WRITE_BLOCK 24
! 21: #define CMD25_WRITE_MULTIPLE_BLOCK 25
! 22: #define CMD41_APP_SEND_OP_COND 41
! 23: #define CMD55_APP_CMD 55
! 24: #define CMD58_READ_OCR 58
! 25:
! 26: /*
! 27: * Command frame.
! 28: */
! 29: struct sdmmc_cmdframe {
! 30: uint8_t sc_cmd;
! 31: uint32_t sc_arg;
! 32: uint8_t sc_crc;
! 33:
! 34: } __attribute__((packed));
! 35:
! 36: /*
! 37: * Macross to construct frame header and footer.
! 38: */
! 39: #define CMDFRAME_CMD(c) ((c & 0x3f) | 0x40)
! 40: #define CMDFRAME_CRC(c) (c << 1 | 0x01)
! 41:
! 42: /*
! 43: * Responses bitfields.
! 44: */
! 45: #define R1_IN_IDLE_STATE 0x01
! 46: #define R1_ERASE_RESET 0x02
! 47: #define R1_ILLEGAL_COMMAND 0x04
! 48: #define R1_COMMAND_CRC_ERROR 0x08
! 49: #define R1_ERASE_SEQUENSE_ERROR 0x10
! 50: #define R1_ADDRESS_ERROR 0x20
! 51: #define R1_PARAMETER_ERROR 0x40
! 52:
! 53: /*
! 54: * R1 response frame.
! 55: */
! 56: struct sdmmc_r1resp {
! 57: uint8_t sr_eflags;
! 58:
! 59: };
! 60:
! 61: /*
! 62: * R3 response frame.
! 63: */
! 64: struct sdmmc_r3resp {
! 65: uint8_t sr_eflags;
! 66: uint32_t sr_ocr;
! 67:
! 68: } __attribute__((packed));
! 69:
! 70:
! 71: #endif /* !_DEV_SDMMC_SDMMCVAR_H */
! 72:
CVSweb