Versions Compared

Key

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

Description

This function takes an already initialized USB device list (USBDeviceList) and previously selected TE USB FX2 device selected by TE_USB_FX2_Open() and sends a command (API command) to the USB FX2 microcontroller of the selected device (TE USB FX2 module)

...

  • send command to EZ-USB FX2 microcontroller (for example, reset the FPGA or power on/off the FPGA);
  • interrogate registers;
  • dipatching of API Commands to MicroBlaze and SPI Flash;
  • read/write from MicroBlaze I2C bus address;
  • read/write from SPI Flash.

Use of the code

Declaration

Code Block
languagecpp
public static bool TE_USB_FX2_SendCommand(ref CyUSBDevice TE_USB_FX2_USBDevice, ref byte[] Command, ref int CmdLength,ref byte[] Reply, ref int ReplyLength, uint Timeout);

Function Call

Your application program shall call this function like this:

Code Block
languagecpp
TE_USB_FX2.TE_USB_FX2.TE_USB_FX2_SendCommand(ref TE_USB_FX2_USBDevice, ref Command, ref CmdLength, ref Reply, ref ReplyLength, Timeout);

Parameters

Code Block
languagec#
ref CyUSBDevice TE_USB-FX2_USBDevice

...

The unsigned integer value is the time in milliseconds assigned to the synchronous method XferData() of data transfer used by CyUSB.dll.
Timeout is the time that is allowed to the function for sending/receiving the data packet passed to the function; this timeout shall be large enough to allow the data/command transmission/reception. Otherwise the transmission/reception will fail. See Timeout Setting.

Return Value

bool : logical type

This function returns true if it is able to send a command to EP1 and receive a response within 2*Timeout milliseconds. This function returns false otherwise.

...