bsp/stm32h7: add configuration for USART1 GPIO pins, registers and alternate function

This commit is contained in:
Karel Gardas
2022-04-01 18:14:11 +02:00
committed by Sebastian Huber
parent 51db61ae48
commit 0acc136039
5 changed files with 68 additions and 3 deletions

View File

@@ -31,15 +31,17 @@
#include <stm32h7/hal.h> #include <stm32h7/hal.h>
#include <bspopts.h>
const stm32h7_uart_config stm32h7_usart1_config = { const stm32h7_uart_config stm32h7_usart1_config = {
.gpio = { .gpio = {
.regs = GPIOB, .regs = STM32H7_USART1_GPIO_REGS,
.config = { .config = {
.Pin = GPIO_PIN_14 | GPIO_PIN_15, .Pin = STM32H7_USART1_GPIO_PINS,
.Mode = GPIO_MODE_AF_PP, .Mode = GPIO_MODE_AF_PP,
.Pull = GPIO_NOPULL, .Pull = GPIO_NOPULL,
.Speed = GPIO_SPEED_FREQ_LOW, .Speed = GPIO_SPEED_FREQ_LOW,
.Alternate = GPIO_AF4_USART1 .Alternate = STM32H7_USART1_ALT_FUNC
} }
}, },
.irq = USART1_IRQn, .irq = USART1_IRQn,

View File

@@ -81,6 +81,12 @@ links:
uid: optprintkinstance uid: optprintkinstance
- role: build-dependency - role: build-dependency
uid: optpwrsupply uid: optpwrsupply
- role: build-dependency
uid: optusart1gpiopins
- role: build-dependency
uid: optusart1gpioregs
- role: build-dependency
uid: optusart1alternatefunc
- role: build-dependency - role: build-dependency
uid: optusart3gpiopins uid: optusart3gpiopins
- role: build-dependency - role: build-dependency

View File

@@ -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>

View File

@@ -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)

View File

@@ -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)