Change Mikoto board

This commit is contained in:
HeavyDutySoul 2023-10-06 17:34:05 +03:00
parent 63d3058465
commit a559896f34
8 changed files with 187 additions and 143 deletions

View file

@ -0,0 +1,39 @@
/*
* Copyright (c) 2022 The ZMK Contributors
* SPDX-License-Identifier: MIT
*/
&pinctrl {
uart0_default: uart0_default {
group1 {
psels = <NRF_PSEL(UART_RX, 0, 4)>;
bias-pull-up;
};
group2 {
psels = <NRF_PSEL(UART_TX, 0, 8)>;
};
};
uart0_sleep: uart0_sleep {
group1 {
psels = <NRF_PSEL(UART_RX, 0, 4)>,
<NRF_PSEL(UART_TX, 0, 8)>;
low-power-enable;
};
};
i2c0_default: i2c0_default {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 17)>,
<NRF_PSEL(TWIM_SCL, 0, 20)>;
};
};
i2c0_sleep: i2c0_sleep {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 17)>,
<NRF_PSEL(TWIM_SCL, 0, 20)>;
low-power-enable;
};
};
};

View file

@ -7,6 +7,7 @@
/dts-v1/; /dts-v1/;
#include <nordic/nrf52840_qiaa.dtsi> #include <nordic/nrf52840_qiaa.dtsi>
#include "arduino_pro_micro_pins.dtsi" #include "arduino_pro_micro_pins.dtsi"
#include "mikoto_520-pinctrl.dtsi"
/ { / {
model = "mikoto"; model = "mikoto";
@ -62,14 +63,17 @@
&i2c0 { &i2c0 {
compatible = "nordic,nrf-twi"; compatible = "nordic,nrf-twi";
sda-pin = <17>; pinctrl-0 = <&i2c0_default>;
scl-pin = <20>; pinctrl-1 = <&i2c0_sleep>;
pinctrl-names = "default", "sleep";
}; };
&uart0 { &uart0 {
compatible = "nordic,nrf-uarte"; compatible = "nordic,nrf-uarte";
tx-pin = <8>; current-speed = <115200>;
rx-pin = <4>; pinctrl-0 = <&uart0_default>;
pinctrl-1 = <&uart0_sleep>;
pinctrl-names = "default", "sleep";
}; };
&usbd { &usbd {
@ -80,7 +84,6 @@
}; };
}; };
&flash0 { &flash0 {
/* /*
* For more information, see: * For more information, see:

View file

@ -7,6 +7,8 @@ CONFIG_BOARD_MIKOTO_520=y
# Enable MPU # Enable MPU
CONFIG_ARM_MPU=y CONFIG_ARM_MPU=y
CONFIG_PINCTRL=y
# enable GPIO # enable GPIO
CONFIG_GPIO=y CONFIG_GPIO=y

View file

@ -4,19 +4,19 @@
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
*/ */
#include <kernel.h> #include <zephyr/kernel.h>
#include <device.h> #include <zephyr/device.h>
#include <init.h> #include <zephyr/init.h>
#include <drivers/gpio.h> #include <zephyr/drivers/gpio.h>
#include <sys/sys_io.h> #include <zephyr/sys/sys_io.h>
#include <devicetree.h> #include <zephyr/devicetree.h>
static int pinmux_mikoto_init(const struct device *port) { static int pinmux_mikoto_init(const struct device *port) {
ARG_UNUSED(port); ARG_UNUSED(port);
#if CONFIG_BOARD_MIKOTO_520 #if CONFIG_BOARD_MIKOTO_520
const struct device *p0 = device_get_binding("GPIO_0"); const struct device *p0 = DEVICE_DT_GET(DT_NODELABEL(gpio0));
const struct device *p1 = device_get_binding("GPIO_1"); const struct device *p1 = DEVICE_DT_GET(DT_NODELABEL(gpio1));
#if CONFIG_BOARD_MIKOTO_CHARGER_CURRENT_40MA #if CONFIG_BOARD_MIKOTO_CHARGER_CURRENT_40MA
gpio_pin_configure(p0, 26, GPIO_INPUT | GPIO_PULL_DOWN); gpio_pin_configure(p0, 26, GPIO_INPUT | GPIO_PULL_DOWN);
gpio_pin_configure(p1, 15, GPIO_INPUT); gpio_pin_configure(p1, 15, GPIO_INPUT);