1/* 2 * Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd. 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7/dts-v1/; 8 9#include <espressif/esp32c3/esp32c3_mini_n4.dtsi> 10#include "esp32c3_rust-pinctrl.dtsi" 11#include <zephyr/dt-bindings/input/input-event-codes.h> 12#include <zephyr/dt-bindings/led/led.h> 13#include <espressif/partitions_0x0_default.dtsi> 14 15/ { 16 model = "Espressif ESP32C3-RUST"; 17 compatible = "espressif,esp32c3_rust"; 18 19 chosen { 20 zephyr,sram = &sram1; 21 zephyr,console = &usb_serial; 22 zephyr,shell-uart = &usb_serial; 23 zephyr,flash = &flash0; 24 zephyr,code-partition = &slot0_partition; 25 }; 26 27 aliases { 28 led0 = &red_led_0; 29 sw0 = &user_button1; 30 i2c-0 = &i2c0; 31 watchdog0 = &wdt0; 32 led-strip = &led_strip; 33 }; 34 35 gpio_keys { 36 compatible = "gpio-keys"; 37 user_button1: button_1 { 38 label = "User SW1"; 39 gpios = <&gpio0 9 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; 40 zephyr,code = <INPUT_KEY_0>; 41 }; 42 }; 43 44 leds { 45 compatible = "gpio-leds"; 46 red_led_0: led_0 { 47 gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; 48 label = "User LD0"; 49 }; 50 }; 51 52}; 53 54&spi2 { 55 #address-cells = <1>; 56 #size-cells = <0>; 57 status = "okay"; 58 pinctrl-0 = <&spim2_default>; 59 pinctrl-names = "default"; 60 61 /* Workaround to support WS2812 driver */ 62 line-idle-low; 63 status = "okay"; 64 65 led_strip: ws2812@0 { 66 compatible = "worldsemi,ws2812-spi"; 67 68 /* SPI */ 69 reg = <0>; /* ignored, but necessary for SPI bindings */ 70 spi-max-frequency = <6400000>; 71 72 /* WS2812 */ 73 chain-length = <1>; /* arbitrary; change at will */ 74 spi-cpha; 75 spi-one-frame = <0xf0>; /* 11110000: 625 ns high and 625 ns low */ 76 spi-zero-frame = <0xc0>; /* 11000000: 312.5 ns high and 937.5 ns low */ 77 color-mapping = <LED_COLOR_ID_GREEN 78 LED_COLOR_ID_RED 79 LED_COLOR_ID_BLUE>; 80 }; 81}; 82 83&usb_serial { 84 status = "okay"; 85}; 86 87 88&i2c0 { 89 status = "okay"; 90 clock-frequency = <I2C_BITRATE_STANDARD>; 91 pinctrl-0 = <&i2c0_default>; 92 pinctrl-names = "default"; 93 94 icm42670@68 { 95 compatible = "invensense,icm42670"; 96 reg = <0x68>; 97 status = "okay"; 98 accel-hz = <800>; 99 accel-fs = <16>; 100 gyro-hz = <800>; 101 gyro-fs = <2000>; 102 }; 103 104 shtc3@70 { 105 compatible = "sensirion,shtc3", "sensirion,shtcx"; 106 reg = <0x70>; 107 measure-mode = "normal"; 108 clock-stretching; 109 }; 110}; 111 112&trng0 { 113 status = "okay"; 114}; 115 116&gpio0 { 117 status = "okay"; 118}; 119 120&wdt0 { 121 status = "okay"; 122}; 123 124&uart0 { 125 status = "disabled"; 126}; 127 128&esp32_bt_hci { 129 status = "okay"; 130}; 131