PCI-DIO48(S)(S) Manual
Page 5-2
Manual 00650-529-1
To import the functions manually in C, the necessary lines would be:
extern "C" __declspec(dllimport) unsigned char InitCOSDriver(unsigned long
BaseAddress, unsigned char IRQ, short BusType, unsigned char BusNumber);
extern "C" __declspec(dllimport) unsigned char GetCOSData(void *Buf);
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.