VxWorks Reference Manual : Libraries

lptDrv

NAME

lptDrv - parallel chip device driver for the IBM-PC LPT

ROUTINES

lptDrv( ) - initialize the LPT driver
lptDevCreate( ) - create a device for an LPT port
lptShow( ) - show LPT statistics

DESCRIPTION

This is the basic driver for the LPT used on the IBM-PC. If the component INCLUDE_LPT is enabled, the driver initializes the LPT port on the PC.

USER-CALLABLE ROUTINES

Most of the routines in this driver are accessible only through the I/O system. However, two routines must be called directly: lptDrv( ) to initialize the driver, and lptDevCreate( ) to create devices.

There are one other callable routines: lptShow( ) to show statistics. The argument to lptShow( ) is a channel number, 0 to 2.

Before the driver can be used, it must be initialized by calling lptDrv( ). This routine should be called exactly once, before any reads, writes, or calls to lptDevCreate( ). Normally, it is called from usrRoot( ) in usrConfig.c. The first argument to lptDrv( ) is a number of channels, 0 to 2. The second argument is a pointer to the resource table. Definitions of members of the resource table structure are:

    int  ioBase;         /* IO base address */
    int  intVector;      /* interrupt vector */
    int  intLevel;       /* interrupt level */
    BOOL autofeed;       /* TRUE if enable autofeed */
    int  busyWait;       /* loop count for BUSY wait */
    int  strobeWait;     /* loop count for STROBE wait */
    int  retryCnt;       /* retry count */
    int  timeout;        /* timeout second for syncSem */

IOCTL FUNCTIONS

This driver responds to two functions: LPT_SETCONTROL and LPT_GETSTATUS. The argument for LPT_SETCONTROL is a value of the control register. The argument for LPT_GETSTATUS is a integer pointer where a value of the status register is stored.

SEE ALSO

lptDrv, VxWorks Programmer's Guide: I/O System


Libraries : Routines

lptDrv( )

NAME

lptDrv( ) - initialize the LPT driver

SYNOPSIS

STATUS lptDrv
    (
    int            channels, /* LPT channels */
    LPT_RESOURCE * pResource /* LPT resources */
    )

DESCRIPTION

This routine initializes the LPT driver, sets up interrupt vectors, and performs hardware initialization of the LPT ports.

This routine should be called exactly once, before any reads, writes, or calls to lptDevCreate( ). Normally, it is called by usrRoot( ) in usrConfig.c.

RETURNS

OK, or ERROR if the driver cannot be installed.

SEE ALSO

lptDrv, lptDevCreate( )


Libraries : Routines

lptDevCreate( )

NAME

lptDevCreate( ) - create a device for an LPT port

SYNOPSIS

STATUS lptDevCreate
    (
    char * name,   /* name to use for this device */
    int    channel /* physical channel for this device (0 - 2) */
    )

DESCRIPTION

This routine creates a device for a specified LPT port. Each port to be used should have exactly one device associated with it by calling this routine.

For instance, to create the device /lpt/0, the proper call would be:

    lptDevCreate ("/lpt/0", 0);

RETURNS

OK, or ERROR if the driver is not installed, the channel is invalid, or the device already exists.

SEE ALSO

lptDrv( )


Libraries : Routines

lptShow( )

NAME

lptShow( ) - show LPT statistics

SYNOPSIS

void lptShow
    (
    UINT channel /* channel (0 - 2) */
    )

DESCRIPTION

This routine shows statistics for a specified LPT port.

RETURNS

N/A

SEE ALSO

lptDrv