boards: gd32f403z_eval: use pinctrl
Enable usage of pinctrl. Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
This commit is contained in:
parent
37c855f3c8
commit
d702e74854
4 changed files with 17 additions and 24 deletions
|
@ -1,5 +0,0 @@
|
|||
# Copyright (c) 2021, ATL Electronics
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
zephyr_library()
|
||||
zephyr_library_sources(board.c)
|
|
@ -1,18 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2021 ATL Electronics
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <init.h>
|
||||
|
||||
static int board_init(const struct device *dev)
|
||||
{
|
||||
rcu_periph_clock_enable(RCU_GPIOA);
|
||||
|
||||
gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_9);
|
||||
gpio_init(GPIOA, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_10);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
SYS_INIT(board_init, PRE_KERNEL_1, CONFIG_BOARD_INIT_PRIORITY);
|
14
boards/arm/gd32f403z_eval/gd32f403z_eval-pinctrl.dtsi
Normal file
14
boards/arm/gd32f403z_eval/gd32f403z_eval-pinctrl.dtsi
Normal file
|
@ -0,0 +1,14 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Teslabs Engineering S.L.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <dt-bindings/pinctrl/gd32f403z(k-i-g-e-c-b)xx-pinctrl.h>
|
||||
|
||||
&pinctrl {
|
||||
usart0_default: usart0_default {
|
||||
group1 {
|
||||
pinmux = <USART0_TX_PA9_NORMP>, <USART0_RX_PA10_NORMP>;
|
||||
};
|
||||
};
|
||||
};
|
|
@ -6,6 +6,7 @@
|
|||
/dts-v1/;
|
||||
|
||||
#include <gigadevice/gd32f403/gd32f403zet6.dtsi>
|
||||
#include "gd32f403z_eval-pinctrl.dtsi"
|
||||
|
||||
/ {
|
||||
model = "GigaDevice GD32F403Z Evaluation Kit";
|
||||
|
@ -21,6 +22,7 @@
|
|||
|
||||
&usart0 {
|
||||
status = "okay";
|
||||
|
||||
current-speed = <115200>;
|
||||
pinctrl-0 = <&usart0_default>;
|
||||
pinctrl-names = "default";
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue