Caution: This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.

Character I/O Library

The libio-char.a library defines these functions and data types:

ttc()
Used during initialization to configure the terminal's settings.
tti()
Passes rx data and control information.
tto()
Writes tx data to hardware, handles settings, line control and line status.
TTYCTRL
Contains the settings which are shared by all devices, e.g. the resource manager configuration.
TTYDEV
Contains the settings specific to one serial device.
TTYINIT
Initializes the driver, termios, and buffer size.

The io-char utility calls the tto() function and the driver implements it. The TTYCTRL and TTYDEV structures provide the interface between io-char and the driver. The tto() function writes tx data, line status, device settings, and line ctrl information to the hardware.

The driver calls the ttc() and tti() function calls. The ttc() function initializes the device and the resource manager. The tti() function passes receive data and control info to the io-char utility.

The tte() function is generated by an event which causes io-char's event handler to be called.

The relationship between the io-char utility and the driver is seen here:


Char interactions


Relationship between io-char and the driver

The TTYDEV structure contains two buffers: an obuf (output buffer) and an ibuf (input buffer).

The tto() function call provides the interface between the Tx FIFO register and the obuf. It's called to send the contents of the output buffer to the Tx FIFO register.

The tti() function call provides the interface between the Rx FIFO register and the ibuf. It's called to place the data from the Rx FIFO register into the input buffer.

The relationship between the output and input buffers and the tto() and tti() function calls can be seen here:


Buffers


Buffer and function call interaction

The following table indicates the relationship between the driver and these APIs:

The driver implements:
tto() — to tx data, and perform line status, line ctrl, and device settings, e.g. baud, parity, etc.)
The driver calls:
ttc() — to initialize the device and resource manager
tti() — to pass rx data and control info to io-char
The driver generates an event:
tte() — to cause the io-char tte() event handler to be called