VxWorks Reference Manual : Libraries
lptDrv - parallel chip device driver for the IBM-PC LPT
lptDrv( ) - initialize the LPT driver
lptDevCreate( ) - create a device for an LPT port
lptShow( ) - show LPT statistics
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.
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 */
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.
lptDrv, VxWorks Programmer's Guide: I/O System
lptDrv( ) - initialize the LPT driver
STATUS lptDrv ( int channels, /* LPT channels */ LPT_RESOURCE * pResource /* LPT resources */ )
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.
OK, or ERROR if the driver cannot be installed.
lptDrv, lptDevCreate( )
lptDevCreate( ) - create a device for an LPT port
STATUS lptDevCreate ( char * name, /* name to use for this device */ int channel /* physical channel for this device (0 - 2) */ )
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);
OK, or ERROR if the driver is not installed, the channel is invalid, or the device already exists.
lptDrv( )
lptShow( ) - show LPT statistics
void lptShow ( UINT channel /* channel (0 - 2) */ )
This routine shows statistics for a specified LPT port.
N/A