![NXP Semiconductors LPC43Sxx Скачать руководство пользователя страница 578](http://html1.mh-extra.com/html/nxp-semiconductors/lpc43sxx/lpc43sxx_user-manual_1721827578.webp)
UM10503
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2015. All rights reserved.
User manual
Rev. 2.1 — 10 December 2015
578 of 1441
NXP Semiconductors
UM10503
Chapter 22: LPC43xx/LPC43Sxx SD/MMC interface
The following functions can be implemented by programming the appropriate bits in the
CCCR register (Function 0) of the SDIO card. To read from or write to the CCCR register,
use the CMD52 command.
1. SUSPEND data transfer - Non-data command.
–
Check if the SDIO card supports the SUSPEND/RESUME protocol; this can be
done through the SBS bit in the CCCR register @0x08 of the card.
Check if the data transfer for the required function number is in process; the
function number that is currently active is reflected in bits 0-3 of the CCCR register
@0x0D. Note that if the BS bit (address 0xc::bit 0) is 1, then only the function
number given by the FSx bits is valid.
To suspend the transfer, set BR (bit 2) of the CCCR register @0x0C.
Poll for clear status of bits BR (bit 1) and BS (bit 0) of the CCCR @0x0C. The BS
(Bus Status) bit is 1 when the currently-selected function is using the data bus; the
BR (Bus Release) bit remains 1 until the bus release is complete. When the BR
and BS bits are 0, the data transfer from the selected function has been
suspended.
During a read-data transfer, the Module can be waiting for the data from the card. If
the data transfer is a read from a card, then the Module must be informed after the
successful completion of the SUSPEND command. The Module then resets the
data state machine and comes out of the wait state. To accomplish this, set
abort_read_data (bit 8) in the Control register.
Wait for data completion. Get pending bytes to transfer by reading the TCBCNT
register @0x5C.
2. RESUME data transfer - This is a data command.
–
Check that the card is not in a transfer state, which confirms that the bus is free for
data transfer.
If the card is in a disconnect state, select it using CMD7. The card status can be
retrieved in response to CMD52/CMD53 commands.
Check that a function to be resumed is ready for data transfer; this can be
confirmed by reading the RFx flag in CCCR @0x0F. If RF = 1, then the function is
ready for data transfer.
To resume transfer, use CMD52 to write the function number at FSx bits (0-3) in the
CCCR register @0x0D. Form the command argument for CMD52 and write it in
CMDARG @0x28; bit values are listed in
.
–
Write the block size in the BLKSIZ register @0x1C; data will be transferred in units
of this block size.
Write the byte count in the BYTCNT register @0x20. This is the total size of the
data; that is, the remaining bytes to be transferred. It is the responsibility of the
software to handle the data.
Program Command register; similar to a block transfer. For details, refer to
"Single-Block or Multiple-Block Read" and "Single-Block or Multiple-Block Write".
When the Command register is programmed, the command is sent and the
function resumes data transfer. Read the DF flag (Resume Data Flag). If it is 1,
then the function has data for the transfer and will begin a data transfer as soon as
the function or memory is resumed. If it is 0, then the function has no data for the
transfer.