led.h
来自「STR71X系列ARM微控制器原理与实践配套光盘」· C头文件 代码 · 共 25 行
H
25 行
#ifndef __LED_H__
#define __LED_H__
#include "71x_lib.h"
#define LED3 0x0400
#define LED4 0x1000
#define LED5 0x4000
enum LEDOPT {
LED_OFF,
LED_ON,
LED_TOGGLE
};
inline void LED_Init(void)
{
GPIO_Config(GPIO2, 0x5400, GPIO_OUT_PP);//配置GPIO2引脚2,4,6为Push-Pull Output
GPIO_WordWrite(GPIO2, GPIO_WordRead(GPIO2) & ~0x5400);//引脚2,4,6置为0,其他位不变
}
void LED_Set(u16 Port_Pin, enum LEDOPT opt);
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?