
The First 16 double words of a PCI device's configuration space are referred to as
the device's configuration region. Within these the 16 (0-15) double words, the 04,
05, 06, 07, 08 and 09 double words are referred to as Base Address0, Base
Address1, Base Address2, Base Address3, Base Address4 and Base Address5.
For more detailed information for about these 16 double words, please referring
the book titled
PLUG AND PLAY SYSTEM ARCHITECTURE
(written by Tom
Shanley, Addison-Wesley Publish Company, 1995). These base addresses are
utilized as control register and/or I/O register for many data acquisition boards. On
PCI-P16R16 and PCI-P8R8 series boards, the base address2 is utilized as the
base address of digital input and digital output. So the Digital I/O functions for PCI-
P16R16 and PCI-P8R8 series are coded as follows:
#define WORD unsigned int
#define UCHAR unsigned char
void P16R16_DO(WORD BaseAddr, WORD wOutData)
{
outport(BaseAddr,wOutData);
}
WORD P16R16_DI(WORD BaseAddr)
{
WORD
DigitalIn;
DigitalIn=inport(BaseAddr);
return DigitalIn;
}
void P8R8_DO(WORD BaseAddr, WORD wOutData)
{
outportb(BaseAddr,wOutData);
}
UCHAR P8R8_DI(WORD BaseAddr)
{
UCHAR DigitalIn;
DigitalIn=inportb(BaseAddr);
return DigitalIn;
}
PCI-P16R16 Series User Manual (Ver.2.8, Apr. 2011, PMH-013-28)
29