FrontPanel API 5.3.5
|
This class encapsulates the functionality of an Opal Kelly FrontPanel-enabled device including FPGA configuration, PLL configuration, and FrontPanel endpoint access. More...
Public Member Functions | |
okCFrontPanel () | |
Default constructor. | |
~okCFrontPanel () | |
Default destructor. | |
ErrorCode | GetLastError () const |
const char * | GetLastErrorMessage () const |
ErrorCode | ActivateTriggerIn (int epAddr, int bit) |
Activates a given trigger. | |
void | Close () |
Close the device. | |
ErrorCode | ClearFPGAConfiguration () |
Clear the current FPGA configuration. | |
ErrorCode | ConfigureFPGA (const std::string strFilename, void(*callback)(int, int, void *)=NULL, void *arg=NULL) |
Download an FPGA configuration from a file. | |
ErrorCode | ConfigureFPGAWithReset (const std::string strFilename, const okTFPGAResetProfile *reset, void(*callback)(int, int, void *)=NULL, void *arg=NULL) |
Download an FPGA configuration from a file and reset. | |
ErrorCode | ConfigureFPGAFromMemory (const unsigned char *data, unsigned long length, void(*callback)(int, int, void *)=NULL, void *arg=NULL) |
Download an FPGA configuration from memory. | |
ErrorCode | ConfigureFPGAFromMemoryWithReset (const unsigned char *data, unsigned long length, const okTFPGAResetProfile *reset, void(*callback)(int, int, void *)=NULL, void *arg=NULL) |
Download an FPGA configuration from memory. | |
ErrorCode | ConfigureFPGAFromFlash (const unsigned long configIndex, void(*callback)(int, int, void *), void *arg) |
Download an FPGA configuration from on-board flash. | |
void | EnableAsynchronousTransfers (bool enable) |
Enables (or disables) asynchronous bulk transfer queueing. | |
BoardModel | GetBoardModel () |
Returns the open board model enumerated type. | |
int | GetDeviceCount () |
Returns the number of attached Opal Kelly devices. | |
std::string | GetDeviceID () |
Retrieve the device ID string stored in EEPROM. | |
ErrorCode | GetDeviceInfo (okTDeviceInfo *info) |
Fills a device information structure. | |
ErrorCode | GetFPGAResetProfile (okEFPGAConfigurationMethod method, okTFPGAResetProfile *profile) |
Retrieve the current FPGA configuration reset profile for the given method. | |
BoardModel | GetDeviceListModel (int num) |
Returns the board model of a device in the devices list. | |
std::string | GetDeviceListSerial (int num) |
Returns the serial number of a device in the devices list. | |
int | GetDeviceMajorVersion () |
Retrieves the device firmware major version. | |
int | GetDeviceMinorVersion () |
Retrieves the device firmware minor version. | |
ErrorCode | GetDeviceSensors (okCDeviceSensors &sensors) const |
Fill the array with the available sensors. | |
ErrorCode | GetDeviceSettings (okCDeviceSettings &settings) |
Initialize the object allowing to access the device settings. | |
ErrorCode | GetEepromPLL22150Configuration (okCPLL22150 &pll) |
Read PLL configuration from the on-board EEPROM (PLL22150). | |
ErrorCode | GetEepromPLL22393Configuration (okCPLL22393 &pll) |
Read PLL configuration from the on-board EEPROM (PLL22393). | |
int | GetHostInterfaceWidth () |
Returns the width of the host interface, in bits. | |
long | GetLastTransferLength () |
Returns the length of the last transfer (successful or not). | |
ErrorCode | GetPLL22150Configuration (okCPLL22150 &pll) |
Read the PLL configuration via the I2C bus (PLL22150). | |
ErrorCode | GetPLL22393Configuration (okCPLL22393 &pll) |
Read the PLL configuration via the I2C bus (PLL22393). | |
std::string | GetSerialNumber () |
Retrieve the iSerialNumber of the device. | |
ErrorCode | GetWireInValue (int epAddr, UINT32 *val) |
Gets the value of a particular Wire In from the internal wire data structure. | |
UINT32 | GetWireOutValue (int epAddr) |
Gets the value of a particular Wire Out from the internal wire data structure. | |
bool | HasDeviceSettingsSupport () const |
Returns true if the device supports settings. | |
bool | HasDeviceSensorsSupport () const |
Returns true if the device supports sensors. | |
bool | IsHighSpeed () |
Returns true if the device is High-Speed. | |
bool | IsFrontPanel3Supported () |
Returns true if FrontPanel-3 is firmware-supported. | |
bool | IsFrontPanelEnabled () |
Reads a byte from the host interface to see if FrontPanel support is built in. | |
bool | IsOpen () const |
Returns true if a device is currently open. | |
bool | IsRemote () const |
Returns true if the device is connected to a remote server. | |
bool | IsTriggered (int epAddr, UINT32 mask) |
Returns true if the trigger has been triggered. | |
UINT32 | GetTriggerOutVector (int epAddr) const |
Returns the value of the given trigger. | |
ErrorCode | LoadDefaultPLLConfiguration () |
Configures the PLL from settings stored in EEPROM. | |
ErrorCode | OpenBySerial (std::string str="") |
Opens the specified device by serial number. | |
ErrorCode | ReadI2C (int addr, int length, unsigned char *data) |
Reads I2C data from an arbitrary I2C device. | |
long | ReadFromBlockPipeOut (int epAddr, int blockSize, long length, unsigned char *data) |
Reads data from a BlockPipeOut endpoint. | |
long | ReadFromPipeOut (int epAddr, long length, unsigned char *data) |
Reads a block from a Pipe Out endpoint. | |
ErrorCode | ReadRegister (UINT32 addr, UINT32 *data) |
Reads a single register. | |
ErrorCode | ReadRegisters (okTRegisterEntries ®s) |
Reads a set of registers. | |
ErrorCode | ResetFPGA () |
Send RESET signal to FPGA design (via okHostInterface). | |
ErrorCode | SetBTPipePollingInterval (int interval) |
Set the BTPipe polling interval for completion. | |
ErrorCode | SetFPGAResetProfile (okEFPGAConfigurationMethod method, const okTFPGAResetProfile *profile) |
Set the current FPGA configuration reset profile for the given method. | |
void | SetDeviceID (const std::string &str) |
Set the device ID in EEPROM. | |
ErrorCode | SetPLL22150Configuration (const okCPLL22150 &pll) |
Store the PLL configuration via the I2C bus (PLL22150). | |
ErrorCode | SetPLL22393Configuration (const okCPLL22393 &pll) |
Store the PLL configuration via the I2C bus (PLL22393). | |
ErrorCode | SetEepromPLL22150Configuration (const okCPLL22150 &pll) |
Store PLL configuration on the on-board EEPROM (PLL22150). | |
ErrorCode | SetEepromPLL22393Configuration (const okCPLL22393 &pll) |
Store PLL configuration on the on-board EEPROM (PLL22393). | |
void | SetTimeout (int timeout) |
Set the USB timeout duration (in milliseconds). | |
ErrorCode | SetWireInValue (int ep, UINT32 val, UINT32 mask=0xffffffff) |
Sets a wire value in the internal wire data structure. | |
ErrorCode | UpdateTriggerOuts () |
Reads Trigger Out endpoints. | |
ErrorCode | UpdateWireIns () |
Transfers current Wire In values to the FPGA. | |
ErrorCode | UpdateWireOuts () |
Transfers current Wire Out values from the FPGA. | |
ErrorCode | FlashEraseSector (UINT32 address) |
Erases the sector at the specified address of System Flash memory. | |
ErrorCode | FlashWrite (UINT32 address, UINT32 length, const UINT8 *buf) |
Writes data to System Flash starting at the specified address. | |
ErrorCode | FlashRead (UINT32 address, UINT32 length, UINT8 *buf) |
Reads data from System Flash starting at the specified address. | |
ErrorCode | WriteI2C (int addr, int length, const unsigned char *data) |
Sends I2C data to an arbitrary I2C device. | |
ErrorCode | WriteRegister (UINT32 addr, UINT32 data) |
Writes a single register. | |
ErrorCode | WriteRegisters (const okTRegisterEntries ®s) |
Writes a set of registers. | |
long | WriteToBlockPipeIn (int epAddr, int blockSize, long length, const unsigned char *data) |
Writes data to a BlockPipeIn endpoint. | |
long | WriteToPipeIn (int epAddr, long length, const unsigned char *data) |
Writes a block to a Pipe In endpoint. | |
Static Public Member Functions | |
static const char * | GetErrorMessage (ErrorCode error) |
static ErrorCode | AddCustomDevice (const okTDeviceMatchInfo &matchInfo, const okTDeviceInfo *devInfo=NULL) |
static ErrorCode | RemoveCustomDevice (int productID) |
static BoardModel | FindUSBDeviceModel (unsigned usbVID, unsigned usbPID) |
static std::string | GetBoardModelString (BoardModel m) |
Returns string describing the given board model or "Unknown" if not found. | |
This is the class that encapsulates the functionality of the FPGA boards as well as the FrontPanel extensions such as wire and trigger endpoints.
okCFrontPanel::ErrorCode okCFrontPanel::ActivateTriggerIn | ( | int | epAddr, |
int | bit ) |
[in] | epAddr | The address of the TriggerIn to activate. |
[in] | bit | The specific bit of the trigger to activate. |
This method activates the specified TriggerIn on the XEM.
|
static |
Adds a custom device description.
This method can used to indicate that a custom device with the IDs specified in matchInfo should be recognized as a FrontPanel device. Opening the device with these identifiers will succeed after a call to this function.
Please use OK_PRODUCT_OEM_START
as offset for the product ID field, all product ID values below it are reserved for internal use.
Notice that it can be called more than once for the devices with different IDs but it is not needed to ever call it again for the same device. Typically, you would call it on the program startup before creating any okCFrontPanel objects.
The devInfo parameter is optional. If specified, some of its fields will override the values that would normally be returned from GetDeviceInfo().
okCFrontPanel::ErrorCode okCFrontPanel::ClearFPGAConfiguration | ( | ) |
This method clears the current configuration of the FPGA.
void okCFrontPanel::Close | ( | ) |
This method can be used to close the device to release the corresponding device at the system level, e.g. to allow another process to use it, without destroying this object itself but keeping it to be reopened later.
Referenced by OpenBySerial().
okCFrontPanel::ErrorCode okCFrontPanel::ConfigureFPGA | ( | const std::string | strFilename, |
void(* | callback )(int, int, void *) = NULL, | ||
void * | arg = NULL ) |
[in] | strFilename | A string containing the filename of the configuration file. |
[in] | callback | An optional progress callback function. |
[in] | arg | An optional argument to the callback function. |
This method downloads a configuration file to the FPGA. The filename should be that of a valid Xilinx bitfile (generated from bitgen). The callback is optional and used to track progress. The prototype for a valid callback would look like:
References ConfigureFPGAFromMemory().
okCFrontPanel::ErrorCode okCFrontPanel::ConfigureFPGAFromFlash | ( | const unsigned long | configIndex, |
void(* | callback )(int, int, void *), | ||
void * | arg ) |
[in] | configIndex | Storage index to the FPGA configuration to load. |
[in] | callback | An optional progress callback function. |
[in] | arg | An optional argument to the callback function. |
This method downloads a configuration file to the FPGA that has been and stored in on-board Flash memory.
Device Support: This method is only available for USB 3.0 devices.
okCFrontPanel::ErrorCode okCFrontPanel::ConfigureFPGAFromMemory | ( | const unsigned char * | data, |
unsigned long | length, | ||
void(* | callback )(int, int, void *) = NULL, | ||
void * | arg = NULL ) |
[in] | data | Pointer to a memory buffer containing the configuration. |
[in] | length | Length of the configuration memory. |
[in] | callback | An optional progress callback function. |
[in] | arg | An optional argument to the callback function. |
This method downloads a configuration file to the FPGA that has been read and stored in memory. The data buffer must contain a loaded Xilinx bitfile (generated from bitgen).
Referenced by ConfigureFPGA().
okCFrontPanel::ErrorCode okCFrontPanel::ConfigureFPGAFromMemoryWithReset | ( | const unsigned char * | data, |
unsigned long | length, | ||
const okTFPGAResetProfile * | reset, | ||
void(* | callback )(int, int, void *) = NULL, | ||
void * | arg = NULL ) |
[in] | data | Pointer to a memory buffer containing the configuration. |
[in] | length | Length of the configuration memory. |
[in] | reset | Pointer to an FPGA Reset Profile to perform after configuration. |
[in] | callback | An optional progress callback function. |
[in] | arg | An optional argument to the callback function. |
This method downloads a configuration file to the FPGA that has been read and stored in memory. The data buffer must contain a loaded Xilinx bitfile (generated from bitgen). After successful configuration, the FPGA is reset according to the provided reset profile.
Device Support: This method is only available for USB 3.0 devices.
okCFrontPanel::ErrorCode okCFrontPanel::ConfigureFPGAWithReset | ( | const std::string | strFilename, |
const okTFPGAResetProfile * | reset, | ||
void(* | callback )(int, int, void *) = NULL, | ||
void * | arg = NULL ) |
[in] | strFilename | A string containing the filename of the configuration file. |
[in] | callback | An optional progress callback function. |
[in] | reset | FPGA Reset profile to perform after configuration. |
[in] | arg | An optional argument to the callback function. |
This method downloads a configuration file to the FPGA and performs the specified Reset Profile after configuration. The filename should be that of a valid Xilinx bitfile (generated from bitgen). The callback is optional and used to track progress. The prototype for a valid callback would look like:
After successful configuration, the FPGA is reset according to the provided Reset Profile, an example of which is below:
Device Support: This method is only available for USB 3.0 devices.
void okCFrontPanel::EnableAsynchronousTransfers | ( | bool | enable | ) |
[in] | enable | true to enable async transfers, false to disable them. |
Asynchronous queueing of bulk transfer requests is a technique used to increase the throughput of the USB stack. This technique is known to cause problems on some operating systems (notably Windows 2000 with certain USB drivers).
If you experience problems with configuration and/or pipe transfers, try disabling async transfers. There will be a performance penalty.
|
static |
Find the board model corresponding to the USB device with the given IDs.
Find the board model of a FrontPanel device with the given IDs or returns brdUnknown if there is no such device.
okCFrontPanel::ErrorCode okCFrontPanel::FlashEraseSector | ( | UINT32 | address | ) |
[in] | address | Address within the sector to erase. |
Erases a single sector in System Flash memory. The sector to erase is determined based on the provided address. Any address within the sector will specify that the entire sector be erased. The sector specified must be in the acceptable range for the user area of Flash memory for the device. See the device User's Manual for Flash memory layout details.
The method blocks and returns when the operation completes. Sector erase times vary, but are approximately one second per sector.
Refer to the device-specific User's Manual for Flash layout and restrictions.
okCFrontPanel::ErrorCode okCFrontPanel::FlashRead | ( | UINT32 | address, |
UINT32 | length, | ||
UINT8 * | buf ) |
[in] | address | Byte address to begin read operation. |
[in] | length | Length of data to read (in bytes). |
[in] | buf | Pointer to data buffer. |
Reads data from System Flash memory starting at the specified address. The address and length must both be integer multiples of the System Flash page size.
Refer to the device-specific User's Manual for Flash layout and restrictions.
Python Note: Within Python, the 'length' parameter is not used and the 'data' parameter is of the mutable type bytearray. For example,
okCFrontPanel::ErrorCode okCFrontPanel::FlashWrite | ( | UINT32 | address, |
UINT32 | length, | ||
const UINT8 * | buf ) |
[in] | address | Byte address to begin write operation. |
[in] | length | Length of data to write (in bytes). |
[in] | buf | Pointer to data to write. |
Writes data to System Flash memory starting at the specified address. The address and length must both be integer multiples of the System Flash page size. This method will not erase the sector prior to writing. You must use FlashEraseSector to erase a sector prior to writing.
Refer to the device-specific User's Manual for Flash layout and restrictions.
Python Note: Within Python, the 'length' parameter is not used and the 'data' parameter is of the mutable type bytearray. For example,
okCFrontPanel::BoardModel okCFrontPanel::GetBoardModel | ( | ) |
Use GetLastError() or GetLastErrorMessage() to get more information about the error if brdUnknown
is returned.
References GetDeviceInfo(), and okTDeviceInfo::productID.
int okCFrontPanel::GetDeviceCount | ( | ) |
Queries to determine how many Opal Kelly devices are attached. This method also builds a list of serial numbers and board models which can subsequently be queried using the methods GetDeviceListSerial() and GetDeviceListModel(), respectively.
std::string okCFrontPanel::GetDeviceID | ( | ) |
This method retrieves the current XEM Device ID string from the device.
If the returned string is empty, use GetLastError() to check whether an error has occurred.
References okTDeviceInfo::deviceID, and GetDeviceInfo().
okCFrontPanel::ErrorCode okCFrontPanel::GetDeviceInfo | ( | okTDeviceInfo * | info | ) |
[in] | info | Pointer to an allocated okDeviceInfo structure. |
size
argument to okFrontPanel_GetDeviceInfoWithSize() function. Fills the okTDeviceInfo structure with information about the device.
Referenced by GetBoardModel(), GetDeviceID(), GetDeviceMajorVersion(), and GetDeviceMinorVersion().
okCFrontPanel::BoardModel okCFrontPanel::GetDeviceListModel | ( | int | num | ) |
[in] | num | Device number to query (0 to count-1) |
This method returns the board model of a particular attached device. The device count must have already been queried using a call to GetDeviceCount(). If a board is unknown or num is outside the range of attached devices, okCUsbFrontPanel::brdUnknown will be returned.
std::string okCFrontPanel::GetDeviceListSerial | ( | int | num | ) |
[in] | num | Device number to query (0 to count-1) |
This method returns the serial number of a particular attached device. The device count must have already been queried using a call to GetDeviceCount(). If num is outside the range of attached devices, an empty string will be returned. The serial number may then be used to open the device by calling OpenBySerial().
int okCFrontPanel::GetDeviceMajorVersion | ( | ) |
If the returned value is -1, use GetLastError() to get more information about the error.
References okTDeviceInfo::deviceMajorVersion, and GetDeviceInfo().
int okCFrontPanel::GetDeviceMinorVersion | ( | ) |
If the returned value is -1, use GetLastError() to get more information about the error.
References okTDeviceInfo::deviceMinorVersion, and GetDeviceInfo().
okCFrontPanel::ErrorCode okCFrontPanel::GetDeviceSensors | ( | okCDeviceSensors & | sensors | ) | const |
[out] | sensors | An instance of okCDeviceSensors that will be modified with the sensor information. |
Device Support: This method is only available for USB 3.0 devices.
Example:
okCFrontPanel::ErrorCode okCFrontPanel::GetDeviceSettings | ( | okCDeviceSettings & | settings | ) |
[out] | settings | An instance of okCDeviceSettings that will operate on device settings. |
Device Support: This method is only available for USB 3.0 devices.
okCFrontPanel::ErrorCode okCFrontPanel::GetEepromPLL22150Configuration | ( | okCPLL22150 & | pll | ) |
[out] | pll | A reference to an okCPLL22150 object. |
This method retrieves the current PLL configuration from the on-board XEM EEPROM. The pll object is then initialized with this configuration.
okCFrontPanel::ErrorCode okCFrontPanel::GetEepromPLL22393Configuration | ( | okCPLL22393 & | pll | ) |
[out] | pll | A reference to an okCPLL22393 object. |
This method retrieves the current PLL configuration from the on-board XEM EEPROM. The pll object is then initialized with this configuration.
|
static |
Return the error message corresponding to the given error code.
This method can be used to get a human-readable message corresponding to the given FrontPanel error code.
Note that GetLastErrorMessage() should be preferred to calling this function as the last error message may contain additional details not present in the generic message returned by this function.
Returns NULL
if the error code is not recognized.
Referenced by GetLastErrorMessage().
okCFrontPanel::ErrorCode okCFrontPanel::GetFPGAResetProfile | ( | okEFPGAConfigurationMethod | method, |
okTFPGAResetProfile * | profile ) |
[in] | method | Indicates which reset profile should be retrieved. |
[out] | profile | Boot FPGA Reset Profile |
This method queries the firmware for the current FPGA Boot or JTAG Reset Profile. The result is returned in the Reset Profile pointed to by profile.
Note: This method is only available in the C/C++ DLL.
int okCFrontPanel::GetHostInterfaceWidth | ( | ) |
The host interface width is device dependent. All USB 2.0 devices have a 16-bit host interface except for the XEM3001v1 (very early release) which has an 8-bit interface. All PCI Express devices have a 32-bit host interface. All USB 3.0 devices have a 32-bit host interface.
|
inline |
Get the error code of the last operation.
Returns one of ErrorCode values, possibly NoError.
Note that GetLastErrorMessage() should be preferred to calling this function and GetErrorMessage(), as the last error message may contain additional details not present in the generic error message returned from GetErrorMessage().
const char * okCFrontPanel::GetLastErrorMessage | ( | ) | const |
Get the message corresponding to the last error, if any.
This method can be used after any of the other methods of this class returning ErrorCode returns an error code different from NoError to check if there is an associated error message further explaining the problem.
Note that the returned pointer only remains valid until the next call to a method of this object or its destruction, so it should be either used immediately or a copy of the string needs to be made by caller.
Returns NULL
if there is no error message (which doesn't mean that the error hadn't occurred, but just that there is no additional information about it).
References GetErrorMessage().
long okCFrontPanel::GetLastTransferLength | ( | ) |
The last transfer length is updated by pipe-related functions, i.e. WriteToBlockPipeIn(), WriteToPipeIn(), ReadFromBlockPipeOut() and ReadFromPipeOut().
This function doesn't change the last error if it was set by a previously called pipe IO function, but does set it to DeviceNotOpen
if the device is not currently open.
okCFrontPanel::ErrorCode okCFrontPanel::GetPLL22150Configuration | ( | okCPLL22150 & | pll | ) |
[in] | pll | A reference to an okCPLL22150 object. |
Reads the current PLL configuration over the I2C bus and modifies the pll argument to reflect that configuration.
okCFrontPanel::ErrorCode okCFrontPanel::GetPLL22393Configuration | ( | okCPLL22393 & | pll | ) |
[in] | pll | A reference to an okCPLL22393 object. |
Reads the current PLL configuration over the I2C bus and modifies the pll argument to reflect that configuration.
std::string okCFrontPanel::GetSerialNumber | ( | ) |
This method will retrieve the 10-character serial number stored in the EEPROM. This serial number is unique to each device and can therefore be used to discriminate multiple devices. Each character in the serial number is an upper or lower case character.
If the returned string is empty, use GetLastError() to check whether an error has occurred.
UINT32 okCFrontPanel::GetTriggerOutVector | ( | int | epAddr | ) | const |
[in] | epAddr | The TriggerOut address to query. |
This method allows to retrieve the full vector of values for a particular TriggerOut endpoint. It is usually preferable to use IsTriggered() to test for a single trigger instead.
Returns 0 in case of error, e.g. an invalid trigger endpoint.
okCFrontPanel::ErrorCode okCFrontPanel::GetWireInValue | ( | int | epAddr, |
UINT32 * | val ) |
[in] | epAddr | The address of the WireIn to query. |
[in] | val | Pointer to a UINT32 to contain the result. |
Note: USB 3.0 device support only.
Gets the value of a particular WireIn from the internal wire data structure. The device firmware maintains a copy of WireIn values that are queried post-configuration and whenever a new instance of okCFrontPanel is created for a device that has an active FrontPanel-enabled configuration.
UINT32 okCFrontPanel::GetWireOutValue | ( | int | epAddr | ) |
[in] | epAddr | The WireOut address to query. |
This method provides a way to get a particular WireOut value. For example,
If the device is not open or an invalid address is given, the return value is 0, use GetLastError() to check for error in this case.
bool okCFrontPanel::HasDeviceSensorsSupport | ( | ) | const |
bool okCFrontPanel::HasDeviceSettingsSupport | ( | ) | const |
bool okCFrontPanel::IsFrontPanel3Supported | ( | ) |
This method checks the firmware device version to determine if FrontPanel-3 methods are supported. These are:
bool okCFrontPanel::IsFrontPanelEnabled | ( | ) |
This method checks to see if the FrontPanel Host Interface has been instantiated in the FPGA design. If it is detected, FrontPanel support is enabled and endpoint functionality is available.
bool okCFrontPanel::IsHighSpeed | ( | ) |
Queries the device to determine which USB speed it has enumerated at. It will return true if high-speed (480Mbps), false otherwise (full-speed, 12Mbps).
Note: This method only detects the speed on FrontPanel-3 enabled devices. If the device is not running version 3 firmware, this method always returns true. This method always returns true if a device is not currently open.
bool okCFrontPanel::IsOpen | ( | ) | const |
bool okCFrontPanel::IsRemote | ( | ) | const |
bool okCFrontPanel::IsTriggered | ( | int | epAddr, |
UINT32 | mask ) |
[in] | epAddr | The TriggerOut address to query. |
[in] | mask | A mask to apply to the trigger value. |
This method provides a way to find out if a particular bit (or bits) on a particular TriggerOut endpoint has triggered since the last call to UpdateTriggerOuts(). For example,
Use GetLastError() to check for error after calling this method.
okCFrontPanel::ErrorCode okCFrontPanel::LoadDefaultPLLConfiguration | ( | ) |
Configures the on-board PLL using the default configuration setup in the EEPROM. For a device with the Cypress CY22150 PLL, this is equivalent to:
Similar equivalence exists for devices with the CY22393 PLL.
okCFrontPanel::ErrorCode okCFrontPanel::OpenBySerial | ( | std::string | str = "" | ) |
[in] | str | The serial number of the device to open. |
Before any communication with the device can proceed, the device must be opened using this method. If the device had been already opened, it is closed automatically before opening it again.
A device is opened matching the given serial number string. If no serial number (or an empty string) is provided, then the first appropriate device is opened.
Python and Java Note: To open the first available device, you must provide an empty string.
References Close().
long okCFrontPanel::ReadFromBlockPipeOut | ( | int | epAddr, |
int | blockSize, | ||
long | length, | ||
unsigned char * | data ) |
[in] | epAddr | The address of the source Pipe Out. |
[in] | length | The length of the transfer (in bytes). |
[in] | blockSize | Block size (in bytes). |
[in] | data | A pointer to the transfer data buffer. |
This method transfers data from a specified BlockPipeOut endpoint to the given buffer.
Block size is specified in bytes and are device-dependent:
Length is specified in bytes. Firmware restrictions put a limitation on the maximum length per transfer. However, this API will automatically perform multiple transfers, if required, to complete the full length. Length must be an integer multiple of the block size. The length must also be an integer multiple of a minimal transfer size according to the list below:
Performance Note: Optimum bandwidth performance is achieved when blockSize is a power of two.
Python Note: Within Python, the 'length' parameter is not used and the 'data' parameter is mutable type bytearray. For example,
long okCFrontPanel::ReadFromPipeOut | ( | int | epAddr, |
long | length, | ||
unsigned char * | data ) |
[in] | epAddr | The address of the source Pipe Out. |
[in] | length | The length of the transfer (in bytes). |
[in] | data | A pointer to the transfer data buffer. |
This method transfers data from a specified Pipe Out endpoint to the given buffer.
Length is specified in bytes. Firmware restrictions put a limitation on the maximum length per transfer. However, this API will automatically perform multiple transfers, if required, to complete the full length. Length must be an integer multiple of a minimal transfer size according to the list below:
Python Note: Within Python, the 'length' parameter is not used and the 'data' parameter is mutable type bytearray. For example,
okCFrontPanel::ErrorCode okCFrontPanel::ReadI2C | ( | int | addr, |
int | length, | ||
unsigned char * | data ) |
[in] | addr | I2C address of the target device. |
[in] | length | Length of data (in bytes). |
[in] | data | Pointer receive data buffer. |
This method reads a string of bytes from the target I2C address. This transfer does not utilize the FPGA and can be done prior to configuration.
okCFrontPanel::ErrorCode okCFrontPanel::ReadRegister | ( | UINT32 | addr, |
UINT32 * | data ) |
[in] | addr | Register address |
[out] | data | Pointer to register data |
Performs a single register read operation and puts the result into data.
Python Note:In Python, the method is called as shown here:
References ReadRegisters().
okCFrontPanel::ErrorCode okCFrontPanel::ReadRegisters | ( | okTRegisterEntries & | regs | ) |
[in,out] | regs | Vector of registers to read. |
Performs multiple register reads at addresses provided by the elements of regs
Referenced by ReadRegister().
|
static |
Remove a previously added custom device description.
This method can be used to forget about the device defined by a previous call to AddCustomDevice().
okCFrontPanel::ErrorCode okCFrontPanel::ResetFPGA | ( | ) |
Performs a RESET of the FPGA internals. This requires that FrontPanel support be present in the FPGA design because the RESET signal actually comes from the FrontPanel Host Interface.
okCFrontPanel::ErrorCode okCFrontPanel::SetBTPipePollingInterval | ( | int | interval | ) |
[in] | interval | Polling interval (in milliseconds). |
At the completion of a BTPipeIn transfer, the host polls the hardware to confirm that all of the data has been consumed by the FPGA before returning from the function. The polling interval is set by this method.
The valid range for this interval is 1 to 100 milliseconds. Values outside this range cause the errorcode Failed to be returned. The default is 25 milliseconds.
void okCFrontPanel::SetDeviceID | ( | const std::string & | str | ) |
[in] | str | A string containing the new Device ID. |
This method modifies the XEM Device ID string with the new string. The Device ID string is a user-programmable string of up to 32 characters that can be used to uniquely identify a particular XEM. The string will be truncated if it exceeds 32 characters.
GetLastError() can be used to check whether an error has occurred after calling this method.
okCFrontPanel::ErrorCode okCFrontPanel::SetEepromPLL22150Configuration | ( | const okCPLL22150 & | pll | ) |
[in] | pll | A reference to an okCPLL22150 object. |
This method programs the on-board XEM EEPROM with the PLL configuration in pll.
okCFrontPanel::ErrorCode okCFrontPanel::SetEepromPLL22393Configuration | ( | const okCPLL22393 & | pll | ) |
[in] | pll | A reference to an okCPLL22393 object. |
This method programs the on-board XEM EEPROM with the PLL configuration in pll.
okCFrontPanel::ErrorCode okCFrontPanel::SetFPGAResetProfile | ( | okEFPGAConfigurationMethod | method, |
const okTFPGAResetProfile * | profile ) |
[in] | method | Indicates which reset profile should be set. |
[in] | profile | Boot FPGA Reset Profile |
The Boot Reset Profile is the Reset Profile that defines how (and if) the firmware should configure the FPGA on boot and the sequence performed after configuration. If a valid Reset Profile is stored, the firmware will use that profile to boot and setup the FPGA at power-on.
The JTAG Reset Profile is the Reset Profile that defines the configuration sequence that should be followed after the FPGA is configured via JTAG. If a valid Reset Profile is stored, the firmware will method that profile to setup the FPGA if it detects completion of a JTAG-based configuration completion.
Example:
An empty Reset Profile (with u32Length=0) specifies that an FPGA configuration is not to be loaded on boot. For example:
Note: This method is only available in the C/C++ DLL.
okCFrontPanel::ErrorCode okCFrontPanel::SetPLL22150Configuration | ( | const okCPLL22150 & | pll | ) |
[in] | pll | A reference to an okCPLL22150 object. |
Configures the on-board PLL via the I2C bus using the configuration information in the pll object.
okCFrontPanel::ErrorCode okCFrontPanel::SetPLL22393Configuration | ( | const okCPLL22393 & | pll | ) |
[in] | pll | A reference to an okCPLL22393 object. |
Configures the on-board PLL via the I2C bus using the configuration information in the pll object.
void okCFrontPanel::SetTimeout | ( | int | timeout | ) |
[in] | timeout | Timeout duration specified in milliseconds. |
This method sets the timeout value used by USB transactions when communicating with the target device. Note that this is not necessarily the timeout for a particular API call. By default, the timeout is set to 10 seconds).
Note that a timeout is not always provided by the underlying calls nor by the operating system. Most generally, the timeout will apply to pipe transfers and FPGA configuration transfers.
Use GetLastError() to check whether timeout was set successfully.
okCFrontPanel::ErrorCode okCFrontPanel::SetWireInValue | ( | int | ep, |
UINT32 | val, | ||
UINT32 | mask = 0xffffffff ) |
[in] | ep | The address of the WireIn endpoint to update. |
[in] | val | The new value of the WireIn. |
[in] | mask | A mask to apply to the new value. |
WireIn endpoint values are stored internally and updated when necessary by calling UpdateWireIns(). The values are updated on a per-endpoint basis by calling this method. In addition, specific bits may be updated independent of other bits within an endpoint by using the optional mask.
okCFrontPanel::ErrorCode okCFrontPanel::UpdateTriggerOuts | ( | ) |
okCFrontPanel::ErrorCode okCFrontPanel::UpdateWireIns | ( | ) |
okCFrontPanel::ErrorCode okCFrontPanel::UpdateWireOuts | ( | ) |
okCFrontPanel::ErrorCode okCFrontPanel::WriteI2C | ( | int | addr, |
int | length, | ||
const unsigned char * | data ) |
[in] | addr | I2C address of the target device. |
[in] | length | Length of data (in bytes). |
[in] | data | Pointer to data to be written. |
This method writes a string of bytes to the target I2C address. This transfer does not utilize the FPGA and can be done prior to configuration.
okCFrontPanel::ErrorCode okCFrontPanel::WriteRegister | ( | UINT32 | addr, |
UINT32 | data ) |
[in] | addr | Register address |
[in] | data | Pointer to register data |
Performs a single register write operation.
References WriteRegisters().
okCFrontPanel::ErrorCode okCFrontPanel::WriteRegisters | ( | const okTRegisterEntries & | regs | ) |
[in,out] | regs | Vector of registers to write. |
Writes values of multiple registers at once.
Referenced by WriteRegister().
long okCFrontPanel::WriteToBlockPipeIn | ( | int | epAddr, |
int | blockSize, | ||
long | length, | ||
const unsigned char * | data ) |
[in] | epAddr | The address of the destination Pipe In. |
[in] | length | The length of the transfer (in bytes). |
[in] | blockSize | Block size (in bytes). |
[in] | data | A pointer to the transfer data buffer. |
This method transfers a specified buffer of data to the given BlockPipeIn endpoint. If the transfer fails, an ErrorCode is returned. A return value less than 0 indicates an error situation.
Block size is specified in bytes and are device-dependent:
Length is specified in bytes. Firmware restrictions put a limitation on the maximum length per transfer. However, this API will automatically perform multiple transfers, if required, to complete the full length. Length must be an integer multiple of the block size. The length must also be an integer multiple of a minimal transfer size according to the list below:
Python Note: Within Python, the 'length' parameter is not used and the 'data' parameter is of the mutable type bytearray. For example,
long okCFrontPanel::WriteToPipeIn | ( | int | epAddr, |
long | length, | ||
const unsigned char * | data ) |
[in] | epAddr | The address of the destination Pipe In. |
[in] | length | The length of the transfer (in bytes). |
[in] | data | A pointer to the transfer data buffer. |
This method transfers a specified buffer of data to the given Pipe In endpoint. If the transfer fails, an ErrorCode is returned. A return value less than 0 indicates an error situation.
Length is specified in bytes. Firmware restrictions put a limitation on the maximum length per transfer. However, this API will automatically perform multiple transfers, if required, to complete the full length. Length must be an integer multiple of a minimal transfer size according to the list below:
Python Note: Within Python, the 'length' parameter is not used and the 'data' parameter is mutable type bytearray. For example,