Rev.2.00 Oct 16, 2006 page 177 of 354
REJ09B0340-0200
M30245 Group
2. USB function
(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”):
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.
Figure 2.8.35. SET_ADDRESS Request
bmRequestType
bRequest
wValue
windex
wlength
00000000B
SET_ADDRESS
(code: 05
16
)
0000
16
0000
16
1st byte
8th byte
Device address
Higher
Lower
Содержание M16C FAMILY
Страница 12: ...Chapter 1 Hardware...
Страница 13: ...See M30245 group datasheet...
Страница 14: ...Chapter 2 Peripheral Functions Usage...
Страница 303: ...THIS PAGE IS BLANK FOR REASONS OF LAYOUT...
Страница 304: ...Chapter 3 Examples of Peripheral Functions Applications...
Страница 340: ...Chapter 4 External Buses...
Страница 361: ...THIS PAGE IS BLANK FOR REASONS OF LAYOUT...
Страница 362: ...Chapter 5 Standard Characteristics...
Страница 369: ...1753 Shimonumabe Nakahara ku Kawasaki shi Kanagawa 211 8668 Japan M30245 Group REJ09B0340 0200 User s Manual...