Atmel SAM4S-XPLD Atmel ATSAM4S-XPLD ATSAM4S-XPLD Scheda Tecnica

Codici prodotto
ATSAM4S-XPLD
Pagina di 1125
 816
SAM4S [DATASHEET]
11100E–ATARM–24-Jul-13
The following flowchart shows how to send a command to the card and read the response if needed. In this example, the
status register bits are polled but setting the appropriate bits in the Interrupt Enable Register (HSMCI_IER) allows using
an interrupt method.
Figure 37-7. Command/Response Functional Flow Diagram 
RETURN OK
RETURN ERROR
(1)
RETURN OK
Set the command argument
HSMCI_ARGR = Argument
(1)
Set the command
HSMCI_CMDR = Command
Read HSMCI_SR
CMDRDY
Status error flags?
Read response if required
Yes
Wait for command
ready status flag
Check error bits in the 
status register 
(1)
0
1
Does the command involve
a busy indication?
No
Read HSMCI_SR
0
NOTBUSY
1