VIRTUTECH CONFIDENTIAL    Previous - Up - Next

serial_device

Implemented By
NS16450, NS16550, SA1110-device, Z8530-port, leon2_uart, serengeti-console, serengeti-console-old, server-console, sun-keyboard, sun-mouse, telos-usart, text-console
Description
Interface used to connect serial devices together. It is typically implemented by both devices and text consoles. A character (byte) is sent with the write() function where obj is the destination device and the value argument is either a data byte, or the out-of-band value TTY_ABORT.

The called device will return the number of characters accepted; i.e. 1 on success and 0 if it could not handle the new byte. If the receiver returns 0, it must later call receive_ready() in the sender's interface to signal that new bytes can be accepted. A serial device should handle the case where the receive_ready() function is called although it has no more bytes to send.

#define TTY_ABORT   0x100

typedef struct {
        int (*write)(conf_object_t *obj, int value);
        void (*receive_ready)(conf_object_t *obj);
} serial_device_interface_t;

#define SERIAL_DEVICE_INTERFACE "serial-device"

VIRTUTECH CONFIDENTIAL    Previous - Up - Next