Rev 384 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
24 | StephanB | 1 | #ifndef _SDC_H |
2 | #define _SDC_H |
||
1 | ingob | 3 | |
4 | |||
5 | //________________________________________________________________________________________________________________________________________ |
||
6 | // |
||
24 | StephanB | 7 | // Functions needed for accessing the sdcard. |
1 | ingob | 8 | // |
9 | //________________________________________________________________________________________________________________________________________ |
||
10 | |||
24 | StephanB | 11 | typedef enum |
12 | { |
||
13 | SD_SUCCESS = 0, |
||
14 | SD_ERROR_NOCARD, |
||
15 | SD_ERROR_RESET, |
||
16 | SD_ERROR_INITIALIZE, |
||
17 | SD_ERROR_BAD_RESPONSE, |
||
18 | SD_ERROR_BAD_VOLTAGE_RANGE, |
||
19 | SD_ERROR_NO_SDCARD, |
||
20 | SD_ERROR_TIMEOUT, |
||
21 | SD_ERROR_CRC_DATA, |
||
22 | SD_ERROR_WRITE_DATA, |
||
23 | SD_ERROR_READ_DATA, |
||
24 | SD_ERROR_SET_BLOCKLEN, |
||
25 | SD_ERROR_UNKNOWN |
||
26 | } SD_Result_t; |
||
1 | ingob | 27 | |
41 | ingob | 28 | SD_Result_t SDC_Init(void); |
29 | SD_Result_t SDC_GetSector (u32 ,u8 *); |
||
30 | SD_Result_t SDC_PutSector (u32, const u8 *); |
||
31 | SD_Result_t SDC_Deinit(void); |
||
1 | ingob | 32 | |
362 | holgerb | 33 | typedef enum |
34 | { |
||
35 | VER_UNKNOWN, |
||
36 | VER_1X, |
||
37 | VER_20 |
||
38 | } SDVersion_t; |
||
39 | |||
40 | typedef struct |
||
41 | { |
||
42 | u8 Valid; |
||
43 | SDVersion_t Version; // HW-Version |
||
44 | u32 Capacity; // Memory capacity in bytes |
||
45 | u8 CID[16]; // CID register |
||
46 | u8 CSD[16]; // CSD register |
||
47 | } __attribute__((packed)) SDCardInfo_t; |
||
48 | |||
49 | extern volatile SDCardInfo_t SDCardInfo; |
||
384 | ingob | 50 | extern u8 SDCardWriteRetryCounterMax; |
362 | holgerb | 51 | |
24 | StephanB | 52 | #endif // _SDC_H |
1 | ingob | 53 | |
54 |