diff --git a/Devices/cyd-2432s024c/cyd,2432s024c.dts b/Devices/cyd-2432s024c/cyd,2432s024c.dts index ccc1ad75d..d9d390de9 100644 --- a/Devices/cyd-2432s024c/cyd,2432s024c.dts +++ b/Devices/cyd-2432s024c/cyd,2432s024c.dts @@ -27,6 +27,7 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 15 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 13 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 14 GPIO_FLAG_NONE>; @@ -38,6 +39,7 @@ spi1 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 5 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 23 GPIO_FLAG_NONE>; pin-miso = <&gpio0 19 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 18 GPIO_FLAG_NONE>; diff --git a/Devices/cyd-2432s024r/cyd,2432s024r.dts b/Devices/cyd-2432s024r/cyd,2432s024r.dts index 737cd00bc..5ae5207bc 100644 --- a/Devices/cyd-2432s024r/cyd,2432s024r.dts +++ b/Devices/cyd-2432s024r/cyd,2432s024r.dts @@ -5,6 +5,7 @@ #include #include #include +#include #include / { @@ -22,10 +23,16 @@ pin-mosi = <&gpio0 13 GPIO_FLAG_NONE>; pin-miso = <&gpio0 12 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 14 GPIO_FLAG_NONE>; + cs-gpios = <&gpio0 15 GPIO_FLAG_NONE>, // Display + <&gpio0 33 GPIO_FLAG_NONE>; // Touch - display { + display@0 { compatible = "display-placeholder"; }; + + touch@1 { + compatible = "touch-placeholder"; + }; }; spi1 { @@ -34,6 +41,7 @@ pin-mosi = <&gpio0 23 GPIO_FLAG_NONE>; pin-miso = <&gpio0 19 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 18 GPIO_FLAG_NONE>; + cs-gpios = <&gpio0 5 GPIO_FLAG_NONE>; sdcard { compatible = "espressif,esp32-sdspi"; diff --git a/Devices/cyd-2432s028r/cyd,2432s028r.dts b/Devices/cyd-2432s028r/cyd,2432s028r.dts index 4179d8e05..41f635429 100644 --- a/Devices/cyd-2432s028r/cyd,2432s028r.dts +++ b/Devices/cyd-2432s028r/cyd,2432s028r.dts @@ -7,6 +7,7 @@ #include #include #include +#include / { compatible = "root"; @@ -28,13 +29,19 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 15 GPIO_FLAG_NONE>, // Display + <&gpio0 33 GPIO_FLAG_NONE>; // Touch pin-mosi = <&gpio0 13 GPIO_FLAG_NONE>; pin-miso = <&gpio0 12 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 14 GPIO_FLAG_NONE>; - display { + display@0 { compatible = "display-placeholder"; }; + + touch@1 { + compatible = "touch-placeholder"; + }; }; spi1 { @@ -43,7 +50,8 @@ pin-mosi = <&gpio0 23 GPIO_FLAG_NONE>; pin-miso = <&gpio0 19 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 18 GPIO_FLAG_NONE>; - + cs-gpios = <&gpio0 5 GPIO_FLAG_NONE>; + sdcard { compatible = "espressif,esp32-sdspi"; pin-cs = <&gpio0 5 GPIO_FLAG_NONE>; diff --git a/Devices/cyd-2432s028rv3/cyd,2432s028rv3.dts b/Devices/cyd-2432s028rv3/cyd,2432s028rv3.dts index 6105b94a3..97ab5a6ec 100644 --- a/Devices/cyd-2432s028rv3/cyd,2432s028rv3.dts +++ b/Devices/cyd-2432s028rv3/cyd,2432s028rv3.dts @@ -7,6 +7,7 @@ #include #include #include +#include / { compatible = "root"; @@ -28,18 +29,25 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 15 GPIO_FLAG_NONE>, // Display + <&gpio0 33 GPIO_FLAG_NONE>; // Touch pin-mosi = <&gpio0 13 GPIO_FLAG_NONE>; pin-miso = <&gpio0 12 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 14 GPIO_FLAG_NONE>; - display { + display@0 { compatible = "display-placeholder"; }; + + touch@1 { + compatible = "touch-placeholder"; + }; }; spi1 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 5 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 23 GPIO_FLAG_NONE>; pin-miso = <&gpio0 19 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 18 GPIO_FLAG_NONE>; diff --git a/Devices/cyd-2432s032c/cyd,2432s032c.dts b/Devices/cyd-2432s032c/cyd,2432s032c.dts index 74beaf2da..796fbe273 100644 --- a/Devices/cyd-2432s032c/cyd,2432s032c.dts +++ b/Devices/cyd-2432s032c/cyd,2432s032c.dts @@ -27,6 +27,7 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 15 GPIO_FLAG_NONE>; pin-mosi = <&gpio1 13 GPIO_FLAG_NONE>; pin-sclk = <&gpio1 14 GPIO_FLAG_NONE>; @@ -38,6 +39,7 @@ spi1 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 5 GPIO_FLAG_NONE>; pin-mosi = <&gpio1 23 GPIO_FLAG_NONE>; pin-miso = <&gpio1 19 GPIO_FLAG_NONE>; pin-sclk = <&gpio1 18 GPIO_FLAG_NONE>; diff --git a/Devices/cyd-3248s035c/cyd,3248s035c.dts b/Devices/cyd-3248s035c/cyd,3248s035c.dts index a4b8aea3f..f02d78794 100644 --- a/Devices/cyd-3248s035c/cyd,3248s035c.dts +++ b/Devices/cyd-3248s035c/cyd,3248s035c.dts @@ -37,6 +37,7 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 15 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 13 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 14 GPIO_FLAG_NONE>; @@ -48,6 +49,7 @@ spi1 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 5 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 23 GPIO_FLAG_NONE>; pin-miso = <&gpio0 19 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 18 GPIO_FLAG_NONE>; diff --git a/Devices/cyd-4848s040c/cyd,4848s040c.dts b/Devices/cyd-4848s040c/cyd,4848s040c.dts index f9b4c5886..e3649e7c7 100644 --- a/Devices/cyd-4848s040c/cyd,4848s040c.dts +++ b/Devices/cyd-4848s040c/cyd,4848s040c.dts @@ -31,11 +31,11 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 42 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 47 GPIO_FLAG_NONE>; pin-miso = <&gpio0 41 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 48 GPIO_FLAG_NONE>; - pin-hd = <&gpio0 42 GPIO_FLAG_NONE>; - + sdcard { compatible = "espressif,esp32-sdspi"; pin-cs = <&gpio0 42 GPIO_FLAG_NONE>; diff --git a/Devices/cyd-8048s043c/cyd,8048s043c.dts b/Devices/cyd-8048s043c/cyd,8048s043c.dts index 222850fff..63e93d34a 100644 --- a/Devices/cyd-8048s043c/cyd,8048s043c.dts +++ b/Devices/cyd-8048s043c/cyd,8048s043c.dts @@ -40,6 +40,7 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 10 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 11 GPIO_FLAG_NONE>; pin-miso = <&gpio0 13 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 12 GPIO_FLAG_NONE>; diff --git a/Devices/cyd-e32r28t/cyd,e32r28t.dts b/Devices/cyd-e32r28t/cyd,e32r28t.dts index d79230fc4..942205083 100644 --- a/Devices/cyd-e32r28t/cyd,e32r28t.dts +++ b/Devices/cyd-e32r28t/cyd,e32r28t.dts @@ -5,6 +5,7 @@ #include #include #include +#include / { compatible = "root"; @@ -18,18 +19,25 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 15 GPIO_FLAG_NONE>, // Display + <&gpio0 33 GPIO_FLAG_NONE>; // Touch pin-mosi = <&gpio0 13 GPIO_FLAG_NONE>; pin-miso = <&gpio0 12 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 14 GPIO_FLAG_NONE>; - display { + display@0 { compatible = "display-placeholder"; }; + + touch@1 { + compatible = "touch-placeholder"; + }; }; spi1 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 5 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 23 GPIO_FLAG_NONE>; pin-miso = <&gpio0 19 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 18 GPIO_FLAG_NONE>; diff --git a/Devices/cyd-e32r32p/cyd,e32r32p.dts b/Devices/cyd-e32r32p/cyd,e32r32p.dts index da75b1a4a..383c8d879 100644 --- a/Devices/cyd-e32r32p/cyd,e32r32p.dts +++ b/Devices/cyd-e32r32p/cyd,e32r32p.dts @@ -6,6 +6,7 @@ #include #include #include +#include / { compatible = "root"; @@ -27,18 +28,25 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 15 GPIO_FLAG_NONE>, // Display + <&gpio0 33 GPIO_FLAG_NONE>; // Touch pin-mosi = <&gpio0 13 GPIO_FLAG_NONE>; pin-miso = <&gpio0 12 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 14 GPIO_FLAG_NONE>; - display { + display@0 { compatible = "display-placeholder"; }; + + touch@1 { + compatible = "touch-placeholder"; + }; }; spi1 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 5 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 23 GPIO_FLAG_NONE>; pin-miso = <&gpio0 19 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 18 GPIO_FLAG_NONE>; diff --git a/Devices/elecrow-crowpanel-advance-28/elecrow,crowpanel-advance-28.dts b/Devices/elecrow-crowpanel-advance-28/elecrow,crowpanel-advance-28.dts index cf8eaa1bb..166075d3d 100644 --- a/Devices/elecrow-crowpanel-advance-28/elecrow,crowpanel-advance-28.dts +++ b/Devices/elecrow-crowpanel-advance-28/elecrow,crowpanel-advance-28.dts @@ -33,6 +33,7 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 40 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 39 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 42 GPIO_FLAG_NONE>; @@ -44,6 +45,7 @@ spi1 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 7 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 6 GPIO_FLAG_NONE>; pin-miso = <&gpio0 4 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 5 GPIO_FLAG_NONE>; diff --git a/Devices/elecrow-crowpanel-advance-35/elecrow,crowpanel-advance-35.dts b/Devices/elecrow-crowpanel-advance-35/elecrow,crowpanel-advance-35.dts index 0050ecd46..314594ed8 100644 --- a/Devices/elecrow-crowpanel-advance-35/elecrow,crowpanel-advance-35.dts +++ b/Devices/elecrow-crowpanel-advance-35/elecrow,crowpanel-advance-35.dts @@ -33,6 +33,7 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 40 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 39 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 42 GPIO_FLAG_NONE>; @@ -44,6 +45,7 @@ spi1 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 7 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 6 GPIO_FLAG_NONE>; pin-miso = <&gpio0 4 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 5 GPIO_FLAG_NONE>; diff --git a/Devices/elecrow-crowpanel-advance-50/elecrow,crowpanel-advance-50.dts b/Devices/elecrow-crowpanel-advance-50/elecrow,crowpanel-advance-50.dts index 6b27e4467..f6e536231 100644 --- a/Devices/elecrow-crowpanel-advance-50/elecrow,crowpanel-advance-50.dts +++ b/Devices/elecrow-crowpanel-advance-50/elecrow,crowpanel-advance-50.dts @@ -32,6 +32,7 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 0 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 6 GPIO_FLAG_NONE>; pin-miso = <&gpio0 4 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 5 GPIO_FLAG_NONE>; diff --git a/Devices/elecrow-crowpanel-basic-28/elecrow,crowpanel-basic-28.dts b/Devices/elecrow-crowpanel-basic-28/elecrow,crowpanel-basic-28.dts index 89c6e3213..dc95198b9 100644 --- a/Devices/elecrow-crowpanel-basic-28/elecrow,crowpanel-basic-28.dts +++ b/Devices/elecrow-crowpanel-basic-28/elecrow,crowpanel-basic-28.dts @@ -7,6 +7,7 @@ #include #include #include +#include / { compatible = "root"; @@ -28,19 +29,26 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 15 GPIO_FLAG_NONE>, // Display + <&gpio0 33 GPIO_FLAG_NONE>; // Touch pin-mosi = <&gpio0 13 GPIO_FLAG_NONE>; pin-miso = <&gpio0 12 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 14 GPIO_FLAG_NONE>; max-transfer-size = <65536>; - display { + display@0 { compatible = "display-placeholder"; }; + + touch@1 { + compatible = "touch-placeholder"; + }; }; spi1 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 5 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 23 GPIO_FLAG_NONE>; pin-miso = <&gpio0 19 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 18 GPIO_FLAG_NONE>; diff --git a/Devices/elecrow-crowpanel-basic-35/elecrow,crowpanel-basic-35.dts b/Devices/elecrow-crowpanel-basic-35/elecrow,crowpanel-basic-35.dts index 8226b5e6d..11cf4f456 100644 --- a/Devices/elecrow-crowpanel-basic-35/elecrow,crowpanel-basic-35.dts +++ b/Devices/elecrow-crowpanel-basic-35/elecrow,crowpanel-basic-35.dts @@ -7,6 +7,7 @@ #include #include #include +#include / { compatible = "root"; @@ -28,19 +29,26 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 15 GPIO_FLAG_NONE>, // Display + <&gpio0 12 GPIO_FLAG_NONE>; // Touch pin-mosi = <&gpio0 13 GPIO_FLAG_NONE>; pin-miso = <&gpio0 33 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 14 GPIO_FLAG_NONE>; max-transfer-size = <65536>; - display { + display@0 { compatible = "display-placeholder"; }; + + touch@1 { + compatible = "touch-placeholder"; + }; }; spi1 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 5 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 23 GPIO_FLAG_NONE>; pin-miso = <&gpio0 19 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 18 GPIO_FLAG_NONE>; diff --git a/Devices/elecrow-crowpanel-basic-50/elecrow,crowpanel-basic-50.dts b/Devices/elecrow-crowpanel-basic-50/elecrow,crowpanel-basic-50.dts index b5dae9648..2f8106745 100644 --- a/Devices/elecrow-crowpanel-basic-50/elecrow,crowpanel-basic-50.dts +++ b/Devices/elecrow-crowpanel-basic-50/elecrow,crowpanel-basic-50.dts @@ -32,6 +32,7 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 10 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 11 GPIO_FLAG_NONE>; pin-miso = <&gpio0 13 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 12 GPIO_FLAG_NONE>; diff --git a/Devices/guition-jc2432w328c/guition,jc2432w328c.dts b/Devices/guition-jc2432w328c/guition,jc2432w328c.dts index 78c3570ba..c96a6a8f7 100644 --- a/Devices/guition-jc2432w328c/guition,jc2432w328c.dts +++ b/Devices/guition-jc2432w328c/guition,jc2432w328c.dts @@ -37,6 +37,7 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 15 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 13 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 14 GPIO_FLAG_NONE>; @@ -48,6 +49,7 @@ spi1 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 5 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 23 GPIO_FLAG_NONE>; pin-miso = <&gpio0 19 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 18 GPIO_FLAG_NONE>; diff --git a/Devices/guition-jc3248w535c/guition,jc3248w535c.dts b/Devices/guition-jc3248w535c/guition,jc3248w535c.dts index f48fa1814..13a14ef43 100644 --- a/Devices/guition-jc3248w535c/guition,jc3248w535c.dts +++ b/Devices/guition-jc3248w535c/guition,jc3248w535c.dts @@ -49,11 +49,16 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 45 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 21 GPIO_FLAG_NONE>; pin-miso = <&gpio0 48 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 47 GPIO_FLAG_NONE>; pin-wp = <&gpio0 40 GPIO_FLAG_NONE>; pin-hd = <&gpio0 39 GPIO_FLAG_NONE>; + + display { + compatible = "display-placeholder"; + }; }; spi1 { diff --git a/Devices/guition-jc8048w550c/guition,jc8048w550c.dts b/Devices/guition-jc8048w550c/guition,jc8048w550c.dts index 6000feaea..dba67451e 100644 --- a/Devices/guition-jc8048w550c/guition,jc8048w550c.dts +++ b/Devices/guition-jc8048w550c/guition,jc8048w550c.dts @@ -50,6 +50,7 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 10 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 11 GPIO_FLAG_NONE>; pin-miso = <&gpio0 13 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 12 GPIO_FLAG_NONE>; diff --git a/Devices/lilygo-tdeck/lilygo,tdeck.dts b/Devices/lilygo-tdeck/lilygo,tdeck.dts index baf70b04d..331a7e99d 100644 --- a/Devices/lilygo-tdeck/lilygo,tdeck.dts +++ b/Devices/lilygo-tdeck/lilygo,tdeck.dts @@ -44,19 +44,21 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 12 GPIO_FLAG_NONE>, // Display + <&gpio0 39 GPIO_FLAG_NONE>; // SD card pin-mosi = <&gpio0 41 GPIO_FLAG_NONE>; pin-miso = <&gpio0 38 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 40 GPIO_FLAG_NONE>; - - sdcard@0 { + + display@0 { + compatible = "display-placeholder"; + }; + + sdcard@1 { compatible = "espressif,esp32-sdspi"; pin-cs = <&gpio0 39 GPIO_FLAG_NONE>; frequency-khz = <20000>; }; - - display@1 { - compatible = "display-placeholder"; - }; }; uart0 { diff --git a/Devices/lilygo-tdisplay-s3/lilygo,tdisplay-s3.dts b/Devices/lilygo-tdisplay-s3/lilygo,tdisplay-s3.dts index d9822732e..3a21669a6 100644 --- a/Devices/lilygo-tdisplay-s3/lilygo,tdisplay-s3.dts +++ b/Devices/lilygo-tdisplay-s3/lilygo,tdisplay-s3.dts @@ -3,8 +3,6 @@ #include #include #include -#include -#include / { compatible = "root"; @@ -18,11 +16,4 @@ compatible = "espressif,esp32-gpio"; gpio-count = <49>; }; - - spi0 { - compatible = "espressif,esp32-spi"; - host = ; - pin-mosi = <&gpio0 7 GPIO_FLAG_NONE>; - pin-sclk = <&gpio0 6 GPIO_FLAG_NONE>; - }; }; diff --git a/Devices/lilygo-tdisplay/lilygo,tdisplay.dts b/Devices/lilygo-tdisplay/lilygo,tdisplay.dts index 750ed3ec0..10350088c 100644 --- a/Devices/lilygo-tdisplay/lilygo,tdisplay.dts +++ b/Devices/lilygo-tdisplay/lilygo,tdisplay.dts @@ -18,6 +18,7 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 5 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 19 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 18 GPIO_FLAG_NONE>; diff --git a/Devices/lilygo-tdongle-s3/lilygo,tdongle-s3.dts b/Devices/lilygo-tdongle-s3/lilygo,tdongle-s3.dts index 2c26cbb3e..7e608f187 100644 --- a/Devices/lilygo-tdongle-s3/lilygo,tdongle-s3.dts +++ b/Devices/lilygo-tdongle-s3/lilygo,tdongle-s3.dts @@ -33,6 +33,7 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 4 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 3 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 5 GPIO_FLAG_NONE>; diff --git a/Devices/lilygo-thmi/lilygo,thmi.dts b/Devices/lilygo-thmi/lilygo,thmi.dts index defb61d1c..93e080900 100644 --- a/Devices/lilygo-thmi/lilygo,thmi.dts +++ b/Devices/lilygo-thmi/lilygo,thmi.dts @@ -23,9 +23,19 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 6 GPIO_FLAG_NONE>, // Display + <&gpio0 2 GPIO_FLAG_NONE>; // Touch pin-mosi = <&gpio0 3 GPIO_FLAG_NONE>; pin-miso = <&gpio0 4 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 1 GPIO_FLAG_NONE>; + + display@0 { + compatible = "display-placeholder"; + }; + + touch@1 { + compatible = "touch-placeholder"; + }; }; sdmmc0 { diff --git a/Devices/lilygo-tlora-pager/Source/Configuration.cpp b/Devices/lilygo-tlora-pager/Source/Configuration.cpp index 13bd752e2..9be746363 100644 --- a/Devices/lilygo-tlora-pager/Source/Configuration.cpp +++ b/Devices/lilygo-tlora-pager/Source/Configuration.cpp @@ -27,7 +27,6 @@ static DeviceVector createDevices() { bq27220, std::make_shared(i2c), power, - createTpagerSdCard(), createDisplay(), keyboard, std::make_shared() diff --git a/Devices/lilygo-tlora-pager/lilygo,tlora-pager.dts b/Devices/lilygo-tlora-pager/lilygo,tlora-pager.dts index 217a87af9..d6b38f7ec 100644 --- a/Devices/lilygo-tlora-pager/lilygo,tlora-pager.dts +++ b/Devices/lilygo-tlora-pager/lilygo,tlora-pager.dts @@ -35,6 +35,8 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 21 GPIO_FLAG_NONE>, // SD card + <&gpio0 36 GPIO_FLAG_NONE>; // Display pin-mosi = <&gpio0 34 GPIO_FLAG_NONE>; pin-miso = <&gpio0 33 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 35 GPIO_FLAG_NONE>; diff --git a/Devices/m5stack-cardputer-adv/m5stack,cardputer-adv.dts b/Devices/m5stack-cardputer-adv/m5stack,cardputer-adv.dts index 155940187..a004ab1e9 100644 --- a/Devices/m5stack-cardputer-adv/m5stack,cardputer-adv.dts +++ b/Devices/m5stack-cardputer-adv/m5stack,cardputer-adv.dts @@ -52,6 +52,7 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 37 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 35 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 36 GPIO_FLAG_NONE>; @@ -63,6 +64,7 @@ spi1 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 12 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 14 GPIO_FLAG_NONE>; pin-miso = <&gpio0 39 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 40 GPIO_FLAG_NONE>; diff --git a/Devices/m5stack-cardputer/m5stack,cardputer.dts b/Devices/m5stack-cardputer/m5stack,cardputer.dts index 1e205b35a..f652eb60a 100644 --- a/Devices/m5stack-cardputer/m5stack,cardputer.dts +++ b/Devices/m5stack-cardputer/m5stack,cardputer.dts @@ -38,6 +38,7 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 37 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 35 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 36 GPIO_FLAG_NONE>; @@ -49,6 +50,7 @@ spi1 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 12 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 14 GPIO_FLAG_NONE>; pin-miso = <&gpio0 39 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 40 GPIO_FLAG_NONE>; diff --git a/Devices/m5stack-core2/m5stack,core2.dts b/Devices/m5stack-core2/m5stack,core2.dts index c14cf4d4f..0269b04dc 100644 --- a/Devices/m5stack-core2/m5stack,core2.dts +++ b/Devices/m5stack-core2/m5stack,core2.dts @@ -53,6 +53,8 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 4 GPIO_FLAG_NONE>, // SD card + <&gpio0 5 GPIO_FLAG_NONE>; // Display pin-mosi = <&gpio0 23 GPIO_FLAG_NONE>; pin-miso = <&gpio0 38 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 18 GPIO_FLAG_NONE>; diff --git a/Devices/m5stack-cores3/m5stack,cores3.dts b/Devices/m5stack-cores3/m5stack,cores3.dts index b7f69d858..c6eba128b 100644 --- a/Devices/m5stack-cores3/m5stack,cores3.dts +++ b/Devices/m5stack-cores3/m5stack,cores3.dts @@ -78,6 +78,8 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 4 GPIO_FLAG_NONE>, // SD card + <&gpio0 3 GPIO_FLAG_NONE>; // Display pin-mosi = <&gpio0 37 GPIO_FLAG_NONE>; pin-miso = <&gpio0 35 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 36 GPIO_FLAG_NONE>; diff --git a/Devices/m5stack-papers3/m5stack,papers3.dts b/Devices/m5stack-papers3/m5stack,papers3.dts index 946de1a79..3a3afde9e 100644 --- a/Devices/m5stack-papers3/m5stack,papers3.dts +++ b/Devices/m5stack-papers3/m5stack,papers3.dts @@ -43,6 +43,7 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 47 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 38 GPIO_FLAG_NONE>; pin-miso = <&gpio0 40 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 39 GPIO_FLAG_NONE>; diff --git a/Devices/m5stack-stackchan/m5stack,stackchan.dts b/Devices/m5stack-stackchan/m5stack,stackchan.dts index f046ebf0f..b81830f65 100644 --- a/Devices/m5stack-stackchan/m5stack,stackchan.dts +++ b/Devices/m5stack-stackchan/m5stack,stackchan.dts @@ -112,16 +112,18 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 4 GPIO_FLAG_NONE>, // SD card + <&gpio0 3 GPIO_FLAG_NONE>; // Display pin-mosi = <&gpio0 37 GPIO_FLAG_NONE>; pin-miso = <&gpio0 35 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 36 GPIO_FLAG_NONE>; - + sdcard@0 { compatible = "espressif,esp32-sdspi"; pin-cs = <&gpio0 4 GPIO_FLAG_NONE>; frequency-khz = <20000>; }; - + display@1 { compatible = "display-placeholder"; }; diff --git a/Devices/m5stack-stickc-plus/m5stack,stickc-plus.dts b/Devices/m5stack-stickc-plus/m5stack,stickc-plus.dts index 86de033f8..4946efdcb 100644 --- a/Devices/m5stack-stickc-plus/m5stack,stickc-plus.dts +++ b/Devices/m5stack-stickc-plus/m5stack,stickc-plus.dts @@ -47,6 +47,7 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 5 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 15 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 13 GPIO_FLAG_NONE>; diff --git a/Devices/m5stack-stickc-plus2/m5stack,stickc-plus2.dts b/Devices/m5stack-stickc-plus2/m5stack,stickc-plus2.dts index e299548a3..5bfb45ebf 100644 --- a/Devices/m5stack-stickc-plus2/m5stack,stickc-plus2.dts +++ b/Devices/m5stack-stickc-plus2/m5stack,stickc-plus2.dts @@ -46,6 +46,7 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 5 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 15 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 13 GPIO_FLAG_NONE>; diff --git a/Devices/m5stack-sticks3/m5stack,sticks3.dts b/Devices/m5stack-sticks3/m5stack,sticks3.dts index 34dc0155a..14a3b34a4 100644 --- a/Devices/m5stack-sticks3/m5stack,sticks3.dts +++ b/Devices/m5stack-sticks3/m5stack,sticks3.dts @@ -53,6 +53,7 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 41 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 39 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 40 GPIO_FLAG_NONE>; @@ -65,6 +66,7 @@ spi1 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 7 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 6 GPIO_FLAG_NONE>; pin-miso = <&gpio0 4 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 5 GPIO_FLAG_NONE>; diff --git a/Devices/m5stack-tab5/m5stack,tab5.dts b/Devices/m5stack-tab5/m5stack,tab5.dts index aea748d8b..c5d6d5428 100644 --- a/Devices/m5stack-tab5/m5stack,tab5.dts +++ b/Devices/m5stack-tab5/m5stack,tab5.dts @@ -82,6 +82,7 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 42 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 44 GPIO_FLAG_NONE>; pin-miso = <&gpio0 39 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 43 GPIO_FLAG_NONE>; diff --git a/Devices/unphone/unphone.dts b/Devices/unphone/unphone.dts index e46ad3b2b..99d7bd125 100644 --- a/Devices/unphone/unphone.dts +++ b/Devices/unphone/unphone.dts @@ -31,12 +31,23 @@ sdcard_spi: spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 48 GPIO_FLAG_NONE>, // Display + <&gpio0 38 GPIO_FLAG_NONE>, // Touch + <&gpio0 43 GPIO_FLAG_NONE>; // SD card pin-mosi = <&gpio0 40 GPIO_FLAG_NONE>; pin-miso = <&gpio0 41 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 39 GPIO_FLAG_NONE>; max-transfer-size = <65536>; - - sdcard { + + display@0 { + compatible = "display-placeholder"; + }; + + touch@1 { + compatible = "touch-placeholder"; + }; + + sdcard@2 { compatible = "espressif,esp32-sdspi"; pin-cs = <&gpio0 43 GPIO_FLAG_NONE>; frequency-khz = <20000>; diff --git a/Devices/waveshare-esp32-s3-geek/waveshare,esp32-s3-geek.dts b/Devices/waveshare-esp32-s3-geek/waveshare,esp32-s3-geek.dts index 40ff3582d..ef3db9a4b 100644 --- a/Devices/waveshare-esp32-s3-geek/waveshare,esp32-s3-geek.dts +++ b/Devices/waveshare-esp32-s3-geek/waveshare,esp32-s3-geek.dts @@ -33,6 +33,7 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 10 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 11 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 12 GPIO_FLAG_NONE>; diff --git a/Devices/waveshare-s3-lcd-13/waveshare,s3-lcd-13.dts b/Devices/waveshare-s3-lcd-13/waveshare,s3-lcd-13.dts index 7da91d261..85a10de7b 100644 --- a/Devices/waveshare-s3-lcd-13/waveshare,s3-lcd-13.dts +++ b/Devices/waveshare-s3-lcd-13/waveshare,s3-lcd-13.dts @@ -39,6 +39,7 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 39 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 41 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 40 GPIO_FLAG_NONE>; @@ -50,6 +51,7 @@ spi1 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 17 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 18 GPIO_FLAG_NONE>; pin-miso = <&gpio0 16 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 21 GPIO_FLAG_NONE>; diff --git a/Devices/waveshare-s3-touch-lcd-128/waveshare,s3-touch-lcd-128.dts b/Devices/waveshare-s3-touch-lcd-128/waveshare,s3-touch-lcd-128.dts index da213dbda..22298c064 100644 --- a/Devices/waveshare-s3-touch-lcd-128/waveshare,s3-touch-lcd-128.dts +++ b/Devices/waveshare-s3-touch-lcd-128/waveshare,s3-touch-lcd-128.dts @@ -39,6 +39,7 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 9 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 11 GPIO_FLAG_NONE>; pin-miso = <&gpio0 12 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 10 GPIO_FLAG_NONE>; @@ -51,6 +52,7 @@ spi1 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 18 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 16 GPIO_FLAG_NONE>; pin-miso = <&gpio0 15 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 17 GPIO_FLAG_NONE>; diff --git a/Devices/waveshare-s3-touch-lcd-147/waveshare,s3-touch-lcd-147.dts b/Devices/waveshare-s3-touch-lcd-147/waveshare,s3-touch-lcd-147.dts index 0877d8131..4f6ee5bd8 100644 --- a/Devices/waveshare-s3-touch-lcd-147/waveshare,s3-touch-lcd-147.dts +++ b/Devices/waveshare-s3-touch-lcd-147/waveshare,s3-touch-lcd-147.dts @@ -32,8 +32,13 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 21 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 39 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 38 GPIO_FLAG_NONE>; + + display { + compatible = "display-placeholder"; + }; }; spi1 { diff --git a/Devices/waveshare-s3-touch-lcd-43/waveshare,s3-touch-lcd-43.dts b/Devices/waveshare-s3-touch-lcd-43/waveshare,s3-touch-lcd-43.dts index 8be9aeb7d..b868a57b1 100644 --- a/Devices/waveshare-s3-touch-lcd-43/waveshare,s3-touch-lcd-43.dts +++ b/Devices/waveshare-s3-touch-lcd-43/waveshare,s3-touch-lcd-43.dts @@ -32,6 +32,7 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 10 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 11 GPIO_FLAG_NONE>; pin-miso = <&gpio0 13 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 12 GPIO_FLAG_NONE>; diff --git a/Devices/wireless-tag-wt32-sc01-plus/wireless-tag,wt32-sc01-plus.dts b/Devices/wireless-tag-wt32-sc01-plus/wireless-tag,wt32-sc01-plus.dts index a09f37a61..f0a6c2b65 100644 --- a/Devices/wireless-tag-wt32-sc01-plus/wireless-tag,wt32-sc01-plus.dts +++ b/Devices/wireless-tag-wt32-sc01-plus/wireless-tag,wt32-sc01-plus.dts @@ -31,6 +31,7 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; + cs-gpios = <&gpio0 41 GPIO_FLAG_NONE>; pin-mosi = <&gpio0 40 GPIO_FLAG_NONE>; pin-miso = <&gpio0 38 GPIO_FLAG_NONE>; pin-sclk = <&gpio0 39 GPIO_FLAG_NONE>; diff --git a/Platforms/platform-esp32/source/drivers/esp32_spi.cpp b/Platforms/platform-esp32/source/drivers/esp32_spi.cpp index 14551a27c..e80297d33 100644 --- a/Platforms/platform-esp32/source/drivers/esp32_spi.cpp +++ b/Platforms/platform-esp32/source/drivers/esp32_spi.cpp @@ -6,6 +6,7 @@ #include "tactility/drivers/gpio_descriptor.h" #include +#include #include #include #include @@ -117,6 +118,18 @@ static error_t start(Device* device) { return ERROR_RESOURCE; } + // Deselect all CS pins (drive high) before any SPI communication + const GpioPinSpec* cs = dts_config->cs_gpios; + while (cs->gpio_controller != nullptr) { + GpioDescriptor* desc = gpio_descriptor_acquire(cs->gpio_controller, cs->pin, GPIO_OWNER_SPI); + if (desc != nullptr) { + gpio_descriptor_set_flags(desc, GPIO_FLAG_DIRECTION_OUTPUT); + gpio_descriptor_set_level(desc, true); + gpio_descriptor_release(desc); + } + cs++; + } + data->initialized = true; return ERROR_NONE; } diff --git a/TactilityKernel/bindings/touch-placeholder.yaml b/TactilityKernel/bindings/touch-placeholder.yaml new file mode 100644 index 000000000..e41b29659 --- /dev/null +++ b/TactilityKernel/bindings/touch-placeholder.yaml @@ -0,0 +1,5 @@ +description: Touch placeholder + +compatible: "touch-placeholder" + +properties: {} diff --git a/TactilityKernel/include/tactility/bindings/touch_placeholder.h b/TactilityKernel/include/tactility/bindings/touch_placeholder.h new file mode 100644 index 000000000..ac0524158 --- /dev/null +++ b/TactilityKernel/include/tactility/bindings/touch_placeholder.h @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: Apache-2.0 +#pragma once + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +DEFINE_DEVICETREE(touch_placeholder, struct TouchPlaceholderConfig) + +#ifdef __cplusplus +} +#endif diff --git a/TactilityKernel/include/tactility/drivers/touch.h b/TactilityKernel/include/tactility/drivers/touch.h new file mode 100644 index 000000000..071aff778 --- /dev/null +++ b/TactilityKernel/include/tactility/drivers/touch.h @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: Apache-2.0 +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +extern const struct DeviceType TOUCH_TYPE; + +#ifdef __cplusplus +} +#endif diff --git a/TactilityKernel/include/tactility/drivers/touch_placeholder.h b/TactilityKernel/include/tactility/drivers/touch_placeholder.h new file mode 100644 index 000000000..62b46b91b --- /dev/null +++ b/TactilityKernel/include/tactility/drivers/touch_placeholder.h @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: Apache-2.0 +#pragma once + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct TouchPlaceholderConfig { + uint8_t _unused; +}; + +#ifdef __cplusplus +} +#endif diff --git a/TactilityKernel/source/drivers/touch.cpp b/TactilityKernel/source/drivers/touch.cpp new file mode 100644 index 000000000..f324ebb8f --- /dev/null +++ b/TactilityKernel/source/drivers/touch.cpp @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: Apache-2.0 +#include + +extern "C" { + +const struct DeviceType TOUCH_TYPE { + .name = "touch" +}; + +} diff --git a/TactilityKernel/source/drivers/touch_placeholder.cpp b/TactilityKernel/source/drivers/touch_placeholder.cpp new file mode 100644 index 000000000..4b76be3e2 --- /dev/null +++ b/TactilityKernel/source/drivers/touch_placeholder.cpp @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: Apache-2.0 +#include +#include +#include +#include +#include + +extern "C" { + +static error_t start(Device*) { return ERROR_NONE; } +static error_t stop(Device*) { return ERROR_NONE; } + +extern Module root_module; + +Driver touch_placeholder_driver = { + .name = "touch_placeholder", + .compatible = (const char*[]) { "touch-placeholder", nullptr }, + .start_device = start, + .stop_device = stop, + .api = nullptr, + .device_type = &TOUCH_TYPE, + .owner = &root_module, + .internal = nullptr +}; + +} diff --git a/TactilityKernel/source/kernel_init.cpp b/TactilityKernel/source/kernel_init.cpp index 9c99278f2..16d0be818 100644 --- a/TactilityKernel/source/kernel_init.cpp +++ b/TactilityKernel/source/kernel_init.cpp @@ -16,6 +16,8 @@ static error_t start() { if (driver_construct_add(&root_driver) != ERROR_NONE) return ERROR_RESOURCE; extern Driver display_placeholder_driver; if (driver_construct_add(&display_placeholder_driver) != ERROR_NONE) return ERROR_RESOURCE; + extern Driver touch_placeholder_driver; + if (driver_construct_add(&touch_placeholder_driver) != ERROR_NONE) return ERROR_RESOURCE; extern Driver spi_peripheral_driver; if (driver_construct_add(&spi_peripheral_driver) != ERROR_NONE) return ERROR_RESOURCE; return ERROR_NONE;