USB Programming Model
14-48
ADSP-BF535 Blackfin Processor Hardware Reference
data phase in the setup packet, but the data phase may terminate early.
Bulk and interrupt transfers, however, appear only as a continuous stream
of packets to the USB.
To delineate blocks of data, the USB requires that all packets be sent at
the maximum size for the endpoint, except for the last packet in a group.
For example, if the endpoint’s maximum packet size is 8 bytes, and a
63-byte transfer is being performed, the data source would send 7 packets
at 8 bytes, and one last packet at 7 bytes. The software on the USB host or
the USB device recognizes the shortened data packet as the end of a group
of packets. If the data transfer ends on a packet boundary (that is, a
64-byte transfer, 8-byte packet size), the data source sends a last 0-byte
packet on the USB.
How to Transfer Data
Preparing a USB endpoint to transfer data consists of several steps:
1. For the first memory block, program the buffer offset and length
into the
USBD_EPADRx
and
USBD_EPLENx
registers. The offset address
is a word-aligned address in the ADSP-BF535 processor’s L2
memory.
2. Unmask the
USBD_BCSTAT
,
USBD_PC
, and
USBD_TC
interrupts.
3. Program the
USB_EPCFGx
register with these fields:
• Set the
USBD_MAX
field to the code for the endpoint’s maxi-
mum packet size.
• Set
USBD_TYP
to the code for the endpoint type.
• Set
USBD_DIR
to IN or OUT.
• Set
USBD_ARM
to 1.
4. Wait for interrupts.
Содержание ADSP-BF535 Blackfin
Страница 80: ...Development Tools 1 26 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 312: ...Working With Memory 6 86 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 332: ...System Interfaces 7 20 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 360: ...Dynamic Power Management Controller 8 28 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 446: ...Beginning and Ending an SPI Transfer 10 40 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 522: ...Timing Examples 11 76 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 562: ...IrDA Support 12 40 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 608: ...PCI I O Issues 13 46 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 672: ...References 14 64 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 810: ...SDRAM Controller SDC 18 86 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 811: ...ADSP BF535 Blackfin Processor Hardware Reference 18 87 External Bus Interface Unit...
Страница 812: ...SDRAM Controller SDC 18 88 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 860: ...DMA Bus Debug Registers 20 30 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 908: ...SDRAM Controller External Bus Interface Unit B 36 ADSP BF535 Blackfin Processor Hardware Reference...