Figure 20.6 Data Stage (Control-In) Operation - Renesas HD6417641 Hardware Manual

32-bit risc microcomputer superh risc engine family / sh7641 series
Table of Contents

Advertisement

Section 20 USB Function Module
Data Stage (Control-IN): The application first analyzes command data from the host in the setup
stage, and determines the subsequent data stage direction. If the result of command data analysis is
that the data stage is in-transfer, one packet of data to be sent to the host is written to the FIFO. If
there is more data to be sent, this data is written to the FIFO after the data written first has been
sent to the host (USBIFR0/EP0iTS = 1).
The end of the data stage is identified when the host transmits an OUT token and the status stage
is entered.
IN token reception
to USBTRG/EP0s
Data transmission to host
Set EP0i transmission
(USBIFR0/EP0i TS = 1)
Note: If the size of the data transmitted by the function is smaller than the data size requested by
the host, the function indicates the end of the data stage by returning to the host a packet
shorter than the maximum packet size. If the size of the data transmitted by the function is
an integral multiple of the maximum packet size, the function indicates the end of the data
stage by transmitting a zero-length packet.
Rev. 4.00 Sep. 14, 2005 Page 770 of 982
REJ09B0023-0400
USB function
1 written
No
RDFN?
NACK
Yes
No
Valid data
in EP0i FIFO?
NACK
Yes
ACK
Interrupt request
complete flag

Figure 20.6 Data Stage (Control-IN) Operation

Application
From setup stage
Write data to USBEP0i
data register (USBEPDR0i)
Write 1 to EP0i packet
enable bit
(USBTRG/EP0i PKTE = 1)
Clear EP0i transmission
complete flag
(USBIFR0/EP0i TS = 0)
Write data to USBEP0i
data register (USBEPDR0i)
Write 1 to EP0i packet
enable bit
(USBTRG/EP0i PKTE = 1)

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sh7641

Table of Contents