Datasheet

878
SAM4S Series [DATASHEET]
11100F–ATARM–29-Jan-14
Figure 38-8. Read Functional Flow Diagram
Note: 1. It is assumed that this command has been correctly sent (see Figure 38-7).
Read status register HSMCI_SR
Send SELECT/DESELECT_CARD
command
(1)
to select the card
Send SET_BLOCKLEN command
(1)
Read with PDC
Reset the PDCMODE bit
HSMCI_MR &= ~PDCMODE
Set the block length (in bytes)
HSMCI_BLKR |= (BlockLength <<16)
Number of words to read = 0 ?
Poll the bit
RXRDY = 0?
Read data = HSMCI_RDR
Number of words to read =
Number of words to read -1
Send READ_SINGLE_BLOCK
command
(1)
Yes
Set the PDCMODE bit
HSMCI_MR |= PDCMODE
Set the block length (in bytes)
HSMCI_BLKR |= (BlockLength << 16)
Configure the PDC channel
HSMCI_RPR = Data Buffer Address
HSMCI_RCR = BlockLength/4
HSMCI_PTCR = RXTEN
Send READ_SINGLE_BLOCK
command
(1)
Read status register HSMCI_SR
Poll the bit
ENDRX = 0?
Yes
RETURN
RETURN
YesNo
No
No
Yes
No
Number of words to read = BlockLength/4