![]() |
FrontPanel API 6.0.0
|
Provides access to the classic FrontPanel data transfer endpoints (wires, triggers, pipes, and registers). More...
Public Member Functions | |
| ErrorCode | ResetFPGA () |
| Send RESET signal to FPGA design (via okHostInterface). | |
| ErrorCode | SetWireInValue (int ep, UINT32 val, UINT32 mask=0xffffffff) |
| Sets a wire value in the internal wire data structure. | |
| ErrorCode | GetWireInValue (int epAddr, UINT32 *val) |
| Gets the value of a particular Wire In from the internal wire data structure. | |
| ErrorCode | UpdateWireIns () |
| Transfers current Wire In values to the FPGA. | |
| UINT32 | GetWireOutValue (int epAddr) |
| Gets the value of a particular Wire Out from the internal wire data structure. | |
| ErrorCode | UpdateWireOuts () |
| Transfers current Wire Out values from the FPGA. | |
| ErrorCode | ActivateTriggerIn (int epAddr, int bit) |
| Activates a given trigger. | |
| ErrorCode | UpdateTriggerOuts () |
| Reads Trigger Out endpoints. | |
| 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 | SetBTPipePollingInterval (int interval) |
| Set the BTPipe polling interval for completion. | |
| long | WriteToPipeIn (int epAddr, long length, const unsigned char *data) |
| Writes a block to a Pipe In endpoint. | |
| long | WriteToBlockPipeIn (int epAddr, int blockSize, long length, const unsigned char *data) |
| Writes data to a BlockPipeIn endpoint. | |
| long | ReadFromPipeOut (int epAddr, long length, unsigned char *data) |
| Reads a block from a Pipe Out endpoint. | |
| long | ReadFromBlockPipeOut (int epAddr, int blockSize, long length, unsigned char *data) |
| Reads data from a BlockPipeOut endpoint. | |
| ErrorCode | ReadRegister (UINT32 addr, UINT32 *data) |
| Reads a single register. | |
| ErrorCode | WriteRegister (UINT32 addr, UINT32 data) |
| Writes a single register. | |
| ErrorCode | ReadRegisters (okTRegisterEntries ®s) |
| Reads a set of registers. | |
| ErrorCode | WriteRegisters (const okTRegisterEntries ®s) |
| Writes a set of registers. | |
An instance of this class is obtained by calling okCFrontPanel::GetFPGADataPortClassic(). It delegates all operations to the underlying okCFrontPanel device.
classic_dataport refers to an instance of okCFPGADataPortClassic obtained as follows: | okCFPGADataPortClassic::ErrorCode okCFPGADataPortClassic::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.
| UINT32 okCFPGADataPortClassic::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.
| okCFPGADataPortClassic::ErrorCode okCFPGADataPortClassic::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 okCFPGADataPortClassic::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 okCFPGADataPortClassic::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.
| long okCFPGADataPortClassic::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 okCFPGADataPortClassic::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,
| okCFPGADataPortClassic::ErrorCode okCFPGADataPortClassic::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:
| okCFPGADataPortClassic::ErrorCode okCFPGADataPortClassic::ReadRegisters | ( | okTRegisterEntries & | regs | ) |
| [in,out] | regs | Vector of registers to read. |
Performs multiple register reads at addresses provided by the elements of regs
| okCFPGADataPortClassic::ErrorCode okCFPGADataPortClassic::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.
| okCFPGADataPortClassic::ErrorCode okCFPGADataPortClassic::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.
| okCFPGADataPortClassic::ErrorCode okCFPGADataPortClassic::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.
| okCFPGADataPortClassic::ErrorCode okCFPGADataPortClassic::UpdateTriggerOuts | ( | ) |
This method is called to query the XEM to determine if any TriggerOuts have been activated since the last call.
| okCFPGADataPortClassic::ErrorCode okCFPGADataPortClassic::UpdateWireIns | ( | ) |
This method is called after all WireIn values have been updated using SetWireInValue(). The latter call merely updates the values held within a data structure inside the class. This method actually commits the changes to the XEM simultaneously so that all wires will be updated at the same time.
| okCFPGADataPortClassic::ErrorCode okCFPGADataPortClassic::UpdateWireOuts | ( | ) |
This method is called to request the current state of all WireOut values from the XEM. All wire outs are captured and read at the same time.
| okCFPGADataPortClassic::ErrorCode okCFPGADataPortClassic::WriteRegister | ( | UINT32 | addr, |
| UINT32 | data ) |
| [in] | addr | Register address |
| [in] | data | Pointer to register data |
Performs a single register write operation.
| okCFPGADataPortClassic::ErrorCode okCFPGADataPortClassic::WriteRegisters | ( | const okTRegisterEntries & | regs | ) |
| [in,out] | regs | Vector of registers to write. |
Writes values of multiple registers at once.
| long okCFPGADataPortClassic::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 okCFPGADataPortClassic::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,