Skip to content

Commit b5e9a5c

Browse files
author
andreas.larsson
committed
Added init for ODIN EVK LEDs to be off by default
1 parent 70e7b40 commit b5e9a5c

File tree

1 file changed

+24
-0
lines changed
  • targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/TARGET_UBLOX_EVK_ODIN_W2

1 file changed

+24
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#include "stm32f4xx_hal.h"
2+
#include "stm32f4xx_hal_rcc.h"
3+
#include "stm32f4xx_hal_gpio.h"
4+
5+
void HAL_MspInit(void)
6+
{
7+
__HAL_RCC_GPIOB_CLK_ENABLE();
8+
__HAL_RCC_GPIOE_CLK_ENABLE();
9+
10+
GPIO_InitTypeDef GPIO_InitDef;
11+
12+
GPIO_InitDef.Pin = GPIO_PIN_6 | GPIO_PIN_8;
13+
GPIO_InitDef.Mode = GPIO_MODE_OUTPUT_PP;
14+
GPIO_InitDef.Pull = GPIO_NOPULL;
15+
GPIO_InitDef.Speed = GPIO_SPEED_FREQ_HIGH;
16+
HAL_GPIO_Init(GPIOB, &GPIO_InitDef);
17+
18+
GPIO_InitDef.Pin = GPIO_PIN_0;
19+
HAL_GPIO_Init(GPIOE, &GPIO_InitDef);
20+
21+
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_6, GPIO_PIN_SET);
22+
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_8, GPIO_PIN_SET);
23+
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_0, GPIO_PIN_SET);
24+
}

0 commit comments

Comments
 (0)