40 #define SDIO_OFFSET (SDIO_BASE - PERIPH_BASE)
45 #define CLKCR_OFFSET (SDIO_OFFSET + 0x04)
46 #define CLKEN_BitNumber 0x08
47 #define CLKCR_CLKEN_BB (PERIPH_BB_BASE + (CLKCR_OFFSET * 32) + (CLKEN_BitNumber * 4))
52 #define CMD_OFFSET (SDIO_OFFSET + 0x0C)
53 #define SDIOSUSPEND_BitNumber 0x0B
54 #define CMD_SDIOSUSPEND_BB (PERIPH_BB_BASE + (CMD_OFFSET * 32) + (SDIOSUSPEND_BitNumber * 4))
57 #define ENCMDCOMPL_BitNumber 0x0C
58 #define CMD_ENCMDCOMPL_BB (PERIPH_BB_BASE + (CMD_OFFSET * 32) + (ENCMDCOMPL_BitNumber * 4))
61 #define NIEN_BitNumber 0x0D
62 #define CMD_NIEN_BB (PERIPH_BB_BASE + (CMD_OFFSET * 32) + (NIEN_BitNumber * 4))
65 #define ATACMD_BitNumber 0x0E
66 #define CMD_ATACMD_BB (PERIPH_BB_BASE + (CMD_OFFSET * 32) + (ATACMD_BitNumber * 4))
71 #define DCTRL_OFFSET (SDIO_OFFSET + 0x2C)
72 #define DMAEN_BitNumber 0x03
73 #define DCTRL_DMAEN_BB (PERIPH_BB_BASE + (DCTRL_OFFSET * 32) + (DMAEN_BitNumber * 4))
76 #define RWSTART_BitNumber 0x08
77 #define DCTRL_RWSTART_BB (PERIPH_BB_BASE + (DCTRL_OFFSET * 32) + (RWSTART_BitNumber * 4))
80 #define RWSTOP_BitNumber 0x09
81 #define DCTRL_RWSTOP_BB (PERIPH_BB_BASE + (DCTRL_OFFSET * 32) + (RWSTOP_BitNumber * 4))
84 #define RWMOD_BitNumber 0x0A
85 #define DCTRL_RWMOD_BB (PERIPH_BB_BASE + (DCTRL_OFFSET * 32) + (RWMOD_BitNumber * 4))
88 #define SDIOEN_BitNumber 0x0B
89 #define DCTRL_SDIOEN_BB (PERIPH_BB_BASE + (DCTRL_OFFSET * 32) + (SDIOEN_BitNumber * 4))
96 #define CLKCR_CLEAR_MASK ((uint32_t)0xFFFF8100)
101 #define PWR_PWRCTRL_MASK ((uint32_t)0xFFFFFFFC)
106 #define DCTRL_CLEAR_MASK ((uint32_t)0xFFFFFF08)
111 #define CMD_CLEAR_MASK ((uint32_t)0xFFFFF800)
114 #define SDIO_RESP_ADDR ((uint32_t)(SDIO_BASE + 0x14))
163 SDIO->POWER = 0x00000000;
164 SDIO->CLKCR = 0x00000000;
165 SDIO->ARG = 0x00000000;
166 SDIO->CMD = 0x00000000;
167 SDIO->DTIMER = 0x00000000;
168 SDIO->DLEN = 0x00000000;
169 SDIO->DCTRL = 0x00000000;
170 SDIO->ICR = 0x00C007FF;
171 SDIO->MASK = 0x00000000;
194 tmpreg =
SDIO->CLKCR;
210 SDIO->CLKCR = tmpreg;
257 SDIO->POWER |= SDIO_PowerState;
316 SDIO->MASK |= SDIO_IT;
321 SDIO->MASK &= ~SDIO_IT;
399 return (uint8_t)(
SDIO->RESPCMD);
414 __IO uint32_t tmp = 0;
421 return (*(
__IO uint32_t *) tmp);
452 tmpreg =
SDIO->DCTRL;
463 SDIO->DCTRL = tmpreg;
520 return SDIO->FIFOCNT;
619 *(
__IO uint32_t *)
CMD_NIEN_BB = (uint32_t)((~((uint32_t)NewState)) & ((uint32_t)0x1));
673 if ((
SDIO->STA & SDIO_FLAG) != (uint32_t)
RESET)
709 SDIO->ICR = SDIO_FLAG;
749 if ((
SDIO->STA & SDIO_IT) != (uint32_t)
RESET)