EasyManua.ls Logo

Cypress CY3684 - Building Firmware Example Code for EZ-USB Internal RAM and External EE

Cypress CY3684
117 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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. Figure 8-2 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’

Table of Contents

Related product manuals