generated from Embedded_Projects/AliOS_DevKit_Template
33 lines
892 B
C
33 lines
892 B
C
#include "pin_mux.h"
|
|
|
|
#include "stm32l4xx_hal.h"
|
|
|
|
void BOARD_InitBootPins(void) {
|
|
BOARD_InitLEDPins();
|
|
}
|
|
|
|
void BOARD_InitLEDPins(void) {
|
|
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
|
|
|
__HAL_RCC_GPIOB_CLK_ENABLE();
|
|
__HAL_RCC_GPIOD_CLK_ENABLE();
|
|
__HAL_RCC_GPIOE_CLK_ENABLE();
|
|
|
|
HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_SET);
|
|
HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, GPIO_PIN_SET);
|
|
HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_SET);
|
|
|
|
GPIO_InitStruct.Pin = LED1_Pin;
|
|
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD;
|
|
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
|
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
|
|
|
HAL_GPIO_Init(LED1_GPIO_Port, &GPIO_InitStruct);
|
|
|
|
GPIO_InitStruct.Pin = LED2_Pin;
|
|
HAL_GPIO_Init(LED2_GPIO_Port, &GPIO_InitStruct);
|
|
|
|
GPIO_InitStruct.Pin = LED3_Pin;
|
|
HAL_GPIO_Init(LED3_GPIO_Port, &GPIO_InitStruct);
|
|
}
|