Files
blinky/boards/atguigu/mini_keyboard/mini_keyboard.dts

234 lines
4.7 KiB
Plaintext
Raw Normal View History

/dts-v1/;
#include <nordic/nrf52840_qiaa.dtsi>
#include "mini_keyboard-pinctrl.dtsi"
#include <zephyr/dt-bindings/adc/adc.h>
#include <zephyr/dt-bindings/mipi_dbi/mipi_dbi.h>
#include <zephyr/dt-bindings/pwm/pwm.h>
/ {
model = "Mini keyboard";
compatible = "atguigu,mini-keyboard";
chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
zephyr,display = &screen_lcd;
};
aliases {
led0 = &myled0;
qdec0 = &qdec;
backlight = &backlight;
};
hid_kbd: hid_kbd {
compatible = "zephyr,hid-device";
label = "HID_KBD";
protocol-code = "keyboard";
in-report-size = <29>;
out-report-size = <1>;
in-polling-period-us = <1000>;
out-polling-period-us = <1000>;
};
hid_consumer: hid_consumer {
compatible = "zephyr,hid-device";
label = "HID_CONSUMER";
protocol-code = "none";
in-report-size = <2>;
in-polling-period-us = <1000>;
};
leds {
compatible = "gpio-leds";
myled0: led_0 {
gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
};
};
pwm_leds {
compatible = "pwm-leds";
status = "okay";
backlight: pwm_led_0 {
pwms = <&pwm0 0 PWM_MSEC(10) PWM_POLARITY_INVERTED>;
};
};
mipi_dbi_screen: mipi_dbi_screen {
compatible = "zephyr,mipi-dbi-spi";
spi-dev = <&spi3>;
dc-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
write-only;
#address-cells = <1>;
#size-cells = <0>;
screen_lcd: st7789v@0 {
compatible = "sitronix,st7789v";
status = "okay";
reg = <0>;
mipi-max-frequency = <32000000>;
width = <320>;
height = <172>;
x-offset = <0>;
y-offset = <34>;
vcom = <0x34>;
gctrl = <0x00>;
mdac = <0x70>;
gamma = <0x01>;
colmod = <0x05>;
lcm = <0x2c>;
porch-param = [ 0c 0c 00 33 33 ];
cmd2en-param = [ 5a 69 02 01 ];
pwctrl1-param = [ a4 a1 ];
pvgam-param = [ f0 04 08 0a 0a 05 25 33 3c 24 0e 0f 27 2f ];
nvgam-param = [ f0 02 06 06 04 22 25 32 3b 3a 15 17 2d 37 ];
ram-param = [ 00 f0 ];
rgb-param = [ cd 08 14 ];
ready-time-ms = <120>;
mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE";
};
};
vbatt: vbatt {
compatible = "voltage-divider";
io-channels = <&adc 7>;
output-ohms = <100000>;
full-ohms = <200000>;
power-gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
power-on-sample-delay-us = <200>;
};
mode_switch_adc: mode-switch-adc {
compatible = "voltage-divider";
io-channels = <&adc 5>;
output-ohms = <1>;
full-ohms = <1>;
};
};
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 DT_SIZE_K(48)>;
};
slot0_partition: partition@c000 {
label = "image-0";
reg = <0x0000c000 DT_SIZE_K(472)>;
};
slot1_partition: partition@82000 {
label = "image-1";
reg = <0x00082000 DT_SIZE_K(472)>;
};
storage_partition: partition@f8000 {
label = "storage";
reg = <0x000f8000 DT_SIZE_K(32)>;
};
};
};
&uicr {
nfct-pins-as-gpios;
gpio-as-nreset;
};
&adc {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
channel@5 {
reg = <5>;
zephyr,gain = "ADC_GAIN_1_6";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,acquisition-time = <ADC_ACQ_TIME(ADC_ACQ_TIME_MICROSECONDS, 40)>;
zephyr,input-positive = <NRF_SAADC_AIN5>;
zephyr,resolution = <12>;
zephyr,oversampling = <4>;
};
channel@7 {
reg = <7>;
zephyr,gain = "ADC_GAIN_1_4";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,acquisition-time = <ADC_ACQ_TIME(ADC_ACQ_TIME_MICROSECONDS, 40)>;
zephyr,input-positive = <NRF_SAADC_AIN7>;
zephyr,resolution = <14>;
zephyr,oversampling = <4>;
};
};
&i2c0 {
status = "okay";
pinctrl-0 = <&i2c0_default>;
pinctrl-1 = <&i2c0_sleep>;
pinctrl-names = "default", "sleep";
clock-frequency = <400000>;
ip5306: pmic@75 {
compatible = "injoinic,ip5306";
reg = <0x75>;
wakeup-gpios = <&gpio0 22 GPIO_ACTIVE_LOW>;
keepalive-interval-ms = <8000>;
keepalive-pulse-width-ms = <500>;
keepalive-hardware;
status = "okay";
};
};
&gpio0 {
status = "okay";
};
&gpio1 {
status = "okay";
};
&gpiote {
status = "okay";
};
&spi3 {
status = "okay";
pinctrl-0 = <&spi3_default>;
pinctrl-1 = <&spi3_sleep>;
pinctrl-names = "default", "sleep";
cs-gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
};
&pwm0 {
status = "okay";
pinctrl-0 = <&pwm0_default>;
pinctrl-1 = <&pwm0_sleep>;
pinctrl-names = "default", "sleep";
};
&qdec {
status = "okay";
pinctrl-0 = <&encoder_default>;
pinctrl-1 = <&encoder_sleep>;
pinctrl-names = "default", "sleep";
led-pre = <0>;
steps = <80>;
nordic,period = "SAMPLEPER_1024US";
};
&usbd {
status = "okay";
num-bidir-endpoints = <0>;
num-in-endpoints = <2>;
num-out-endpoints = <1>;
num-isoin-endpoints = <0>;
num-isoout-endpoints = <0>;
};