![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
hi
Dependencies: FreescaleIAP mbed-rtos mbed
Diff: cdms_sd.h
- Revision:
- 0:bcbd76c86cde
diff -r 000000000000 -r bcbd76c86cde cdms_sd.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cdms_sd.h Wed Dec 16 09:06:59 2015 +0000 @@ -0,0 +1,41 @@ +#include "mbed.h" +#include "mbed_debug.h" + +#define SD_COMMAND_TIMEOUT 5000 + +#define SD_DBG 0 + +#define R1_IDLE_STATE (1 << 0) +#define R1_ERASE_RESET (1 << 1) +#define R1_ILLEGAL_COMMAND (1 << 2) +#define R1_COM_CRC_ERROR (1 << 3) +#define R1_ERASE_SEQUENCE_ERROR (1 << 4) +#define R1_ADDRESS_ERROR (1 << 5) +#define R1_PARAMETER_ERROR (1 << 6) + +int initialise_card(); +int initialise_card_v1(); +int initialise_card_v2(); +int disk_write(const uint8_t *, uint64_t); +int disk_read(uint8_t *, uint64_t); +int disk_initialize(); +int disk_erase(int,int); + +//void FCTN_CDMS_INIT_SD(); +//int FCTN_CDMS_WR_SD(const uint8_t *, uint64_t); +//int FCTN_CDMS_RD_SD(uint8_t *, uint64_t); +void FCTN_SD_MNGR(); + + +int cmd(int, int); +int cmd58(); +int cmdx(int, int); +int cmd8(); +int read(uint8_t*, uint32_t ); +int write(const uint8_t*, uint32_t ); +static uint32_t ext_bits(unsigned char *, int , int ); + +#define SDCARD_FAIL 0 +#define SDCARD_V1 1 +#define SDCARD_V2 2 +#define SDCARD_V2HC 3 \ No newline at end of file