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 <daniel.degrasse@nxp.com>
This commit is contained in:
Daniel DeGrasse 2023-03-15 09:41:44 -05:00 committed by Carles Cufí
commit f907f9592d
8 changed files with 203 additions and 2 deletions

View file

@ -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 |
+-----------+------------+-------------------------------------+-----------------+-----------------+

View file

@ -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:

View file

@ -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

View file

@ -0,0 +1,5 @@
# Copyright 2023 NXP
# SPDX-License-Identifier: Apache-2.0
config SHIELD_G1120B0MIPI
def_bool $(shields_list_contains,g1120b0mipi)

View file

@ -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;
};

View file

@ -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;
};

View file

@ -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

View file

@ -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 = <MIPI_DSI_PIXFMT_RGB565>;
};
};