Files
player/Project/Src/Drive/Include/led.h
2025-07-05 19:47:28 +08:00

31 lines
1.1 KiB
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 "stm32f4xx.h"
/*---------------------- LED配置宏 ------------------------*/
#define LED1_PIN GPIO_Pin_7 // LED1 引脚
#define LED1_PORT GPIOG // LED1 GPIO端口
#define LED1_CLK RCC_AHB1Periph_GPIOG // LED1 GPIO端口时钟
#define LED2_PIN GPIO_Pin_12 // LED2 引脚
#define LED2_PORT GPIOD // LED2 GPIO端口
#define LED2_CLK RCC_AHB1Periph_GPIOD // LED2 GPIO端口时钟
/*---------------------- LED控制宏 ------------------------*/
#define LED1_ON GPIO_ResetBits(LED1_PORT,LED1_PIN); // 输出低电平点亮LED1
#define LED1_OFF GPIO_SetBits(LED1_PORT,LED1_PIN); // 输出高电平关闭LED1
#define LED2_ON GPIO_ResetBits(LED2_PORT,LED2_PIN); // 输出低电平点亮LED2
#define LED2_OFF GPIO_SetBits(LED2_PORT,LED2_PIN); // 输出高电平关闭LED2
/*---------------------- 函数声明 ----------------------------*/
void LED_Init(void); //LED初始化函数
#endif //__LED_H