Skip to content

Commit 20ad454

Browse files
authored
Merge pull request #5613 from andreaslarssonublox/ublox_init_odin_evk_leds
Added init for ODIN EVK LEDs to be off by default
2 parents 2f4f82e + 1eef1cd commit 20ad454

File tree

1 file changed

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

1 file changed

+45
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*---------------------------------------------------------------------------
2+
* Copyright (c) 2017, u-blox Malmö, All Rights Reserved
3+
* SPDX-License-Identifier: LicenseRef-PBL
4+
*
5+
* This file and the related binary are licensed under the
6+
* Permissive Binary License, Version 1.0 (the "License");
7+
* you may not use these files except in compliance with the License.
8+
*
9+
* You may obtain a copy of the License here:
10+
* LICENSE-permissive-binary-license-1.0.txt and at
11+
* https://www.mbed.com/licenses/PBL-1.0
12+
*
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
* Component : HAL
17+
* File : hal_overrides.c
18+
*
19+
* Description : Placeholder for HAL overrides.
20+
*-------------------------------------------------------------------------*/
21+
22+
#include "stm32f4xx_hal.h"
23+
#include "stm32f4xx_hal_rcc.h"
24+
#include "stm32f4xx_hal_gpio.h"
25+
26+
void HAL_MspInit(void)
27+
{
28+
__HAL_RCC_GPIOB_CLK_ENABLE();
29+
__HAL_RCC_GPIOE_CLK_ENABLE();
30+
31+
GPIO_InitTypeDef GPIO_InitDef;
32+
33+
GPIO_InitDef.Pin = GPIO_PIN_6 | GPIO_PIN_8;
34+
GPIO_InitDef.Mode = GPIO_MODE_OUTPUT_PP;
35+
GPIO_InitDef.Pull = GPIO_NOPULL;
36+
GPIO_InitDef.Speed = GPIO_SPEED_FREQ_HIGH;
37+
HAL_GPIO_Init(GPIOB, &GPIO_InitDef);
38+
39+
GPIO_InitDef.Pin = GPIO_PIN_0;
40+
HAL_GPIO_Init(GPIOE, &GPIO_InitDef);
41+
42+
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_6, GPIO_PIN_SET);
43+
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_8, GPIO_PIN_SET);
44+
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_0, GPIO_PIN_SET);
45+
}

0 commit comments

Comments
 (0)