HAL_Project/Project -APP-V1.0/Hardware/LED/led.c

21 lines
409 B
C
Raw Normal View History

2025-05-09 15:43:42 +08:00
#include "main.h"
//<2F>û<EFBFBD>LED<45><44><EFBFBD>ų<EFBFBD>ʼ<EFBFBD><CABC>
void ledInit(void)
{
GPIO_InitTypeDef GPIO_InitStruct = {0};
GPIOA_RCC_ENABLE;
GPIO_InitStruct.Pin = LED1_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(LED1_GPIO_Port, &GPIO_InitStruct);
HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_SET);
}