You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
944 B
33 lines
944 B
3 years ago
|
/*
|
||
|
* @Author: your name
|
||
|
* @Date: 2022-04-10 10:08:56
|
||
|
* @LastEditTime: 2022-05-10 20:41:28
|
||
|
* @LastEditors: htujun 134864016@qq.com
|
||
|
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||
|
* @FilePath: \20220410-IntelligentPiggery\stm32\HARDWARE\LED\led.c
|
||
|
*/
|
||
|
#include "led.h"
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @description: LED初始化
|
||
|
* @param {*}
|
||
|
* @return {*}
|
||
|
*/
|
||
|
void LED_Init()
|
||
|
{
|
||
|
GPIO_InitTypeDef GPIO_InitStructure;
|
||
|
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOC, ENABLE);
|
||
|
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_15;
|
||
|
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
|
||
|
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||
|
GPIO_Init(GPIOC, &GPIO_InitStructure);
|
||
|
|
||
|
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13;
|
||
|
GPIO_Init(GPIOC, &GPIO_InitStructure);
|
||
|
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8 | GPIO_Pin_11;
|
||
|
GPIO_Init(GPIOA, &GPIO_InitStructure);
|
||
|
}
|
||
|
|
||
|
|