xPCIe1516 API
xPCIe1516 General functions

Functions

_INT_ i_PCIe1516_GetNumberOfBoards (OUT BYTE *pb_NbrOfBoards)
 
_INT_ i_PCIe1516_GetBoardInformation (IN BYTE b_BoardIndex, IN DWORD dw_IdentifierStringSize, OUT CHAR *pc_Identifier, OUT DWORD *pdw_UINumber, OUT DWORD *pdw_DeviceNumber, OUT DWORD *pdw_BusNumber, OUT DWORD *pdw_BaseAddress0, OUT DWORD *pdw_BaseAddress1, OUT DWORD *pdw_BaseAddress2, OUT DWORD *pdw_BaseAddress3, OUT BYTE *pb_Interrupt)
 
_INT_ i_PCIe1516_OpenBoardViaIndex (IN BYTE b_BoardIndex, OUT HANDLE *ph_DeviceHandle)
 
_INT_ i_PCIe1516_OpenBoardViaIdentifier (IN CHAR pc_Identifier[], OUT HANDLE *ph_DeviceHandle)
 
_INT_ i_PCIe1516_CloseBoard (HANDLE h_DeviceHandle)
 
_INT_ i_PCIe1516_GetDLLVersion (OUT DWORD *pdw_Version)
 
_INT_ i_PCIe1516_GetDeviceDriverVersion (IN HANDLE h_DeviceHandle, OUT DWORD *pdw_Version)
 
const _PCHAR_ pc_PCIe1516_GetLastError (IN HANDLE h_DeviceHandle)
 
_INT_ i_PCIe1516_SetBoardIntRoutine (IN HANDLE h_DeviceHandle, IN void(*v_FunctionName)(INHANDLE h_DeviceHandle, INBYTEb_FifoOverflow, INDWORDdw_InterruptSource, INDWORDdw_InterruptMask, OUT WORD *pw_Args, INDWORDdw_ArgsCount))
 
_INT_ i_PCIe1516_ResetBoardIntRoutine (IN HANDLE h_DeviceHandle)
 

Detailed Description

Function Documentation

_INT_ i_PCIe1516_GetNumberOfBoards ( OUT BYTE *  pb_NbrOfBoards)

Returns the number of xPCIe1516 boards present in the system.
The function fills 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
Return values
0No error
-1Error while getting the number of boards
_INT_ i_PCIe1516_GetBoardInformation ( IN BYTE  b_BoardIndex,
IN DWORD  dw_IdentifierStringSize,
OUT CHAR *  pc_Identifier,
OUT DWORD *  pdw_UINumber,
OUT DWORD *  pdw_DeviceNumber,
OUT DWORD *  pdw_BusNumber,
OUT DWORD *  pdw_BaseAddress0,
OUT DWORD *  pdw_BaseAddress1,
OUT DWORD *  pdw_BaseAddress2,
OUT DWORD *  pdw_BaseAddress3,
OUT BYTE *  pb_Interrupt 
)

Gets generic device information.

Parameters
[in]b_BoardIndexIndex of the board
[in]dw_IdentifierStringSizeSize of the identifier parameter buffer
[out]pc_IdentifierIdentifier of the board
[out]pdw_UINumberThis 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_DeviceNumberDevice number.
[out]pdw_BusNumberBus number.
[out]pdw_BaseAddress0Base address 0 of the board
[out]pdw_BaseAddress1Base address 1 of the board
[out]pdw_BaseAddress2Base address 2 of the board
[out]pdw_BaseAddress3Base address 3 of the board
[out]pb_InterruptInterrupt line of the board
Return values
0No error
-1Unable to open the board via index
-2Error when calling driver's IOCTL
_INT_ i_PCIe1516_OpenBoardViaIndex ( IN BYTE  b_BoardIndex,
OUT HANDLE *  ph_DeviceHandle 
)

Opens the board with the specified index. A handle is returned to the
user which allows driver functions to be used.

Parameters
[in]b_BoardIndexIndex of the board to open
[out]ph_DeviceHandleHandle of the selected xPCIe1516 board
Return values
0No error
-1Unable to get the number of available boards
-2Wrong device index parameter, the parameter is too high
-3Error while getting the device's class
-4Error while getting informations about the device
-5Memory allocation error
-6Get device interface detail error
-7Error while creating communication handle
-8Error in the initialization callback function
_INT_ i_PCIe1516_OpenBoardViaIdentifier ( IN CHAR  pc_Identifier[],
OUT HANDLE *  ph_DeviceHandle 
)

Opens the board with the specified identifier. A handle is returned to the
user which allows driver functions to be used.

Parameters
[in]pc_IdentifierIdentifier of the board to open
[out]ph_DeviceHandleHandle of the xPCIe1516 board
Return values
0No Error
-1Unable to get the number of available boards
-2Unable to get the board identifier
-3Unable to open the board
-4Identifier not found
_INT_ i_PCIe1516_CloseBoard ( HANDLE  h_DeviceHandle)

Releases the handle to the board. Block the access to the board.

Parameters
[in]h_DeviceHandleHandle of the board
Return values
0No Error
-1The device handle parameter is wrong
-2Unable to close the device handle
_INT_ i_PCIe1516_GetDLLVersion ( OUT DWORD *  pdw_Version)

Gets the version of the DLL.

Parameters
[out]pdw_VersionVersion. For example: 0x01010910 -> Version 1.01, September 2010
Return values
0No Error
_INT_ i_PCIe1516_GetDeviceDriverVersion ( IN HANDLE  h_DeviceHandle,
OUT DWORD *  pdw_Version 
)

Gets the version of the device driver.

Parameters
[in]h_DeviceHandleHandle of the board
[out]pdw_VersionVersion. For example: 0x01011211 -> Version 1.01, December 2011
Return values
0No Error
-1Error while calling IOCTL function
const _PCHAR_ pc_PCIe1516_GetLastError ( IN HANDLE  h_DeviceHandle)

Gets a pointer to a string describing the last error that occurred.

Parameters
[in]h_DeviceHandleHandle of the board
Returns
a pointer to the error string
_INT_ i_PCIe1516_SetBoardIntRoutine ( IN HANDLE  h_DeviceHandle,
IN void(*)(INHANDLE h_DeviceHandle, INBYTEb_FifoOverflow, INDWORDdw_InterruptSource, INDWORDdw_InterruptMask, OUT WORD *pw_Args, INDWORDdw_ArgsCount)  v_FunctionName 
)

Registers an interrupt callback function. This callback function will be called each time the board generates an interruption.
The value of dw_InterruptSource will enable you to determine the source of the interruption:

Parameters
[in]h_DeviceHandleHandle of the board
[in]v_FunctionNameAddress of the callback function
h_DeviceHandle: Handle of the board
b_FIFOOverflow: If uc_FIFOOverflow != 0, there are too many unprocessed interrupts in the kernel FIFO, and any new information is lost
dw_InterruptMask: Source of the interrupt
pw_Args: Values read during the interrupt. If DMA interrupt, this pointer will be set to NULL.
dw_ArgsCount: Number of values read during the interrupt
Return values
0No Error
-1The device handle parameter is wrong
-2An interrupt routine is already installed. Remove it with ResetBoardIntRoutine and retry
-3Error while creating kill event
-4Error while creating interrupt event
-5Error while creating interrupt thread
-6Error while changing the priority class of the thread
-7Error while changing the priority of the thread
-8Error while calling the IOCTL command
-9Error in the interrupt callback function
_INT_ i_PCIe1516_ResetBoardIntRoutine ( IN HANDLE  h_DeviceHandle)

Deregisters the current interrupt callback function.

Parameters
[in]h_DeviceHandleHandle of the board
Return values
0No Error
-1The device handle parameter is wrong
-2No interrupt routine installed
-3Error in the reset interrupt callback function