PLX#
Note
These functions were distributed in xia_plx.dll
before they were merged
into the Handel library.
-
int plx_close_slot(HANDLE h)#
Closes the connection to an open PCI slot defined in the HANDLE.
- Param[out] h:
A HANDLE to the PLX_DEVICE_OBJECT that will be closed.
- Returns:
A status code indicating the result of the operation.
-
void plx_dump_vmap_DEBUG(void)#
Dumps the virtual address map and data for all PLX devices loaded by the system. Only available in debug builds.
- Returns:
A status code indicating the result of the operation.
-
int plx_open_slot(unsigned short id, byte_t bus, byte_t slot, HANDLE *h)#
Opens the PCI device located using the specified parameters. As the specification for the DEVICE_LOCATION struct states, id, bus and slot may be set to -1 to indicate that the value should not be used in the search.
- Param[in] id:
Used for reporting and tracking from the caller.
- Param[in] bus:
The PCI bus that we will search for devices. Pairs with slot to define the PLX_DEVICE_KEY.
- Param[in] slot:
The PCI slot that the device occupies. Pairs with bus to define the PLX_DEVICE_KEY.
- Param[out] h:
A pointer to a memory block that will hold the instance of the PLX_DEVICE_OBJECT initialized from bus and slot.
- Returns:
A status code indicating the result of the operation.
-
void plx_print_error(int err, char *errorstring)#
Translates a PlxApi error code into a string and puts the result into the errorstring.
- Param[in] err:
The error code that needs to be translated.
- Param[out] errorstring:
A character array containing enough elements to hold the error message generated from the err code.
- Returns:
A status code indicating the result of the operation.
-
int plx_read_block(HANDLE h, unsigned long addr, unsigned long len, unsigned long n_dead, unsigned long *data)#
Uses a PCI burst read to read a block of data from the hardware. This is generally more efficient than reading individual addresses.
- Param[in] h:
A handle to the device containing the information to access.
- Param[in] addr:
The PCI address containing the information to access.
- Param[in] len:
The length of the data block to read from the provided address.
- Param[in] n_dead:
The number of dead words that will be included in the burst data block.
- Param[out] data:
A data block of length
len+n_dead
to store the data.- Returns:
A status code indicating the result of the operation.
-
int plx_read_long(HANDLE h, unsigned long addr, unsigned long *data)#
Uses the provided HANDLE to read an unsigned long from the provided address.
- Param[in] h:
A handle to the device containing the information to access.
- Param[in] addr:
The PCI address containing the information to access.
- Param[out] data:
A pointer to an unsigned long that will contain the data contained in the address.
- Returns:
A status code indicating the result of the operation.
-
void plx_set_file_DEBUG(char *f)#
Opens a file that will contain the debugging messages. If the file cannot be opened, then this redirects to
stderr
. Only available in debug builds.- Param[in] f:
The file name that will contain the message output.
- Returns:
A status code indicating the result of the operation.
-
int plx_write_long(HANDLE h, unsigned long addr, unsigned long data)#
Writes the value in data to the PCI address using the handle.
- Param[in] h:
A handle to the PCI device that we will write the data to.
- Param[in] addr:
The PCI address that we will write the data into.
- Param[in] data:
The data to be written into the provided PCI address.
- Returns:
A status code indicating the result of the operation.