GD32F403xx User Manual
504
CS_Receive
Receive the response and check the CRC.
1.Response Received in CE-ATA mode and
interrupt disabled and wait for CE-ATA Command
Completion signal enabled
→
CS_Waitcompl
2.Response Received in CE-ATA mode and
interrupt disabled and wait for CE-ATA Command
Completion signal disabled
→
CS_Pend
3.CSM disabled
→
CS_Idle
4.Response received
→
CS_Idle
5.Command CRC failed
→
CS_Idle
CS_Waitcompl
Wait for the Command Completion signal.
1.CE-ATA Command Completion signal received
→
CS_Idle
2.CSM disabled
→
CS_Idle
3.Command CRC failed
→
CS_Idle
Data unit
The data unit performs data transfers to and from cards. The data transfer uses
SDIO_DAT[7:0] signals when 8-bits data width (BUSMODE bits in SDIO_CLKCTL register is
0b10), use SDIO_DAT[3:0] signals when 4-bits data width (BUSMODE bits in SDIO_CLKCTL
register is 0b01), or SDIO_DAT[0] signal when 1-bit data width (BUSMODE bits in
SDIO_CLKCTL register is 0b00). The data transfer flow is controlled by Date State Machine
(DSM). After a write operation to SDIO_DATACTL register and DATAEN in SDIO_DATACTL
register is 1, the data transfer starts. It sends data to card when DATADIR in SDIO_DATACTL
register is 0, or receive data from card when DATADIR in SDIO_DATACTL register is 1. The
data unit also generates the data status flags defined in SDIO_STAT register.
Data state machine
DS_Idle
The data unit is inactive, waiting for send and receive.
1.DSM enabled and data transfer direction is from
host to card
→
DS_WaitS
2.DSM enabled and data transfer direction is from
card to host
→
DS_WaitR
3.DSM enabled and Read Wait Started and SD I/O
mode enabled
→
DS_Readwait
DS_WaitS
Wait until the data FIFO empty flag is deasserted or data
transfer ended.
1.Data transfer ended
→
DS_Idle
2.DSM disabled
→
DS_Idle
3.Data FIFO empty flag is deasserted
→
DS_Send