Jump to main content
QNX Everywhere
QNX Everywhere
Advanced search
  1. Home
  2. Driver Development Kit (DDK) Developer's Guide

    The Driver Development Kit (DDK) Developer's Guide is for developers who build device drivers for the QNX OS.

  3. Character I/O and UART (Universal Asynchronous Receiver Transmitter) DDK
  4. io-char library reference
  • Introduction

    This introduction provides an overview of QNX Everywhere, how to get a QNX Software Development Platform license, and where to get support.

  • Self-Hosted Developer Desktop Guide

    This guide provides instructions for building applications on QNX OS 8 using the self-hosted desktop, without the need for cross-compilation. It's built on the XFCE (XForms Common Environment) desktop environment, allowing QNX Everywhere users to start building QNX apps with minimal setup and friction.

  • Quick Start Target Image (QSTI)

    This guide provides instructions on how to set up the Quick Start Target Image (QSTI) on a Raspberry Pi.

  • Custom Target Image (CTI)

    This guide provides instructions on how to set up the Custom Target Image (CTI) on a Raspberry Pi.

  • Interfacing with your hardware

    This chapter describes how to communicate with your given hardware.

  • The QNX Porting Guide

    This guide provides comprehensive information on porting software from Linux to QNX.

  • Driver Development Kit (DDK) Developer's Guide

    The Driver Development Kit (DDK) Developer's Guide is for developers who build device drivers for the QNX OS.

    • Character I/O and UART (Universal Asynchronous Receiver Transmitter) DDK
      • Developing a char driver
      • Starting the char driver
      • Interfacing with the driver
      • io-char library reference
        • Macros
        • dev_cleanup()

          Clean up a device

        • drain_check()

          Check if a device has been drained

        • iochar_send_event()

          Send a pulse event into io-char's event handler

        • iochar_tick_cnt()

          Calculate tick count

        • kick()

          Kick the output driver into life

        • timer_queue()

          Add an entry to the io-char timer queue

        • timer_remove()

          Remove an entry from the io-char timer queue

        • ttc()

          Configure the terminal's settings

        • tti()

          Pass data, or error and control codes to io-char

        • tti2()

          Pass a data buffer, or error and control codes to io-char

        • tto()

          Give output buffer data to hardware

        • tto_checkclients()

          Check client lists for notify conditions

        • tto_getchar()

          Get the first character from the output buffer to process

        • tto_write_block()

          Store bytes in a buffer

        • tty_init_lock()

          Initialize the TTYCTRL locking mechanism

        • tty_lock()

          Lock the TTYCTRL structure to prevent modification by other threads

        • tty_unlock()

          Unlock the TTYCTRL structure to allow modifications by other threads

        • TTYBUF

          Implement a circular buffer for character I/O operations

        • TTYCTRL

          Tty control structure

        • TTYDEV

          Structure for a tty device

        • TTYINIT

          Structure used to initialize a tty device

        • TTYINITPTY

          Structure for initialization and configuration of pty devices

        • TTYWAIT

          Structure to track and manage clients that are waiting for I/O operations on terminal devices

        • tx_inject()

          Inject a character at the front of the output buffer

        • wait_add()

          Add a new wait entry to the client message buffer

        • wait_remove_rcvid()

          Remove the receive ID matching the wait entry

      • Stub io-char driver
      • Raspberry Pi 4 mini UART driver example
    • Inter-integrated circuit (I2C) DDK
    • Serial peripheral interface (SPI) DDK
    • Human interface device (HID) DDK
    • Touch DDK

io-char library reference

This chapter provides detailed information on io-char's macros, functions, and structures.

io-char implements a resource manager for each device and provides:
ttc()
An initialization and control function.
tti(), tti2()
Incoming data processing functions.
tto_getchar(), tto_write_block(), tto_checkclients()
Output processing functions.
iochar_send_event()
A library wake-up function.
dev_lock(), dev_unlock()
Locking macros.
Page updated: January 08, 2026