USB Programming Model
14-58
ADSP-BF535 Blackfin Processor Hardware Reference
Control Transfer With Data Phase
A control transfer can include a data phase between the setup and status
phases. The data phase can run from 0 to 65,535 bytes, in either IN or
OUT direction. The flow is:
1. At initialization time, device software unmasks the
USBD_SETUP
interrupt on the control endpoint(s).
2. Device initializes the
USBD_EPADRx
and
USBD_EPLENx
registers to
point to a storage buffer.
3. Device initializes the
USBD_EPCFGx
registers for OUT direction,
USBD_TYP
= 00,
USBD_DIR
= 0 (OUT direction). The
USBD_MAX
field
is programmed to match the endpoint’s maximum packet size. The
USBD_ARM
bit is set to 1.
4. Monitor the
USBD_SETUP
interrupt.
5. On receipt of a
USBD_SETUP
interrupt, read the setup packet from
the memory buffer and decode the command. If the command is
valid, execute it. If the
wLength
field of the setup packet is nonzero,
then a data phase is associated with the transfer. The direction of
the transfer is specified by the
bmAttributes[7]
bit of the setup
packet.
6. Program the endpoint registers to execute a data transfer as in the
BULK IN example (see
“Bulk Data Transfers” on page 14-11
).
Under no circumstances should software attempt to transfer more
bytes than specified in the
wLength
field of the setup packet. It can
transfer fewer bytes than specified in the
wLength
field.
7. To complete the command, a status packet must be returned to the
USB host. For a transfer with a data phase, this is a packet with
0 bytes, or a STALL handshake. The direction of the status phase is
opposite
that of the data transfer. For example, for a control transfer
with an OUT data phase, set the endpoint registers
Summary of Contents for ADSP-BF535 Blackfin
Page 80: ...Development Tools 1 26 ADSP BF535 Blackfin Processor Hardware Reference...
Page 312: ...Working With Memory 6 86 ADSP BF535 Blackfin Processor Hardware Reference...
Page 332: ...System Interfaces 7 20 ADSP BF535 Blackfin Processor Hardware Reference...
Page 360: ...Dynamic Power Management Controller 8 28 ADSP BF535 Blackfin Processor Hardware Reference...
Page 446: ...Beginning and Ending an SPI Transfer 10 40 ADSP BF535 Blackfin Processor Hardware Reference...
Page 522: ...Timing Examples 11 76 ADSP BF535 Blackfin Processor Hardware Reference...
Page 562: ...IrDA Support 12 40 ADSP BF535 Blackfin Processor Hardware Reference...
Page 608: ...PCI I O Issues 13 46 ADSP BF535 Blackfin Processor Hardware Reference...
Page 672: ...References 14 64 ADSP BF535 Blackfin Processor Hardware Reference...
Page 810: ...SDRAM Controller SDC 18 86 ADSP BF535 Blackfin Processor Hardware Reference...
Page 811: ...ADSP BF535 Blackfin Processor Hardware Reference 18 87 External Bus Interface Unit...
Page 812: ...SDRAM Controller SDC 18 88 ADSP BF535 Blackfin Processor Hardware Reference...
Page 860: ...DMA Bus Debug Registers 20 30 ADSP BF535 Blackfin Processor Hardware Reference...