SY/USER/Led/Led.h
ecol 1da6dcb89c 综合实验完成
添加系统状态显示LED

将pwm控制放到了定时器中断里

改变开关为控制系统开关

在按键中断里加入了整个系统的开关控制

修改并优化了电路图
2020-05-26 09:29:43 +08:00

28 lines
674 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_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