You are here

USB SuperSpeed Code Examples | Cypress Semiconductor

USB SuperSpeed Code Examples

Last Updated: 
Mar 12, 2015

Code Examples integrated with Application Notes

AN#
AN Title
Part#
Kits
Description
AN65974 Designing with the EZ-USB® FX3™ Slave FIFO Interface CYUSB3014 CYUSB3KIT-001, CYUSBKIT-003 AN65974 describes the synchronous Slave FIFO interface of EZ-USB® FX3™. Two complete design examples are provided along with AN65974 to demonstrate how to use the synchronous Slave FIFO to interface an FPGA to FX3
AN84868 Configuring an FPGA over USB Using Cypress EZ-USB® FX3™ CYUSB3014 CYUSB3KIT-001, CYUSBKIT-003 The projects associated with AN84868 show you how to configure a Xilinx FPGA over a slave serial interface using EZ-USB® FX3™. This serial interface lets you download configuration files into a Xilinx FPGA over USB 2.0 or 3.0. The firmware files with this application note are designed and tested for Xilinx FPGAs, but you can customize them for other FGPAs with a similar interface.
AN86947 Optimizing USB 3.0 Throughput with EZ-USB® FX3™ CYUSB3014 CYUSB3KIT-001, CYUSBKIT-003 The project associated with this application note shows you different strategies to maximize USB 3.0 data transfers for EZ-USB® FX3™ controller.
AN75779 How to Implement an Image Sensor Interface with EZ-USB® FX3™ in a USB Video Class (UVC) Framework CYUSB3014 CYUSB3KIT-001, CYUSBKIT-003 The project associated with this application note, demonstrates how to implement a converter that connects to the image sensor on one side and to a USB 3.0 Host PC on the other side using the Cypress EZ-USB® FX3™ chip. FX3 uses its General Programmable Interface, Gen 2 (GPIF II), to provide the image sensor interface, and its SuperSpeed USB unit to connect to the PC. The FX3 firmware converts the data coming from the image sensor into a format compatible with the USB Video Class (UVC). Conforming to this class allows the camera to operate using built-in OS drivers, making the camera compatible with Host applications, such as AMCap and VLC Media Player.
AN70983 Designing a Bulk Transfer Host Application for EZ-USB® FX2LP™/FX3™ CYUSB3014 CYUSB3KIT-001, CYUSBKIT-003 The project associated with this application note demonstrates how to use the Cypress library for Microsoft .NET languages to implement host PC applications to communicate with Cypress's FX2LP and FX3 devices. Using this library, a Visual C#, Visual Basic, or Visual C++ program can communicate with an FX2LP or FX3-based device at a high level of abstraction.
AN73609 EZ-USB® FX2LP™/ FX3™ Developing Bulk-Loop Example on Linux CY7C6801XA CY3684 This project describes how libusb can be used to develop an USB host application on a Linux-based OS for Cypress EZ-USB® FX2LP™/ FX3™ products. It includes a step-by-step procedure for developing the bulk-loop example.
AN87216 Designing a GPIF™ II Master Interface CYUSB3014 CYUSB3KIT-001, CYUSBKIT-003 The project associated with this application note demonstrates how to use FX3's GPIF™ II as Master. FX3's GPIF™ II Designer tool is used to develop the interface using a graphical state machine entry. To test this design, we connected two FX3 development kits back to back over the GPIF II interface, one acting as the master (the subject of this application note) and the other as a test slave. Firmware source code and GPIF II state machines for both master and slave FX3 kits are attached to this application note.

Code Examples integrated with Development Kits

The following Code Examples are integrated with FX3 SDK. To access these code examples, follow the path C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\firmware.

Title
Part#
Kits
Description
cyfxbulklpauto CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example demonstrates the use of DMA AUTO channels. The data received in EP1 OUT is looped back to EP1 IN without any firmware intervention. This type of channel provides the maximum throughput and is the simplest of all DMA configurations.
cyfxbulklpautosig CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example demonstrates the use of DMA AUTO_SIGNAL channels. The data received in EP1 OUT is looped back to EP1 IN without any firmware intervention. This type of channel is similar to AUTO channel except for the event signaling provided for every buffer received by FX3. Even though the throughput is same as that of AUTO channel, the CPU is involved every time a buffer of data is received by FX3 due to interrupts received during the buffer generation.
cyfxbulklpmanual CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example demonstrates the use of DMA MANUAL channels. The data received in EP1 OUT is looped back to EP1 IN after every bit in the received data is inverted. In this type of channel, the CPU has to explicitly commit the received data. The CPU also gets a change to modify the data received before sending it out of the device. The data manipulation is done in place and does not require any memory to memory copy.
cyfxbulklpmaninout CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example demonstrates the use of DMA MANUAL_IN and MANUAL_OUT channels. The data received in EP1 OUT through a MANUAL_IN channel and is copied to a MANUAL_OUT channel so that it can be looped back to EP1 IN. MANUAL_IN channel is used to receive data into the FX3 device.
cyfxbulklpautomanytoone CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example demonstrates the use of DMA AUTO_MANY_TO_ONE channels. The data received from EP1 OUT and EP2 OUT is looped back to EP1 IN in an interleaved fashion. In this type of channel, the data is sent out without any firmware intervention. The buffers received on EP1 IN will be of the fashion: EP1 OUT Buffer 0, EP2 OUT Buffer 0, EP1 OUT Buffer 1, EP2 OUT Buffer 1 and so on.
cyfxbulklpmanmanytoone CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example demonstrates the use of DMA MANUAL_MANY_TO_ONE channels. The data received from EP1 OUT and EP2 OUT is looped back to EP1 IN in an interleaved fashion. This channel is similar to AUTO_MANY_TO_ONE except for the fact that the data has to be committed explicitly by the CPU and the CPU can modify the data before being sent out.
cyfxbulklpautoonetomany CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example demonstrates the use of DMA AUTO_ONE_TO_MANY channels. The data received from EP1 OUT is looped back to EP1 IN and EP2 IN in an interleaved fashion. In this type of channel, the data is sent out without any firmware intervention. The buffers received on EP1 IN will be of the fashion: EP1 OUT Buffer 0, EP1 OUT Buffer 2 and so on and buffers received on EP2 IN will of the fashion: EP1 OUT Buffer 1, EP1 OUT Buffer 3 and so on.
cyfxbulklpmanonetomany CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example demonstrates the use of DMA MANUAL_ONE_TO_MANY channels. The data received from EP1 OUT is looped back to EP1 IN and EP2 IN in an interleaved fashion. This channel is similar to AUTO_ONE_TO_MANY except for the fact that the data has to be committed explicitly by the CPU and the CPU can modify the data before being sent out.
cyfxbulklpmulticast CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example demonstrates the use of DMA MULTICAST channels. The data received from EP1 OUT is looped back to EP1 IN and EP2 IN. Both IN EPs shall receive the same data. In this type of channel, the data received from the producer shall be sent out to all consumers. The channel requires CPU intervention and buffers have to be explicitly committed.
cyfxbulklpman_addition CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example demonstrates the use of DMA MANUAL channels where a header and footer get added to the data before sending out. The data received from EP1 OUT is looped back to EP1 IN after adding the header and footer. The addition of header and footer does not require the copy of the entire data. Only the required header/footer regions need to be updated.
cyfxbulklpman_removal CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example demonstrates the use of DMA MANUAL channels where a header and footer get removed from the data before sending out. The data received from EP1 OUT is looped back to EP1
cyfxbulklplowlevel CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 The DMA channel is a helpful construct that allows for simple data transfer. The low level DMA descriptor and DMA socket APIs allow for finer constructs. This example uses these APIs to implement a simple bulkloop back example where a buffer of data received from EP1 OUT is looped back to EP1 IN.
cyfxbulklpmandcache CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 FX3 device has the data cache disabled by default. The data cache is useful when there is large amount of data modifications done by the CPU. But enabling D-cache adds additional constraints for managing the data cache. This example demonstrates how DMA transfers can be done with the data cache enabled.
cyfxbulklpmanual_rvds CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example demonstrates the use of RVDS 4.0 for building the firmware examples. This is same as the cyfxbulklpmanual example.
cyfxbulklpautoenum CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 The example demonstrates the normal mode USB enumeration. All standard setup requests from the USB host PC are handled by the FX3 application example. The example implements a simple bulkloop back example using DMA AUTO channel.
cyfxbulksrcsink CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 The example demonstrates the use of FX3 as a data source and a data sink using bulk endpoints. All data received on EP1 OUT are discarded and EP1 IN always sends out pre filled buffers. This example can be used to measure the throughput for the system.
cyfxbulkstreams CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example demonstrates the use of stream enabled bulk endpoints using FX3 device. This example is specific to USB 3.0 and requires the PC USB host stack to be stream capable. The example enables four streams of data to be looped back though EP1 OUT to EP1 IN using DMA AUTO channels.
cyfxisolpauto CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example demonstrates the loopback of data through ISO endpoints. This example is similar to the cyfxbulklpauto except for the fact that the endpoints used here are isochronous instead of bulk. The data received on EP3 OUT is looped back to EP3 IN.
cyfxisolpmaninout CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example demonstrates the loopback of data through ISO endpoints. This example is similar to the cyfxbulklpmaninout except for the fact that the endpoints used here are isochronous instead of bulk. The data received on EP3 OUT is looped back to EP3 IN.
cyfxisosrcsink CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 The example demonstrates the use of FX3 as a data source and a data sink using ISO endpoints. All data received on EP3 OUT are discarded and EP3 IN always sends out pre filled buffers. This example is similar to the cyfxbulksrcsink except for the fact that the endpoints used here are isochronous instead of bulk.
cyfxflashprog CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example demonstrates the use of FX3 to program the I2C and SPI boot sources for FX3. FX3 can boot from I2C EEPROMs and SPI Flash and this utility can be used to write the firmware image to these.
cyfxusbdebug CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example demonstrates the use of USB interrupt endpoint to log the debug data from the FX3 device. The default debug logging in all other examples are done through the UART. This example shows how any consumer socket can be used to log FX3 debug data.
cyfxbulklpauto_cpp CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example demonstrates the use of C++ with FX3 APIs. The example implements a bulkloop back example with DMA AUTO channel.
cyfxusbhost CYUSB3014 CYUSB3KIT-001 This example demonstrates the use of FX3 as a USB 2.0 single port host. The example supports simple HID mouse class and simple MSC class devices.
cyfxusbotg CYUSB3014 CYUSB3KIT-001 This example demonstrates the use of FX3 as an OTG device which when connected to a USB host is capable of doing a bulkloop back using DMA AUTO channel. When connected to a USB mouse, it can detect and use the mouse to track the three button states, X, Y, and scroll changes.
cyfxbulklpotg CYUSB3014 CYUSB3KIT-001 This example demonstrates the full OTG capability of the FX3 device. When connected to a USB PC host, it acts a bulkloop device. When connected to another FX3 in device mode running the same the firmware, both can demonstrate session request protocol (SRP) and host negotiation protocol (HNP).
cyfxgpioapp CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example demonstrates the use of simple GPIOs to be used as input and output. It also implements the use of GPIO interrupt on the input line.
cyfxgpiocomplexapp CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 The FX3 device has eight complex GPIO blocks that can be used to implement various functions such as timer, counter and PWM. The example demonstrates the use of complex GPIO APIs to implement three features: a counter, PWM and to measure the low time period for an input signal.
cyfxuartlpregmode CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example demonstrates the use of UART in register mode of operation. The data is read from the UART RX byte by byte and is sent out on UART TX byte by byte using register mode APIs. Register mode APIs are useful when the data to be transmitted/received is very small.
cyfxuartlpdmamode CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example demonstrates the use of UART in DMA mode of operation. The data is read from UART RX and sent to UART TX without any firmware intervention. The data is received and transmitted only when the buffer is filled up. DMA mode of operation is useful when there is large amount of data to be transferred.
cyfxusbi2cregmode CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example demonstrates the use of I2C master in register mode of operation. The example reads/writes data to an I2C EEPROM attached to the FX3 device using register mode APIs.
cyfxusbi2cdmamode CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example demonstrates the use of I2C master in DMA mode of operation. The example reads/writes data to an I2C EEPROM attached to the FX3 device using DMA channels.
cyfxusbspiregmode CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example demonstrates the use of SPI master in register mode of operation. The example reads/writes data to an SPI Flash attached to the FX3 device using register mode APIs.
cyfxusbspidmamode CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example demonstrates the use of SPI master in DMA mode of operation. The example reads/writes data to an SPI Flash attached to the FX3 device using DMA channels.
cyfxusbspigpiomode CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example demonstrates the use of GPIO to build an SPI master. The example reads/writes data to an SPI Flash attached to the FX3 device using FX3 GPIOs.
cyfxusbi2sdmamode CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example demonstrates the use of I2S APIs. The example sends the data received on EP1 OUT to the left channel and EP2 OUT to the right channel.
cyfxusbuart CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example implements a CDC-ACM-compliant USB to UART bridge using the USB and UART APIs.
cyfxuvcinmem CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example demonstrates the USB video class device stack implementation for FX3. The example repeatedly streams the pre-filled images from the FX3 system memory to the USB host PC. This example uses Isochronous endpoints.
cyfxuvcinmem_bulk CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example demonstrates the USB video class device stack implementation for FX3. The example is similar to the UVC example, but uses Bulk endpoints instead of Isochronous endpoints.
slfifoasync CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example demonstrates the use of FX3 GPIF-II to implement an asynchronous slave FIFO. The example transmits the data received from USB host on EP1 OUT to the slave FIFO egress socket and also transmits the data received on slave FIFO ingress socket to EP1 IN. This requires a slave FIFO master capable of reading and writing data to be attached to FX3.
slfifosync CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example demonstrates the use of FX3 GPIF-II to implement a synchronous slave FIFO. The example transmits the data received from USB host on EP1 OUT to the slave FIFO egress socket and also transmits the data received on slave FIFO ingress socket to EP1 IN. This requires a slave FIFO master capable of reading and writing data to be attached to FX3.
slfifoasync5bit CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example implements a USB-to-Asynchronous Slave FIFO bridge device, which makes use of all the endpoints supported by the FX3 device. A 5-bit addressed version of the Slave FIFO protocol is used such that 32 DMA channels can be created across the GPIF-II port.
slfifosync5bit CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example implements a USB-to-Synchronous Slave FIFO bridge device, which makes use of all the endpoints supported by the FX3 device.
lpp_source CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This project build the low performance peripheral (LPP) library for FX3. This library contains the FX3 firmware driver and API source for GPIO, I2S, I2C, SPI and UART. The corresponding register set is documented in the FX3 Programmer's Manual.
cyfxmscdemo CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example uses a small portion of the FX3 system RAM as the storage for implementing a USB Mass Storage Class (MSC) Bulk-Only Transport device. This examples shows how the mass storage command handling can be implemented in FX3 firmware.
cyfx3s_msc CYUSB3035 FX3S DVK by Pactron This example provides a Mass Storage Class interface through which USB host can access the SD cards or eMMC devices connected to the FX3S device. The example shows how to implement highperformance data transfers using the FX3S storage APIs, and also supports features such as device hotplug handling, partitioning (multi-volume) support, and more.
cyfx3s_raid0 CYUSB3035 FX3S RAID-on-Chip USB Dongle by Pactron This example illustrates the use of the FX3S firmware APIs to implement a RAID-0 system based on SD/MMC storage devices.
cyfxgpiftostorage CYUSB3035 FX3S DVK by Pactron This example illustrates the use of the FX3S firmware APIs to allow an external processor to access SD/MMC devices through the GPIF port. A 16-bit Async. ADMux interface is used on the GPIF side, and the P-port mailbox registers are used to receive control requests from the external processor. The firmware interprets the various requests received, and initiates data transfers that are requested by the processor.
cyfx3s_fatfs CYUSB3035 FX3S DVK by Pactron

This example illustrates the use of the FX3S APIs to integrate a FAT file system. The application creates a basic UART based shell which can be used to list, read and write files stored on the storage devices. The FatFs File System implementation by Elm Chan (http://elm-chan.org/fsw/ff/00index_e.html) is used in this application.The block driver required by the file system is implemented using the FX3S storage APIs. The UART port is used to implement a primitive shell through which commands are received from the user and file operations performed. The commands supported by this application are:
touch: Create an empty file with the specified name.
rm : Remove a single file or an empty directory from the file system.
mkdir: Create a new directory with the specified name.
ls : List the contents of a directory.
write: Write strings specified on the command line into the specified file (creates a new file if needed).
read : Read and print the contents of the specified file.
exit : Exit the shell.
help : Lists Command Syntax.

cyfx3s_sdiouart CYUSB3035 FX3S DVK by Pactron This example illustrates the use of the FX3S SDIO APIs by implementing a USB-UART device over an SDIO card with a UART Function. The example is expected to work with any SDIO device with a standard UART interface compliant function. It has been developed and tested on the ARASAN AC2200 SDIO HDK platform. This example enumerates with a UART Baud rate of 9600 Baud and it is the only baud rate supported for this example. The application uses the VID/PID for the Cypress USB-UART device and uses the Cypress Virtual Com driver for the Cypress USB-UART device to interact with PC side `applications. This example works on USB2.0 and USB3.0 hosts.
cyfxuac CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 This example implements a microphone compliant with the USB Audio Class specification. The audio data is not sourced from an actual microphone, but is read from an SPI flash connected to the FX3 device. The audio data is then streamed over isochronous endpoints to the USB host.
boot_fw CYUSB3014 CYUSB3KIT-001, CYUSB3KIT-003 A simple set of APIs have been provided as a separate library to implement two stage booting. This example demonstrates the use of these APIs. Configuration files that can be used for Real View Tool chain is also provided.
cycx3_rgb16_as0260 CYUSB3065 DENEBOLA (See3CAM_CX3RDK) - CX3 Reference Design by e-con Systems This example has been provided for use with the Aptina AS0260 image sensor. The example uses UVC class as the transport protocol and provide uncompressed video frames of up to 1920×1080 pixels at 30 frames per second for the color format RGB565
cycx3_rgb24_as0260 CYUSB3065 DENEBOLA (See3CAM_CX3RDK) - CX3 Reference Design by e-con Systems This example has been provided for use with the Aptina AS0260 image sensor. The example uses UVC class as the transport protocol and provide uncompressed video frames of up to 1920×1080 pixels at 30 frames per second for the color format RGB888
cycx3_uvc_as0260 CYUSB3065 DENEBOLA (See3CAM_CX3RDK) - CX3 Reference Design by e-con Systems This example has been provided for use with the Aptina AS0260 image sensor. The example uses UVC class as the transport protocol and provide uncompressed video frames of up to 1920×1080 pixels at 30 frames per second for the color format YUV422
cycx3_uvc_ov5640 CYUSB3065 DENEBOLA (See3CAM_CX3RDK) - CX3 Reference Design by e-con Systems This example has been provided for use with the Omnivision OV5640 image sensor. The example uses UVC class as the transport protocol and provide uncompressed video frames of up to 2592×1944 pixels at 15 frames per second for the color format YUV422
BootLedBlink CYUSB3014 CYUSB3KIT-001,
CYUSB3KIT-003
This example demonstrates the usage of the FX3 boot API to sample Switches and control GPIOs.