Versions Compared

Key

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

...

Declaration

Code Block
languagecpp
ETE_USB_FX2_CYAPI int TE_USB_FX2_SendCommand(CCyUSBDevice USBDeviceList, byte Command, long CmdLength, byte* Reply, long ReplyLength, unsigned long Timeout)

...

CCyUSBDevice is a type defined in CyAPI.lib. Its name is misleading because it is not a class that represents a single USB device, but it rather represents a list of USB devices.
CCyUSBDevice is the list of devices served by the CyUSB.sys driver (or a derivative like TE_USB_FX2_xx.sys). This parameter is passed by pointer. See page 7 and pages 23-49 of CyAPI.pdf (Cypress CyAPI Programmer's Reference).

Code Block
languagecpp
byte* Command

This parameter is passed by pointer. It is the pointer to the byte array that contains the commands to send to USB FX2 microcontroller (FX2_Commands), to MicroBlaze (MB_Commands) and/or to SPI Flash.

Code Block
languagecpp
long CmdLength

This parameter is the length (in bytes) of the previous byte array; it is the length of the packet to transmit to USB FX2 controller endpoint EP1 (0x01). It is typically initialized to 64 bytes.

Code Block
languagecpp
byte* Reply

This parameter (passed by pointer) is the pointer to the byte array that contains the response to the command sent to the USB FX2 microcontroller (FX2_Commands) or , to the MicroBlaze embedded processor (MB_Commands) and/or to SPI Flash.

Code Block
languagecpp
long ReplyLength

This parameter is the length (in bytes) of the previous byte array; it is the length of the packet to transmit to the USB FX2 microcontroller endpoint EP1 (0x81). It is typically initialized to 64 byes, but normally the meaningful bytes are less.

Code Block
languagecpp
unsigned long Timeout

The unsigned integer value is the time in milliseconds assigned to the synchronous method XferData() of data transfer used by CyAPI.lib.
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.

...