14 #define FAT_SECTOR_SIZE 512 21 #include "../integer.h" 33 DRESULT sd_write (
const uint8_t* buff, uint32_t sector, uint16_t count);
44 #define CT_SDC (CT_SD1|CT_SD2) 48 #define MMCSD_R1_OUTOFRANGE ((uint32_t)1 << 31) 49 #define MMCSD_R1_ADDRESSERROR ((uint32_t)1 << 30) 50 #define MMCSD_R1_BLOCKLENERROR ((uint32_t)1 << 29) 51 #define MMCSD_R1_ERASESEQERROR ((uint32_t)1 << 28) 52 #define MMCSD_R1_ERASEPARAM ((uint32_t)1 << 27) 53 #define MMCSD_R1_WPVIOLATION ((uint32_t)1 << 26) 54 #define MMCSD_R1_CARDISLOCKED ((uint32_t)1 << 25) 55 #define MMCSD_R1_LOCKUNLOCKFAILED ((uint32_t)1 << 24) 56 #define MMCSD_R1_COMCRCERROR ((uint32_t)1 << 23) 57 #define MMCSD_R1_ILLEGALCOMMAND ((uint32_t)1 << 22) 58 #define MMCSD_R1_CARDECCFAILED ((uint32_t)1 << 21) 59 #define MMCSD_R1_CCERROR ((uint32_t)1 << 20) 60 #define MMCSD_R1_ERROR ((uint32_t)1 << 19) 61 #define MMCSD_R1_UNDERRUN ((uint32_t)1 << 18) 62 #define MMCSD_R1_OVERRRUN ((uint32_t)1 << 17) 63 #define MMCSD_R1_CIDCSDOVERWRITE ((uint32_t)1 << 16) 64 #define MMCSD_R1_WPERASESKIP ((uint32_t)1 << 15) 65 #define MMCSD_R1_CARDECCDISABLED ((uint32_t)1 << 14) 66 #define MMCSD_R1_ERASERESET ((uint32_t)1 << 13) 67 #define MMCSD_R1_STATE_SHIFT (9) 68 #define MMCSD_R1_STATE_MASK ((uint32_t)15 << MMCSD_R1_STATE_SHIFT) 70 # define MMCSD_R1_STATE_IDLE ((uint32_t)0 << MMCSD_R1_STATE_SHIFT) 71 # define MMCSD_R1_STATE_READY ((uint32_t)1 << MMCSD_R1_STATE_SHIFT) 72 # define MMCSD_R1_STATE_IDENT ((uint32_t)2 << MMCSD_R1_STATE_SHIFT) 74 # define MMCSD_R1_STATE_STBY ((uint32_t)3 << MMCSD_R1_STATE_SHIFT) 75 # define MMCSD_R1_STATE_TRAN ((uint32_t)4 << MMCSD_R1_STATE_SHIFT) 76 # define MMCSD_R1_STATE_DATA ((uint32_t)5 << MMCSD_R1_STATE_SHIFT) 77 # define MMCSD_R1_STATE_RCV ((uint32_t)6 << MMCSD_R1_STATE_SHIFT) 78 # define MMCSD_R1_STATE_PRG ((uint32_t)7 << MMCSD_R1_STATE_SHIFT) 79 # define MMCSD_R1_STATE_DIS ((uint32_t)8 << MMCSD_R1_STATE_SHIFT) 80 #define MMCSD_R1_READYFORDATA ((uint32_t)1 << 8) 81 #define MMCSD_R1_APPCMD ((uint32_t)1 << 5) 82 #define MMCSD_R1_AKESEQERROR ((uint32_t)1 << 3) 83 #define MMCSD_R1_ERRORMASK ((uint32_t)0xfdffe008)
DRESULT sd_write(const uint8_t *buff, uint32_t sector, uint16_t count)
DRESULT sd_read(uint8_t *buff, uint32_t sector, uint16_t count)
DRESULT sd_ioctl(uint8_t cmd, void *buff)
uint8_t sd_getSectorCount(uint32_t *ptr)