vr1.1

Dependencies:   FreescaleIAP mbed-rtos mbed

Fork of CDMS_RTOS_v1_1 by Team Fox

Committer:
cholletisaik777
Date:
Tue Jun 16 13:06:19 2015 +0000
Revision:
4:cc85cfaa2086
Parent:
0:d6e3d1e21484
Child:
7:c270a9e37290
WROTE SD FUNCTION

Who changed what in which revision?

UserRevisionLine numberNew contents of line
cholletisaik777 0:d6e3d1e21484 1 #include "mbed.h"
cholletisaik777 0:d6e3d1e21484 2 #include "mbed_debug.h"
cholletisaik777 0:d6e3d1e21484 3
cholletisaik777 0:d6e3d1e21484 4
cholletisaik777 0:d6e3d1e21484 5 #define SD_COMMAND_TIMEOUT 5000
cholletisaik777 0:d6e3d1e21484 6
cholletisaik777 0:d6e3d1e21484 7 #define SD_DBG 0
cholletisaik777 0:d6e3d1e21484 8
cholletisaik777 0:d6e3d1e21484 9 #define R1_IDLE_STATE (1 << 0)
cholletisaik777 0:d6e3d1e21484 10 #define R1_ERASE_RESET (1 << 1)
cholletisaik777 0:d6e3d1e21484 11 #define R1_ILLEGAL_COMMAND (1 << 2)
cholletisaik777 0:d6e3d1e21484 12 #define R1_COM_CRC_ERROR (1 << 3)
cholletisaik777 0:d6e3d1e21484 13 #define R1_ERASE_SEQUENCE_ERROR (1 << 4)
cholletisaik777 0:d6e3d1e21484 14 #define R1_ADDRESS_ERROR (1 << 5)
cholletisaik777 0:d6e3d1e21484 15 #define R1_PARAMETER_ERROR (1 << 6)
cholletisaik777 0:d6e3d1e21484 16
cholletisaik777 0:d6e3d1e21484 17
cholletisaik777 0:d6e3d1e21484 18 int initialise_card();
cholletisaik777 0:d6e3d1e21484 19 int initialise_card_v1();
cholletisaik777 0:d6e3d1e21484 20 int initialise_card_v2();
cholletisaik777 0:d6e3d1e21484 21 int disk_initialize();
cholletisaik777 4:cc85cfaa2086 22 int FUNC_WR_SD(const uint8_t *, uint64_t);
cholletisaik777 4:cc85cfaa2086 23 int FUNC_RD_SD(uint8_t *, uint64_t);
cholletisaik777 0:d6e3d1e21484 24 int cmd(int, int);
cholletisaik777 0:d6e3d1e21484 25 int cmd58();
cholletisaik777 0:d6e3d1e21484 26 int cmdx(int, int);
cholletisaik777 0:d6e3d1e21484 27 int cmd8();
cholletisaik777 4:cc85cfaa2086 28 int *FUNC_INIT_SD();
cholletisaik777 0:d6e3d1e21484 29
cholletisaik777 0:d6e3d1e21484 30 uint64_t sd_sectors();
cholletisaik777 0:d6e3d1e21484 31
cholletisaik777 0:d6e3d1e21484 32
cholletisaik777 0:d6e3d1e21484 33 int read(uint8_t*, uint32_t );
cholletisaik777 0:d6e3d1e21484 34 int write(const uint8_t*, uint32_t );
cholletisaik777 0:d6e3d1e21484 35 static uint32_t ext_bits(unsigned char *, int , int );
cholletisaik777 0:d6e3d1e21484 36
cholletisaik777 0:d6e3d1e21484 37
cholletisaik777 0:d6e3d1e21484 38
cholletisaik777 0:d6e3d1e21484 39
cholletisaik777 0:d6e3d1e21484 40 #define SDCARD_FAIL 0
cholletisaik777 0:d6e3d1e21484 41 #define SDCARD_V1 1
cholletisaik777 0:d6e3d1e21484 42 #define SDCARD_V2 2
cholletisaik777 0:d6e3d1e21484 43 #define SDCARD_V2HC 3
cholletisaik777 0:d6e3d1e21484 44
cholletisaik777 0:d6e3d1e21484 45
cholletisaik777 0:d6e3d1e21484 46
cholletisaik777 0:d6e3d1e21484 47
cholletisaik777 0:d6e3d1e21484 48