1lstoff 2 3; SD Card common definitions 4 5; $Id: sdcard.def,v 1.3 2012-09-21 14:02:22 stefano Exp $ 6 7 8 defc sd_error_spi_mode_failed = $01 9 10 defc sd_error_mmc_init_failed = $10 11 defc sd_error_sd_init_failed = $11 12 defc sd_error_sdhc_init_failed = $12 13 defc sd_error_vrange_bad = $13 14 defc sd_error_check_pattern_bad = $14 15 16 defc sd_error_illegal_command = $20 17 defc sd_error_bad_command_response = $21 18 defc sd_error_data_token_timeout = $22 19 defc sd_error_write_timeout = $23 20 defc sd_error_write_failed = $24 21 defc sd_error_too_big = $25 22 23 24; ---------------------- SD protocol commands ------------------------------------ 25 26 defc CMD0 = $40 27 defc SD_GO_IDLE_STATE = $40 28 29 defc CMD1 = $41 30 defc SD_SEND_OP_COND = $41 31 32 defc CMD8 = $48 33 34 defc CMD9 = $49 35 ;;defc SD_READ_CSD = $49 36 37 defc CMD10 = $4A 38 ;;defc SD_READ_CID = $4A 39 40 defc CMD12 = $4C 41 defc SD_TERMINATE_MULTI_READ = $4C 42 43 defc CMD13 = $4D 44 defc SD_STATUS = $4D 45 46 defc CMD16 = $50 47 defc SD_SET_BLOCK_SIZE = $50 48 49 defc CMD17 = $51 50 defc MMC_READ_SINGLE_BLOCK = $51 51 52 defc CMD18 = $52 53 defc SD_READ_MULTIPLE_BLOCK = $52 54 55 defc CMD24 = $58 56 defc SD_WRITE_SINGLE_BLOCK = $58 57 58 defc CMD25 = $59 59 defc SD_WRITE_MULTIPLE_BLOCK = $59 60 61 defc SD_START_TAG = $60 62 defc SD_END_TAG = $61 63 defc SD_ERASE_BLOCK = $66 64 65 defc ACMD41 = $69 ; SDHC 66 defc CMD55 = $77 ; SDHC APP_CMD (prefix for application command) 67 defc CMD58 = $7A ; SDHC 68 69 defc CMD59 = $7B ; CRC_ON_OFF (Only bit 0) Argument sets CRC on (1) or off (0). 70 71 defc MMC_STOP_TRAN = $FD 72 73 74lston 75 76