|
int | edt_parse_unit_channel (const char *str, char *dev, const char *default_dev, int *channel) |
| Parse an EDT device name string. Fills in the name of the device, with the default_device if specified, or a default determined by the package, and returns a unit number. Designed to facilitate a flexible device/unit command line argument scheme for application programs. Most EDT example/utility programs use this subroutine to allow users to specify either a unit number alone or a device/unit number concatenation. More...
|
|
void | edt_reset_counts (EdtDev edt_p) |
| Reset timeout and overflow counters in the driver. More...
|
|
int | edt_device_unit (EdtDev edt_p) |
| Get the 'unit' number of the specified device. More...
|
|
int | edt_device_channel (EdtDev edt_p) |
| Get the 'channel' number of the specified device. More...
|
|
enum EDT_PCI_PID | edt_device_id (EdtDev edt_p) |
| Get the PCI device ID (PID) of the EDT device. More...
|
|
const char * | edt_idstr (enum EDT_PCI_PID id) |
| Get a descriptive string of a given board ID. More...
|
|
int | edt_parse_unit (const char *str, char *dev, const char *default_dev) |
| Parse an EDT device name string. Same as edt_parse_unit_channel() but without the channel number. More...
|
|
int | edt_find_xpn (const char *part_number, char *fpga) |
| Read the default part number->fpga cross-reference file edt_parts.xpn in the current directory, and provides the FPGA if a match is found. More...
|
|
int | edt_get_xref_info (const char *path, const char *pn, char *fpga, char *sn, char *mac_type, char *mac_offset, char *mac_count, char *desc, char *rsvd1, char *rsvd2) |
| Read a part number->fpga cross-reference file and provides the FPGA and base serial number if a match is found. More...
|
|
unsigned int | edt_errno (void) |
| Get an operating system dependent error number. More...
|
|
const char * | edt_home_dir (EdtDev edt_p) |
| Get base installation directory of PCD or PDV package. More...
|
|
EDT_CHECK_RETURN int | edt_system (const char *cmdstr) |
| Performs a UNIX-like system() call which passes the argument string to a shell or command interpreter, then returns the exit status so that errors can be detected. On Windows spawnv() will be used. More...
|
|
int | edt_set_bitpath (EdtDev edt_p, const char *bitpath) |
| Set bitpath as the currently loaded "user interface" FPGA firmware ("bitfile") in the driver. More...
|
|
int | edt_get_bitpath (EdtDev edt_p, char *bitpath, int size) |
| Get file path from the driver of the currently loaded interface bitfile. More...
|
|
int | edt_get_bitname (EdtDev edt_p, char *bitfile, int size) |
| Same as edt_get_bitpath() but returns the file name without the directory. More...
|
|
int | edt_get_driver_version (EdtDev edt_p, char *version_str, size_t size) |
|
int | edt_get_driver_buildid (EdtDev edt_p, char *build_str, size_t size) |
| Get the full build ID of the EDT driver. The build ID string is the same format as that returned by edt_get_library_buildid(). More...
|
|
int | edt_get_library_version (char *version_str, size_t size) |
| Get the version string of the EDT library. Example: "1.2.3-rc4" More...
|
|
unsigned int | edt_get_version_number (void) |
| Get the EDT library version as a packed number. Example v5.6.1 would be represented as 50601 . More...
|
|
int | edt_get_library_buildid (char *build_str, size_t size) |
| Get the build ID of the EDT library. Example: "20210214124523.asdf1234 64 bit" More...
|
|
int | edt_check_version (EdtDev edt_p) |
| Ensure the EDT library and the kernel driver are the same version. More...
|
|
uint32_t | edt_get_dma_info (EdtDev edt_p, edt_dma_info_t *dmainfo) |
| Gets information about active DMA. More...
|
|
Utility functions.
int edt_get_xref_info |
( |
const char * |
path, |
|
|
const char * |
pn, |
|
|
char * |
fpga, |
|
|
char * |
sn, |
|
|
char * |
mac_type, |
|
|
char * |
mac_offset, |
|
|
char * |
mac_count, |
|
|
char * |
desc, |
|
|
char * |
rsvd1, |
|
|
char * |
rsvd2 |
|
) |
| |
Read a part number->fpga cross-reference file and provides the FPGA and base serial number if a match is found.
- Parameters
-
[in] | path | Path of the xref FPGA file (typ. "edt_parts.xpn"). |
[in] | pn | EDT part number to search for. Either 8 to 10 characters, meaning either with or without the last 2 characters, which is the revision number. Example: "01901933" . |
[out] | fpga | If a match is found, the FPGA part number will be returned here. Should be at least 64 bytes. If NULL, this parameter will be ignored. |
[out] | sn | The base serial number, if found. Should be at least 64 bytes. If NULL, this parameter will be ignored. |
[out] | mac_type | The MAC address board type, if found. Should be at least 8 bytes. If NULL, this parameter will be ignored. |
[out] | mac_offset | The MAC address offset found. Should be at least 8 bytes. If NULL this parameter will be ignored. |
[out] | mac_count | The MAC addresses for this board, if found. Should be at least 8 bytes. If NULL this parameter will be ignored. |
[out] | rsvd1 | Reserved. Always pass NULL. |
[out] | rsvd2 | Reserved. Always pass NULL. |
- Returns
- Number of parameters successfully assigned, or 0 if none or error.
Opens the file specified in the path
argument (e.g. "edt_parts.xpn") and compares the entries with the provided part number. If a match is found, it will be copied to the fpga
argument. Will also copy a serial number if found. Format of the file is ASCII text, one line per part number, as follows:
<part_number> <fpga> [serial] <description>
(serial is optional and not present in earlier files)
Anything after the third item is ignored, and can be blank but should typically be the description (name of the device). Since files originally had only two fields and no serial number, an attempt is made to determine if the 3rd field looks like a serial number and copies that if so, otherwise sets the first character to NULL.
The last 2 digits of 10 digit pn
are the revision number. If a match with a 10-digit number is found, returns with the info from that one. If no 10-digit match is found but an 8-digit is found, returns with that info. That way we can have some numbers return a match regardless of rev, and others that cover a specific rev that takes precedence.
const char * edt_home_dir |
( |
EdtDev |
edt_p | ) |
|
Get base installation directory of PCD or PDV package.
Home directory is based on EDT environment variable for the driver type, if set. Driver type depends on the version of EDT package / SDK in use. Drivertype / environment variable associations follow:
"pcd": $EDT_PCD_DIR "pdv": $EDT_PDV_DIR
By default, the installation script installs packages in /opt/EDT<type>
(Linux) or C:\EDT\<type>
(Windows), so for example with a PCD package and default install directory, this subroutine would return "/opt/EDTpcd" or "C:\EDT\pcd".
- Parameters
-
- Returns
- value of the appropriate $XXXHOME environment variable, or CWD (".") if not set.