Oki JOB60851 user manual write Operation

Page 65

Chapter 4 Software Development

pointer as necessary for string input.

If the character is a carriage return, the function echoes both it and a line feed back to the terminal emulator and stores the latter in memory instead.

The function repeats the above cycle the number of times specified by the count argument to the read() function. The compiler automatically determines this count from the standard I/O library function calling read().

The echo portions of the function are there to provide visual feedback when testing the firmware from the personal computer keyboard. If the user application program does not need this feedback, echoing can be dropped.

(2)write() function

Figure 4.5.4 gives a flowchart for function operation.

Read first character from string

Character is line feed

Character is not line feed

Write carriage return to

 

transmit buffer

Write character to

 

 

transmit buffer

Transmit character (CR)

 

in transmit buffer

 

Write character (LF) to

 

transmit buffer

 

Transmit character (LF)

Transmit character in

in transmit buffer

transmit buffer

 

Figure 4.5.4. write() Operation

The control flow is slightly more complicated than that for read(), but the entire operation can be described in a single sentence: The function reads a character from the buffer and transmits it, inserting a carriage return into the output stream before a line feed.

The function repeats the above cycle the number of times specified by the count argument to the write() function. The compiler automatically determines this count from the standard I/O library function calling write().

page 4-30

Image 65
Contents JOB60851 Starter Kit Page OKI Contents Software Development Port 7 LED2 Control Introduction 1. Packing List Checking Packing ListIntroduction Host Environment Icons Precaution for Safe and Proper UseLabels 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 Putting Board through its Paces SetupConfiguring JOB60851 Board 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 ComponentsUse only the AC adapter included with the product Hardware SpecificationConnectors and Switches 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 1. MSM66Q573 Pin Assignments 1/2 System LimitationsResources Uses P11-3/XTOUT System Specifications 1. MSM66Q573 Pin Assignments 2/2Software Development Software Development USB BasicsBus Topology, Addresses, and Hot Plugging Core Specifications Specification Documents2. USB Data Flow Types Data Flow TypesBus Transactions 3. lists the USB packet types PacketsEndpoints 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 FirmwareConfirming USB Compliance with Usbcheck.exe Sample USB Host SoftwareCompiling and Executing Sample USB Firmware 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 ConsiderationsOther Tools Necessary Building a ProductVendor and Product IDs 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 Link 2. 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