xPCI-1500 API
xPCI-1500 general functions

Functions

_INT_ i_PCI1500_GetNumberOfBoards (PBYTE pb_NbrOfBoards)
 
_INT_ i_PCI1500_GetBoardInformation (BYTE b_BoardIndex, DWORD dw_IdentifierStringSize, PCHAR pc_Identifier, PDWORD pdw_UINumber, PDWORD pdw_DeviceNumber, PDWORD pdw_BusNumber, PDWORD pdw_BaseAddress0, PDWORD pdw_BaseAddress1, PDWORD pdw_BaseAddress2, PBYTE pb_Interrupt)
 
INT i_PCI1500_ClearInterruptFIFO (HANDLE b_boardHandle)
 
_INT_ i_PCI1500_GetSerialNumber (HANDLE h_DeviceHandle, DWORD *serialNumber)
 
_INT_ i_PCI1500_GetFirmwareVersion (HANDLE h_DeviceHandle, PDWORD firmwareVersion)
 
_INT_ i_PCI1500_SetSerialNumber (HANDLE h_DeviceHandle, DWORD serialNumber)
 
_INT_ i_PCI1500_OpenBoardViaIndex (BYTE b_BoardIndex, PHANDLE ph_DeviceHandle)
 
_INT_ i_PCI1500_OpenBoardViaIdentifier (PCHAR pc_Identifier, PHANDLE ph_DeviceHandle)
 
_INT_ i_PCI1500_CloseBoard (HANDLE h_DeviceHandle)
 
_INT_ i_PCI1500_GetDLLVersion (PDWORD pdw_Version)
 
_INT_ i_PCI1500_GetDeviceDriverVersion (HANDLE h_DeviceHandle, PDWORD pdw_Version)
 

Detailed Description

Function Documentation

_INT_ i_PCI1500_GetNumberOfBoards ( PBYTE  pb_NbrOfBoards)

Enables to get the number of xPCI-1500 boards present in the system.
The function fill the value pointed by pb_NbrOfBoards with the number of boards present.

Parameters
[out]pb_NbrOfBoardsValue that will be filled with the number of boards
Returns
0 : No error
-1 : Error while getting the number of boards
_INT_ i_PCI1500_GetBoardInformation ( BYTE  b_BoardIndex,
DWORD  dw_IdentifierStringSize,
PCHAR  pc_Identifier,
PDWORD  pdw_UINumber,
PDWORD  pdw_DeviceNumber,
PDWORD  pdw_BusNumber,
PDWORD  pdw_BaseAddress0,
PDWORD  pdw_BaseAddress1,
PDWORD  pdw_BaseAddress2,
PBYTE  pb_Interrupt 
)

Get device information of the board.

Parameters
[in]b_BoardIndex: Index of the board
[in]dw_IdentifierStringSize: size of the identifier parameter
[out]pc_IdentifierIdentifier of the board
[out]pdw_UINumber: This number is typically a user-perceived slot number, such as a number printed next to the slot on the board, or some other number that makes locating the physical device easier for the user. If the device is on a bus that has no UI number convention, or if the bus driver for the device cannot determine the UI number, this value is 0xFFFFFFFF.
[out]pdw_DeviceNumber: Device number.
[out]pdw_BusNumber: Bus number.
[out]pdw_BaseAddress0: Base address 0 of the board
[out]pdw_BaseAddress1: Base address 1 of the board
[out]pdw_BaseAddress2: Base address 2 of the board
[out]pb_Interrupt: Interrupt line of the board
Returns
0 : No error
-1 : Unable to open the board via index
-2 : Error when calling driver's IOCTL
INT i_PCI1500_ClearInterruptFIFO ( HANDLE  b_boardHandle)

Clear the Interrupt fifo

Parameters
[in]b_BoardIndex: Index of the board
Returns
0 : No error
-1 : Error when calling driver's IOCTL
_INT_ i_PCI1500_GetSerialNumber ( HANDLE  h_DeviceHandle,
DWORD *  serialNumber 
)

Return the serial number of the board.

Parameters
[in]h_DeviceHandle: Handle of the board
[out]serialNumber: Serial number of the board in decimal
Return values
0: No Error
-1: timeout
-100: Error while calling IOCTL function
_INT_ i_PCI1500_GetFirmwareVersion ( HANDLE  h_DeviceHandle,
PDWORD  firmwareVersion 
)

Return the serial number of the board.

Parameters
[in]h_DeviceHandle: Handle of the board
[out]firmwareVersion: Firmware Version of the Board Contains the 4 ASCII codes of the configuration
  • bits 0 -> 7 ASCII code (version low)
  • bits 8 -> 15 ASCII code (version high)
  • bits 16 -> 23 ASCII code (functionality name second digit)
  • bits 24 -> 31 ASCII code (functionality name first digit)
  • to read them select one of the four bits and print it using a char printf("%c", )
Return values
0: No Error
-1: timeout
-100: Error while calling IOCTL function
_INT_ i_PCI1500_SetSerialNumber ( HANDLE  h_DeviceHandle,
DWORD  serialNumber 
)

Return the serial number of the board.

Parameters
[in]h_DeviceHandle: Handle of the board
[out]pdw_DeviceNumber: Serial number of the board in decimal
Return values
0: No Error
-1: timeout
-100: Error while calling IOCTL function
_INT_ i_PCI1500_OpenBoardViaIndex ( BYTE  b_BoardIndex,
PHANDLE  ph_DeviceHandle 
)

Open the board with the index : b_BoardIndex. A handle is returned to the
user which allows to use the driver functions.

Parameters
[in]b_BoardIndex: Index of the board to open
[out]ph_DeviceHandle: Handle of the selected xPCI-1500 board for using the functions
Returns
0 : No error
-1 : Unable to get the number of available boards
-2 : Wrong device index parameter. The parameter is too high
-3 : Error while getting the device's class
-4 : Error while getting informations about the device
-5 : Memory allocation error
-6 : Get device interface detail error
-7 : Error while creating communication handle
-8 : Error in the initialization callback function
_INT_ i_PCI1500_OpenBoardViaIdentifier ( PCHAR  pc_Identifier,
PHANDLE  ph_DeviceHandle 
)

Open the board with the indentifier : pc_Identifier. A handle is returned to the
user which allows to use the following functions.

Parameters
[in]pc_Identifier: Identifier of the board to open
[out]ph_DeviceHandle: Handle of the board xPCI-1500 for using the functions
Returns
0 : No Error
-1 : Unable to get the number of available boards
-2 : Unable to get the board identifier
-3 : Unable to open the board
-4 : Identifier not found
_INT_ i_PCI1500_CloseBoard ( HANDLE  h_DeviceHandle)

Release the handle of the board. Block the access to the board.

Parameters
[in]h_DeviceHandle: Handle of the board
Returns
0 : No Error
-1 : The device handle parameter is wrong
_INT_ i_PCI1500_GetDLLVersion ( PDWORD  pdw_Version)

Return the version of the DLL.

Parameters
[out]pdw_Version: Version. sample : 0x01010910 -> version 1.01 september 2010
Returns
0 : No Error
_INT_ i_PCI1500_GetDeviceDriverVersion ( HANDLE  h_DeviceHandle,
PDWORD  pdw_Version 
)

Return the version of the device driver.

Parameters
[in]h_DeviceHandle: Handle of the board
[out]pdw_Version: Version. sample : 0x01011211 -> version 1.01 - 12/2011
Returns
0 : No Error
-1 : Error while calling IOCTL function