VxWorks Reference Manual : Libraries

ns16550Sio

NAME

ns16550Sio - NS 16550 UART tty driver

ROUTINES

ns16550DevInit( ) - intialize an NS16550 channel
ns16550IntWr( ) - handle a transmitter interrupt
ns16550IntRd( ) - handle a receiver interrupt
ns16550IntEx( ) - miscellaneous interrupt processing
ns16550Int( ) - interrupt level processing

DESCRIPTION

This is the driver for the NS16552 DUART. This device includes two universal asynchronous receiver/transmitters, a baud rate generator, and a complete modem control capability.

A NS16550_CHAN structure is used to describe the serial channel. This data structure is defined in ns16550Sio.h.

Only asynchronous serial operation is supported by this driver. The default serial settings are 8 data bits, 1 stop bit, no parity, 9600 baud, and software flow control.

USAGE

The BSP's sysHwInit( ) routine typically calls sysSerialHwInit( ), which creates the NS16550_CHAN structure and initializes all the values in the structure (except the SIO_DRV_FUNCS) before calling ns16550DevInit( ). The BSP's sysHwInit2( ) routine typically calls sysSerialHwInit2( ), which connects the chips interrupts via intConnect( ) (either the single interrupt ns16550Int or the three interrupts ns16550IntWr, ns16550IntRd, and ns16550IntEx).

This driver handles setting of hardware options such as parity(odd, even) and number of data bits(5, 6, 7, 8). Hardware flow control is provided with the handshakes RTS/CTS. The function HUPCL(hang up on last close) is available. When hardware flow control is enabled, the signals RTS and DTR are set TRUE and remain set until a HUPCL is performed.

INCLUDE FILES

drv/sio/ns16552Sio.h

SEE ALSO

ns16550Sio


Libraries : Routines

ns16550DevInit( )

NAME

ns16550DevInit( ) - intialize an NS16550 channel

SYNOPSIS

void ns16550DevInit
    (
    NS16550_CHAN * pChan /* pointer to channel */
    )

DESCRIPTION

This routine initializes some SIO_CHAN function pointers and then resets the chip in a quiescent state. Before this routine is called, the BSP must already have initialized all the device addresses, etc. in the NS16550_CHAN structure.

RETURNS

N/A

SEE ALSO

ns16550Sio


Libraries : Routines

ns16550IntWr( )

NAME

ns16550IntWr( ) - handle a transmitter interrupt

SYNOPSIS

void ns16550IntWr
    (
    NS16550_CHAN * pChan /* pointer to channel */
    )

DESCRIPTION

This routine handles write interrupts from the UART. It reads a character and puts it in the transmit holding register of the device for transfer.

If there are no more characters to transmit, transmission is disabled by clearing the transmit interrupt enable bit in the IER(int enable register).

RETURNS

N/A

SEE ALSO

ns16550Sio


Libraries : Routines

ns16550IntRd( )

NAME

ns16550IntRd( ) - handle a receiver interrupt

SYNOPSIS

void ns16550IntRd
    (
    NS16550_CHAN * pChan /* pointer to channel */
    )

DESCRIPTION

This routine handles read interrupts from the UART.

RETURNS

N/A

SEE ALSO

ns16550Sio


Libraries : Routines

ns16550IntEx( )

NAME

ns16550IntEx( ) - miscellaneous interrupt processing

SYNOPSIS

void ns16550IntEx
    (
    NS16550_CHAN * pChan /* pointer to channel */
    )

DESCRIPTION

This routine handles miscellaneous interrupts on the UART. Not implemented yet.

RETURNS

N/A

SEE ALSO

ns16550Sio


Libraries : Routines

ns16550Int( )

NAME

ns16550Int( ) - interrupt level processing

SYNOPSIS

void ns16550Int
    (
    NS16550_CHAN * pChan /* pointer to channel */
    )

DESCRIPTION

This routine handles four sources of interrupts from the UART. They are prioritized in the following order by the Interrupt Identification Register: Receiver Line Status, Received Data Ready, Transmit Holding Register Empty and Modem Status.

When a modem status interrupt occurs, the transmit interrupt is enabled if the CTS signal is TRUE.

RETURNS

N/A

SEE ALSO

ns16550Sio