Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

This documentation describes the SW API supported by standard Trenz Electronic FPGA modules (TE USB FX2 FPGA module) equipped with Cypress EZ-USB FX2 microcontroller (currently: TE0300, TE0320 and TE0630).

TE USB FX2 module is able to communicate with host computer's USB using

  • SW .NET (C#) API (

...

  • TE_USB_FX2_

...

Info

In order to provide a user interface for driver functions, dynamic link library "TE_USB_FX2_

...

CyUSB.dll" and "CyUSB.dll" have been used.

C# applications or managed C++ applications (running on host computer) use directly TE_USB_FX2_CyAPI.dll based on CyUSB.dll.

To avoid copying back and forth large amount of data between these two DLLs, data is passed by reference and not by value.

Host computer requirements

When using GetData()15
3.5.1 Declaration15
3.5.2 Function Call15
3.5.3 Description15
3.5.4 Expected Data Throughput15
3.5.5 DataRead Size Shall Not Be Too Large15
3.5.5.1 Simplified sample code15
3.5.5.2 Actual sample code16
3.5.6 DataRead Size Shall Not Be Too Small16
3.5.7 Parameters17
3.5.8 Return Value17
3.6 TE_USB_FX2_CyUSB.dll API, a host computer should meet the following requirements:

  • Operating system: Microsoft Windows 2000, Microsoft Windows XP, Microsoft Windows Vista, Microsoft Windows 7
  • USB driver: Trenz Electronic USB FX2 driver
  • Interface: USB 2.0 host
  • .NET Framework version ≥ 4.0.30319

See your module user manual for dedicated driver installation instructions.SetData()19
3.6.1 Declaration19
3.6.2 Function Call19
3.6.3 Description19
3.6.4 Data throughput expected19
3.6.5 DataWrite size shall not be too large19
3.6.5.1 Simplified sample code19
3.6.5.2 Actual sample code20
3.6.6 DataWrite size shall not be too small20
3.6.7 Parameters20
3.6.8 Return Value21
4 API Commands22
4.1 Introduction22
4.1.1 Reference Architecture22
4.1.2 Custom Logic Block22
4.2 USB FX2 API Commands26
4.2.1 READ_VERSION26
4.2.2 INITIALIZE26
4.2.3 READ_STATUS26
4.2.4 RESET_FIFO27
4.2.5 FLASH_READ27
4.2.6 FLASH_WRITE27
4.2.7 FLASH_ERASE28
4.2.8 EEPROM_READ28
4.2.9 EEPROM_WRITE29
4.2.10 FIFO_STATUS29
4.2.11 I2C_WRITE29
4.2.12 I2C_READ30
4.2.13 POWER30
4.2.14 FLASH_WRITE_COMMAND30
4.2.15 SET_INTERRUPT31
4.2.16 GET_INTERRUPT31
4.3 MicroBlaze API Commands32
4.3.1 FX22MB_REG0_NOP33
4.3.2 FX22MB_REG0_GETVERSION33
4.3.2.1 Code Form33
4.3.2.2 Table Form33
4.3.3 FX22MB_REG0_START_TX35
4.3.3.1 Combination 1 (simplified version)35
4.3.3.2 Combination 2 (simplified version)36
4.3.4 FX22MB_REG0_START_RX37
4.3.4.1 Combination 1 (simplified version)37
4.3.4.2 Combination 2 (simplified version)37
4.3.5 FX22MB_REG0_STOP38
4.3.6 FX22MB_REG0_PING39
5 API Usage Example Program40
5.1 First Example: select module, read firmware version, read VID/PID40
5.2 Second Example: Read Test43
5.3 Third Example: Write Test43
6 TE_USB_FX2_CyUSB.dll: Data Transfer Throughput Optimization44
6.1 Introduction44
6.2 XferSize (driver buffer size) Influence44
6.3 PacketSize (transfer data size) Influence44
6.4 Conclusion45
6.5 Appendix : Charts46
7 Document Change History47
8 Bibliography47