Atmel Evaluation Kit AT91SAM9X35-EK AT91SAM9X35-EK Data Sheet

Product codes
AT91SAM9X35-EK
Page of 1301
588
SAM9X35 [DATASHEET]
11055E–ATARM–10-Mar-2014
Figure 34-10. Read Multiple Block and Write Multiple Block 
).
2. Handle errors reported in HSMCI_SR.
34.8.5 WRITE_SINGLE_BLOCK Operation using DMA Controller
1.
Wait until the current command execution has successfully terminated.
3. Check that CMDRDY and NOTBUSY fields are asserted in HSMCI_SR
2.
Program the block length in the card. This value defines the value block_length.
3.
Program the block length in the HSMCI Configuration Register with block_length value.
Send  SELECT/DESELECT_CARD
command
(1)
  to select the card
Send SET_BLOCKLEN command
(1)
 
Set the block length
HSMCI_MR |= (BlockLength << 16)
Set the DMAEN bit
HSMCI_DMA |= DMAEN
Configure the HDMA channel X
DMAC_SADDRx and DMAC_DADDRx
DMAC_BTSIZE = BlockLength/4
Send WRITE_MULTIPLE_BLOCK or
READ_MULTIPLE_BLOCK command
(1)
Read status register DMAC_EBCISR
and Poll Bit CBTC[X]
New Buffer ?
(2)
No
DMAC_CHEN[X] = TRUE
Poll the bit
XFRDONE = 1
No
RETURN
Yes
Send STOP_TRANSMISSION
command
(1)
Yes
Read status register HSMCI_SR
and Poll Bit FIFOEMPTY