Skip to content

Commit

Permalink
boards: shields: add g1120b0mipi watch display
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
danieldegrasse committed May 5, 2023
1 parent 02e08a0 commit 6770484
Show file tree
Hide file tree
Showing 7 changed files with 198 additions and 2 deletions.
3 changes: 2 additions & 1 deletion boards/arm/mimxrt1170_evk/doc/index.rst
Expand Up @@ -136,7 +136,8 @@ configuration supports the following hardware features:
| FLEXSPI | on-chip | flash programming |
+-----------+------------+-------------------------------------+
| DISPLAY | on-chip | eLCDIF; MIPI-DSI. Tested with |
| | | :ref:`rk055hdmipi4m` shield |
| | | :ref:`rk055hdmipi4m` and |
| | | :ref:`g1120b0mipi` display shields |
+-----------+------------+-------------------------------------+

The default configuration can be found in the defconfig file:
Expand Down
3 changes: 2 additions & 1 deletion boards/arm/mimxrt595_evk/doc/index.rst
Expand Up @@ -106,7 +106,8 @@ already supported, which can also be re-used on this mimxrt595_evk board:
| SDHC | on-chip | disk access (works with eMMC & SD) |
+-----------+------------+-------------------------------------+
| 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:
Expand Down
51 changes: 51 additions & 0 deletions boards/shields/g1120b0mipi/Kconfig.defconfig
@@ -0,0 +1,51 @@
# Copyright 2023 NXP
# SPDX-License-Identifier: Apache-2.0

if SHIELD_G1120B0MIPI

config DISPLAY
default y

config MIPI_DSI
default y

# 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

if LVGL

# 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_Z_DPI
default 128

choice LV_COLOR_DEPTH
default LV_COLOR_DEPTH_16
endchoice

endif # LVGL

endif # SHIELD_G1120B0MIPI
5 changes: 5 additions & 0 deletions 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)
12 changes: 12 additions & 0 deletions boards/shields/g1120b0mipi/boards/mimxrt1170_evk_cm7.overlay
@@ -0,0 +1,12 @@
/*
* Copyright 2023, NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

&rm67162 {
/* R414 is not populated on this board, so LPTE signal is not
* connected. remove the property from the display.
*/
/delete-property/ te-gpios;
};
68 changes: 68 additions & 0 deletions 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_prod_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_prod_page:
https://www.nxp.com/design/development-boards/i-mx-evaluation-and-development-boards/1-2-wearable-display-g1120b0mipi:G1120B0MIPI
58 changes: 58 additions & 0 deletions boards/shields/g1120b0mipi/g1120b0mipi.overlay
@@ -0,0 +1,58 @@
/*
* Copyright 2023, NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

/{
aliases {
kscan0 = &kscan_input;
};

chosen {
zephyr,display = &rm67162;
zephyr,keyboard-scan = &kscan_input;
};

en_mipi_display: enable-mipi-display {
compatible = "regulator-fixed";
regulator-name = "en_mipi_display";
enable-gpios = <&mipi_connector 32 GPIO_ACTIVE_HIGH>;
regulator-boot-on;
};
};

&mipi_i2c {
status = "okay";
ft3267: 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 = <&mipi_connector 29 GPIO_ACTIVE_LOW>;
reset-gpios = <&mipi_connector 28 GPIO_ACTIVE_HIGH>;
kscan_input: kscan-input {
compatible = "zephyr,kscan-input";
};
};
};

&mipi_dsi {
status = "okay";
autoinsert-eotp;
phy-clock = <316800000>;
rm67162: rm67162@0 {
status = "okay";
compatible = "raydium,rm67162";
reg = <0x0>;
reset-gpios = <&mipi_connector 21 GPIO_ACTIVE_HIGH>;
bl-gpios = <&mipi_connector 0 GPIO_ACTIVE_HIGH>;
te-gpios = <&mipi_connector 22 GPIO_ACTIVE_HIGH>;
data-lanes = <1>;
width = <400>;
height = <392>;
pixel-format = <MIPI_DSI_PIXFMT_RGB565>;
};
};

0 comments on commit 6770484

Please sign in to comment.