1
0
forked from Git_test/Git_TEST

初始化项目:红灯闪烁

This commit is contained in:
BD7IWD-CMP\bd7iw
2025-09-10 12:01:07 +08:00
commit 6d170cf95a
446 changed files with 144336 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
#include "stm32f10x.h" // Device header
#include "Led_Init.h"
void Led_Init()
{
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB,ENABLE);
GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.GPIO_Mode=GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Pin=BLU_Led |GRE_Led;
GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz;
GPIO_Init(GPIOA,&GPIO_InitStructure);
GPIO_InitStructure.GPIO_Mode=GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Pin=RED_Led;
GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz;
GPIO_Init(GPIOB,&GPIO_InitStructure);
}

View File

@@ -0,0 +1,10 @@
#ifndef __Led_Init_H
#define __Led_Init_H
#define GRE_Led GPIO_Pin_7 //绿灯PA7
#define BLU_Led GPIO_Pin_6 //蓝灯PA6
#define RED_Led GPIO_Pin_0 //红灯PB0
void Led_Init(void);
#endif