led.h

来自「基于ST750的串口程序-MDK,基于ST750的串口程序-MDK!」· C头文件 代码 · 共 40 行

H
40
字号
#ifndef __LED_H__
#define __LED_H__

#include "75x_lib.h"
#define L1	0x01
#define L2	0x02
#define L3	0x03
#define L4	0x04
#define L5	0x05

enum LEDOPT {
	LED_OFF,
	LED_ON,
	LED_TOGGLE
};

__inline void LED_Init(void)
{
	GPIO_InitTypeDef GPIO_InitStructure;
/* GPIO Configuration --------------------------------------------------------*/
  /* Configure P2.5,P2.7,P2.19  as output push-pull */
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
  GPIO_InitStructure.GPIO_Pin =  GPIO_Pin_5 | GPIO_Pin_7 | GPIO_Pin_9;
  GPIO_Init(GPIO2, &GPIO_InitStructure);

  /* Configure P1.10,P1.06 as output push-pull */
  GPIO_InitStructure.GPIO_Pin =  GPIO_Pin_6 | GPIO_Pin_10;
  GPIO_Init(GPIO1, &GPIO_InitStructure);


  /* Mask the unused pins */
  //GPIO_PinMaskConfig(GPIO2, GPIO_Read(GPIO2)&(~(GPIO_Pin_5 | GPIO_Pin_7 | GPIO_Pin_9)), ENABLE);
  //GPIO_PinMaskConfig(GPIO1, GPIO_Read(GPIO1)&(~(GPIO_Pin_6 | GPIO_Pin_10)), ENABLE);

}

void LED_Set(int index, enum LEDOPT opt);

#endif

⌨️ 快捷键说明

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