things are working

Dependencies:   FreescaleIAP mbed-rtos mbed

Fork of CDMS_DEC_2016_jan by Team Fox

cdms_sd.h

Committer:
cholletisaik777
Date:
2015-12-16
Revision:
0:bcbd76c86cde
Child:
1:ad3b8a8032e2

File content as of revision 0:bcbd76c86cde:

#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