Oki JOB60851 Standard Device Requests, Device Request Types, Control Transfer Data Packet

Page 42

Chapter 4 Software Development

4-1-10. Device Requests

Device requests represent commands from the host to USB functions using control transfers. The USB function parses the request, performs the necessary action, and returns the appropriate response.

There are three types of device requests.

 

Table 4.1.6. Device Request Types

 

 

Standard

Requests that all USB devices must support because they hold the key to hot plugging

 

(a.k.a. dynamic insertion and removal)

Class-specific

Requests required by the USB Device Class Specifications for the general application

Vendor-specific

Requests implemented by the vendor for accessing functionality particular to the USB

 

device

 

 

A control transfer starts with a SETUP token packet followed by an 8-byte data packet containing the following fields. Note that the meaning of the wValue and wIndex fields depends on the request type.

Table 4.1.7. Control Transfer Data Packet

bmRequestType

1byte

Transfer direction, request type, and endpoint address

bRequest

1byte

Request number

wValue

2byte

Value (meaning depends on the request type)

wIndex

2byte

Index or offset (which depends on the request type)

wLength

2byte

Number of bytes transferred during the Data stage

A control transfer consists of up to three stages.

1.Setup stage: The data packet following the SETUP token packet is an 8-byte command from the host to the device. The device parses the command and, as necessary, prepares to send or receive data.

2.Data stage: The pipe transfers the specified data in the direction specified by the command. Note that commands that do not involve data transfer skip this stage.

3.Status stage: The host initiates a transaction, in the direction opposite the immediately preceding data transfer, for reporting command success or failure from the device to the host.

4-1-11. Standard Device Requests

The standard device requests are common ones to all USB devices. Most important are those that support hot plugging (a.k.a. dynamic insertion and removal). Detailed descriptions are in Section 9.- 4 of the USB version 1.1 specifications.

Table 4.1.8. Standard Device Requests

No. Request Name

Description

0GET_STATUS

1CLEAR_FEA TURE

3 SET_FEATURE

5SET_ADDRESS

6GET_DESCRIPTOR

Return status for specified recipient Clear or disable a specific feature Set or enable a specific feature

Set device address for al future device accesses Return the specified descriptor, if it exists

page 4-7

Image 42
Contents JOB60851 Starter Kit Page OKI Contents Software Development Port 7 LED2 Control Introduction Checking Packing List Introduction1. Packing List Host Environment Precaution for Safe and Proper Use LabelsIcons Use only the specified voltage Do not pile objects on top of the productUse only the cables and other accessories provided Notation Putting Board through Its Paces Setup Configuring JOB60851 BoardPutting Board through its Paces Installing Development Software Installing USB Driver Running Default ProgramConnecting Board Running Flash Memory ProgramUse the -u command line option to view the USB pipe numbers Running User Programs Connecting Serial Cable Loading Terminal EmulatorSynchronizing Link Downloading and ExecutingOverwriting Flash Memory Contents System Specifications System Objective System SpecificationsSystem Components System ComponentsHardware Specification Connectors and SwitchesUse only the AC adapter included with the product System Specifications Circuit Diagram 2. Circuit Diagram 1/2System Specifications Parts List 1. Parts List 1/24. Memory Map for Download Mode Memory Maps5. Memory Map for Flash Execution Mode 6. Memory Map for Application Mode 7. Memory Map for Flash Rewrite Mode System Limitations Resources Uses1. MSM66Q573 Pin Assignments 1/2 System Specifications 1. MSM66Q573 Pin Assignments 2/2 P11-3/XTOUTSoftware Development USB Basics Bus Topology, Addresses, and Hot PluggingSoftware Development Specification Documents Core SpecificationsData Flow Types Bus Transactions2. USB Data Flow Types Packets Endpoints3. lists the USB packet types Data Rates Device Class Specifications5. USB Device Class Specifications 4. Maximum Payload Sizes6. Device Request Types Device RequestsStandard Device Requests 7. Control Transfer Data PacketDevice Descriptors Device Descriptor for Bidirectional PrinterString descriptor Sample USB Firmware SetupSample Firmware Specifications 1. Sample USB FirmwareSample USB Host Software Compiling and Executing Sample USB FirmwareConfirming USB Compliance with Usbcheck.exe Software Development Creating USB Mouse Demo Modifying Application Layer Receive Only Skeleton Simple Debugging Evaluating USB EquipmentUSB Bits and Pieces Device Controller Specifications1. ML60851C Specifications Overview of ML60851C OperationConnecting Microcontroller to USB Controller 1. ML60851C Block DiagramSpecial USB Considerations 2. Microcontroller with 16- or 32-Bit BusBuilding a Product Vendor and Product IDsOther Tools Necessary Products Limitations Port 7 LED2 Control Port 7 RegistersChanging LED2 Color Sample Port 7 Control Program Standard I/O over Serial Link JOB60851 Board Standard I/OSerial Port 2. Serial Port StructureSerial port SIO0 Chapter Internal timer 9 and following Read and write Functions 3. read Operation4. write Operation Sample Program Using Standard Output Standard I/O ExamplesSample Program Using Standard Input Debugging with Standard I/O