• 大小: 677KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-06
  • 语言: 其他
  • 标签: key  

资源简介

cypress 的芯片做的程序,有键按下时发送相应的键值

资源截图

代码片段和文件信息

//*****************************************
//Created by Future SDC BillyLi
//Date: 2007-04-10
//Version: V1.0
//*****************************************
#include         // part specific constants and macros
#include “PSoCAPI.h“    // PSoC API definitions for all User Modules
#include “Driver.h“

#pragma interrupt_handler  Sleep_Timer_ISR_C

enRefreshType genRefreshVal=LED_REFRESH;
enBuzzerStatusType enKeyBzStatusenBzISRStatusenSlideBzStatus;
unsigned char   gcKeyCnt=0gcSlideCnt=0;
unsigned char gcLEDData=0xff;
unsigned char gcDigiLEDDataH=0xff;
unsigned char gcDigiLEDDataL=0xff;
unsigned char   gcLEDRefleshCnt; 
//unsigned int giBeepCnt;
BYTE Flag_Time_Config_base;
volatile unsigned int giConfigbaseTime;
 //  00  1     2    3    4    5   6    7    8    9    A     B   C    D    E    F
const BYTE SEG_LED_MASK[16] = {0x110x7d0x230x290x4d0x890x810x3d0x010x090x050xc10x930x610x830x87};
// {0x050xDD0x160x940xCC0xA40x240xD50x040x840x440x040x270x050x260x66};
const BYTE KEY_LED_MASK[8] = {0x010x100x200x080x020x800x400x04};
//External API Function
//--------------------------------------------------------
//Function InitDynamicReconfig
//Initialize the dynamic reconfig
//--------------------------------------------------------
void InitDynamicReconfig(void)
{
Flag_Time_Config_base=TRUE;
giConfigbaseTime=base_RECONGIG_CNT;
}
//--------------------------------------------------------
//Function LED_Start
//Initialize data
//--------------------------------------------------------
void LED_Start(void)
{
M8C_EnableGInt ;                              
    SleepTimer_1_Start();  
    SleepTimer_1_SetInterval(SleepTimer_1_512_HZ);
    genRefreshVal=LED_REFRESH;
    gcLEDData=0xff;
    gcDigiLEDDataH=0xff;
    gcDigiLEDDataL=0xff; 
    gcLEDRefleshCnt=0x00;  
    SleepTimer_1_EnableInt();
}
//--------------------------------------------------------
//Function LED_Stop
//clear all data
//--------------------------------------------------------
void  LED_Stop(void)
{
SleepTimer_1_Stop();
SleepTimer_1_DisableInt();
//turn off all led
TurnOffAllLED();
}
//--------------------------------------------------------
//Function TurnOnLED
//Turn on the LeD
//--------------------------------------------------------
void TurnOnLED(enLEDType enLEDVal)
{
gcLEDData &=(~KEY_LED_MASK[enLEDVal]);
}
//--------------------------------------------------------
//Function TurnOffLED
//Turn off the LED
//--------------------------------------------------------
void TurnOffLED(enLEDType enLEDVal)
{
gcLEDData |= KEY_LED_MASK[enLEDVal];
}
//--------------------------------------------------------
//Function TurnOffLED
//Turn off the LED
//--------------------------------------------------------
void  ToggleLED(enLEDType enLEDVal)
{
gcLEDData ^= KEY_LED_MASK[enLEDVal];
}
//--------------------------------------------------------

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      23196  2009-07-12 06:43  key\backup\boot.asm

     文件      20810  2006-06-23 14:27  key\backup\boot.tpl

     文件      27691  2009-07-12 17:03  key\backup\csd_1.asm

     文件       8289  2009-07-12 17:04  key\backup\csd_1.h

     文件       6682  2009-07-12 17:03  key\backup\csd_1.inc

     文件      36902  2009-07-12 17:03  key\backup\csd_1hl.asm

     文件       5606  2009-07-12 17:03  key\backup\csd_1int.asm

     文件       5012  2009-07-12 17:03  key\backup\csd_1table.asm

     文件       5434  2009-07-12 06:43  key\backup\globalparams.h

     文件       5605  2009-07-12 06:43  key\backup\globalparams.inc

     文件       3771  2009-07-12 06:43  key\backup\psocconfig.asm

     文件       7231  2009-07-12 06:43  key\backup\psocconfigtbl.asm

     文件      14635  2009-07-12 06:43  key\backup\psocgpioint.h

     文件      12711  2009-07-12 06:43  key\backup\psocgpioint.inc

     文件      18089  2009-07-12 17:03  key\backup\sleeptimer_1.asm

     文件       3632  2009-07-12 17:03  key\backup\sleeptimer_1.h

     文件       2013  2009-07-12 17:03  key\backup\sleeptimer_1.inc

     文件       4255  2009-07-12 17:03  key\backup\sleeptimer_1int.asm

     文件      20965  2009-07-12 17:03  key\backup\tx8_1.asm

     文件       4337  2009-07-12 17:04  key\backup\tx8_1.h

     文件       2531  2009-07-12 17:03  key\backup\tx8_1.inc

     文件       2464  2009-07-12 17:03  key\backup\tx8_1int.asm

     文件        558  2009-07-12 17:03  key\backup\tx8_1plus.asm

     目录          0  2009-07-15 09:03  key\backup

     文件      23196  2009-07-12 17:04  key\boot.asm

     文件      23102  2009-04-01 14:50  key\boot.tpl

     文件       1669  2009-07-12 17:04  key\BuildMsg.txt

     文件      10288  2009-07-12 14:28  key\driver.c

     文件       2725  2009-07-13 19:06  key\driver.h

     文件       1508  2006-06-23 14:27  key\flashsecurity.txt

............此处省略187个文件信息

评论

共有 条评论