
EZ-USB FX2 Technical Reference Manual
Page 2-14 EZ-USB FX2 Technical Reference Manual v2.1
2.3.4.1 Get Descriptor-Device
As illustrated in Figure 2-5, the firmware loads the 2-byte SUDPTR with the starting address of the
Device Descriptor table. When SUDPTRL is loaded, the FX2 automatically performs the following
operations:
1. Reads the requested number of bytes for the transfer from bytes 6 and 7 of the SETUP packet
(LenL and LenH in Table 2-10).
2. Reads the requested descriptor’s length field to determine the actual descriptor length.
3. Sends the smaller of (a) the requested number of bytes or (b) the actual number of bytes in
the descriptor, over EP0BUF using the Setup Data Pointer as a data table index. This consti-
tutes the second phase of the three-phase CONTROL transfer. The FX2 packetizes the data
into multiple data transfers as necessary.
4. Automatically checks for errors and re-transmits data packets if necessary.
5. Responds to the third (handshake) phase of the CONTROL transfer to terminate the opera-
tion.
The Setup Data Pointer can be used for any
Get Descriptor
request (e.g.,
Get Descriptor-String
).
It can also be used for vendor-specific requests. If bytes 6 and 7 of those requests contain the
number of bytes in the transfer (see Step 1, above), the Setup Data Pointer works automatically,
as it does for Get Descriptor requests; if bytes 6 and 7 don’t contain the length of the transfer, the
length can be loaded explicitly (see the SDPAUTO paragraphs of Section 8.7, "The Setup Data
Pointer").
It is possible for the firmware to do manual CONTROL transfers by directly loading the EP0BUF
buffer with the various packets and keeping track of which SETUP phase is in effect. This is a
good USB training exercise, but not necessary due to the hardware support built into the FX2 for
CONTROL transfers.
For DATA stage transfers of fewer than 64 bytes, moving the data into the EP0BUF buffer and
then loading the EP0BCH:L registers with the byte count would be equivalent to loading the Setup
Table 2-10. Get Descriptor-Device
Byte Field Value Meaning Firmware Response
0 bmRequestType 0x80 IN, Device
Set SUDPTR H:L to start of
1 bRequest
0x06
“Get Descriptor”
Device Descriptor table in RAM.
2 wValueL 0x00
3wValueH
0x01
Descriptor Type: Device
4 wIndexL 0x00
5 wIndexH 0x00
6 wLengthL
LenL
7 wLengthH
LenH
Comentarios a estos manuales