Skip to content

Commit b56244b

Browse files
committed
drivers: display: features for ILI9341 driver
Replaced display-controller.yaml with lcd-controller.yaml Deleted pixel format property, replacing it with the property on lcd-controller.yaml. Replace ILI9XXX RGB macro with PANEL RGB macro. Also, added condition to verify pixel format is RGB565, BRG565 or RGB888, otherwise it will show error Signed-off-by: Nicolas Moreno <[email protected]>
1 parent 947498c commit b56244b

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

drivers/display/display_ili9xxx.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,12 +393,15 @@ static int ili9xxx_configure(const struct device *dev)
393393
enum display_orientation orientation;
394394

395395
/* pixel format */
396-
if (config->pixel_format == ILI9XXX_PIXEL_FORMAT_RGB565) {
396+
if (config->pixel_format == PANEL_PIXEL_FORMAT_RGB_565) {
397397
pixel_format = PIXEL_FORMAT_RGB_565;
398398
} else if (config->pixel_format == PANEL_PIXEL_FORMAT_BGR_565) {
399399
pixel_format = PIXEL_FORMAT_BGR_565;
400-
} else {
400+
} else if (config->pixel_format == PANEL_PIXEL_FORMAT_RGB_888){
401401
pixel_format = PIXEL_FORMAT_RGB_888;
402+
} else {
403+
LOG_ERR("Unsupported pixel format in DT");
404+
return -ENOTSUP;
402405
}
403406

404407
r = ili9xxx_set_pixel_format(dev, pixel_format);

dts/bindings/display/ilitek,ili9xxx-common.yaml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,12 @@ description: |
88
Ilitek ILI9XXX is a color TFT-LCD controller series.
99
1010
include:
11-
- display-controller.yaml
11+
- lcd-controller.yaml
1212
- name: mipi-dbi-spi-device.yaml
1313
property-blocklist:
1414
- te-delay
1515

1616
properties:
17-
pixel-format:
18-
type: int
19-
default: 0
20-
enum:
21-
- 0 # RGB565
22-
- 1 # RGB888
23-
- 0x20 # BGR565
24-
description:
25-
Display pixel format. Note that when RGB888 pixel format is selected
26-
only 6 color bits are actually used being in practice equivalent to
27-
RGB666.
28-
2917
rotation:
3018
type: int
3119
default: 0

0 commit comments

Comments
 (0)