Unit PCI

From Ultibo.org
Jump to: navigation, search

Return to Unit Reference


Description


Ultibo PCI/PCIe Interface unit

Constants



[Expand]
PCI device, driver and host specific constants PCI_*


[Expand]
PCI device type PCI_TYPE_*


[Expand]
PCI device state PCI_STATE_*


[Expand]
PCI device status PCI_STATUS_*


[Expand]
PCI device flag PCI_FLAG_*


[Expand]
PCI host type PCIHOST_TYPE_*


[Expand]
PCI host state PCIHOST_STATE_*


[Expand]
PCI host flag PCIHOST_FLAG_*


[Expand]
PCI status code PCI_STATUS_*


[Expand]
PCI logging PCI_LOG_*


Type definitions



PCI device

[Expand]

PPCIDevice = ^TPCIDevice;

TPCIDevice = record

PCI device bind callback

TPCIDeviceBind = function(Device:PPCIDevice):LongWord;

PCI device unbind callback

TPCIDeviceUnbind = function(Device:PPCIDevice; Driver:PPCIDriver):LongWord;

PCI device enumeration callback

TPCIDeviceEnumerate = function(Device:PPCIDevice; Data:Pointer):LongWord;

PCI device notification callback

TPCIDeviceNotification = function(Device:PDevice; Data:Pointer; Notification:LongWord):LongWord;

PCI driver

[Expand]

PPCIDriver = ^TPCIDriver;

TPCIDriver = record

PCI driver enumeration callback

TPCIDriverEnumerate = function(Driver:PPCIDriver; Data:Pointer):LongWord;

PCI driver bind

TPCIDriverBind = function(Device:PPCIDevice):LongWord;

PCI driver unbind

TPCIDriverUnbind = function(Device:PPCIDevice):LongWord;

PCI host

[Expand]

PPCIHost = ^TPCIHost;

TPCIHost = record

PCI host enumeration callback

TPCIHostEnumerate = function(Host:PPCIHost; Data:Pointer):LongWord;

PCI host notification callback

TPCIHostNotification = function(Device:PDevice; Data:Pointer; Notification:LongWord):LongWord;

PCI host start

TPCIHostStart = function(Host:PPCIHost):LongWord;

PCI host stop

TPCIHostStop = function(Host:PPCIHost):LongWord;

PCI host reset

TPCIHostReset = function(Host:PPCIHost):LongWord;

PCI logging

TPCILogOutput = procedure(const AText:String; Data:Pointer);


Public variables



PCI logging

PCI_DEFAULT_LOG_LEVEL:LongWord = PCI_LOG_LEVEL_DEBUG; Minimum level for PCI messages. Only messages with level greater than or equal to this will be printed.
PCI_LOG_ENABLED:Boolean;


Function declarations



Initialization functions

[Expand]
procedure PCIInit;
Description: Performs basic initialization of the PCI core driver, after this devices, hosts and drivers can be registered however nothing will work until PCIStart is called


[Expand]
function PCIStart:LongWord;
Description: Starts all registered PCI hosts and begins the PCI enumeration process


[Expand]
function PCIStop:LongWord;
Description: To be documented


[Expand]
procedure PCIAsyncStart(Host:PPCIHost);
Description: To be documented


PCI device, driver and host functions

[Expand]
function PCIDeviceAllocate(Host:PPCIHost):PPCIDevice;
Description: Create and Register a new Device entry in the Device table


[Expand]
function PCIDeviceRelease(Device:PPCIDevice):LongWord;
Description: Deregister and Destroy a Device from the Device table


[Expand]
function PCIDeviceFind(PCIId:LongWord):PPCIDevice;
Description: To be documented


[Expand]
function PCIDeviceFindById(VendorId,ProductId:Word):PPCIDevice;
Description: To be documented


[Expand]
function PCIDeviceFindByName(const Name:String):PPCIDevice; inline;
Description: To be documented


[Expand]
function PCIDeviceFindByDescription(const Description:String):PPCIDevice; inline;
Description: To be documented


[Expand]
function PCIDeviceEnumerate(Callback:TPCIDeviceEnumerate; Data:Pointer):LongWord;
Description: To be documented


[Expand]
function PCIDeviceNotification(Device:PPCIDevice; Callback:TPCIDeviceNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Description: To be documented


[Expand]
function PCIDriverCreate:PPCIDriver;
Description: Create a new PCI Driver entry


[Expand]
function PCIDriverCreateEx(Size:LongWord):PPCIDriver;
Description: Create a new PCI Driver entry


[Expand]
function PCIDriverDestroy(Driver:PPCIDriver):LongWord;
Description: Destroy an existing PCI Driver entry


[Expand]
function PCIDriverRegister(Driver:PPCIDriver):LongWord;
Description: Register a new PCI Driver in the Driver table


[Expand]
function PCIDriverDeregister(Driver:PPCIDriver):LongWord;
Description: Deregister a PCI Driver from the Driver table


[Expand]
function PCIDriverFind(DriverId:LongWord):PPCIDriver;
Description: Find a driver by Id in the PCI Driver table


[Expand]
function PCIDriverFindByName(const Name:String):PPCIDriver; inline;
Description: Find a driver by name in the Driver table


[Expand]
function PCIDriverEnumerate(Callback:TPCIDriverEnumerate; Data:Pointer):LongWord;
Description: Enumerate all drivers in the PCI Driver table


[Expand]
function PCIHostCreate:PPCIHost;
Description: Create a new Host entry


[Expand]
function PCIHostCreateEx(Size:LongWord):PPCIHost;
Description: Create a new Host entry


[Expand]
function PCIHostDestroy(Host:PPCIHost):LongWord;
Description: Destroy an existing Host entry


[Expand]
function PCIHostRegister(Host:PPCIHost):LongWord;
Description: Register a new Host in the Host table


[Expand]
function PCIHostDeregister(Host:PPCIHost):LongWord;
Description: Deregister a Host from the Host table


[Expand]
function PCIHostFind(HostId:LongWord):PPCIHost;
Description: To be documented


[Expand]
function PCIHostFindByName(const Name:String):PPCIHost; inline;
Description: To be documented


[Expand]
function PCIHostFindByDescription(const Description:String):PPCIHost; inline;
Description: To be documented


[Expand]
function PCIHostEnumerate(Callback:TPCIHostEnumerate; Data:Pointer):LongWord;
Description: To be documented


[Expand]
function PCIHostNotification(Host:PPCIHost; Callback:TPCIHostNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Description: To be documented


PCI device, driver and host helper functions

[Expand]
function PCIDeviceGetCount:LongWord; inline;
Description: Get the current device count


[Expand]
function PCIDeviceCheck(Device:PPCIDevice):PPCIDevice;
Description: Check if the supplied Device is in the device table


[Expand]
function PCIDriverGetCount:LongWord; inline;
Description: Get the current PCI driver count


[Expand]
function PCIDriverCheck(Driver:PPCIDriver):PPCIDriver;
Description: Check if the supplied PCI Driver is in the driver table


[Expand]
function PCIHostGetCount:LongWord; inline;
Description: Get the current host count


[Expand]
function PCIHostCheck(Host:PPCIHost):PPCIHost;
Description: Check if the supplied Host is in the host table


[Expand]
function PCIStatusToString(Status:LongWord):String;
Description: Translates a PCI status code into a string


[Expand]
function PCIDeviceTypeToString(PCIType:LongWord):String;
Description: To be documented


[Expand]
function PCIDeviceStateToString(PCIState:LongWord):String;
Description: To be documented


[Expand]
function PCIDeviceStatusToString(PCIStatus:LongWord):String;
Description: To be documented


[Expand]
function PCIDeviceStateToNotification(State:LongWord):LongWord;
Description: Convert a Device state value into the notification code for device notifications


[Expand]
function PCIDeviceStatusToNotification(Status:LongWord):LongWord;
Description: Convert a Device status value into the notification code for device notifications


[Expand]
function PCIHostTypeToString(HostType:LongWord):String;
Description: To be documented


[Expand]
function PCIHostStateToString(HostState:LongWord):String;
Description: To be documented


[Expand]
function PCIHostStateToNotification(State:LongWord):LongWord;
Description: Convert a Host state value into the notification code for device notifications


[Expand]
procedure PCILog(Level:LongWord;Device:PPCIDevice; const AText:String);
Description: To be documented


[Expand]
procedure PCILogInfo(Device:PPCIDevice; const AText:String); inline;
Description: To be documented


[Expand]
procedure PCILogWarn(Device:PPCIDevice; const AText:String); inline;
Description: To be documented


[Expand]
procedure PCILogError(Device:PPCIDevice; const AText:String); inline;
Description: To be documented


[Expand]
procedure PCILogDebug(Device:PPCIDevice; const AText:String); inline;
Description: To be documented


Return to Unit Reference