Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/
#include "bl5340_dvk_nrf5340_cpuapp_common-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include <zephyr/dt-bindings/display/panel.h>

/ {
chosen {
Expand Down Expand Up @@ -130,6 +131,7 @@
rotation = <270>;
width = <320>;
height = <240>;
pixel-format = <0x20>;
};
};
};
Expand Down
4 changes: 2 additions & 2 deletions boards/m5stack/m5stack_core2/m5stack_core2_procpu.dts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "m5stack_core2-pinctrl.dtsi"
#include "grove_connectors.dtsi"
#include "m5stack_mbus_connectors.dtsi"
#include <zephyr/dt-bindings/display/ili9xxx.h>
#include <zephyr/dt-bindings/display/panel.h>
#include <zephyr/dt-bindings/regulator/axp192.h>
#include <espressif/partitions_0x1000_amp.dtsi>

Expand Down Expand Up @@ -68,7 +68,7 @@
mipi-max-frequency = <30000000>;
reg = <0>;
vin-supply = <&lcd_bg>;
pixel-format = <ILI9XXX_PIXEL_FORMAT_RGB565>;
pixel-format = <0x20>;
display-inversion;
width = <320>;
height = <240>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <espressif/esp32s3/esp32s3_wroom_n16r8.dtsi>
#include <espressif/partitions_0x0_amp.dtsi>
#include <zephyr/dt-bindings/display/ili9xxx.h>
#include <zephyr/dt-bindings/display/panel.h>
#include "m5stack_cores3-pinctrl.dtsi"
#include "m5stack_mbus_connectors.dtsi"
#include "grove_connectors.dtsi"
Expand Down Expand Up @@ -56,7 +56,7 @@
mipi-max-frequency = <30000000>;
reg = <0>;
vin-supply = <&vcc_bl>;
pixel-format = <ILI9XXX_PIXEL_FORMAT_RGB565>;
pixel-format = <0x20>;
display-inversion;
width = <320>;
height = <240>;
Expand Down
4 changes: 2 additions & 2 deletions boards/m5stack/m5stack_fire/m5stack_fire_procpu.dts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "m5stack_fire-pinctrl.dtsi"
#include "grove_connectors.dtsi"
#include "m5stack_mbus_connectors.dtsi"
#include <zephyr/dt-bindings/display/ili9xxx.h>
#include <zephyr/dt-bindings/display/panel.h>
#include <espressif/partitions_0x1000_amp.dtsi>
#include <zephyr/dt-bindings/input/input-event-codes.h>

Expand Down Expand Up @@ -95,7 +95,7 @@
compatible = "ilitek,ili9342c";
mipi-max-frequency = <30000000>;
reg = <0>;
pixel-format = <ILI9XXX_PIXEL_FORMAT_RGB565>;
pixel-format = <0x20>;
display-inversion;
width = <320>;
height = <240>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/display/ili9xxx.h>
#include <zephyr/dt-bindings/display/panel.h>
#include <zephyr/dt-bindings/gpio/gpio.h>

/ {
Expand Down Expand Up @@ -52,7 +52,7 @@
reg = <0>;
width = <240>;
height = <320>;
pixel-format = <ILI9XXX_PIXEL_FORMAT_RGB565>;
pixel-format = <PANEL_PIXEL_FORMAT_RGB565>;
rotation = <0>;
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/display/ili9xxx.h>
#include <zephyr/dt-bindings/display/panel.h>
#include <zephyr/dt-bindings/gpio/gpio.h>

/ {
Expand Down Expand Up @@ -52,7 +52,7 @@
reg = <0>;
width = <240>;
height = <320>;
pixel-format = <ILI9XXX_PIXEL_FORMAT_RGB565>;
pixel-format = <0x20>;
rotation = <0>;
};
};
4 changes: 2 additions & 2 deletions boards/seeed/wio_terminal/wio_terminal.dts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "wio_terminal-pinctrl.dtsi"
#include "grove_connectors.dtsi"
#include "raspberrypi_40pins_connector.dtsi"
#include <zephyr/dt-bindings/display/ili9xxx.h>
#include <zephyr/dt-bindings/display/panel.h>
#include <zephyr/dt-bindings/input/input-event-codes.h>

/ {
Expand Down Expand Up @@ -148,7 +148,7 @@
compatible = "ilitek,ili9341";
mipi-max-frequency = <24000000>;
reg = <0>;
pixel-format = <ILI9XXX_PIXEL_FORMAT_RGB565>;
pixel-format = <0x20>;
rotation = <270>;
width = <320>;
height = <240>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include <zephyr/dt-bindings/spi/spi.h>
#include <zephyr/dt-bindings/display/panel.h>

/ {
chosen {
Expand Down Expand Up @@ -44,7 +45,7 @@
reg = <0>;
width = <320>;
height = <240>;
pixel-format = <ILI9XXX_PIXEL_FORMAT_RGB888>;
pixel-format = <PANEL_PIXEL_FORMAT_RGB888>;
rotation = <90>;
frmctr1 = [00 18];
pwctrl1 = [23 00];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/display/ili9xxx.h>
#include <zephyr/dt-bindings/display/panel.h>
#include <zephyr/dt-bindings/gpio/arduino-header-r3.h>

/ {
Expand Down Expand Up @@ -35,7 +35,7 @@
reg = <0>;
width = <320>;
height = <240>;
pixel-format = <ILI9XXX_PIXEL_FORMAT_RGB888>;
pixel-format = <PANEL_PIXEL_FORMAT_RGB888>;
rotation = <90>;
frmctr1 = [00 18];
pwctrl1 = [23 00];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/display/ili9xxx.h>
#include <zephyr/dt-bindings/display/panel.h>
#include <zephyr/dt-bindings/gpio/arduino-header-r3.h>

/ {
Expand Down Expand Up @@ -36,7 +36,7 @@
reg = <0>;
width = <240>;
height = <320>;
pixel-format = <ILI9XXX_PIXEL_FORMAT_RGB565>;
pixel-format = <PANEL_PIXEL_FORMAT_RGB565>;
rotation = <0>;
frmctr1 = [00 18];
pwctrl1 = [23 00];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/display/ili9xxx.h>
#include <zephyr/dt-bindings/display/panel.h>
#include <zephyr/dt-bindings/gpio/arduino-header-r3.h>

/ {
Expand Down Expand Up @@ -34,7 +34,7 @@
compatible = "ilitek,ili9488";
mipi-max-frequency = <25000000>;
reg = <0>;
pixel-format = <ILI9XXX_PIXEL_FORMAT_RGB888>;
pixel-format = <PANEL_PIXEL_FORMAT_RGB888>;
width = <320>;
height = <480>;
rotation = <0>;
Expand Down
4 changes: 2 additions & 2 deletions boards/shields/x_nucleo_gfx01m2/x_nucleo_gfx01m2.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/display/ili9xxx.h>
#include <zephyr/dt-bindings/display/panel.h>
#include <zephyr/dt-bindings/mipi_dbi/mipi_dbi.h>
#include <freq.h>
#include <mem.h>
Expand Down Expand Up @@ -74,7 +74,7 @@
width = <240>;
height = <320>;
rotation = <180>;
pixel-format = <ILI9XXX_PIXEL_FORMAT_RGB565>;
pixel-format = <PANEL_PIXEL_FORMAT_RGB565>;
frmctr1 = [00 1f]; /* 60Hz frame rate */
};
};
Expand Down
4 changes: 2 additions & 2 deletions boards/st/st25dv_mb1283_disco/st25dv_mb1283_disco.dts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "st/f4/stm32f405Xg.dtsi"
#include "st/f4/stm32f405vgtx-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include <zephyr/dt-bindings/display/ili9xxx.h>
#include <zephyr/dt-bindings/display/panel.h>

/ {
model = "ST ST25DV Discovery Kit with MB1283";
Expand Down Expand Up @@ -86,7 +86,7 @@
compatible = "ilitek,ili9341";
mipi-max-frequency = <DT_FREQ_M(20)>;
reg = <0>;
pixel-format = <ILI9XXX_PIXEL_FORMAT_RGB888>;
pixel-format = <0x20>;
rotation = <0>;
width = <240>;
height = <320>;
Expand Down
6 changes: 3 additions & 3 deletions boards/st/stm32f429i_disc1/stm32f429i_disc1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/dts-v1/;
#include <st/f4/stm32f429Xi.dtsi>
#include <st/f4/stm32f429zitx-pinctrl.dtsi>
#include <zephyr/dt-bindings/display/ili9xxx.h>
#include <zephyr/dt-bindings/display/panel.h>
#include <zephyr/dt-bindings/input/input-event-codes.h>

/ {
Expand Down Expand Up @@ -81,7 +81,7 @@
width = <240>;
height = <320>;
rotation = <180>;
pixel-format = <ILI9XXX_PIXEL_FORMAT_RGB565>;
pixel-format = <0x20>;
pwctrla = [39 2c 00 34 02];
pwctrlb = [00 c1 30];
timctrla = [85 00 78];
Expand Down Expand Up @@ -253,7 +253,7 @@

width = <240>;
height = <320>;
pixel-format = <PANEL_PIXEL_FORMAT_RGB_565>;
pixel-format = <0x20>;

display-timings {
compatible = "zephyr,panel-timing";
Expand Down
9 changes: 9 additions & 0 deletions doc/releases/migration-guide-4.4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ MDIO
MDIO bus enabling/disabling is now handled internally by the MDIO drivers.
(:github:`99690`).

Display
=======

* For ILI9XXX controllers, the usage of ``ILI9XXX_PIXEL_FORMAT_x`` in devicetrees for panel color format selection
has been updated to ``PANEL_PIXEL_FORMAT_x``. Out-of-tree boards and shields should be updated accordingly.
(:github:`99267`).
* For ILI9341 controller, display mirroring configuration has been updated to conform with the described behavior
of the sample ``samples/drivers/display``. (:github:`99267`).

QSPI
===

Expand Down
21 changes: 13 additions & 8 deletions drivers/display/display_ili9xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
*/

#include "display_ili9xxx.h"

#include <zephyr/dt-bindings/display/ili9xxx.h>
#include <zephyr/dt-bindings/display/panel.h>
#include <zephyr/drivers/display.h>
#include <zephyr/sys/byteorder.h>

Expand Down Expand Up @@ -295,7 +294,7 @@ ili9xxx_set_pixel_format(const struct device *dev,
uint8_t tx_data;
uint8_t bytes_per_pixel;

if (pixel_format == PIXEL_FORMAT_RGB_565) {
if (pixel_format == PIXEL_FORMAT_RGB_565 || pixel_format == PIXEL_FORMAT_BGR_565) {
bytes_per_pixel = 2U;
tx_data = ILI9XXX_PIXSET_MCU_16_BIT | ILI9XXX_PIXSET_RGB_16_BIT;
} else if (pixel_format == PIXEL_FORMAT_RGB_888) {
Expand Down Expand Up @@ -324,7 +323,8 @@ static int ili9xxx_set_orientation(const struct device *dev,
struct ili9xxx_data *data = dev->data;

int r;
uint8_t tx_data = ILI9XXX_MADCTL_BGR;
uint8_t tx_data = data->pixel_format == PIXEL_FORMAT_BGR_565
? ILI9XXX_MADCTL_BGR : 0;
if (config->quirks->cmd_set == CMD_SET_1) {
if (orientation == DISPLAY_ORIENTATION_NORMAL) {
tx_data |= ILI9XXX_MADCTL_MX;
Expand Down Expand Up @@ -368,7 +368,7 @@ static void ili9xxx_get_capabilities(const struct device *dev,
memset(capabilities, 0, sizeof(struct display_capabilities));

capabilities->supported_pixel_formats =
PIXEL_FORMAT_RGB_565 | PIXEL_FORMAT_RGB_888;
PIXEL_FORMAT_RGB_565 | PIXEL_FORMAT_RGB_888 | PIXEL_FORMAT_BGR_565;
capabilities->current_pixel_format = data->pixel_format;

if (data->orientation == DISPLAY_ORIENTATION_NORMAL ||
Expand All @@ -392,10 +392,15 @@ static int ili9xxx_configure(const struct device *dev)
enum display_orientation orientation;

/* pixel format */
if (config->pixel_format == ILI9XXX_PIXEL_FORMAT_RGB565) {
if (config->pixel_format == PANEL_PIXEL_FORMAT_RGB_565) {
pixel_format = PIXEL_FORMAT_RGB_565;
} else {
} else if (config->pixel_format == PANEL_PIXEL_FORMAT_BGR_565) {
pixel_format = PIXEL_FORMAT_BGR_565;
} else if (config->pixel_format == PANEL_PIXEL_FORMAT_RGB_888) {
pixel_format = PIXEL_FORMAT_RGB_888;
} else {
LOG_ERR("Unsupported pixel format in DT");
return -ENOTSUP;
}

r = ili9xxx_set_pixel_format(dev, pixel_format);
Expand Down Expand Up @@ -511,7 +516,7 @@ static const struct ili9xxx_quirks ili9340_quirks = {

#ifdef CONFIG_ILI9341
static const struct ili9xxx_quirks ili9341_quirks = {
.cmd_set = CMD_SET_1,
.cmd_set = CMD_SET_2,
};
#endif

Expand Down
2 changes: 1 addition & 1 deletion drivers/display/display_ili9xxx.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

enum madctl_cmd_set {
CMD_SET_1, /* Default for most of ILI9xxx display controllers */
CMD_SET_2, /* Used by ILI9342c */
CMD_SET_2, /* Used by ILI9342c & ILI9341 */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you verified that display orientation works with this change? Assuming that is why it was made

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using CMD_SET_2 the display orientation works as described on the documentation . To verify it, I set a small delay between the squares rendering, comment the display_blanking_off and put it at the beginning. It was shown how each square was appearing according with the order set up on the script, showing the behaviour described on the document: clockwise, from TOP_LEFT(RED) to BOTTOM_LEFT(GRAY SCALE). I used RGB888 for the example

test_de

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should add the delay between the squares in the sample, seems useful.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we do that on this PR? or is better left it for another PR?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we do that on this PR? or is better left it for another PR?

Out-of-scope for this one

};

struct ili9xxx_quirks {
Expand Down
13 changes: 1 addition & 12 deletions dts/bindings/display/ilitek,ili9xxx-common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,12 @@ description: |
Ilitek ILI9XXX is a color TFT-LCD controller series.

include:
- display-controller.yaml
- lcd-controller.yaml
- name: mipi-dbi-spi-device.yaml
property-blocklist:
- te-delay

properties:
pixel-format:
type: int
default: 0
enum:
- 0 # RGB565
- 1 # RGB888
description:
Display pixel format. Note that when RGB888 pixel format is selected
only 6 color bits are actually used being in practice equivalent to
RGB666.

rotation:
type: int
default: 0
Expand Down
13 changes: 0 additions & 13 deletions include/zephyr/dt-bindings/display/ili9xxx.h

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/display/ili9xxx.h>
#include <zephyr/dt-bindings/display/panel.h>

&adafruit_2_8_tft_touch_v2_ili9340 {
pixel-format = <ILI9XXX_PIXEL_FORMAT_RGB565>;
pixel-format = <PANEL_PIXEL_FORMAT_RGB565>;
};

&adafruit_2_8_tft_touch_v2_mipi_dbi {
Expand Down