Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

There are some major differences between the two DLLs.

 

Scroll Title
titleFeatures comparison

feature

Dewesoft C++ DLL

Simplified Trenz Electronic C++ DLL

programming language

C, C++, Python

C, C++, Python

architecture

standard
(TE0300DLL.dll)

Standard (the stacked nature of the solution is hidden)
(TE_USB_FX2_CyAPI.dll requires Cypress CyAPI.lib);

Handles

present

absent

structures

embedded

Embedded (defined in Cypress CyAPI.h but invisible to user)

parameters*

less

more

freedom*

less

more

buffer size2 Kbyte (fixed)4 Kbyte or more (it can be changed)
Note

Both the Simplified Trenz Electronic C++ DLL and this porting guide are fully working developer versions but are not supported by Trenz Electronic till the official release, currently not yet planned.

Function Declarations

#define TE_USB_FX2_CYAPI extern "C" __declspec(dllexport)

...

These two functions are called internally by function TE_USB_FX2_Open(). 

Note
This Simplified DLL is not thread safe.
Info

This Simplified DLL is successfully used in the Python (using ctypes to import/export c types) program Open_FUT (Gen3) to program USB FX2 microcontroller's firmware and SPI Flash/FPGA's bitstream.

This Simplified DLL is full extern C (C compatible).

Function Translation

 

Scroll Title
titleFunction translation between DLLs

Dewesoft C++ DLL

Simplified Trenz Electronic C++ DLL

HANDLE m_handle = 0;

Nothing (you must charge the DLL)

cout << endl << TE0300_ScanCards() << endl;

cout << endl << TE_USB_FX2_ScanCards() << endl;

TE0300_Open(&m_handle, 0)!=0TE_USB_FX2_Open(0, TimeOut, DriverBufferSize)!=0
TE0300_Open(&m_handle, 1)!=0TE_USB_FX2_Open(1, TimeOut, DriverBufferSize)!=0

TE0300_Close(&m_handle);

TE_USB_FX2_Close();

TE0300_SendCommand(handle, cmd, cmd_length, reply, &reply_length, timeout)

TE_USB_FX2_SendCommand( cmd, cmd_length, reply, reply_length, timeout)

TE0300_SetData(handle, data, packetlen, PI_EP8)TE_USB_FX2_SetData(data, packetlen)
TE0300_GetData(handle, data, &packetlen, PI_EP6, 1000)TE_USB_FX2_GetData(data, packetlen)
Note
The instantiation of driver buffer happens in TE_USB_FX2_Open(): the user must specify TimeOut and DriverBufferSize.

...