©Copyright 2000-2007 SD Card Association

SDIO Simplified Specification Version 2.00

5.New I/O Read/Write Commands

Two additional data transfer instructions have been added to support I/O. IO_RW_DIRECT, a direct I/O command similar to the MMC 'Fast I/O' command, and IO_RW_EXTENDED, which allows fast access with byte or block addresses. Both commands are in class 9 (I/O Commands).

5.1IO_RW_DIRECT Command (CMD52)

The IO_RW_DIRECT is the simplest means to access a single register within the total 128K of register space in any I/O function, including the common I/O area (CIA). This command reads or writes 1 byte using only 1 command/response pair. A common use is to initialize registers or monitor status values for I/O functions. This command is the fastest means to read or write single I/O registers, as it requires only a single command/response pair.

S

D

Command

Index

110100b

R/W

flag

Function Number

RAW

flag

Stuff

Register Address

Stuff

Write Data or Stuff Bits

CRC7

E

1

1

6

1

3

1

1

17

1

8

7

1

Figure 5-1 IO_RW_DIRECT Command

The IO_RW_DIRECT Command contains the following fields:

S(tart bit):

Start bit. Always 0

D(irection):

Direction. Always1 indicates transfer host to card.

Command Index:

Identifies the “IO_RW_DIRECT” command with a value of 110100b

R/W Flag:

This bit determines the direction of the I/O operation. If this bit is 0, this command

 

shall read data from the SDIO card at the address specified by the Function Number

 

and the Register Address to the host. The data byte is returned in the response, R5.

 

If this bit is set to 1, the command shall write the bytes in the Write Data field to the

 

I/O location addressed by the Function Number and the Register Address. If the

 

RAW flag is 0, then the data in the register that was written shall be read and that

 

value returned in the response.

RAW Flag:

The Read after Write flag. If this bit is set to 1 and the R/W flag is set to 1, then the

 

command shall read the value of the register after the write. This is useful to allow

 

writing to a control register and reading the status at the same address. If this bit is

 

cleared, the value returned in the R5 response shall be the same as the write data in

 

the command. If this bit is set, the data field of the R5 response shall contain the

 

value read from the addressed register after the write operation.

Function Number:

The number of the function within the I/O card you wish to read or write. Note that

 

function 0 selects the common I/O area (CIA).

Register Address:

This is the address of the byte of data inside of the selected function to read or write.

 

There are 17 bits of address available so the register is located within the first 128K

 

(131,072) addresses of that function.

Write Data/Stuff Bits:

For a direct write command (R/W=1), this is the byte that is written to the selected

 

address. For a direct read (R/W=0), this field is not used and shall be set to 0.

CRC7:

7 bits of CRC data

E(nd bit):

End bit, always 1

21

Page 30
Image 30
SDI Technologies SDIO Card manual New I/O Read/Write Commands, Iorwdirect Command CMD52