EZ-USB Development Kit User Guide, Doc. # 001-66390 Rev. *D
67
EZ-USB Development Kit Firmware Examples
lowing table summarizes the mapping of Push buttons on the FX2LP development board to key-
board buttons.
The function TD_poll () in the firmware (periph.c) is where the periodic checking of a new push but-
ton event is done. Following is the code snippet of this function.
if( !(EP1INCS & bmEPBUSY) ) // Is the EP1INBUF
//available,
{
EZUSB_ReadI2C(BTN_ADDR,0x01,&buttons); // Read button states
buttons &= 0x0F;
if ((oldbuttons - buttons) != 0) //Change in button state
{
if (buttons & 1) //Shift
EP1INBUF[0] = 0;
else
EP1INBUF[0] = 2;
if (buttons & 2) //a
EP1INBUF[2] = 0;
else
EP1INBUF[2] = 4;
if (buttons & 4) //b
EP1INBUF[3] = 0;
else
EP1INBUF[3] = 5;
if (buttons & 8) //c
EP1INBUF[4] = 0;
else
EP1INBUF[4] = 6;
EP1INBUF[1] = 0;
EP1INBC = 5;
}
oldbuttons = buttons;
}
8.2.1
Building Firmware Example Code for EZ-USB Internal RAM and External
EEPROM.
■
Click on
Build Target button
at the top right corner of the IDE.
of the
Build
window of
the Keil IDE shows the successful compilation of the entire project.
Table 8-2. Function Mapping of Development Board Buttons
EZ-USB Development Board
Push Button
Function
f1
Shift
f2
Send ‘a’
f3
Send ‘b’
f4
Send ‘c’
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...