📄 key.c
字号:
// ------------------file start ,copyright turui 2008 4.15 by bill-----------------------------
/* created by bill.zhang */
#include "key.h"
#include "config.h"
void Key1(void)
{
const uint32 KEY1 = 1 << 16;
const uint32 KEY1var = 0x00000003;
//PINSEL1=
}
void Key2(void)
{
//add source code
}
void Key3(void)
{
//add source code
}
void Key4(void)
{
//add source code
}
void Key5(void)
{
//add source code
}
void Key6(void)
{
//add source code
}
void Beep_On(void)
{
const uint32 BEEP = 1 << 7; // P0.7控制蜂鸣器
const uint32 BEEPvar = 0x00000003 << 14; // P0.7控制蜂鸣器
// uint32 beep_pinsel,beep_iodir;
// beep_pinsel=PINSEL0;
// beep_iodir=IO0DIR;
PINSEL0&=(~BEEPvar);
IO0DIR=BEEP;
IO0CLR = BEEP;
}
void Beep_Off(void)
{
const uint32 BEEP = 1 << 7; // P0.7控制蜂鸣器
const uint32 BEEPvar = 0x00000003 << 14; // P0.7控制蜂鸣器
uint32 beep_pinsel,beep_iodir;
beep_pinsel=PINSEL0;
beep_iodir=IO0DIR;
PINSEL0&=(~BEEPvar);
IO0DIR=BEEP;
IO0SET = BEEP;
IO0DIR=beep_iodir;
PINSEL0=beep_pinsel;
}
//--------------------------end file-----------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -