VxWorks Reference Manual : Libraries

winSio

NAME

winSio - win serial driver

ROUTINES

winDevInit( ) - initialize a WIN_CHAN
winDevInit2( ) - initialize a WIN_CHAN, part 2
winIntRcv( ) - handle a channel's receive-character interrupt
winIntTx( ) - transmit a single character.
dummyCallback( ) - dummy callback routine

DESCRIPTION

This is the console serial driver for the Windows simulator. It recieves character interrupts from Windows and send them off to vxWorks.

Device data structures are defined in the header file h/drv/sio/winSio.h. A device data structure, WIN_CHAN, is defined for each channel.

USAGE

The driver is typically only called only by the BSP. The directly callable routines in this module are winDevInit( ), winDevInit2( ), winIntRcv( ) and winIntTx( ).

The BSP calls winDevInit( ) to initialize or reset the device. It connects the driver's interrupt handlers (winIntRcv and winIntTx) using intConnect( ). After connecting the interrupt handlers, the BSP calls winDevInit2( ) to inform the driver that interrupt mode operation is now possible.

BSP

By convention all the BSP-specific serial initialization is performed in a file called sysSerial.c, which is #include'ed by sysLib.c. sysSerial.c implements at least four functions, sysSerialHwInit( ) sysSerialHwInit2( ), sysSerialChanGet( ), and sysSerialReset( ), which work as follows:

sysSerialHwInit is called by sysHwInit to initialize the serial devices. This routine will initialize all the board specific fields in the WIN_CHAN structure (e.g., register I/O addresses, etc) before calling winDevInit( ), which resets the device and installs the driver function pointers. sysSerialHwInit( ) should also perform any other processing which is needed for the serial drivers, such as configuring on-board interrupt controllers as appropriate.

sysSerialHwInit2 is called by sysHwInit2 to connect the serial driver's interrupt handlers using intConnect( ). After connecting the interrupt handlers, the call to winDevInit2( ) is made to permit interrupt mode operations to begin.

sysSerialChanGet is called by usrRoot to get the serial channel descriptor associated with a serial channel number. The routine takes a single parameter which is a channel number ranging between zero and NUM_TTY. It returns a pointer to the corresponding channel descriptor, SIO_CHAN *, which is just the address of the WIN_CHAN structure.

sysSerialReset is called from sysToMonitor( ) and should reset the serial devices to an inactive state.

INCLUDE FILES

drv/sio/winSio.h sioLib.h

SEE ALSO

winSio


Libraries : Routines

winDevInit( )

NAME

winDevInit( ) - initialize a WIN_CHAN

SYNOPSIS

void winDevInit
    (
    WIN_CHAN * pChan
    )

DESCRIPTION

This routine initializes the driver function pointers and then resets the chip in a quiescent state. The BSP must have already initialized all the device addresses and the baudFreq fields in the WIN_CHAN structure before passing it to this routine.

RETURNS

N/A

SEE ALSO

winSio


Libraries : Routines

winDevInit2( )

NAME

winDevInit2( ) - initialize a WIN_CHAN, part 2

SYNOPSIS

void winDevInit2
    (
    WIN_CHAN * pChan /* device to initialize */
    )

DESCRIPTION

This routine is called by the BSP after interrupts have been connected. The driver can now operate in interrupt mode. Before this routine is called only polled mode operations should be allowed.

RETURNS

N/A

ARGSUSED

SEE ALSO winSio


Libraries : Routines

winIntRcv( )

NAME

winIntRcv( ) - handle a channel's receive-character interrupt

SYNOPSIS

void winIntRcv
    (
    WIN_CHAN * pChan, /* channel generating the interrupt */
    UINT16     wparam /* message args get passed if you look */
    )

DESCRIPTION

This function is attached to the simulator's interrupt handler, and passes the character received in the message to the callback.

RETURNS

N/A

SEE ALSO

winSio


Libraries : Routines

winIntTx( )

NAME

winIntTx( ) - transmit a single character.

SYNOPSIS

void winIntTx
    (
    WIN_CHAN * pChan /* channel generating the interrupt */
    )

DESCRIPTION

This displays a single character to the simulator's window.

RETURNS

N/A

SEE ALSO

winSio


Libraries : Routines

dummyCallback( )

NAME

dummyCallback( ) - dummy callback routine

SYNOPSIS


STATUS dummyCallback (void)

DESCRIPTION

RETURNS

ERROR.

SEE ALSO

winSio