VxWorks Reference Manual : Libraries
unixSio - unix serial driver
unixDevInit( ) - initialize a UNIX_DUSART
unixDevInit2( ) - enable interrupts
unixIntRcv( ) - handle a channel's receive-character interrupt.
dummyCallback( ) - dummy callback routine.
This is the driver for the UNIX stdin/stdio-base simulated serial port.
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]); ... }
drv/sio/unixSio.h sioLib.h
unixDevInit( ) - initialize a UNIX_DUSART
void unixDevInit ( UNIX_CHAN * pChan )
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.
N/A
unixDevInit2( ) - enable interrupts
void unixDevInit2 ( UNIX_CHAN * pChan )
N/A
unixIntRcv( ) - handle a channel's receive-character interrupt.
void unixIntRcv ( UNIX_CHAN * pChan /* channel generating the interrupt */ )
N/A
dummyCallback( ) - dummy callback routine.
STATUS dummyCallback (void)
ERROR.