Change Mikoto board
This commit is contained in:
parent
63d3058465
commit
a559896f34
8 changed files with 187 additions and 143 deletions
39
app/boards/arm/mikoto/mikoto_520-pinctrl.dtsi
Normal file
39
app/boards/arm/mikoto/mikoto_520-pinctrl.dtsi
Normal 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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
|
@ -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:
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Add table
Reference in a new issue