On Time RTOS-32 Documentation
Welcome
RTTarget-32
RTKernel-32
RTKernel-32 Programming Manual
Introduction
Multitasking, Real-Time, and RTKernel-32
Module RTKernel-32
Alternate APIs for RTKernel-32
Supplemental Modules
Module FineTime
Module Clock
Module Timer
Module RTCom
Module RTKeybrd
Module RTTextIO
Module CPUMoni
Module RTProf
RTKernel-32 Drivers
Demo Programs
Advanced Topics
Typical Error Sources
Error and Information Messages
RTKernel-32 Reference Manual
RTFiles-32
RTIP-32
RTPEG-32
RTUSB-32
|
Module RTTextIO
Module RTTextIO provides a simple windowing facility to share the screen among several tasks. Each task can reserve a window on the screen and perform text I/O in this window. Each window can have a title, a frame, and different colors for foreground and background.
Each window owns a structure created and initialized by function WOpenWindow or WNewWindow. This structure emulates the functions of a text file. RTTextIO provides functions corresponding to fprintf, fputs, fgets, etc., for I/O in the window.
A task that wants to write to the screen should perform the following steps:
- If you are not using a color graphics display, call WSetVideoRAMAddress to define screen and video controller parameters.
- If user input is required, call WSetUserInput.
- Execute WNewWindow or WOpenWindow to obtain a pointer to a WWindow structure. Make sure the window does not overlap any windows defined by other tasks. If WOpenWindow is used and a frame is desired, an extra line and two extra columns must be reserved above, below, and to the right and left of each window.
- Use WPutC, WPutS, WGetS, and Wprintf to access the window. If two tasks try to read simultaneously, an orderly distribution of the characters to the tasks cannot be expected.
- Use WGotoXY to position the (virtual) output cursor anywhere in the window. Please note that the upper left-hand corner is at (0,0). Since the display adapter supports only one physical cursor, the physical cursor is used only to mark the next character input position. However, each window has its own logical output cursor.
- If you want the physical cursor to appear at the logical cursor position of a window, call WSetCursor. RTTextIO will normally display the physical cursor only when user input is expected.
- If you want RTTextIO to expand function keys on the command line, use function WDefineFunctionKey to associate a key with a string. The string should not be longer than 15 characters. WDefineFunctionKey may be used to reassign any key that generates a zero followed by a scan code using KBGetCh.
If you want to use a non-standard video mode (e.g., to have more rows and columns on the screen), use function WSetScreenSize to inform RTTextIO. Up to 132 columns and 75 rows are supported.
The functions of module RTTextIO are declared in header file Rttextio.h and are documented in the RTKernel-32 Reference Manual.
Supplemental Modules
Module RTKeybrd
Module CPUMoni
|