![ARTERY AT32F435 Series Скачать руководство пользователя страница 566](http://html1.mh-extra.com/html/artery/at32f435-series/at32f435-series_reference-manual_2977592566.webp)
AT32F435/437
Series Reference Manual
2022.11.11
Page 566
Rev 2.03
and then program the SDIO data control register (SDIO_DTCTRL): TFREN=1 (enable the
SDIO card host to send data), TFRDIR=0 (from the controller to the card), TFRMODE=0
(block data transfer), DMAEN=1 (enable DMA), BLKSIZE=9 (512 bytes), and wait from
SDIO_STS [10]=DTBLKCMPL.
6.
Check that no channels are still enabled by confirming the DMA channel enable SDIO status
register (SDIO_STS)
25.3.3.4 Hardware flow control
The HFCEN bit is set in the SDIO_CLKCTRL register to enable hardware flow control, which is sued to
avoid BUF underflow and overflow errors. Read/write access to the BUF is still active even if flow control
is enabled.
25.3.4 SDIO I/O card-specific operations
The SDIO can support the following operations (except read suspend, for it does not require specific
hardware operation) when the SDIO_DTCTRL [11] is set.
SDIO read wait operation by SDIO_D2 signal lines
The optional read wait operation is used only for SD card 1-bit or 4-bit mode. The read wait operation
can instruct the host to stop data transfer temporarily while the host is reading from multiple registers
(IO_RW_EXTENDED, CMD53), and also allows the host to send commands to other functions in the
SD I/O device in order to start a read wait process after the reception of the first data block. The detailed
process as follows:
Enable data path (SDIO_DTCTRL [0] = 1)
Enable SDIO-specific operation (SDIO_DTCTRL [11] = 1)
Start read wait (SDIO_DTCTRL [10]=0 and SDIO_DTCTRL [8]=1)
Data direction is from a card to the SDIO host (SDIO_DTCTRL [1]=1)
The data unit in the SDIO adapter will enter read wait state, and drive the SDIO_D2 to 0 after 2
SDIO_CK cycles
The data unit starts waiting to receive data from a card. The DCSM will not enter read wait even
if read wait start is set. The read wait process will start after the CRC is received. The RDWTSTOP
has to be cleared to start a new read wait operation.
During the read wait period, the SDIO host can detect the SDIO interrupts over the SDIO_D1.
SDIO read wait operation by stopping clock
If the SDIO card does not support the mentioned above read wait operation, the SDIO can enter a read
wait by stopping SDIO_CK, described as follows:
Enable data path (SDIO_DTCTRL [0] = 1)
Enable SDIO-specific operation (SDIO_DTCTRL [11] = 1)
Start read wait (SDIO_DTCTRL [10]=0 and SDIO_DTCTRL [8]=1)
The DCSM stops the clock two SDIO_CK cycles after the end bit of the current received data block and
starts the clock again after the read wait end bit is set.
Note that as the SDIO_CK is stopped, the SDIO host cannot send any command to the card. The SDIO
host can detect the SDIO interrupt over the SDIO_D1.
SDIO suspend/resume operation (write and read operation suspend)
To free the bus to provide higher-priority transfers for other functions or memories, the host can suspend
data transfer to certain functions or memories. As soon as the higher-priority transfer is completed, the
previous transfer operation will restart at the suspended location.
While sending data to a card, the SDIO can suspend the write operation. The SDIO_CMD [11] bit is set
and indicates to the CCSM that the current command is a suspend command. The CCSM analyzes the
response and when an ACK signal is received from the card (suspend accepted), it acknowledges the
DCSM that enters the idle state after receiving the CRC of the current data block.