Download VLSI - nexp

Transcript
VLSI
Solution
y
VS1000 Programmer’s Guide
PKP
VSMPG
4. PERIPHERAL DOCUMENTATION
When the DSP has written a packet into the transmit buffer, that is ready to be transmitted to the PC by an endpoint, the DSP signals the USB firmware by setting the
value of the USB EP SENDn register of the endpoint that should transmit the packet
(USB EP SEND0 for endpoint 0, USB EP SEND1 for endpoint 1 etc).
The txpkt-ready bit should be set to “1” by the DSP. When the packet information (not
contents) is loaded to the internal Transmit Holding Register of the endpoint, txpktready bit is set to “0” by the hardware. Note that this does not indicate that the packet
is sent to the PC, merely that it is ready for sending when the PC next requests “IN”
data for that endpoint. Scanning the txpkt-ready bit merely allows software to prepare
the next packet to be sent even before the previous packet has been sent to the PC.
The start-addr field is index to a 64-word boundary in the transmit buffer memory area.
The actual memory location that start-addr corresponds to is calculated by:
packet start address = USB SEND MEM + (start-addr × 64)
which in VS1000A corresponds to address X:0x3000 for start-addr=0, X:0x3040 for startaddr=1 etc.
USB EP STn - Flags for endpoints EPnIN and EP0nUT 0xC090..0xC093
Name
out-type
out-enable
out-forcestall
out-stall-sent
reserved
in-type
in-enable
in-forcestall
in-stall-sent
in-nak-sent
in-xmit-empty
reserved
4.9.3
USB EP STn bits
Bits Description
EPnOUT (PC → Device) endpoint (0 .. 3) flags
15:14 00=bulk 01=interrupt 11=isochronous
14:13 1=enabled 0=disabled
12 Force STALL
11 At least 1 STALL sent
10:8 Set to 0
EPnIN (Device → PC) endpoint (0 .. 3) flags
7:6 00=bulk 01=interrupt 11=isochronous
5 1=enabled 0=disabled
4 Force STALL
3 At least 1 STALL sent to PC
2 At least 1 NAK sent to PC
1 Transmitter empty
0 Set to 0
Receiving Packets from PC (EP0OUT, EP1OUT, ... , EP3OUT)
The USB hardware handles all necessary token (ACK, NAK, IN, OUT, SETUP, STALL)
sending and receiving. The software sees only the data packet contents plus some state
information about the sent tokens.
Rev. 0.12 Preliminary
2007-03-23
Page 77(83)