2 * Copyright © 2013 Keith Packard <keithp@keithp.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 of the License.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
22 ao_sdcard_read_block(uint32_t block, uint8_t *data);
25 ao_sdcard_write_block(uint32_t block, uint8_t *data);
31 #define SDCARD_GO_IDLE_STATE 0
32 #define SDCARD_SEND_OP_COND 1
33 #define SDCARD_SEND_IF_COND 8
34 #define SDCARD_SEND_CSD 9
35 #define SDCARD_SEND_CID 10
36 #define SDCARD_SEND_STATUS 13
37 #define SDCARD_SET_BLOCKLEN 16
38 #define SDCARD_READ_BLOCK 17
39 #define SDCARD_WRITE_BLOCK 24
40 #define SDCARD_WRITE_MULTIPLE_BLOCK 25
41 #define SDCARD_ERASE_WR_BLK_START 32
42 #define SDCARD_ERASE_WR_BLK_END 33
43 #define SDCARD_ERASE 38
44 #define SDCARD_APP_CMD 55
45 #define SDCARD_READ_OCR 58
48 #define SDCARD_APP_SET_WR_BLK_ERASE_COUNT 23
49 #define SDCARD_APP_SEND_OP_COMD 41
52 #define SDCARD_STATUS_READY_STATE 0
53 #define SDCARD_STATUS_IDLE_STATE 1
54 #define SDCARD_STATUS_ILLEGAL_COMMAND 4
55 #define SDCARD_STATUS_TIMEOUT 0xff
57 #define SDCARD_DATA_START_BLOCK 0xfe
58 #define SDCARD_STOP_TRAN_TOKEN 0xfd
59 #define SDCARD_WRITE_MULTIPLE_TOKEN 0xfc
60 #define SDCARD_DATA_RES_MASK 0x1f
61 #define SDCARD_DATA_RES_ACCEPTED 0x05
63 #define SDCARD_CMD_TIMEOUT 100
64 #define SDCARD_IDLE_WAIT 100
65 #define SDCARD_BLOCK_TIMEOUT 100
75 #endif /* _AO_SDCARD_H_ */