pci_type1.bas

PCI Configuration Method 1 functions

Author

Marcel Sondaar

License

Public Domain

Summary
pci_type1.basPCI Configuration Method 1 functions
Functions
PCI_type1_readbyteGrabs a byte from PCI configuration space using configuration method 1
PCI_type1_readwordGrabs a 2-byte word from PCI configuration space using configuration method 1
PCI_type1_readdwordGrabs a 4-byte doubleword from PCI configuration space using configuration method 1
PCI_type1_writedwordGrabs a 4-byte doubleword from PCI configuration space using configuration method 1

Functions

PCI_type1_readbyte

Function PCI_type1_readbyte(ByVal Bus As Unsigned Integer,
ByVal Device As Unsigned Integer,
ByVal Func As Unsigned Integer,
ByVal Offset As Unsigned Integer) As Unsigned Byte

Grabs a byte from PCI configuration space using configuration method 1

In

BusThe PCI Bus index
DeviceThe Device index of the bus
FuncThe subfunction of the device
OffsetThe base address to read from

Out

ReturnThe byte read from PCI

PCI_type1_readword

Function PCI_type1_readword(
   ByVal Bus As Unsigned Integer,
   ByVal Device As Unsigned Integer,
   ByVal Func As Unsigned Integer,
   ByVal Offset As Unsigned Integer
) As Unsigned Short

Grabs a 2-byte word from PCI configuration space using configuration method 1

In

BusThe PCI Bus index
DeviceThe Device index of the bus
FuncThe subfunction of the device
OffsetThe base address to read from

Out

ReturnThe word read from PCI

PCI_type1_readdword

Function PCI_type1_readdword(
   ByVal Bus As Unsigned Integer,
   ByVal Device As Unsigned Integer,
   ByVal Func As Unsigned Integer,
   ByVal Offset As Unsigned Integer
) As Unsigned Integer

Grabs a 4-byte doubleword from PCI configuration space using configuration method 1

In

BusThe PCI Bus index
DeviceThe Device index of the bus
FuncThe subfunction of the device
OffsetThe base address to read from

Out

ReturnThe doubleword read from PCI

PCI_type1_writedword

Sub PCI_type1_writedword(ByVal Bus As Unsigned Integer,
ByVal Device As Unsigned Integer,
ByVal Func As Unsigned Integer,
ByVal Offset As Unsigned Integer,
Value As Unsigned Integer)

Grabs a 4-byte doubleword from PCI configuration space using configuration method 1

In

BusThe PCI Bus index
DeviceThe Device index of the bus
FuncThe subfunction of the device
OffsetThe base address to read from
ValueThe value to write

Out

None

Function PCI_type1_readbyte(ByVal Bus As Unsigned Integer,
ByVal Device As Unsigned Integer,
ByVal Func As Unsigned Integer,
ByVal Offset As Unsigned Integer) As Unsigned Byte
Grabs a byte from PCI configuration space using configuration method 1
Function PCI_type1_readword(
   ByVal Bus As Unsigned Integer,
   ByVal Device As Unsigned Integer,
   ByVal Func As Unsigned Integer,
   ByVal Offset As Unsigned Integer
) As Unsigned Short
Grabs a 2-byte word from PCI configuration space using configuration method 1
Function PCI_type1_readdword(
   ByVal Bus As Unsigned Integer,
   ByVal Device As Unsigned Integer,
   ByVal Func As Unsigned Integer,
   ByVal Offset As Unsigned Integer
) As Unsigned Integer
Grabs a 4-byte doubleword from PCI configuration space using configuration method 1
Sub PCI_type1_writedword(ByVal Bus As Unsigned Integer,
ByVal Device As Unsigned Integer,
ByVal Func As Unsigned Integer,
ByVal Offset As Unsigned Integer,
Value As Unsigned Integer)
Grabs a 4-byte doubleword from PCI configuration space using configuration method 1