boards: arm: bbc_microbit_v2: migrate to pinctrl

Use pinctrl instead of `-pin` properties.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2022-03-16 18:06:47 +01:00 committed by Carles Cufí
parent 1faacdaafa
commit 052d0cd0ba
3 changed files with 46 additions and 4 deletions

View File

@ -0,0 +1,37 @@
/*
* Copyright (c) 2022 Nordic Semiconductor
* SPDX-License-Identifier: Apache-2.0
*/
&pinctrl {
uart0_default: uart0_default {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 6)>,
<NRF_PSEL(UART_RX, 1, 8)>;
};
};
uart0_sleep: uart0_sleep {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 6)>,
<NRF_PSEL(UART_RX, 1, 8)>;
low-power-enable;
};
};
i2c0_default: i2c0_default {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 16)>,
<NRF_PSEL(TWIM_SCL, 0, 8)>;
};
};
i2c0_sleep: i2c0_sleep {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 16)>,
<NRF_PSEL(TWIM_SCL, 0, 8)>;
low-power-enable;
};
};
};

View File

@ -6,6 +6,7 @@
/dts-v1/;
#include <nordic/nrf52833_qiaa.dtsi>
#include "bbc_microbit_v2-pinctrl.dtsi"
/ {
model = "BBC Micro:bit V2";
@ -111,19 +112,21 @@
compatible = "nordic,nrf-uart";
status = "okay";
current-speed = <115200>;
tx-pin = <6>;
rx-pin = <40>;
pinctrl-0 = <&uart0_default>;
pinctrl-1 = <&uart0_sleep>;
pinctrl-names = "default", "sleep";
};
&i2c0 {
compatible = "nordic,nrf-twim";
status = "okay";
clock-frequency = <I2C_BITRATE_FAST>;
sda-pin = <16>;
scl-pin = <8>;
/* See https://tech.microbit.org/hardware/i2c/ for board variants */
pinctrl-0 = <&i2c0_default>;
pinctrl-1 = <&i2c0_sleep>;
pinctrl-names = "default", "sleep";
lsm303agr-magn@1e {
compatible = "st,lis2mdl", "st,lsm303agr-magn";
status = "okay";

View File

@ -17,3 +17,5 @@ CONFIG_SERIAL=y
# enable console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_PINCTRL=y