下载

Freescale Semiconductor
Application Note
Document Number: AN3492
Rev. 0, 08/2007
Contents
© Freescale Semiconductor, Inc., 2007. All rights reserved.
1 Overview of USB
Universal Serial Bus (USB) is not a true bus, it is a
point-to-point star topology. There is a single host that
initiates all data transfers (USB is a polled
communication system). Up to 127 devices can be
managed by a single host, with hubs providing the
connections from the host to the devices. Electrically,
USB supports point to point connections with a max
length of 5 meters, and a maximum of 5 hubs between
the host and end device.
Low-level USB communications are implemented using
a protocol. The protocol is slightly different depending
on the type of transfer. The USB specification describes
this protocol using the terms host and function. The host
is the master of the bus and starts all data transfers. The
function (also called the device) is used to execute the
requests of the host.
The upper levels of USB communications are referred to
as classes. A class is a group of variables and methods. A
method can also be called a function because it performs
1 Overview of USB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2 USB Communications . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
3 The USB OTG Capable Controller Module . . . . . . . . . . 12
4 Using the USB OTG Module in Host Mode . . . . . . . . . . 16
5 Introduction to the CMX Stack. . . . . . . . . . . . . . . . . . . . 20
6 Enumeration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
7 The USB Device-Side Driver . . . . . . . . . . . . . . . . . . . . . 30
8 The USB Host-Side Driver. . . . . . . . . . . . . . . . . . . . . . . 38
9 The HID Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
10 PC-Side USB Host Software . . . . . . . . . . . . . . . . . . . . . 72
11 The Communication Device Class . . . . . . . . . . . . . . . . 75
12 USB On-The-Go . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
13 Resource Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
USB and Using the CMX USB
Stack
by: Eric Gregori,
Product Specilaist—Embedded Firmware