
Chapter 2. Endpoint Zero Page 2-13
Figure 2-5. Using Setup Data Pointer (SUDPTR) for Get_Descriptor Requests
Figure 2-5 illustrates use of the Setup Data Pointer. This pointer is implemented as two registers,
SUDPTRH and SUDPTRL. Most Get Descriptor requests involve transferring more data than fits
into one packet. In the Figure 2-5 example, the descriptor data consists of 91 bytes.
The CONTROL transaction starts in the usual way, with theFX2 automatically transferring the eight
bytes from the SETUP packet into RAM at SETUPDAT, then asserting the SUDAV interrupt
request. The firmware decodes the
Get Descriptor
request, and responds by clearing the HSNAK
bit (
by writing 1 to it
), and then loading the SUDPTRH:L registers with the address of the requested
descriptor. Loading the SUDPTRL register causes the FX2 to automatically respond to two IN
transfers with 64 bytes and 27 bytes of data using SUDPTR as a base address, and then to
respond to the STATUS stage with an ACK.
The usual endpoint-zero interrupts SUDAV and EP0IN remain active during this automated trans-
fer, so firmware will normally disables these interrupts because the transfer requires no firmware
intervention.
Three types of descriptors are defined: Device, Configuration, and String.
I
N
A
D
D
R
E
N
D
P
C
R
C
5
Token Packet
D
A
T
A
0
8 bytes
Setup
Data
C
R
C
1
6
Data Packet
A
C
K
H/S Pkt
S
E
T
U
P
A
D
D
R
E
N
D
P
C
R
C
5
Token Packet
D
A
T
A
1
Payload
Data
C
R
C
1
6
Data Packet
A
C
K
I
N
A
D
D
R
E
N
D
P
C
R
C
5
Token Packet
D
A
T
A
0
Payload
Data
C
R
C
1
6
Data Packet
A
C
K
H/S Pkt
SETUP Stage
SUDAV Interrupt
DATA Stage
EP0IN
Interrupt
EP0IN
Interrupt
STATUS Stage
D
A
T
A
1
O
U
T
A
D
D
R
E
N
D
P
C
R
C
5
Token Packet
C
R
C
1
6
H/S Pkt
Data Pkt
A
C
K
H/S Pkt
SUDPTRH/L
64 bytes
27 bytes
8 RAM
bytes
SETUPDAT
Comentarios a estos manuales