From f907f9592da7e6590fc0833536fb21015dc1867d Mon Sep 17 00:00:00 2001 From: Daniel DeGrasse Date: Wed, 15 Mar 2023 09:41:44 -0500 Subject: [PATCH] boards: shields: add g1120b0mipi watch display Add g1120b0mipi watch display to shields. This shield is currently supported with the RT595 and RT1170 EVK. The shield contains a 400x392 circular OLED watch display, with an integrated RM67162 display controller Note that the touchscreen IC can be driven by the FT5336 driver, with the following changes: - the FT3267 reports touch data as inverted from the FT5336, so LVGL must be made aware of this via CONFIG_LV_Z_POINTER_KSCAN_INVERT_Y - the FT3267 reports the X and Y coordinates as swapped from the FT5336. To resolve this, the RM67162 driver reports the display as rotated by 90 degrees. Signed-off-by: Daniel DeGrasse --- boards/arm/mimxrt1170_evk/doc/index.rst | 3 +- boards/arm/mimxrt595_evk/doc/index.rst | 3 +- boards/shields/g1120b0mipi/Kconfig.defconfig | 44 ++++++++++++ boards/shields/g1120b0mipi/Kconfig.shield | 5 ++ .../boards/mimxrt1170_evk_cm7.overlay | 12 ++++ .../boards/mimxrt1170_evkb_cm7.overlay | 12 ++++ boards/shields/g1120b0mipi/doc/index.rst | 68 +++++++++++++++++++ .../shields/g1120b0mipi/g1120b0mipi.overlay | 58 ++++++++++++++++ 8 files changed, 203 insertions(+), 2 deletions(-) create mode 100644 boards/shields/g1120b0mipi/Kconfig.defconfig create mode 100644 boards/shields/g1120b0mipi/Kconfig.shield create mode 100644 boards/shields/g1120b0mipi/boards/mimxrt1170_evk_cm7.overlay create mode 100644 boards/shields/g1120b0mipi/boards/mimxrt1170_evkb_cm7.overlay create mode 100644 boards/shields/g1120b0mipi/doc/index.rst create mode 100644 boards/shields/g1120b0mipi/g1120b0mipi.overlay diff --git a/boards/arm/mimxrt1170_evk/doc/index.rst b/boards/arm/mimxrt1170_evk/doc/index.rst index 033f2d823bc..f62bd6c63da 100644 --- a/boards/arm/mimxrt1170_evk/doc/index.rst +++ b/boards/arm/mimxrt1170_evk/doc/index.rst @@ -131,7 +131,8 @@ RT1170 EVKB (`mimxrt1170_evkb_cm7/cm4`) | HWINFO | on-chip | Unique device serial number | Supported (M7) | Supported (M7) | +-----------+------------+-------------------------------------+-----------------+-----------------+ | DISPLAY | on-chip | eLCDIF; MIPI-DSI. Tested with | Supported (M7) | Supported (M7) | -| | | :ref:`rk055hdmipi4m` shield | | | +| | | :ref:`rk055hdmipi4m` and | | | +| | | :ref:`g1120b0mipi` shields | | | +-----------+------------+-------------------------------------+-----------------+-----------------+ | ACMP | on-chip | analog comparator | Supported | No support | +-----------+------------+-------------------------------------+-----------------+-----------------+ diff --git a/boards/arm/mimxrt595_evk/doc/index.rst b/boards/arm/mimxrt595_evk/doc/index.rst index a21b9745938..a7b53ea763c 100644 --- a/boards/arm/mimxrt595_evk/doc/index.rst +++ b/boards/arm/mimxrt595_evk/doc/index.rst @@ -109,7 +109,8 @@ already supported, which can also be re-used on this mimxrt595_evk board: | I2S | on-chip | i2s | +-----------+------------+-------------------------------------+ | DISPLAY | on-chip | LCDIF; MIPI-DSI. Tested with | -| | | :ref:`rk055hdmipi4m` shield | +| | | :ref:`rk055hdmipi4m` and | +| | | :ref:`g1120b0mipi` display shields | +-----------+------------+-------------------------------------+ The default configuration can be found in the defconfig file: diff --git a/boards/shields/g1120b0mipi/Kconfig.defconfig b/boards/shields/g1120b0mipi/Kconfig.defconfig new file mode 100644 index 00000000000..33d23518194 --- /dev/null +++ b/boards/shields/g1120b0mipi/Kconfig.defconfig @@ -0,0 +1,44 @@ +# Copyright 2023 NXP +# SPDX-License-Identifier: Apache-2.0 + +if SHIELD_G1120B0MIPI + +if LVGL +# Enable input subsystem for FT5336 driver +config INPUT + default y + +config INPUT_FT5336_INTERRUPT + default y + +# KSCAN subsystem must be enabled for KSCAN input shim driver +config KSCAN + default y + +# Configure LVGL to use touchscreen with KSCAN API +config LV_Z_POINTER_KSCAN + default y + +# Y coordinates need to be inverted for this controller. Note that +# the RM67162 display driver also reports the display orientation as rotated +# by 90 degrees, so LVGL will read coordinates correctly. +config LV_Z_POINTER_KSCAN_INVERT_Y + default y + +# Swap 16 bit color setting for LVGL, to send high byte first +config LV_COLOR_16_SWAP + default y + +config LV_Z_VDB_SIZE + default 16 + +config LV_DPI_DEF + default 128 + +choice LV_COLOR_DEPTH + default LV_COLOR_DEPTH_16 +endchoice + +endif # LVGL + +endif # SHIELD_G1120B0MIPI diff --git a/boards/shields/g1120b0mipi/Kconfig.shield b/boards/shields/g1120b0mipi/Kconfig.shield new file mode 100644 index 00000000000..4c15ae49f82 --- /dev/null +++ b/boards/shields/g1120b0mipi/Kconfig.shield @@ -0,0 +1,5 @@ +# Copyright 2023 NXP +# SPDX-License-Identifier: Apache-2.0 + +config SHIELD_G1120B0MIPI + def_bool $(shields_list_contains,g1120b0mipi) diff --git a/boards/shields/g1120b0mipi/boards/mimxrt1170_evk_cm7.overlay b/boards/shields/g1120b0mipi/boards/mimxrt1170_evk_cm7.overlay new file mode 100644 index 00000000000..5669c8440f2 --- /dev/null +++ b/boards/shields/g1120b0mipi/boards/mimxrt1170_evk_cm7.overlay @@ -0,0 +1,12 @@ +/* + * Copyright 2023, NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&rm67162_g1120b0mipi { + /* R414 is not populated on this board, so LPTE signal is not + * connected. remove the property from the display. + */ + /delete-property/ te-gpios; +}; diff --git a/boards/shields/g1120b0mipi/boards/mimxrt1170_evkb_cm7.overlay b/boards/shields/g1120b0mipi/boards/mimxrt1170_evkb_cm7.overlay new file mode 100644 index 00000000000..5669c8440f2 --- /dev/null +++ b/boards/shields/g1120b0mipi/boards/mimxrt1170_evkb_cm7.overlay @@ -0,0 +1,12 @@ +/* + * Copyright 2023, NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&rm67162_g1120b0mipi { + /* R414 is not populated on this board, so LPTE signal is not + * connected. remove the property from the display. + */ + /delete-property/ te-gpios; +}; diff --git a/boards/shields/g1120b0mipi/doc/index.rst b/boards/shields/g1120b0mipi/doc/index.rst new file mode 100644 index 00000000000..ccfeae05833 --- /dev/null +++ b/boards/shields/g1120b0mipi/doc/index.rst @@ -0,0 +1,68 @@ +.. _g1120b0mipi: + +G1120B0MIPI MIPI Display +########################## + +Overview +******** + +The G1120B0MIPI is a 1.2 inch circular AMOLED display, 390x390 pixels, with a +1-lane MIPI interface. This display connects to the i.MX RT595 Evaluation Kit. + + +More information about the shield can be found +at the `G1120B0MIPI product page`_. + +This display uses a 40 pin FPC interface, which is available on many +NXP EVKs. + +Pins Assignment of the G1120B0MIPI MIPI Display +========================================================== + ++-----------------------+------------------------+ +| FPC Connector Pin | Function | ++=======================+========================+ +| 1 | LED backlight cathode | ++-----------------------+------------------------+ +| 21 | Controller reset | ++-----------------------+------------------------+ +| 22 | Controller LPTE | ++-----------------------+------------------------+ +| 26 | Touch ctrl I2C SDA | ++-----------------------+------------------------+ +| 27 | Touch ctrl I2C SCL | ++-----------------------+------------------------+ +| 28 | Touch ctrl reset | ++-----------------------+------------------------+ +| 29 | Touch ctrl interrupt | ++-----------------------+------------------------+ +| 32 | LCD power enable | ++-----------------------+------------------------+ +| 34 | Backlight power enable | ++-----------------------+------------------------+ + +Requirements +************ + +This shield can only be used with a board which provides a configuration +for the 40 pin FPC interface + +Programming +*********** + +Set ``-DSHIELD=g1120b0mipi`` when you invoke ``west build``. For +example: + +.. zephyr-app-commands:: + :zephyr-app: samples/drivers/display + :board: mimxrt595_evk_cm33 + :shield: g1120b0mipi + :goals: build + +References +********** + +.. target-notes:: + +.. _G1120B0MIPI product page: + https://www.nxp.com/design/development-boards/i-mx-evaluation-and-development-boards/1-2-wearable-display-g1120b0mipi:G1120B0MIPI diff --git a/boards/shields/g1120b0mipi/g1120b0mipi.overlay b/boards/shields/g1120b0mipi/g1120b0mipi.overlay new file mode 100644 index 00000000000..a60fac33121 --- /dev/null +++ b/boards/shields/g1120b0mipi/g1120b0mipi.overlay @@ -0,0 +1,58 @@ +/* + * Copyright 2023, NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/{ + aliases { + kscan0 = &kscan_input_g1120b0mipi; + }; + + chosen { + zephyr,display = &rm67162_g1120b0mipi; + zephyr,keyboard-scan = &kscan_input_g1120b0mipi; + }; + + en_mipi_display_g1120b0mipi: enable-mipi-display { + compatible = "regulator-fixed"; + regulator-name = "en_mipi_display"; + enable-gpios = <&nxp_mipi_connector 32 GPIO_ACTIVE_HIGH>; + regulator-boot-on; + }; +}; + +&nxp_mipi_i2c { + status = "okay"; + ft3267@38 { + /* + * Note- the actual controller present on this IC is a FT3267, + * but the FT35336 driver in Zephyr supports this IC. + */ + compatible = "focaltech,ft5336"; + reg = <0x38>; + int-gpios = <&nxp_mipi_connector 29 GPIO_ACTIVE_LOW>; + reset-gpios = <&nxp_mipi_connector 28 GPIO_ACTIVE_HIGH>; + kscan_input_g1120b0mipi: kscan-input { + compatible = "zephyr,kscan-input"; + }; + }; +}; + +&zephyr_mipi_dsi { + status = "okay"; + autoinsert-eotp; + phy-clock = <316800000>; + rm67162_g1120b0mipi: rm67162@0 { + status = "okay"; + compatible = "raydium,rm67162"; + reg = <0x0>; + reset-gpios = <&nxp_mipi_connector 21 GPIO_ACTIVE_HIGH>; + bl-gpios = <&nxp_mipi_connector 0 GPIO_ACTIVE_HIGH>; + te-gpios = <&nxp_mipi_connector 22 GPIO_ACTIVE_HIGH>; + data-lanes = <1>; + width = <400>; + height = <392>; + pixel-format = ; + }; +};