34 #if !defined(CHIP_LPC175X_6X)
39 #define CMD_TIMEOUT (0x10000)
40 #define DATA_TIMEOUT (0x1000000)
41 #define DATA_TIMER_VALUE_R (SDC_TRAN_CLOCK_RATE / 4) // 250ms
42 #define DATA_TIMER_VALUE_W (SDC_TRAN_CLOCK_RATE) // 1000ms
43 #define MS_ACQUIRE_DELAY (100)
157 while (RetryCnt > 0) {
190 while (RetryCnt > 0) {
212 while (RetryCnt > 0) {
215 *pOCR = Response.
Data[0];
243 while (RetryCnt > 0) {
276 while (RetryCnt > 0) {
279 pCID[3] = Response.
Data[0];
280 pCID[2] = Response.
Data[1];
281 pCID[1] = Response.
Data[2];
282 pCID[0] = Response.
Data[3];
297 while (RetryCnt > 0) {
316 while (RetryCnt > 0) {
341 while (RetryCnt > 0) {
344 pCSD[3] = Response.
Data[0];
345 pCSD[2] = Response.
Data[1];
346 pCSD[1] = Response.
Data[2];
347 pCSD[0] = Response.
Data[3];
362 while (RetryCnt > 0) {
382 while (RetryCnt > 0) {
386 *pStatus = Response.
Data[0];
399 uint8_t RetryCnt = 0x20;
401 while (RetryCnt > 0) {
424 if (i == (start >> 5)) {
428 v = ((data[i] << (32 - j)) | (data[start >> 5] >> j));
431 return v & ((1 << (end - start + 1)) - 1);
438 int32_t CSizeMult = 0;
447 pCardInfo->
blocknr = CSize << 10;
453 Mult = 1 << (CSizeMult + 2);
454 pCardInfo->
blocknr = (CSize + 1) * Mult;
470 uint8_t RetryCnt = 0x20;
472 while (RetryCnt > 0) {
534 uint8_t RetryCnt = 0x20;
536 while (RetryCnt > 0) {
575 uint8_t RetryCnt = 0x20;
587 Argument = startBlock;
590 Argument = startBlock << 9;
593 while (RetryCnt > 0) {
594 Ret =
executeCmd(pSDC, Command, Argument, &Response);
610 uint8_t RetryCnt = 0x20;
621 Argument = startBlock;
624 Argument = startBlock << 9;
628 while (RetryCnt > 0) {
629 Ret =
executeCmd(pSDC, Command, Argument, &Response);
661 while (RetryCnt > 0) {
754 volatile int32_t Ret;
775 uint16_t ByteNum = 64;
784 #ifdef SDC_DMA_ENABLE
797 Event.
Size = ByteNum;
807 #ifdef SDC_DMA_ENABLE
829 #ifdef SDC_DMA_ENABLE
925 if (pCardInfo->
cid[0]) {
941 return (pCardInfo->
cid[0]) ? 1 : 0;
957 if (( startBlock < 0) || ( (startBlock + blockNum) > pCardInfo->
blocknr) ) {
966 #ifdef SDC_DMA_ENABLE
979 Event.
Size = ByteNum;
989 #ifdef SDC_DMA_ENABLE
1010 #ifdef SDC_DMA_ENABLE
1038 if (( startBlock < 0) || ( (startBlock + blockNum) > pCardInfo->
blocknr) ) {
1055 #ifdef SDC_DMA_ENABLE
1069 Event.
Size = ByteNum;
1079 #ifdef SDC_DMA_ENABLE
1092 #ifdef SDC_DMA_ENABLE