Skip to content

Commit a59116f

Browse files
committed
Merge pull request #7 from mnishiguchi/ili948x
Add support for ILI948x displays (ILI9486 / ILI9488)
2 parents 270f77a + 7ae82b8 commit a59116f

File tree

5 files changed

+1091
-0
lines changed

5 files changed

+1091
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ idf_component_register(SRCS
3131
"display_driver.c"
3232
"5in65_acep_7c_display_driver.c"
3333
"ili934x_display_driver.c"
34+
"ili948x_display_driver.c"
3435
"memory_display_driver.c"
3536
"ssd1306_display_driver.c"
3637
"st7789_display_driver.c"

README.Md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ that would otherwise be impossible to support with traditional frame buffer appr
8181
## Supported Hardware
8282

8383
* `ilitek,ili9341` / `ilitek,ili9342c`: ILI9341 / ILI9342C - 240x320, 16-bit colors
84+
* `ilitek,ili9486`: ILI9486 - 320x480, 16-bit colors (RGB565)
85+
* `ilitek,ili9488`: ILI9488 - 320x480, 18-bit colors (RGB666 over SPI; 3 bytes/pixel transfer)
8486
* `waveshare,5in65-acep-7c`: Waveshare 7-color 5.65" ACeP display module - 600x480, 7 colors +
8587
software dithering
8688
* `sharp,memory-lcd`: Sharp Memory LCDs - 400x240, 1-bit monochrome

display_driver.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ static const char *TAG = "display_driver";
3131

3232
Context *acep_5in65_7c_display_driver_create_port(GlobalContext *global, term opts);
3333
Context *ili934x_display_create_port(GlobalContext *global, term opts);
34+
Context *ili948x_display_create_port(GlobalContext *global, term opts);
3435
Context *memory_lcd_display_create_port(GlobalContext *global, term opts);
3536
Context *ssd1306_display_create_port(GlobalContext *global, term opts);
3637
Context *st7789_display_create_port(GlobalContext *global, term opts);
@@ -60,6 +61,10 @@ Context *display_create_port(GlobalContext *global, term opts)
6061
ctx = ili934x_display_create_port(global, opts);
6162
} else if (!strcmp(compat_string, "ilitek,ili9342c")) {
6263
ctx = ili934x_display_create_port(global, opts);
64+
} else if (!strcmp(compat_string, "ilitek,ili9486")) {
65+
ctx = ili948x_display_create_port(global, opts);
66+
} else if (!strcmp(compat_string, "ilitek,ili9488")) {
67+
ctx = ili948x_display_create_port(global, opts);
6368
} else if (!strcmp(compat_string, "solomon-systech,ssd1306")) {
6469
ctx = ssd1306_display_create_port(global, opts);
6570
} else if (!strcmp(compat_string, "sino-wealth,sh1106")) {

docs/display-drivers.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,46 @@ ili9341_opts = [
141141
]
142142
```
143143

144+
### ILI9486 / ILI9488 (ilitek,ili9486 / ilitek,ili9488)
145+
146+
320×480 TFT displays.
147+
148+
- **ILI9486**: RGB565 over SPI (16-bit color)
149+
- **ILI9488**: RGB666 over SPI (18-bit color; transferred as 3 bytes/pixel). AtomGL renders in RGB565 and converts scanlines for transfer.
150+
151+
**Compatible strings:** `"ilitek,ili9486"` or `"ilitek,ili9488"`
152+
153+
| Option | Type | Description | Default |
154+
|--------|------|-------------|---------|
155+
| `spi_host` | term | SPI host reference | Required |
156+
| `width` | integer | Display width in pixels (kept for API consistency) | 320 |
157+
| `height` | integer | Display height in pixels (kept for API consistency) | 480 |
158+
| `cs` | integer | Chip select GPIO pin | Required |
159+
| `dc` | integer | Data/Command GPIO pin | Required |
160+
| `reset` | integer | Reset GPIO pin | Required |
161+
| `rotation` | integer | Display rotation (0-3) | 0 |
162+
| `enable_tft_invon` | boolean | Enable color inversion | false |
163+
| `color_order` | atom | Color order (:bgr/:rgb) | :bgr |
164+
| `backlight` | integer | Backlight GPIO pin | Optional |
165+
| `backlight_active` | atom | Backlight active level (:low/:high) | Optional |
166+
| `backlight_enabled` | boolean | Enable backlight on init | Optional |
167+
168+
**Example:**
169+
```elixir
170+
ili948x_opts = [
171+
spi_host: spi_host,
172+
compatible: "ilitek,ili9488",
173+
width: 320,
174+
height: 480,
175+
cs: 22,
176+
dc: 21,
177+
reset: 18,
178+
rotation: 1,
179+
enable_tft_invon: false,
180+
color_order: :bgr
181+
]
182+
```
183+
144184
### ST7789 / ST7796 (sitronix,st7789 / sitronix,st7796)
145185

146186
TFT displays with 16-bit colors.

0 commit comments

Comments
 (0)