Specifications
Getting Started with FX2LP™
www.cypress.com Document No. 001-65209 Rev. *B 9
Cypress USB Class Library API
CyAPI.lib
This is a C++ class library that simplifies the application
accesses to custom FX2LP-based devices through the
Cypress generic USB driver. The ‘Cypress USB Class
Library API’ (CyApi) is available after the SuiteUSB
package installation in the ‘CyAPI’ folder. This library is
compatible with Microsoft tool chains. For more
information on how to use these APIs, refer to the CyBulk,
CyDesc and Streamer examples located in the ‘examples’
directory. The API documentation can be found in
CyApi.pdf under the same directory.
CyUsb.dll
For easing the host application development using
C#.NET, Cypress also provides a library named CyUsb.dll.
You can find this library in the ‘lib’ folder after the
SuiteUSB package installation. The SuiteUSB package is
common for the host .NET windows application
development on all Cypress USB 2.0 chipset families. The
SuiteUSB details and executable file is available at the
Cypress website.
Firmware Example Projects
The FX2LP DVK provides a framework that satisfies the
Chapter 9 requirements of the USB2.0 specification for
high-speed devices. The ‘Target\Fw\LP’ directory of DVK
installation contains a ‘firmware framework’. This
framework simplifies and accelerates the custom firmware
development by using a Cypress pre-developed code for
common functionalities like FX2LP chip initialization, USB
standard device request handling, USB suspend power
management, and so on. The framework also provides
function hooks and the firmware examples, making the
firmware development process easier. The user needs to
provide the USB descriptor table and the code for
implementing the custom peripheral functionality.
The FX2LP firmware frameworks are written using Keil
uVision2 IDE. Cypress includes an evaluation version of
the 8051 Keil Software Tools in the CY3684 EZ-USB
FX2LP Development Kit. The supplied Keil tools are fully
functional, but are limited in object size to 4 kilobytes. If
you need to build an object of size more than 4KB then
you need to purchase the license from Keil.
Alternative tools for developing the firmware for FX2LP are
the combination of Eclipse, CDT and SDCC plug in.
The CDT is Eclipse's C/C++ Development Tooling project.
Small Device C Compiler (SDCC) allows embedded 'C'
applications for 8051 to be developed using the fully
featured eclipse IDE. Eclipse is an open source platform,
so you can find all these installation files on web for free.
The firmware examples are not stored along with the
firmware framework itself, but stored separately in the
‘Firmware’ directory after installing CY3684 EZ-USB
FX2LP Development Kit. These examples can be used as
a reference or can be built upon, while developing
firmware for custom FX2LP-based products. The following
firmware examples are provided in the DVK.
Table 4. Description of FX2LP Firmware Examples
S.No Firmware Example Description
1 hid_kb Example firmware that emulates a HID-class keyboard using the buttons and 7-segment display on the DVK
board
2 Bulkloop Contains a bulk loopback test that exercises the EZ-USB bulk endpoints. It loops back EP2OUT to EP6IN and
EP4OUT to EP8IN.
3 Bulkext Contains a bulk loopback test that exercises the EZ-USB bulk endpoints. The loopback is performed using the
external auto pointer. Data is copied from the OUT endpoint buffer to external RAM and then to the IN endpoint
buffer. It loops back EP2OUT to EP6IN and EP4OUT to EP8IN
4 Bulksrc Contains bulk endpoint endless source/sink firmware. It can be driven using the CyConsole or CyBulk. EP2OUT
always accepts a bulk OUT; EP4OUT always accept a bulk OUT; EP6IN always returns a 512-byte packet, 64
bytes at full-speed. Based on buffer availability in EP8IN, the most recent packet of EP4OUT is written to EP8IN.
5 dev_io Contains the source files to build simple development board I/O sample. This software demonstrates how to use
the buttons and LED on the EZ-USB development kit.
6 EP_Interrupts Bulk loopback firmware that demonstrates use of endpoint interrupts using EZ-USB FX2LP.
7 extr_intr Firmware that demonstrates external interrupt handling INT0, INT1, INT4, INT5, and INT6.
8 ibn Contains firmware to perform bulk loopback of EP2OUT to EP6IN and EP4OUT to EP8IN using the IBN (In Bulk
Nak) interrupt to initiate the transfer