diff --git a/boards/shields/rpi_pico_lcd/boards/waveshare_pico_lcd_1_14/rpipico_r3.dtsi b/boards/shields/rpi_pico_lcd/boards/waveshare_pico_lcd_1_14/rpipico_r3.dtsi index b01af82ef7..93301dc41f 100644 --- a/boards/shields/rpi_pico_lcd/boards/waveshare_pico_lcd_1_14/rpipico_r3.dtsi +++ b/boards/shields/rpi_pico_lcd/boards/waveshare_pico_lcd_1_14/rpipico_r3.dtsi @@ -8,20 +8,28 @@ #include -&lcd_backlight_en { - enable-gpios = <&rpipico_header 13 GPIO_ACTIVE_HIGH>; /* GP13 */ +&rpipico_spi_lcd { + pinctrl-0 = <&spi1_lcd>; + pinctrl-names = "default"; + cs-gpios = <&rpipico_header 9 GPIO_ACTIVE_LOW>; /* GP9 */ }; -&lcd_panel { +&mipi_dbi { status = "okay"; reset-gpios = <&rpipico_header 12 GPIO_ACTIVE_LOW>; /* GP12 */ - cmd-data-gpios = <&rpipico_header 8 GPIO_ACTIVE_LOW>; /* GP8 */ + dc-gpios = <&rpipico_header 8 GPIO_ACTIVE_HIGH>; /* GP8 */ + spi-dev = <&rpipico_spi_lcd>; + #address-cells = <1>; + #size-cells = <0>; }; -&rpipico_spi_lcd { - pinctrl-0 = <&spi1_lcd>; - pinctrl-names = "default"; - cs-gpios = <&rpipico_header 9 GPIO_ACTIVE_LOW>; /* GP9 */ +&lcd_panel { + status = "okay"; +}; + +&lcd_backlight_en { + status = "okay"; + enable-gpios = <&rpipico_header 13 GPIO_ACTIVE_HIGH>; /* GP13 */ }; &button_0 { /* GP15 */ diff --git a/boards/shields/rpi_pico_lcd/boards/waveshare_pico_lcd_1_14/st7789v_135x240.dtsi b/boards/shields/rpi_pico_lcd/boards/waveshare_pico_lcd_1_14/st7789v_135x240.dtsi index 8ac3ca03ef..339b387433 100644 --- a/boards/shields/rpi_pico_lcd/boards/waveshare_pico_lcd_1_14/st7789v_135x240.dtsi +++ b/boards/shields/rpi_pico_lcd/boards/waveshare_pico_lcd_1_14/st7789v_135x240.dtsi @@ -4,11 +4,13 @@ */ #include +#include -&rpipico_spi_lcd { +&mipi_dbi { st7789v_135x240: st7789v@0 { compatible = "sitronix,st7789v"; - spi-max-frequency = ; + mipi-max-frequency = ; + mipi-mode = ; reg = <0>; status = "disabled"; diff --git a/boards/shields/rpi_pico_lcd/boards/waveshare_pico_lcd_1_14/st7789v_240x135.dtsi b/boards/shields/rpi_pico_lcd/boards/waveshare_pico_lcd_1_14/st7789v_240x135.dtsi index acab8be7f4..127dd73632 100644 --- a/boards/shields/rpi_pico_lcd/boards/waveshare_pico_lcd_1_14/st7789v_240x135.dtsi +++ b/boards/shields/rpi_pico_lcd/boards/waveshare_pico_lcd_1_14/st7789v_240x135.dtsi @@ -4,11 +4,13 @@ */ #include +#include -&rpipico_spi_lcd { +&mipi_dbi { st7789v_240x135: st7789v@0 { compatible = "sitronix,st7789v"; - spi-max-frequency = ; + mipi-max-frequency = ; + mipi-mode = ; reg = <0>; status = "disabled"; diff --git a/boards/shields/rpi_pico_lcd/boards/waveshare_pico_lcd_2/rpipico_r3.dtsi b/boards/shields/rpi_pico_lcd/boards/waveshare_pico_lcd_2/rpipico_r3.dtsi index a89304af21..bbbe32aa3f 100644 --- a/boards/shields/rpi_pico_lcd/boards/waveshare_pico_lcd_2/rpipico_r3.dtsi +++ b/boards/shields/rpi_pico_lcd/boards/waveshare_pico_lcd_2/rpipico_r3.dtsi @@ -8,20 +8,28 @@ #include -&lcd_backlight_en { - enable-gpios = <&rpipico_header 13 GPIO_ACTIVE_HIGH>; /* GP13 */ +&rpipico_spi_lcd { + pinctrl-0 = <&spi1_lcd>; + pinctrl-names = "default"; + cs-gpios = <&rpipico_header 9 GPIO_ACTIVE_LOW>; /* GP9 */ }; -&lcd_panel { +&mipi_dbi { status = "okay"; reset-gpios = <&rpipico_header 12 GPIO_ACTIVE_LOW>; /* GP12 */ - cmd-data-gpios = <&rpipico_header 8 GPIO_ACTIVE_LOW>; /* GP8 */ + dc-gpios = <&rpipico_header 8 GPIO_ACTIVE_HIGH>; /* GP8 */ + spi-dev = <&rpipico_spi_lcd>; + #address-cells = <1>; + #size-cells = <0>; }; -&rpipico_spi_lcd { - pinctrl-0 = <&spi1_lcd>; - pinctrl-names = "default"; - cs-gpios = <&rpipico_header 9 GPIO_ACTIVE_LOW>; /* GP9 */ +&lcd_panel { + status = "okay"; +}; + +&lcd_backlight_en { + status = "okay"; + enable-gpios = <&rpipico_header 13 GPIO_ACTIVE_HIGH>; /* GP13 */ }; &button_0 { /* GP15 */ diff --git a/boards/shields/rpi_pico_lcd/boards/waveshare_pico_lcd_2/st7789v_240x320.dtsi b/boards/shields/rpi_pico_lcd/boards/waveshare_pico_lcd_2/st7789v_240x320.dtsi index d707260060..a37f6e1786 100644 --- a/boards/shields/rpi_pico_lcd/boards/waveshare_pico_lcd_2/st7789v_240x320.dtsi +++ b/boards/shields/rpi_pico_lcd/boards/waveshare_pico_lcd_2/st7789v_240x320.dtsi @@ -4,11 +4,13 @@ */ #include +#include -&rpipico_spi_lcd { +&mipi_dbi { st7789v_240x320: st7789v@0 { compatible = "sitronix,st7789v"; - spi-max-frequency = ; + mipi-max-frequency = ; + mipi-mode = ; reg = <0>; status = "disabled"; diff --git a/boards/shields/rpi_pico_lcd/boards/waveshare_pico_lcd_2/st7789v_320x240.dtsi b/boards/shields/rpi_pico_lcd/boards/waveshare_pico_lcd_2/st7789v_320x240.dtsi index 594f408e96..f1cb861138 100644 --- a/boards/shields/rpi_pico_lcd/boards/waveshare_pico_lcd_2/st7789v_320x240.dtsi +++ b/boards/shields/rpi_pico_lcd/boards/waveshare_pico_lcd_2/st7789v_320x240.dtsi @@ -4,11 +4,13 @@ */ #include +#include -&rpipico_spi_lcd { +&mipi_dbi { st7789v_320x240: st7789v@0 { compatible = "sitronix,st7789v"; - spi-max-frequency = ; + mipi-max-frequency = ; + mipi-mode = ; reg = <0>; status = "disabled"; diff --git a/boards/shields/rpi_pico_lcd/waveshare_pico_lcd_1_14.overlay b/boards/shields/rpi_pico_lcd/waveshare_pico_lcd_1_14.overlay index 22bde0c943..ac3d3c3c90 100644 --- a/boards/shields/rpi_pico_lcd/waveshare_pico_lcd_1_14.overlay +++ b/boards/shields/rpi_pico_lcd/waveshare_pico_lcd_1_14.overlay @@ -11,6 +11,10 @@ zephyr,display = &lcd_panel; }; + mipi_dbi: mipi-dbi { + compatible = "zephyr,mipi-dbi-spi"; + }; + lcd_backlight_en: lcd-backlight-en { compatible = "regulator-fixed"; regulator-name = "lcd_backlight_enable"; diff --git a/boards/shields/rpi_pico_lcd/waveshare_pico_lcd_2.overlay b/boards/shields/rpi_pico_lcd/waveshare_pico_lcd_2.overlay index ea56649596..bef01a4fc7 100644 --- a/boards/shields/rpi_pico_lcd/waveshare_pico_lcd_2.overlay +++ b/boards/shields/rpi_pico_lcd/waveshare_pico_lcd_2.overlay @@ -11,6 +11,10 @@ zephyr,display = &lcd_panel; }; + mipi_dbi: mipi-dbi { + compatible = "zephyr,mipi-dbi-spi"; + }; + lcd_backlight_en: lcd-backlight-en { compatible = "regulator-fixed"; regulator-name = "lcd_backlight_enable"; diff --git a/boards/waveshare/rp2040/rpigeek_lcd_st7789v.dtsi b/boards/waveshare/rp2040/rpigeek_lcd_st7789v.dtsi index c24f369520..fd7e38716b 100644 --- a/boards/waveshare/rp2040/rpigeek_lcd_st7789v.dtsi +++ b/boards/waveshare/rp2040/rpigeek_lcd_st7789v.dtsi @@ -5,13 +5,59 @@ #include #include +#include / { chosen { zephyr,display = &lcd_panel; }; + + mipi_dbi_st7789v_240x135: mipi-dbi-st7789v-240x135 { + compatible = "zephyr,mipi-dbi-spi"; + status = "okay"; + + reset-gpios = <&gpio0 12 GPIO_ACTIVE_LOW>; + dc-gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>; + spi-dev = <&spi1>; + + #address-cells = <1>; + #size-cells = <0>; + + /* LCD with ST7789V controller. */ + st7789v_240x135: st7789v@0 { + compatible = "sitronix,st7789v"; + status = "okay"; + + reg = <0>; + mipi-max-frequency = ; + mipi-mode = ; + + width = <240>; + height = <135>; + x-offset = <40>; + y-offset = <53>; + + vcom = <0x19>; + gctrl = <0x35>; + vrhs = <0x12>; + vdvs = <0x20>; + 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 = [D0 04 0D 11 13 2B 3F 54 4C 18 0D 0B 1F 23]; + nvgam-param = [D0 04 0C 11 13 2C 3F 44 51 2F 1F 1F 20 23]; + ram-param = [00 F0]; + rgb-param = [CD 08 14]; + }; + }; }; +lcd_panel: &st7789v_240x135 {}; + &spi1 { status = "okay"; pinctrl-0 = <&spi1_lcd>; @@ -19,40 +65,8 @@ clock-frequency = ; cs-gpios = <&gpio0 9 GPIO_ACTIVE_LOW>; - - /* LCD with ST7789V controller. */ - st7789v_240x135: st7789v@0 { - compatible = "sitronix,st7789v"; - reg = <0>; - status = "okay"; - reset-gpios = <&gpio0 12 GPIO_ACTIVE_LOW>; - cmd-data-gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; - width = <240>; - height = <135>; - x-offset = <40>; - y-offset = <53>; - vcom = <0x19>; - gctrl = <0x35>; - vrhs = <0x12>; - vdvs = <0x20>; - 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 = [D0 04 0D 11 13 2B 3F 54 4C 18 0D 0B 1F 23]; - nvgam-param = [D0 04 0C 11 13 2C 3F 44 51 2F 1F 1F 20 23]; - ram-param = [00 F0]; - rgb-param = [CD 08 14]; - - spi-max-frequency = ; - }; }; -lcd_panel: &st7789v_240x135 {}; - &gpio0 { status = "okay"; }; diff --git a/boards/waveshare/rp2040/rpipico_lcd_st7735s.dtsi b/boards/waveshare/rp2040/rpipico_lcd_st7735s.dtsi index 582d4a587b..b683aee9c5 100644 --- a/boards/waveshare/rp2040/rpipico_lcd_st7735s.dtsi +++ b/boards/waveshare/rp2040/rpipico_lcd_st7735s.dtsi @@ -5,13 +5,63 @@ #include #include +#include / { chosen { zephyr,display = &lcd_panel; }; + + mipi_dbi_st7735s_160x80: mipi-dbi-st7735s-160x80 { + compatible = "zephyr,mipi-dbi-spi"; + status = "okay"; + + reset-gpios = <&gpio0 12 GPIO_ACTIVE_LOW>; + dc-gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>; + spi-dev = <&spi1>; + + #address-cells = <1>; + #size-cells = <0>; + + /* LCD with ST7735S controller can use with ST7735R driver. */ + st7735s_160x80: st7735s@0 { + compatible = "sitronix,st7735r"; + status = "okay"; + + reg = <0>; + mipi-max-frequency = ; + mipi-mode = ; + + width = <160>; + height = <80>; + x-offset = <1>; + y-offset = <26>; + + inversion-on; + rgb-is-inverted; + + pwctr1 = [62 02 04]; + pwctr2 = [C0]; + pwctr3 = [0D 00]; + pwctr4 = [8D 6A]; + pwctr5 = [8D EE]; + vmctr1 = <0x0E>; + frmctr1 = [05 3A 3A]; + frmctr2 = [05 3A 3A]; + frmctr3 = [05 3A 3A 05 3A 3A]; + invctr = <0x03>; + gamctrp1 = [10 0E 02 03 0E 07 02 07 0A 12 27 37 00 0D 0E 10]; + gamctrn1 = [10 0E 03 03 0F 06 02 08 0A 13 26 36 00 0D 0E 10]; + colmod = <0x05>; + madctl = <0xA8>; /* rotated: madctl = <0x78>; */ + caset = [00 01 00 A0]; + raset = [00 1A 00 69]; + }; + }; }; +lcd_panel: &st7735s_160x80 {}; + &spi1 { status = "okay"; pinctrl-0 = <&spi1_lcd>; @@ -19,43 +69,8 @@ clock-frequency = ; cs-gpios = <&gpio0 9 GPIO_ACTIVE_LOW>; - - /* LCD with ST7735S controller can use with ST7735R driver. */ - st7735s_160x80: st7735s@0 { - compatible = "sitronix,st7735r"; - reg = <0>; - status = "okay"; - reset-gpios = <&gpio0 12 GPIO_ACTIVE_LOW>; - cmd-data-gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; - width = <160>; - height = <80>; - inversion-on; - rgb-is-inverted; - x-offset = <1>; - y-offset = <26>; - pwctr1 = [62 02 04]; - pwctr2 = [C0]; - pwctr3 = [0D 00]; - pwctr4 = [8D 6A]; - pwctr5 = [8D EE]; - vmctr1 = <0x0E>; - frmctr1 = [05 3A 3A]; - frmctr2 = [05 3A 3A]; - frmctr3 = [05 3A 3A 05 3A 3A]; - invctr = <0x03>; - gamctrp1 = [10 0E 02 03 0E 07 02 07 0A 12 27 37 00 0D 0E 10]; - gamctrn1 = [10 0E 03 03 0F 06 02 08 0A 13 26 36 00 0D 0E 10]; - colmod = <0x05>; - madctl = <0xA8>; /* rotated: madctl = <0x78>; */ - caset = [00 01 00 A0]; - raset = [00 1A 00 69]; - - spi-max-frequency = ; - }; }; -lcd_panel: &st7735s_160x80 {}; - &gpio0 { status = "okay"; }; diff --git a/doc/bridle/releases/release-notes-3.7.0.rst b/doc/bridle/releases/release-notes-3.7.0.rst index da7347f091..950d3a6f7d 100644 --- a/doc/bridle/releases/release-notes-3.7.0.rst +++ b/doc/bridle/releases/release-notes-3.7.0.rst @@ -167,6 +167,8 @@ Take over the new build principles from Zephyr: * tbd. * tbd. * tbd. +* Use the new upstream *MIPI DBI driver class* for all *ST7735R* based displays. +* Use the new upstream *MIPI DBI driver class* for all *ST7789V* based displays. * Convert all Bridle *boards* and *SoCs* to the **new Hardware Model v2**. * Hook up ``board.cmake`` in Bridle's board extension folder. * Hook up ``Kconfig.defconfig`` in Bridle's board extension folder. @@ -204,6 +206,7 @@ Issue Related Items These GitHub issues were addressed since project bootstrapping: +* :github:`234` - [BUG] boards and shields with LCD do not support the new MIPI-DBI mode * :github:`231` - [BUG] build Zephyr docset fails * :github:`229` - [BUG] magpie_f777ni: wdt_basic_api/drivers.watchdog.stm32wwdg FAILED * :github:`227` - [BUG] Unable to build any application referencing bridle version information