38 #define SDIO_CMD_INT_MSK 0xA146
39 #define SDIO_DATA_INT_MSK 0xBE88
40 #define SDIO_CARD_INT_MSK (1UL << 16)
72 sdioif->fnum = (val >> 28) & 7;
87 for(i = 0; i < 100; i++){
93 if(val & (1UL << 31)){
101 if(val & (1UL << 31)){
118 if((
sdioif->response[0] & 0x0000e000) != 0){
129 sdioif->response[0] &= 0xffff0000;
170 tmp = blkSize & 0xFF;
179 sdioif->blkSz[func] = asz;
189 return sdioif->blkSz[func];
194 uint32_t dest_addr,
const uint8_t *src_addr,
195 uint32_t size, uint32_t flags)
198 uint32_t bs = size, bsize = size;
199 uint32_t cmd =
CMD53 | (1UL << 10);
204 if (bsize > 512 || bsize == 0)
222 ret =
SDIO_Send_Command(pSDMMC, cmd, (func << 28) | (dest_addr << 9) | (bsize & 0x1FF) | (1UL << 31) | (flags & (0x3 << 26)));
226 if(
sdioif->response[0] & 0xcb00){
242 uint32_t bs = size, bsize = size;
243 uint32_t cmd =
CMD53;
248 if (bsize > 512 || bsize == 0)
265 ret =
SDIO_Send_Command(pSDMMC, cmd | (1 << 13), (func << 28) | (src_addr << 9) | (bsize & 0x1FF) | (flags & (0x3 << 26)));
269 if(
sdioif->response[0] & 0xcb00){
293 val |= (1 << func) | 1;
364 if ((val & 0x03) == 3) {
389 if(
sdioif->response[0] & 0xcb00){
398 return data != (
sdioif->response[0] & 0xFF);
406 ret =
SDIO_Send_Command(pSDMMC,
CMD52, (func << 28) | (1 << 27) | (addr << 9) | ((*data) & 0xFF) | (1UL << 31));
410 if(
sdioif->response[0] & 0xcb00){
419 *data =
sdioif->response[0] & 0xFF;
431 if(
sdioif->response[0] & 0xcb00){
440 *data =
sdioif->response[0] & 0xFF;
457 uint32_t imsk = pSDMMC->
INTMASK;
481 uint32_t status = pSDMMC->
MINTSTS;
494 }
else if (status & 4) {
504 }
else if (status & 8) {