EZ-USB Development Kit User Guide, Doc. # 001-66390 Rev. *D
41
EZ-USB Firmware Frameworks
descriptor in response to a get configuration descriptor request and must return its full-speed config-
uration descriptor in response to a get other-speed descriptor request.
5.4
EZ-USB Library
The EZ-USB library is an 8051 .LIB file that implements functions that are common to many firmware
projects. These functions need not be modified and are, therefore, provided in library form. However,
the kit includes the source code for the library in the event that you need to modify a function or if you
just want to know how something is done.
In addition to providing common functions, the library also creates register definitions for all EZ-USB
registers. The source code and the compiled .LIB file are located in the
<Installed_directory>\<Version>\Target\Lib\lp
directory.
5.4.1
Building the Library
Only the full retail version of the Keil tools can build library files. The evaluation version will not build
this library.
After starting the Windows Command Prompt, run
setenv.bat
(located in the
<Installed_directory>\<Version>\Bin
directory) to set up the build environment. This
batch file assumes that you have installed the DVK and Keil tools in the default directories. To build
the library, run the
build.bat
file from the command prompt.
Build.bat also assembles the
usbjmptb.a51
file to create
usbjmptb.obj
. This file contains the jump
table for the USB (INT2) and GPIF (INT4) auto-vectored interrupts. See the EZ-USB Technical Ref-
erence Manual (TRM) in the kit documentation for more information on auto-vector interrupts.
5.4.2
Library Functions
5.4.2.1
EZUSB_Delay()
void EZUSB_Delay(WORD ms)
This function performs a busy wait for a given number of milliseconds. The parameter ms deter-
mines the length of the busy wait. Upon completion of the delay the function returns.
5.4.2.2
EZUSB_Discon()
void EZUSB_Discon(BOOL renum)
This function performs a USB disconnect/reconnect. It disconnects the device, delays for 1500 ms,
clears any pending USB interrupts (INT2), reconnects, and then returns. The parameter renum
determines if the EZ-USB renumerate bit is set in the USB control register. If renum is TRUE, the
renumerate bit is set and following a return from this function, the 8051 will be responsible for han-
dling all USB device requests on endpoint 0. If renum is FALSE, the renumerate bit is not modified. If
the renumerate bit is clear, then the EZ-USB serial interface engine handles most of the USB device
requests on endpoint 0.
5.4.2.3
EZUSB_GetStringDscr()
STRINGDSCR xdata * EZUSB_GetStringDscr(BYTE StrIdx)
This function returns a pointer to instance StrIdx of a string descriptor in the descriptor table. The
instance is determined by the StrIdx parameter. If the descriptor table does not contain the given
number of instances, then the function returns a NULL pointer.
Summary of Contents for CY3674
Page 18: ...18 EZ USB Development Kit User Guide Doc 001 66390 Rev D Getting Started...
Page 34: ...34 EZ USB Development Kit User Guide Doc 001 66390 Rev D Development Kit Contents...
Page 54: ...54 EZ USB Development Kit User Guide Doc 001 66390 Rev D Cypress USB Drivers for EZ USB Kits...
Page 110: ...110 EZ USB Development Kit User Guide Doc 001 66390 Rev D Resources...
Page 113: ...EZ USB Development Kit User Guide Doc 001 66390 Rev D 113 A 2 Board Layout...