Atmel Evaluation Kit AT91SAM9X35-EK AT91SAM9X35-EK Data Sheet
Product codes
AT91SAM9X35-EK
585
SAM9X35 [DATASHEET]
11055E–ATARM–10-Mar-2014
Figure 34-8. Read Functional Flow Diagram
Notes: 1. It is assumed that this command has been correctly sent (see
).
2. This field is also accessible in the HSMCI Block Register (HSMCI_BLKR).
Read status register HSMCI_SR
Send SELECT/DESELECT_CARD
command
(1)
to select the card
Send SET_BLOCKLEN command
(1)
Read with DMAC
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 DMAEN bit
HSMCI_DMA |= DMAEN
Set the block length (in bytes)
HSMCI_BLKR |= (BlockLength << 16)
HSMCI_DMA |= DMAEN
Set the block length (in bytes)
HSMCI_BLKR |= (BlockLength << 16)
(2)
Configure the DMA channel X
DMAC_SADDRx = Data Address
DMAC_BTSIZE = BlockLength/4
DMACHEN[X] = TRUE
DMAC_SADDRx = Data Address
DMAC_BTSIZE = BlockLength/4
DMACHEN[X] = TRUE
Send READ_SINGLE_BLOCK
command
(1)
Read status register HSMCI_SR
Poll the bit
XFRDONE = 0?
Yes
RETURN
RETURN
Yes
No
No
No
Yes
No
Number of words to read = BlockLength/4
Reset the DMAEN bit
HSMCI_DMA &= ~DMAEN
Set the block length (in bytes)
HSMCI_MR l= (BlockLength<<16) (2)
Set the block count (if neccessary)
HSMCI_BLKR l= (BlockCount<<0)
HSMCI_DMA &= ~DMAEN
Set the block length (in bytes)
HSMCI_MR l= (BlockLength<<16) (2)
Set the block count (if neccessary)
HSMCI_BLKR l= (BlockCount<<0)