45 #define SD_DEFAULT_BLOCK_SIZE 512
46 #define SD_REGISTER_SIZE 16
51 #define SD_INIT_ERROR_NO_CARD -1
52 #define SD_INIT_ERROR_ARCH -2
53 #define SD_INIT_ERROR_NO_IF_COND -3
54 #define SD_INIT_ERROR_NO_BLOCK_SIZE -4
56 #define SD_WRITE_ERROR_NO_CMD_RESPONSE -5
57 #define SD_WRITE_ERROR_NO_BLOCK_RESPONSE -6
58 #define SD_WRITE_ERROR_PROGRAMMING -7
59 #define SD_WRITE_ERROR_TOKEN -8
60 #define SD_WRITE_ERROR_NO_TOKEN -9
62 #define SD_READ_ERROR_NO_CMD_RESPONSE -10
63 #define SD_READ_ERROR_INVALID_SIZE -11
64 #define SD_READ_ERROR_TOKEN -12
65 #define SD_READ_ERROR_NO_TOKEN -13
68 typedef uint32_t sd_offset_t;
71 int sd_initialize(
void);
72 int sd_write(sd_offset_t,
char *,
unsigned);
73 int sd_read(sd_offset_t,
char *,
unsigned);
74 int sd_write_block(sd_offset_t,
char *);
75 int sd_read_block(sd_offset_t,
char *);
76 sd_offset_t sd_get_capacity(
void);
77 char *sd_error_string(
int);