Intel PXA255 Personal Computer User Manual


 
Intel® PXA255 Processor Developer’s Manual 12-15
USB Device Controller
the wrong amount of data was sent, software cleans up any buffer pointers and disregards the
received data.
20. Software changes its internal state machine to EP0_IDLE.
21. Software clears the UDC interrupt bit and returns from the interrupt service routine.
If the host sends another SETUP command during these steps, the software must terminate the first
SETUP command and start the new command.
12.5.4 Case 4: EP0 No Data Command
1. When software starts, it initializes a software state machine to EP0_IDLE. The software state
machine is used to track stages when software communicates with the host PC.
2. The host PC sends a SETUP command.
3. UDC generates an EP0 Interrupt.
4. Software determines that the UDCCS0[SA] and UDCCS0[OPR] bits are set. This indicates
that a new OUT packet is in the EP0 Buffer and identifies a SETUP transaction.
5. Software reads the data into a buffer while UDCCS0[RNE] bit (receiver not empty) is set.
6. Software parses the data in the buffer and determines that it is a No Data command.
7.
Software executes the command and sets its internal state machine to EP0_IDLE. Software
clears the UDCCS0[IPR] and UDCCS0[SA] bits. If the command is a No-Data-Phase
Standard command, then do not set the UDCCS0[IPR] bit. If the command is not a No-Data-
Phase Standard command, e.g a No-Data-Phase Vendor command or No-Data-Phase Class
command, then software must set the UDCCS0[IPR] bit.
8. When the host PC executes the STATUS IN stage, the UDC sends back a zero-length packet,
which indicates a successful handshake. This does not cause an interrupt.
If the host sends another SETUP command during these steps, the software must terminate the first
SETUP command and start the new command.
12.5.5 Case 5: EP1 Data Transmit (BULK-IN)
The procedure in Case 5 can also be used to operate Endpoints 6 and 11.
In Case 5, the Transmit Short Packet is only set if a packet size of less than 64 bytes is sent. If the
packet size is 64 bytes, the system arms when the 64th byte is loaded. Loading the 64th byte and
setting the UDCCS1[TSP] bit produces one 64-byte packet and one zero-length packet.
When software receives a SETUP VENDOR command to set up an EP1 BULK IN transaction, it
may take one of two courses of action, as appropriate for the chosen operating model:
Configure the DMA engine and disable the EP1 interrupt to allow the DMA engine to handle
the transaction.
Enable the EP1 interrupt to allow the Megacell to directly handle the transaction.
12.5.5.1 Software Enables the DMA
If software enables the DMA engine, use the following steps: