![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
things are working
Dependencies: FreescaleIAP mbed-rtos mbed
Fork of CDMS_DEC_2016_jan by
cdms_sd.h@4:560716ec8414, 2016-01-23 (annotated)
- Committer:
- cholletisaik777
- Date:
- Sat Jan 23 11:33:47 2016 +0000
- Revision:
- 4:560716ec8414
- Parent:
- 1:ad3b8a8032e2
things are working
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
cholletisaik777 | 0:bcbd76c86cde | 1 | #include "mbed.h" |
cholletisaik777 | 0:bcbd76c86cde | 2 | #include "mbed_debug.h" |
cholletisaik777 | 0:bcbd76c86cde | 3 | |
cholletisaik777 | 0:bcbd76c86cde | 4 | #define SD_COMMAND_TIMEOUT 5000 |
cholletisaik777 | 0:bcbd76c86cde | 5 | |
cholletisaik777 | 0:bcbd76c86cde | 6 | #define SD_DBG 0 |
cholletisaik777 | 0:bcbd76c86cde | 7 | |
cholletisaik777 | 0:bcbd76c86cde | 8 | #define R1_IDLE_STATE (1 << 0) |
cholletisaik777 | 0:bcbd76c86cde | 9 | #define R1_ERASE_RESET (1 << 1) |
cholletisaik777 | 0:bcbd76c86cde | 10 | #define R1_ILLEGAL_COMMAND (1 << 2) |
cholletisaik777 | 0:bcbd76c86cde | 11 | #define R1_COM_CRC_ERROR (1 << 3) |
cholletisaik777 | 0:bcbd76c86cde | 12 | #define R1_ERASE_SEQUENCE_ERROR (1 << 4) |
cholletisaik777 | 0:bcbd76c86cde | 13 | #define R1_ADDRESS_ERROR (1 << 5) |
cholletisaik777 | 0:bcbd76c86cde | 14 | #define R1_PARAMETER_ERROR (1 << 6) |
cholletisaik777 | 0:bcbd76c86cde | 15 | |
pradeepvk2208 | 1:ad3b8a8032e2 | 16 | |
pradeepvk2208 | 1:ad3b8a8032e2 | 17 | |
pradeepvk2208 | 1:ad3b8a8032e2 | 18 | #define SD_MAX_CYCLES 10000 |
pradeepvk2208 | 1:ad3b8a8032e2 | 19 | |
pradeepvk2208 | 1:ad3b8a8032e2 | 20 | extern uint8_t SD_INIT_FLAGS; |
pradeepvk2208 | 1:ad3b8a8032e2 | 21 | |
pradeepvk2208 | 1:ad3b8a8032e2 | 22 | |
pradeepvk2208 | 1:ad3b8a8032e2 | 23 | |
cholletisaik777 | 0:bcbd76c86cde | 24 | int initialise_card(); |
cholletisaik777 | 0:bcbd76c86cde | 25 | int initialise_card_v1(); |
cholletisaik777 | 0:bcbd76c86cde | 26 | int initialise_card_v2(); |
cholletisaik777 | 0:bcbd76c86cde | 27 | int disk_write(const uint8_t *, uint64_t); |
cholletisaik777 | 0:bcbd76c86cde | 28 | int disk_read(uint8_t *, uint64_t); |
cholletisaik777 | 0:bcbd76c86cde | 29 | int disk_initialize(); |
cholletisaik777 | 0:bcbd76c86cde | 30 | int disk_erase(int,int); |
cholletisaik777 | 0:bcbd76c86cde | 31 | |
cholletisaik777 | 0:bcbd76c86cde | 32 | //void FCTN_CDMS_INIT_SD(); |
cholletisaik777 | 0:bcbd76c86cde | 33 | //int FCTN_CDMS_WR_SD(const uint8_t *, uint64_t); |
cholletisaik777 | 0:bcbd76c86cde | 34 | //int FCTN_CDMS_RD_SD(uint8_t *, uint64_t); |
pradeepvk2208 | 1:ad3b8a8032e2 | 35 | uint32_t FCTN_SD_MNGR(uint8_t); |
cholletisaik777 | 0:bcbd76c86cde | 36 | int cmd(int, int); |
cholletisaik777 | 0:bcbd76c86cde | 37 | int cmd58(); |
cholletisaik777 | 0:bcbd76c86cde | 38 | int cmdx(int, int); |
cholletisaik777 | 0:bcbd76c86cde | 39 | int cmd8(); |
cholletisaik777 | 0:bcbd76c86cde | 40 | int read(uint8_t*, uint32_t ); |
cholletisaik777 | 0:bcbd76c86cde | 41 | int write(const uint8_t*, uint32_t ); |
cholletisaik777 | 0:bcbd76c86cde | 42 | static uint32_t ext_bits(unsigned char *, int , int ); |
pradeepvk2208 | 1:ad3b8a8032e2 | 43 | int SD_WRITE(uint8_t*,uint32_t,uint8_t); |
pradeepvk2208 | 1:ad3b8a8032e2 | 44 | void FCTN_CDMS_SD_INIT(); |
pradeepvk2208 | 1:ad3b8a8032e2 | 45 | int SD_READ(uint8_t*,uint32_t,uint8_t); |
cholletisaik777 | 0:bcbd76c86cde | 46 | #define SDCARD_FAIL 0 |
cholletisaik777 | 0:bcbd76c86cde | 47 | #define SDCARD_V1 1 |
cholletisaik777 | 0:bcbd76c86cde | 48 | #define SDCARD_V2 2 |
cholletisaik777 | 0:bcbd76c86cde | 49 | #define SDCARD_V2HC 3 |