SY/USER/Led/Led.h
gituser 4b6f0a164d 更新 'USER/Led/Led.h'
更改宏定义错误
2020-05-27 00:15:12 +08:00

28 lines
703 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef __LED_H
#define __LED_H
#include "stm32f10x.h"
#define LED2_Pin GPIO_Pin_2
#define LED3_Pin GPIO_Pin_3
#define LED4_Pin GPIO_Pin_4
#define LED5_Pin GPIO_Pin_5
#define LED_Pin_ALL LED2_Pin | LED3_Pin | LED4_Pin | LED5_Pin
#define LED_PORT GPIOA
#define LED_CLOCK RCC_APB2Periph_GPIOA
//系统状态指示灯
#define LED_SYS_Pin GPIO_Pin_11
#define LED_SYS_PORT GPIOA
#define LED_SYS_CLOCK RCC_APB2Periph_GPIOA
//函数声明
#define LED_SYS_ON() GPIO_ResetBits(LED_SYS_PORT,LED_SYS_Pin)
#define LED_SYS_OFF() GPIO_SetBits(LED_SYS_PORT,LED_SYS_Pin)
void LED_GPIO_INIT(void);//LED GPIO初始化
void LED_ON(u8 n);//点亮指定LED LED0,1,2,3
void LED_OFF(void);//关闭所有LED
#endif