Renesas M16C Series User Manual page 186

16-bit single-chip microcomputer
Hide thumbs Also See for M16C Series:
Table of Contents

Advertisement

M30245 Group
(4) Control Transfer: Example of Standard Device Request Receive
The control transfer includes the setup stage, data stage and status stage.
Which one of write transfer, read transfer and no data transfer is executed in the data stage is deter-
mined by the content of the setup data acquired in the setup stage.
Examples of the receive processing routine of the SET_ADDRESS request and the
GET_CONFIGURATION request are described.
For rewriting USB address register when the SET_ADDRESS request is received, follow the proce-
dure below:
When the device is in the default state (USB address register value is "0"):
www.DataSheet4U.com
1: When USB address register is received the SET_ADDRESS request from the host CPU, store the
new address data in the USB address register.
2: When the status phase of the SET_ADDRESS request is completed, USB address register is
rewritten into the address written in above-mentioned 1:. When the status phase is not normally
completed, USB address register is not rewritten.
When the device is in the address state (USB address register value is other than "0"):
1: When USB address registeris received the SET_ADDRESS request from the host CPU, confirm
that the status phase of SET_ADDRESS request completes.
2: Store the new address data in USB address register.
The USB function control unit applies this address to all the subsequent device accesses.
The SET_ADDRESS request is shown in Figure 2.8.35, the device address acquisition processing
routine of USB SET_ADDRESS request is shown in Figure 2.8.36 and Figure 2.8.37, the device
configuration notification processing routine of GET_CONFIGURATION request is shown in Figure
2.8.38 and Figure 2.8.39.
Describe these processing to endpoint 0 interrupt processing.
1st byte
bmRequestType
00000000B
Figure 2.8.35. SET_ADDRESS Request
Rev.2.00 Oct 16, 2006
REJ09B0340-0200
bRequest
SET_ADDRESS
(code: 05
)
16
page 177 of 354
wValue
windex
Device address
0000
Lower
Higher
2. USB function
8th byte
wlength
0000
16
16

Advertisement

Table of Contents
loading

Table of Contents