led.c
上传用户:dsfgsdff
上传日期:2022-07-10
资源大小:319k
文件大小:2k
- //#include "LPC214x.H"
- #include "LED.H"
- #include "config.h"
- /**************************************************************/
- /************WWW.MCU666.COM************************************/
- /************QQ:228939191 月亮*********************************/
- #define Led1Pin (1 << 18) // P1.18 is LED1 pin
- #define Led2Pin (1 << 19) // P1.19 is LED1 pin
- #define Led3Pin (1 << 20) // P1.20 is LED1 pin
-
- #define Led4Pin (1 << 21) // P1.21 is LED1 pin
- #define Led5Pin (1 << 22) // P1.22 is LED1 pin
- #define Led6Pin (1 << 23) // P1.23 is LED1 pin
- #define Led7Pin (1 << 24) // P1.24 is LED1 pin
- #define Led8Pin (1 << 25) // P1.25 is LED1 pin
- #define AlarmPin (1 << 7) // P0.7蜂鸣器
- const int LetTab[]={Led1Pin,Led2Pin,Led3Pin,Led4Pin,Led5Pin,Led6Pin,Led7Pin,Led8Pin};
- /**************************************************************/
- void IO_Int(void)
- {
- IO0DIR|= AlarmPin; //设置P0.7蜂鸣器 输出
- PINSEL0&=0xffff3fff;
- IO1DIR|=Led1Pin|Led2Pin|Led3Pin|Led4Pin|Led5Pin|Led6Pin|Led7Pin|Led8Pin;
- }
- /**************************************************************/
- void LedCS0(int sign)
- {
- if(sign)
- IO1CLR|=Led1Pin;
- else
- IO1SET|=Led1Pin;
- }
- /**************************************************************/
- void LedCS1(int sign)
- {
- if(sign)
- IO1CLR|=Led2Pin;
- else
- IO1SET|=Led2Pin;
- }
- /**************************************************************/
- void LedCS2(int sign)
- {
- if(sign)
- IO1CLR|=Led3Pin;
- else
- IO1SET|=Led3Pin;
- }
- /**************************************************************/
- void LedCS3(int sign)
- {
- if(sign)
- IO0CLR|=AlarmPin;
- else
- IO0SET|=AlarmPin;
- }
- /**************************************************************/
- void LedCS4(int sign)
- {
- if(sign)
- IO1CLR|=Led4Pin|Led5Pin|Led6Pin|Led7Pin|Led8Pin;
- else
- IO1SET|=Led4Pin|Led5Pin|Led6Pin|Led7Pin|Led8Pin;
- }