mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-10-17 02:45:05 +00:00
189 lines
4.7 KiB
Plaintext
189 lines
4.7 KiB
Plaintext
/dts-v1/;
|
|
|
|
#include <tactility/bindings/root.h>
|
|
#include <tactility/bindings/esp32_ble.h>
|
|
#include <tactility/bindings/esp32_gpio.h>
|
|
#include <tactility/bindings/esp32_i2c_master.h>
|
|
#include <tactility/bindings/esp32_i2s.h>
|
|
#include <tactility/bindings/esp32_pwm_ledc.h>
|
|
#include <tactility/bindings/esp32_sdspi.h>
|
|
#include <tactility/bindings/esp32_sleep.h>
|
|
#include <tactility/bindings/esp32_spi.h>
|
|
#include <tactility/bindings/esp32_wifi_pinned.h>
|
|
#include <tactility/bindings/esp32_usbdevice.h>
|
|
#include <tactility/bindings/gpio_hog.h>
|
|
#include <tactility/bindings/pwm_backlight.h>
|
|
|
|
#include <bindings/st7789.h>
|
|
#include <bindings/dummy_i2s_amp.h>
|
|
#include <bindings/pdm_mic.h>
|
|
#include <bindings/bq25896.h>
|
|
#include <bindings/bq27220.h>
|
|
#include <bindings/gpio_encoder.h>
|
|
#include <bindings/esp32_led_strip.h>
|
|
#include <bindings/cc1101.h>
|
|
|
|
#define WAKEUP_BUTTON_FLAGS (GPIO_FLAG_ACTIVE_LOW | GPIO_FLAG_PULL_UP)
|
|
|
|
// Reference:
|
|
// https://wiki.lilygo.cc/products/t-embed-series/t-embed-cc1101/
|
|
// https://github.com/Xinyuan-LilyGO/T-Embed-CC1101
|
|
// https://lilygo.cc/products/t-embed-cc1101
|
|
/ {
|
|
compatible = "root";
|
|
model = "T-Embed CC1101";
|
|
|
|
wifi0 {
|
|
compatible = "espressif,esp32-wifi-pinned";
|
|
};
|
|
|
|
ble0 {
|
|
compatible = "espressif,esp32-ble";
|
|
};
|
|
|
|
gpio0 {
|
|
compatible = "espressif,esp32-gpio";
|
|
gpio-count = <49>;
|
|
};
|
|
|
|
// Required to enable peripherals like BQ25896
|
|
peripheral-power-hog {
|
|
compatible = "gpio-hog";
|
|
pin = <&gpio0 15 GPIO_FLAG_NONE>;
|
|
mode = <GPIO_HOG_MODE_OUTPUT_HIGH>;
|
|
};
|
|
|
|
// Speaker I2S (MAX98357A amplifier)
|
|
i2s0 {
|
|
compatible = "espressif,esp32-i2s";
|
|
port = <I2S_NUM_0>;
|
|
pin-bclk = <&gpio0 46 GPIO_FLAG_NONE>;
|
|
pin-ws = <&gpio0 40 GPIO_FLAG_NONE>;
|
|
pin-data-out = <&gpio0 7 GPIO_FLAG_NONE>;
|
|
pin-data-in = <&gpio0 42 GPIO_FLAG_NONE>;
|
|
pin-mclk = <&gpio0 39 GPIO_FLAG_NONE>;
|
|
};
|
|
|
|
// MAX98357A class-D speaker amplifier. No I2C.
|
|
speaker0 {
|
|
compatible = "maxim,max98357a";
|
|
i2s = <&i2s0>;
|
|
};
|
|
|
|
mic0 {
|
|
compatible = "generic,spm1423";
|
|
i2s = <&i2s0>;
|
|
channels = <1>;
|
|
};
|
|
|
|
// WS2812 RGB LED Ring
|
|
// TODO - Sync on/off with DisplayIdle?
|
|
ledstrip0 {
|
|
compatible = "espressif,esp32-led-strip";
|
|
pin-data = <&gpio0 14 GPIO_FLAG_NONE>;
|
|
led-count = <8>;
|
|
};
|
|
|
|
i2c_internal: i2c0 {
|
|
compatible = "espressif,esp32-i2c-master";
|
|
port = <I2C_NUM_0>;
|
|
clock-frequency = <100000>;
|
|
pin-sda = <&gpio0 8 GPIO_FLAG_NONE>;
|
|
pin-scl = <&gpio0 18 GPIO_FLAG_NONE>;
|
|
|
|
bq27220 {
|
|
compatible = "ti,bq27220";
|
|
reg = <0x55>;
|
|
};
|
|
|
|
bq25896 {
|
|
compatible = "ti,bq25896";
|
|
reg = <0x6B>;
|
|
};
|
|
|
|
// TODO - Add PN532 NFC - IRQ GPIO 17, RES GPIO 45, address 0x24 - driver needed
|
|
};
|
|
|
|
display_backlight_pwm {
|
|
compatible = "espressif,esp32-pwm-ledc";
|
|
pin = <&gpio0 21 GPIO_FLAG_NONE>;
|
|
period-ns = <33333>;
|
|
ledc-timer = <0>;
|
|
ledc-channel = <0>;
|
|
};
|
|
|
|
display_backlight {
|
|
compatible = "pwm-backlight";
|
|
// Off by default so dispaly power-on won't show the screen from before the last power loss.
|
|
// The display backlight is turned on during the boot process.
|
|
status = "disabled";
|
|
pwm = <&display_backlight_pwm>;
|
|
};
|
|
|
|
spi0 {
|
|
compatible = "espressif,esp32-spi";
|
|
host = <SPI2_HOST>;
|
|
cs-gpios = <&gpio0 41 GPIO_FLAG_NONE>, // Display
|
|
<&gpio0 13 GPIO_FLAG_NONE>, // SD card
|
|
<&gpio0 12 GPIO_FLAG_NONE>; // Radio - CC1101
|
|
pin-mosi = <&gpio0 9 GPIO_FLAG_NONE>;
|
|
pin-miso = <&gpio0 10 GPIO_FLAG_NONE>;
|
|
pin-sclk = <&gpio0 11 GPIO_FLAG_NONE>;
|
|
|
|
display@0 {
|
|
compatible = "sitronix,st7789";
|
|
horizontal-resolution = <320>;
|
|
vertical-resolution = <170>;
|
|
gap-x = <35>;
|
|
swap-xy;
|
|
mirror-y;
|
|
invert-color;
|
|
pixel-clock-hz = <80000000>;
|
|
pin-dc = <&gpio0 16 GPIO_FLAG_NONE>;
|
|
backlight = <&display_backlight>;
|
|
};
|
|
|
|
sdcard@1 {
|
|
compatible = "espressif,esp32-sdspi";
|
|
status = "disabled";
|
|
frequency-khz = <20000>;
|
|
};
|
|
|
|
// CC1101 transceiver: CS/GDO0 = GPIO 12/3. SW1/SW0 (GPIO 47/48) select the
|
|
// antenna matching network: 315 MHz = 1/0, 433 MHz = 1/1, 868/915 MHz = 0/1.
|
|
// Module power comes from the peripheral power hog (GPIO 15).
|
|
radio@2 {
|
|
compatible = "ti,cc1101";
|
|
reg = <2>;
|
|
pin-gdo0 = <&gpio0 3 GPIO_FLAG_NONE>;
|
|
pin-band-switch-0 = <&gpio0 48 GPIO_FLAG_NONE>;
|
|
pin-band-switch-1 = <&gpio0 47 GPIO_FLAG_NONE>;
|
|
band-switch-low = <2>;
|
|
band-switch-mid = <3>;
|
|
band-switch-high = <1>;
|
|
};
|
|
};
|
|
|
|
encoder {
|
|
compatible = "tactility,gpio-encoder";
|
|
pin-a = <&gpio0 5 GPIO_FLAG_NONE>;
|
|
pin-b = <&gpio0 4 GPIO_FLAG_NONE>;
|
|
pin-enter = <&gpio0 0 GPIO_FLAG_NONE>;
|
|
pulses-per-detent = <2>;
|
|
pending-capacity = <8>;
|
|
};
|
|
|
|
sleep {
|
|
compatible = "espressif,esp32-sleep";
|
|
wakeup-gpios = <&gpio0 6 WAKEUP_BUTTON_FLAGS>;
|
|
};
|
|
|
|
usbdevice0 {
|
|
compatible = "espressif,esp32-usbdevice";
|
|
|
|
usbdevicemsc0 {
|
|
compatible = "espressif,esp32-usbdevice-msc";
|
|
};
|
|
};
|
|
};
|