VxWorks Reference Manual : Libraries

unixSio

NAME

unixSio - unix serial driver

ROUTINES

unixDevInit( ) - initialize a UNIX_DUSART
unixDevInit2( ) - enable interrupts
unixIntRcv( ) - handle a channel's receive-character interrupt.
dummyCallback( ) - dummy callback routine.

DESCRIPTION

This is the driver for the UNIX stdin/stdio-base simulated serial port.

USAGE

A UNIX_CHAN structure is used to describe each channel available.

The BSP's sysHwInit( ) routine typically calls sysSerial.c:sysSerialHwInit( ), which opens unix tty/pty devices for serial lines & initializes the UNIX_CHAN u_fd & u_pid fields before calling unixDevInit( ).

The BSP sysSerialHwInit2( ) calls unixDevInit2( ) to enable interrupts.

i.e.

#include "drv/sio/unixSio.h"

UNIX_CHAN myChan [NUM_TTY];
SIO_CHAN * sysSioChans[NUM_TTY];

sysSerialHwInit (void)
    {
    ...
    for (ix = 0; ix < NUM_TTY; ix++)
        {        
        if (ix > 0)     // dev 0 is unix sdtin/out/err //
            {
            UNIX_CHAN * pChan = &myChan[ix];
            sysSioChans[ix] = (SIO_CHAN *) pChan;
            pChan->u_fd = ptyXtermOpen (ptyName, &pChan->u_pid, 0);
            }
        ...
        unixDevInit (&myChan);
        }
    }

sysSerialHwInit2 (void)
    {
    ...
    for (i = 0; i < NUM_TTY; i++)
        intConnect (FD_TO_IVEC(myChan[i]->u_fd), unixInt, (int)&myChan[i]);
    ...
    }

INCLUDE FILES

drv/sio/unixSio.h sioLib.h

SEE ALSO

unixSio


Libraries : Routines

unixDevInit( )

NAME

unixDevInit( ) - initialize a UNIX_DUSART

SYNOPSIS

void unixDevInit
    (
    UNIX_CHAN * pChan
    )

DESCRIPTION

This routine initializes the driver function pointers and then resets to a quiescent state. The BSP must have already opened all the file descriptors in the structure before passing it to this routine.

RETURNS

N/A

SEE ALSO

unixSio


Libraries : Routines

unixDevInit2( )

NAME

unixDevInit2( ) - enable interrupts

SYNOPSIS

void unixDevInit2
    (
    UNIX_CHAN * pChan
    )

DESCRIPTION

RETURNS

N/A

SEE ALSO

unixSio


Libraries : Routines

unixIntRcv( )

NAME

unixIntRcv( ) - handle a channel's receive-character interrupt.

SYNOPSIS

void unixIntRcv
    (
    UNIX_CHAN * pChan /* channel generating the interrupt */
    )

DESCRIPTION

RETURNS

N/A

SEE ALSO

unixSio


Libraries : Routines

dummyCallback( )

NAME

dummyCallback( ) - dummy callback routine.

SYNOPSIS


STATUS dummyCallback (void)

DESCRIPTION

RETURNS

ERROR.

SEE ALSO

unixSio