CapSense_Tuning

时间:2013-05-27 07:40:08
【文件属性】:

文件名称:CapSense_Tuning

文件大小:406KB

文件格式:RAR

更新时间:2013-05-27 07:40:08

CapSense

void main() { // initialization WORD slidepos; // EzI2Cs initialization EzI2Cs_SetRamBuffer(sizeof(MyI2C_Regs), sizeof(MyI2C_Regs), (BYTE *) &MyI2C_Regs); EzI2Cs_Start(); // Turn on I2C EzI2Cs_SetAddr(5); // Change address to 5 M8C_EnableGInt; // capsense initialization CSD_Start(); CSD_InitializeBaselines() ; CSD_SetDefaultFingerThresholds() ; // LCD initialization LCD_Start(); LCD_Position(0,0); LCD_PrCString("Button:FF"); LCD_Position(1,0); LCD_PrCString("Slider:00"); while (1) { CSD_ScanAllSensors(); //scan all sensors in array (buttons and sliders) CSD_UpdateAllBaselines(); //Update all baseline levels; //detect if any sensor is pressed if(CSD_bIsAnySensorActive()){ // Add user code here to proceed the sensor touching if(CSD_baSnsOnMask[0]&0x01) { LCD_Position(0,0); LCD_PrCString("Button:0 "); } else if(CSD_baSnsOnMask[0]&0x02) { LCD_Position(0,0); LCD_PrCString("Button:1 "); } else if(CSD_baSnsOnMask[0]&0x04) { LCD_Position(0,0); LCD_PrCString("Button:2 "); } else if(CSD_baSnsOnMask[0]&0x08) { LCD_Position(0,0); LCD_PrCString("Button:3 "); } else if(CSD_baSnsOnMask[0]&0x10) { LCD_Position(0,0); LCD_PrCString("Button:4 "); } else if(CSD_baSnsOnMask[0]&0x20) { LCD_Position(0,0); LCD_PrCString("Button:5 "); } else if(CSD_baSnsOnMask[0]&0x40) { LCD_Position(0,0); LCD_PrCString("Button:6 "); } slidepos=CSD_wGetCentroidPos(1); if(slidepos!=0xffff) { // if((slidepos==0x21)&&(CSD_waSnsDiff[11]<32)&&(CSD_waSnsDiff[13]<32)) // slidepos=0x63; LCD_Position(1,7); LCD_PrHexByte(slidepos&0xff); } } else { LCD_Position(0,0); LCD_PrCString("Button:FF"); } // internal variable output for tuning MyI2C_Regs.rawcount=CSD_waSnsResult[9]; MyI2C_Regs.baseline=CSD_waSnsBaseline[9]; MyI2C_Regs.diff=CSD_waSnsDiff[9]; } }


【文件预览】:
capsense_csd
----capsense_csd()
--------boot.tpl(23KB)
--------main.c(3KB)
--------capsense_csd.WNP(22KB)
--------boot.asm(23KB)
--------obj()
--------mkdep(343B)
--------main.s(8KB)
--------project.mk(882B)
--------PSoCConfig.xml(42KB)
--------backup()
--------capsense_csd.soc(5KB)
--------flashsecurity.txt(1KB)
--------memory.inc(13KB)
--------linkfile(451B)
--------output()
--------project.dep.bak(430B)
--------project.dep(2KB)
--------BuildMsg.txt(771B)
--------opts.txt(440B)
--------lib()
--------project.mk.bak(1KB)
----capsense_csd.cmx(1KB)
----Templates()
----capsense_csd.app(132B)
----capsense_csd.hex(18KB)
----VarOffset.xml(95B)
----capsense_csd.pep(6KB)

网友评论

  • 学习中,感谢提供这样有参考意义的资料,谢谢