led.c

来自「瑞萨(Renesas)M16C系列芯片的函数库」· C语言 代码 · 共 36 行

C
36
字号
#include "LED.h"	// LED utility header#include "sfr62p.h"	// SFR definition of M16C/62P/*""FUNC COMMENT""************************************************************** ID         		: ---* Function name     : void InitLED(void)* Function     		: initialize light-emitted diode* Paramenter   		: none* Return 	 		: none* Function used		: none* Notice	   		: none* History    		: ---*""FUNC COMMENT END""*********************************************************/void InitLED(void){	pd5 = pd5 & 0xE1; // P5_1 to P5_5 is used as input	pd2 = 0xFF;	//P2 is used as output	p2 = 0xFF;	//all LED not light}/*""FUNC COMMENT""************************************************************** ID         		: ---* Function name     : void SetLED(unsigned char)* Function     		: light diode with parameter* Paramenter   		: none* Return 	 		: none* Function used		: none* Notice	   		: none* History    		: ---*""FUNC COMMENT END""*********************************************************/void SetLED(unsigned char value){	value = ~value;	// because the circuit, the parameter should be reversed	p2 = value;		// set the result to Port P2}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?