summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarel Gardas <karel@functional.vision>2022-04-01 18:14:11 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2022-04-05 09:56:05 +0200
commit0acc136039fd1de72b276be6130a66551e546823 (patch)
tree9586fd173d045269b86c85cfed3de429f3e33546
parentbsp/stm32h7: disable UART 5, 7, 8, 9 and USART 3, 6, 10 for STM32H7B3I-DK BSP (diff)
downloadrtems-0acc136039fd1de72b276be6130a66551e546823.tar.bz2
bsp/stm32h7: add configuration for USART1 GPIO pins, registers and alternate function
Diffstat (limited to '')
-rw-r--r--bsps/arm/stm32h7/console/console-usart1-cfg.c8
-rw-r--r--spec/build/bsps/arm/stm32h7/grp.yml6
-rw-r--r--spec/build/bsps/arm/stm32h7/optusart1alternatefunc.yml19
-rw-r--r--spec/build/bsps/arm/stm32h7/optusart1gpiopins.yml19
-rw-r--r--spec/build/bsps/arm/stm32h7/optusart1gpioregs.yml19
5 files changed, 68 insertions, 3 deletions
diff --git a/bsps/arm/stm32h7/console/console-usart1-cfg.c b/bsps/arm/stm32h7/console/console-usart1-cfg.c
index 47c13b2f54..d64d91ab30 100644
--- a/bsps/arm/stm32h7/console/console-usart1-cfg.c
+++ b/bsps/arm/stm32h7/console/console-usart1-cfg.c
@@ -31,15 +31,17 @@
#include <stm32h7/hal.h>
+#include <bspopts.h>
+
const stm32h7_uart_config stm32h7_usart1_config = {
.gpio = {
- .regs = GPIOB,
+ .regs = STM32H7_USART1_GPIO_REGS,
.config = {
- .Pin = GPIO_PIN_14 | GPIO_PIN_15,
+ .Pin = STM32H7_USART1_GPIO_PINS,
.Mode = GPIO_MODE_AF_PP,
.Pull = GPIO_NOPULL,
.Speed = GPIO_SPEED_FREQ_LOW,
- .Alternate = GPIO_AF4_USART1
+ .Alternate = STM32H7_USART1_ALT_FUNC
}
},
.irq = USART1_IRQn,
diff --git a/spec/build/bsps/arm/stm32h7/grp.yml b/spec/build/bsps/arm/stm32h7/grp.yml
index 7b001e3701..e3b44d9593 100644
--- a/spec/build/bsps/arm/stm32h7/grp.yml
+++ b/spec/build/bsps/arm/stm32h7/grp.yml
@@ -82,6 +82,12 @@ links:
- role: build-dependency
uid: optpwrsupply
- role: build-dependency
+ uid: optusart1gpiopins
+- role: build-dependency
+ uid: optusart1gpioregs
+- role: build-dependency
+ uid: optusart1alternatefunc
+- role: build-dependency
uid: optusart3gpiopins
- role: build-dependency
uid: optusart3gpioregs
diff --git a/spec/build/bsps/arm/stm32h7/optusart1alternatefunc.yml b/spec/build/bsps/arm/stm32h7/optusart1alternatefunc.yml
new file mode 100644
index 0000000000..049ed6a3ac
--- /dev/null
+++ b/spec/build/bsps/arm/stm32h7/optusart1alternatefunc.yml
@@ -0,0 +1,19 @@
+actions:
+- get-string: null
+- define-unquoted: null
+build-type: option
+default: GPIO_AF4_USART1
+default-by-variant:
+- value: GPIO_AF7_USART1
+ variants:
+ - arm/stm32h7b3i-dk
+enabled-by: true
+format: '{}'
+links: []
+name: STM32H7_USART1_ALT_FUNC
+description: |
+ Alternate function mapping for the USART1 pin configuration.
+type: build
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+- Copyright (C) 2022 Karel Gardas <karel@functional.vision>
diff --git a/spec/build/bsps/arm/stm32h7/optusart1gpiopins.yml b/spec/build/bsps/arm/stm32h7/optusart1gpiopins.yml
new file mode 100644
index 0000000000..1580ded243
--- /dev/null
+++ b/spec/build/bsps/arm/stm32h7/optusart1gpiopins.yml
@@ -0,0 +1,19 @@
+actions:
+- get-string: null
+- define-unquoted: null
+build-type: option
+default: ( GPIO_PIN_14 | GPIO_PIN_15 )
+default-by-variant:
+- value: ( GPIO_PIN_9 | GPIO_PIN_10 )
+ variants:
+ - arm/stm32h7b3i-dk
+enabled-by: true
+format: '{}'
+links: []
+name: STM32H7_USART1_GPIO_PINS
+description: |
+ GPIO pins used for the USART1 pin configuration.
+type: build
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+- Copyright (C) 2021-22 embedded brains GmbH (http://www.embedded-brains.de)
diff --git a/spec/build/bsps/arm/stm32h7/optusart1gpioregs.yml b/spec/build/bsps/arm/stm32h7/optusart1gpioregs.yml
new file mode 100644
index 0000000000..46d10616bb
--- /dev/null
+++ b/spec/build/bsps/arm/stm32h7/optusart1gpioregs.yml
@@ -0,0 +1,19 @@
+actions:
+- get-string: null
+- define-unquoted: null
+build-type: option
+default: GPIOD
+default-by-variant:
+- value: GPIOA
+ variants:
+ - arm/stm32h7b3i-dk
+enabled-by: true
+format: '{}'
+links: []
+name: STM32H7_USART1_GPIO_REGS
+description: |
+ GPIO registers used for the USART1 pin configuration.
+type: build
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)