Oki JOB60851 user manual Modifying Application Layer

Page 49

Chapter 4 Software Development

n Note n

The Windows 98 CD-ROM is not necessary if the OEM release has copied the installation image from the CD-ROM to the directory c:\Windows\Option. If so, specify that directory instead of the CD-ROM.

(5)Operate mouse with terminal emulator

After reading the messages on the terminal emulator screen, enter HELP at the command prompt to display the commands available. Try RIGHT, LEFT, UP, and DOWN, for example.

Another way to test the emulated USB mouse is with HIDview, the HID class device portion of Usbcheck.exe.

4-2-7. Modifying Application Layer

This section gives a hints for modifying the application layer. Note that, in practice, such modifications require careful study of the USB Specifications, M852.txt, and the source code.

A USB device controller basically uses interrupt-driven communications control. The following API functions provide the application layer with access to such functionality as initialization, specifying callback function, and initiating data flow.

usb_init()

usb_set_callback() usb_tx_start() usb_rx_start() usb_int_enable() usb_int_disable() usb_remote_wakeup() usb_cfg_status() usb_alt_status()

Initialize USB control variables

Specify notification function for bulk transfer compl Specify transmit data buffer and start

Specify receive data buffer and start Enable packet ready interrupt Disable packet ready interrupt Transmit remote wake-up signal

Retrieve information from current configuration descriptor Retrieve current alternate setting

The sample firmware provides everything needed to evaluate hot plugging (a.k.a. dynamic insertion and removal) using control transfers and standard device requests.

The sample application layer provides loopback from endpoint 1 (EP1) to endpoint 2 (EP2). Modifying the source code in the file main.c permits the simple use of bulk transfers from upstream applications.

The source code below gives skeletons for two simple application layers consisting of only BulkOut (receive) or BulkIn (transmit) operations, respectively. Modify the source code, recompile it, download it to the JOB60851 board, and run the program.

For further details on the API functions, refer to the file M852.txt.

page 4-14

Image 49
Contents JOB60851 Starter Kit Page OKI Contents Software Development Port 7 LED2 Control Introduction Introduction Checking Packing List1. Packing List Host Environment Labels Precaution for Safe and Proper UseIcons Do not pile objects on top of the product Use only the specified voltageUse only the cables and other accessories provided Notation Putting Board through Its Paces Configuring JOB60851 Board SetupPutting Board through its Paces Installing Development Software Connecting Board Running Default ProgramInstalling USB Driver Running Flash Memory ProgramUse the -u command line option to view the USB pipe numbers Running User Programs Loading Terminal Emulator Connecting Serial CableDownloading and Executing Synchronizing LinkOverwriting Flash Memory Contents System Specifications System Components System SpecificationsSystem Objective System ComponentsConnectors and Switches Hardware SpecificationUse only the AC adapter included with the product System Specifications 2. Circuit Diagram 1/2 Circuit DiagramSystem Specifications 1. Parts List 1/2 Parts ListMemory Maps 4. Memory Map for Download Mode5. Memory Map for Flash Execution Mode 6. Memory Map for Application Mode 7. Memory Map for Flash Rewrite Mode Resources Uses System Limitations1. MSM66Q573 Pin Assignments 1/2 P11-3/XTOUT System Specifications 1. MSM66Q573 Pin Assignments 2/2Software Development Bus Topology, Addresses, and Hot Plugging USB BasicsSoftware Development Core Specifications Specification DocumentsBus Transactions Data Flow Types2. USB Data Flow Types Endpoints Packets3. lists the USB packet types 5. USB Device Class Specifications Device Class SpecificationsData Rates 4. Maximum Payload SizesStandard Device Requests Device Requests6. Device Request Types 7. Control Transfer Data PacketDevice Descriptor for Bidirectional Printer Device DescriptorsString descriptor Sample Firmware Specifications SetupSample USB Firmware 1. Sample USB FirmwareCompiling and Executing Sample USB Firmware Sample USB Host SoftwareConfirming USB Compliance with Usbcheck.exe Software Development Creating USB Mouse Demo Modifying Application Layer Receive Only Skeleton Evaluating USB Equipment Simple Debugging1. ML60851C Specifications Device Controller SpecificationsUSB Bits and Pieces Overview of ML60851C Operation1. ML60851C Block Diagram Connecting Microcontroller to USB Controller2. Microcontroller with 16- or 32-Bit Bus Special USB ConsiderationsVendor and Product IDs Building a ProductOther Tools Necessary Products Limitations Port 7 Registers Port 7 LED2 ControlChanging LED2 Color Sample Port 7 Control Program JOB60851 Board Standard I/O Standard I/O over Serial Link2. Serial Port Structure Serial PortSerial port SIO0 Chapter Internal timer 9 and following 3. read Operation Read and write Functions4. write Operation Standard I/O Examples Sample Program Using Standard OutputDebugging with Standard I/O Sample Program Using Standard Input