Home    Prev Next    
Contents
Programming For PCI Device
Overview
Programmers Guide
Scenario
Access to PCI devices information
How to work with PCI header
Accessing PCI registers
Accessing BAR0-BAR5 areas
I/O Ports control
Single read/write operations
Data array read/write operations
Accessing Physical Memory Addresses
Memory Mapping
Additional Functions
Hardware interrupts handling at user level
Common Issues
Extended options of hardware interrupt handling
PCI Support Routines And Structures
Common Procedures
OpenRapidPci
IsRapidPciOpened
CloseRapidPci
GetHardwareConfiguration
GetPciLocation
PCI specific functions
PCI Header
GetPciHeader
SetPciHeader
ReadFromPci
WriteToPci
PCI BAR Areas
GetNumOfPciBars
GetPciBarLength
GetPciBarPhysicalAddress
GetPciBarLinearAddress
ReadPciBarByte
ReadPciBarWord
ReadPciBarLong
WritePciBarByte
WritePciBarWord
WritePciBarLong
PCI Registers
ReadPciCommandReg
WritePciCommandReg
ControlPciCommandRegBits
ReadPciStatusReg
Memory Access
MapPhysToLinear
UnmapMemory
GetMem
GetMemW
GetMemL
SetMem
SetMemW
SetMemL
Direct Port I/O
GetPortByte
GetPortWord
GetPortLong
SetPortByte
SetPortWord
SetPortLong
ReadPortBuffer
WritePortBuffer
Hardware Interrupts
UnmaskPciIrq
MaskPciIrq
GetInterruptCounter
OpenRapidPci
Go to RapidDriver Main Page

Opens the RapidPci.sys kernel mode WDM device driver under Windows 2000/XP, providing direct access to the PCI hardware.

Language

Description

C/C++
HANDLE OpenRapidPci ( ULONG DeviceInstance )
Delphi
function OpenRapidPci ( DeviceInstance : Longword) : THandle; stdcall
VB
Function OpenRapidPci ( ByVal DeviceInstance As Long) As Long


Parameters:
DeviceInstance - PCI device instance.

Return Value:
The RapidPci handle value or NULL if fails. Keep this handle opened all time when you are working with RapidPci functions and close by CloseRapidPci() at end of application.

Comments:

If the driver was successfully opened, the IsRapidPciOpened() returns True; if the function fails, the IsRapidPciOpened() returns False.
With RapidPci you can support as many PCI devices as you want. To select the device you need change DriverInstance value from 0 up to maximal number of PCI device installed with RapidPci driver. For the first application use

    hPci = OpenRapidPci(0);

For second:

    hPci = OpenRapidPci(1);

and so on.

See also: CloseRapidPci IsRapidPciOpened