Difference between revisions of "Unit PCI"
From Ultibo.org
(3 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
---- | ---- | ||
− | '''Ultibo PCI/PCIe | + | '''Ultibo PCI/PCIe Interface unit''' |
=== Constants === | === Constants === | ||
Line 45: | Line 45: | ||
| <code>PCI_TYPE_NAMES:array[PCI_TYPE_NONE..PCI_TYPE_MAX] of String = ('PCI_TYPE_NONE');</code> | | <code>PCI_TYPE_NAMES:array[PCI_TYPE_NONE..PCI_TYPE_MAX] of String = ('PCI_TYPE_NONE');</code> | ||
| style="width: 50%;"| | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''PCI device state''' <code> PCI_STATE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>PCI_STATE_DETACHED = 0;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>PCI_STATE_DETACHING = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>PCI_STATE_ATTACHING = 2;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>PCI_STATE_ATTACHED = 3;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>PCI_STATE_MAX = 3;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>PCI_STATE_NAMES:array[PCI_STATE_DETACHED..PCI_STATE_MAX] of String = ('PCI_STATE_DETACHED', 'PCI_STATE_DETACHING', 'PCI_STATE_ATTACHING', 'PCI_STATE_ATTACHED');</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''PCI device status''' <code> PCI_STATUS_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code> PCI_STATUS_UNBOUND = 0; </code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>PCI_STATUS_BOUND = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>PCI_STATUS_MAX = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>PCI_STATUS_NAMES:array[PCI_STATUS_UNBOUND..PCI_STATUS_MAX] of String = ('PCI_STATUS_UNBOUND', 'PCI_STATUS_BOUND');</code> | ||
+ | | | ||
|- | |- | ||
|} | |} | ||
Line 67: | Line 121: | ||
| <code>PCIHOST_TYPE_NONE = 0;</code> | | <code>PCIHOST_TYPE_NONE = 0;</code> | ||
| style="width: 50%;"| | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>PCIHOST_TYPE_PCI = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>PCIHOST_TYPE_PCIX = 2;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>PCIHOST_TYPE_PCIE = 3;</code> | ||
+ | | | ||
|- | |- | ||
|colspan="2"| | |colspan="2"| | ||
|- | |- | ||
− | | <code>PCIHOST_TYPE_MAX = | + | | <code>PCIHOST_TYPE_MAX = 3;</code> |
| | | | ||
|- | |- | ||
|colspan="2"| | |colspan="2"| | ||
|- | |- | ||
− | | <code>PCIHOST_TYPE_NAMES:array[PCIHOST_TYPE_NONE..PCIHOST_TYPE_MAX] of String = ('PCIHOST_TYPE_NONE');</code> | + | | <code>PCIHOST_TYPE_NAMES:array[PCIHOST_TYPE_NONE..PCIHOST_TYPE_MAX] of String = ('PCIHOST_TYPE_NONE', 'PCIHOST_TYPE_PCI', 'PCIHOST_TYPE_PCIX', 'PCIHOST_TYPE_PCIE');</code> |
| | | | ||
|- | |- | ||
Line 179: | Line 242: | ||
| <code>PCIId:LongWord;</code> | | <code>PCIId:LongWord;</code> | ||
| Unique Id of this PCI in the PCI device table | | Unique Id of this PCI in the PCI device table | ||
+ | |- | ||
+ | | <code>PCIState:LongWord;</code> | ||
+ | | PCI device state (eg PCI_STATE_ATTACHED) | ||
+ | |- | ||
+ | | <code>PCIStatus:LongWord;</code> | ||
+ | | PCI device status (eg PCI_STATUS_BOUND) | ||
|- | |- | ||
| <code>Host:PPCIHost;</code> | | <code>Host:PPCIHost;</code> | ||
| Host controller this PCI device is connected to (Set by PCI core) | | Host controller this PCI device is connected to (Set by PCI core) | ||
+ | |- | ||
+ | | <code>Parent:PPCIDevice;</code> | ||
+ | | Parent this PCI device is connected to, if any (Set by PCI core) | ||
|- | |- | ||
| <code>Driver:PPCIDriver;</code> | | <code>Driver:PPCIDriver;</code> | ||
Line 321: | Line 393: | ||
| <code>HostId:LongWord;</code> | | <code>HostId:LongWord;</code> | ||
| Unique Id of this Host in the Host table | | Unique Id of this Host in the Host table | ||
+ | |- | ||
+ | | <code>HostState:LongWord</code> | ||
+ | | Host state (eg PCIHOST_STATE_ENABLED) | ||
|- | |- | ||
| <code>HostStart:TPCIHostStart;</code> | | <code>HostStart:TPCIHostStart;</code> | ||
Line 583: | Line 658: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
<pre style="border: 0; padding-bottom:0px;">function PCIDriverCreate:PPCIDriver;</pre> | <pre style="border: 0; padding-bottom:0px;">function PCIDriverCreate:PPCIDriver;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create a new Driver entry</div> | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create a new PCI Driver entry</div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
Line 595: | Line 670: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
<pre style="border: 0; padding-bottom:0px;">function PCIDriverCreateEx(Size:LongWord):PPCIDriver;</pre> | <pre style="border: 0; padding-bottom:0px;">function PCIDriverCreateEx(Size:LongWord):PPCIDriver;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create a new Driver entry</div> | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create a new PCI Driver entry</div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
Line 610: | Line 685: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
<pre style="border: 0; padding-bottom:0px;">function PCIDriverDestroy(Driver:PPCIDriver):LongWord;</pre> | <pre style="border: 0; padding-bottom:0px;">function PCIDriverDestroy(Driver:PPCIDriver):LongWord;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Destroy an existing Driver entry</div> | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Destroy an existing PCI Driver entry</div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
Line 622: | Line 697: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
<pre style="border: 0; padding-bottom:0px;">function PCIDriverRegister(Driver:PPCIDriver):LongWord;</pre> | <pre style="border: 0; padding-bottom:0px;">function PCIDriverRegister(Driver:PPCIDriver):LongWord;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Register a new Driver in the Driver table</div> | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Register a new PCI Driver in the Driver table</div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
Line 634: | Line 709: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
<pre style="border: 0; padding-bottom:0px;">function PCIDriverDeregister(Driver:PPCIDriver):LongWord;</pre> | <pre style="border: 0; padding-bottom:0px;">function PCIDriverDeregister(Driver:PPCIDriver):LongWord;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Deregister a Driver from the Driver table</div> | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Deregister a PCI Driver from the Driver table</div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
Line 646: | Line 721: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
<pre style="border: 0; padding-bottom:0px;">function PCIDriverFind(DriverId:LongWord):PPCIDriver;</pre> | <pre style="border: 0; padding-bottom:0px;">function PCIDriverFind(DriverId:LongWord):PPCIDriver;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Find a driver by Id in the PCI Driver table</div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
Line 658: | Line 733: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
<pre style="border: 0; padding-bottom:0px;">function PCIDriverFindByName(const Name:String):PPCIDriver; inline;</pre> | <pre style="border: 0; padding-bottom:0px;">function PCIDriverFindByName(const Name:String):PPCIDriver; inline;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Find a driver by name in the Driver table</div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
Line 670: | Line 745: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
<pre style="border: 0; padding-bottom:0px;">function PCIDriverEnumerate(Callback:TPCIDriverEnumerate; Data:Pointer):LongWord;</pre> | <pre style="border: 0; padding-bottom:0px;">function PCIDriverEnumerate(Callback:TPCIDriverEnumerate; Data:Pointer):LongWord;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Enumerate all drivers in the PCI Driver table</div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
Line 832: | Line 907: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
<pre style="border: 0; padding-bottom:0px;">function PCIDriverGetCount:LongWord; inline;</pre> | <pre style="border: 0; padding-bottom:0px;">function PCIDriverGetCount:LongWord; inline;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current driver count</div> | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current PCI driver count</div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
Line 844: | Line 919: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
<pre style="border: 0; padding-bottom:0px;">function PCIDriverCheck(Driver:PPCIDriver):PPCIDriver;</pre> | <pre style="border: 0; padding-bottom:0px;">function PCIDriverCheck(Driver:PPCIDriver):PPCIDriver;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Check if the supplied Driver is in the driver table</div> | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Check if the supplied PCI Driver is in the driver table</div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
Line 881: | Line 956: | ||
<pre style="border: 0; padding-bottom:0px;">function PCIStatusToString(Status:LongWord):String;</pre> | <pre style="border: 0; padding-bottom:0px;">function PCIStatusToString(Status:LongWord):String;</pre> | ||
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Translates a PCI status code into a string</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Translates a PCI status code into a string</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function PCIDeviceTypeToString(PCIType:LongWord):String;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function PCIDeviceStateToString(PCIState:LongWord):String;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function PCIDeviceStatusToString(PCIStatus:LongWord):String; | ||
+ | </pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function PCIDeviceStateToNotification(State:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert a Device state value into the notification code for device notifications</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function PCIDeviceStatusToNotification(Status:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert a Device status value into the notification code for device notifications</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function PCIHostTypeToString(HostType:LongWord):String;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function PCIHostStateToString(HostState:LongWord):String;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function PCIHostStateToNotification(State:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert a Host state value into the notification code for device notifications</div> | ||
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" |
Latest revision as of 04:59, 31 August 2021
Return to Unit Reference
Contents
[hide]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
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
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
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
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 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 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 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 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 PCIDeviceCheck(Device:PPCIDevice):PPCIDevice;
Description: Check if the supplied Device is in the device table
[Expand]
function PCIDriverCheck(Driver:PPCIDriver):PPCIDriver;
Description: Check if the supplied PCI Driver is in the driver table
[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 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 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