InitCOSDriver
This function performs the initialization required to respond to change-of-state IRQs. It must be called
before GetCOSData can be called, although calling GetCOSData first will only cause it to return a value of
FALSE. The function's parameters are the card's Base Address, the IRQ level to monitor, the card's bus
type, and the card's bus number. The last two parameters, BusType and BusNumber, are only used in
Windows NT. The header files Win32COS.PAS (for Pascal) and Win32COS.H (for C) contain the
enumerated constants that can be passed in the BusType parameter. The two possible values are PCIBus
and Isa. For Windows 95/98, the IRQCOS Driver ignores these parameters and their values can be set to
zero. The return result is TRUE if initialization was completed successfully, FALSE if not.
GetCOSData
This function suspends the thread that it was called from and waits for an IRQ to occur on the IRQ level
that was passed to InitCOSDriver. GetCOSData will return immediately, however, if an IRQ occurred
anytime before the GetCOSData call, as long as InitCOSDriver was previously called. Otherwise,
GetCOSData will not return until an IRQ occurs. If the program needs to continue running while waiting for
GetCOSData, a separate thread should be created from which to call GetCOSData. Immediately upon
detecting an IRQ, GetCOSData reads 48 bits of data off the card and returns the data in a pointer supplied
by the calling application. This pointer must be at least six bytes and must be allocated by the calling
application. For cards that contain less than 48 bits of data, the lowest bits are valid and the extraneous
data should be discarded. For example, a card that contains 24 bits of data will return the valid data in the
lowest 3 bytes of the memory block pointed to by the supplied pointer, while the upper 3 bytes will be
invalid. If multiple interrupts occur before any GetCOSData call, the data read after the most recent IRQ will
be returned. The return result is TRUE if an IRQ was detected on the given IRQ level and data was
successfully read, FALSE if InitCOSDriver was not called before calling GetCOSData.
SETUP.EXE
This program is supplied in the root or base directory as a tool for you to use in configuring jumpers on the
card. It is menu-driven and provides pictures of the card on the computer monitor. You make simple
keystrokes to select functions. The picture on the monitor then changes to show how the jumper should be
placed to effect your choices.
The setup program is a stand-alone program that can be run at any time. It does not require that the card
be plugged into the computer for any part of the setup. The program is self-explanatory with operation
instructions and on-line help.
To run this program, at the DOS prompt, enter SETUP.EXE followed by
-
.
VisualBASIC Utility Driver
Extensions to the VisualBASIC 3.0 language are also included on the diskette provided with your card. (For
later versions of VisualBASIC, use the ACCES32 driver and samples.) The extensions are in a directory
named VBACCES. These extensions are in the form of a .DLL, a .GBL, and a VisualBASIC sample.
Together these files allow you to access the port and main memory space in a fashion similar to BASIC,
QuickBASIC, Pascal, C/C++, Assembly, and most other standard languages.
To use these files in a VisualBASIC program, you must create a .MAK file (File l New Project) similar to the
sample provided (or else, modify your existing project file) and include the .GBL file (File | Add File). Once
this has been done, VisualBASIC will be enhanced with the addition of the following functions.
InPortb
Function:
Reads a byte from a hardware port. Due to limitations of VisualBASIC, the number is
returned in an integer.
Declaration:
function InPortb(byval address as integer) as integer
Manual PCI-DIO-48(S)
15