Skip to content

Commit af26644

Browse files
authored
Merge branch '173-add-support-to-ILI9488-8bit' into devel
2 parents f246518 + c7fd7ac commit af26644

12 files changed

+119
-4
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Currently, IceNav works with the following hardware setups and specs
5555
|:------------|:----------:|:---:|:----:|:-----:|:---------:|:---------------------------------|
5656
| ILI9488 [^3]| 320x480 | yes | --- | --- | XPT2046 | ```-D ILI9488_XPT2046_SPI = 1``` |
5757
| ILI9488 | 320x480 | yes | --- | --- | FT5x06 | ```-D ILI9488_FT5x06_SPI = 1 ``` |
58+
| ILI9488 | 320x480 | --- | yes | --- | -------- | ```-D ILI9488_NOTOUCH_8B = 1 ``` |
5859
| ILI9488 | 320x480 | --- | --- | yes | FT5x06 | ```-D ILI9488_FT5x06_16B = 1``` |
5960
| ILI9341 | 320x240 | yes | --- | --- | XPT2046 | ```-D ILI9341_XPT2046_SPI = 1``` |
6061

include/hal.hpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,16 @@ extern const bool TFT_INVERT = true;
118118
#endif
119119

120120
/**
121-
* @brief TFT 16 Bits parallel pin definition
121+
* @brief TFT 8/16 Bits parallel pin definition
122122
*
123123
*/
124124
extern const uint8_t TFT_WR = 35;
125125
extern const uint8_t TFT_RD = 48;
126126
extern const uint8_t TFT_RS = 36;
127+
extern const uint8_t TFT_RST = -1;
128+
extern const uint8_t TFT_CS = 5;
129+
130+
// 8 bit Mode
127131
extern const uint8_t TFT_D0 = 47;
128132
extern const uint8_t TFT_D1 = 21;
129133
extern const uint8_t TFT_D2 = 14;
@@ -132,6 +136,8 @@ extern const uint8_t TFT_D4 = 12;
132136
extern const uint8_t TFT_D5 = 11;
133137
extern const uint8_t TFT_D6 = 10;
134138
extern const uint8_t TFT_D7 = 9;
139+
140+
// Extra 16 bit Mode
135141
extern const uint8_t TFT_D8 = 3;
136142
extern const uint8_t TFT_D9 = 8;
137143
extern const uint8_t TFT_D10 = 16;

lib/gui/src/settingsScr.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ void createSettingsScr()
111111
lv_obj_add_event_cb(btn, compassCalib, LV_EVENT_CLICKED, NULL);
112112
#endif
113113

114+
#ifdef TOUCH_INPUT
114115
// Touch Calibration
115116
btn = lv_btn_create(settingsButtons);
116117
lv_obj_set_size(btn, TFT_WIDTH - 30, 40 * scale);
@@ -119,6 +120,7 @@ void createSettingsScr()
119120
lv_label_set_text_static(btnLabel, "Touch Calibration");
120121
lv_obj_center(btnLabel);
121122
lv_obj_add_event_cb(btn, touchCalib, LV_EVENT_CLICKED, NULL);
123+
#endif
122124

123125
// Map Settings
124126
btn = lv_btn_create(settingsButtons);

lib/lvgl/src/lvglSetup.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,12 @@ void initLVGL()
163163

164164
#endif
165165

166+
#ifdef TOUCH_INPUT
166167
lv_indev_t *indev_drv = lv_indev_create();
167168
lv_indev_set_type(indev_drv, LV_INDEV_TYPE_POINTER);
168169
lv_indev_set_read_cb(indev_drv, touchRead);
169-
170+
#endif
171+
170172
// Create Main Timer
171173
mainTimer = lv_timer_create(updateMainScreen, UPDATE_MAINSCR_PERIOD, NULL);
172174
lv_timer_ready(mainTimer);

lib/panel/ILI9341_XPT2046_SPI.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
#define LGFX_USE_V1
1313

14+
#define TOUCH_INPUT
15+
1416
#include "LovyanGFX.hpp"
1517

1618
extern const uint8_t TFT_SPI_SCLK;

lib/panel/ILI9488_FT5x06_16B.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ extern const uint8_t TFT_D14;
3838
extern const uint8_t TFT_D15;
3939

4040
#define LARGE_SCREEN
41+
#define TOUCH_INPUT
4142

4243
class LGFX : public lgfx::LGFX_Device
4344
{

lib/panel/ILI9488_FT5x06_SPI.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ extern const uint8_t TCH_I2C_INT;
2626
extern const bool TFT_INVERT;
2727

2828
#define LARGE_SCREEN
29+
#define TOUCH_INPUT
2930

3031
class LGFX : public lgfx::LGFX_Device
3132
{

lib/panel/ILI9488_NOTOUCH_8B.hpp

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
/**
2+
* @file ILI9488_NOTOUCH_8B.hpp
3+
* @author Jordi Gauchía (jgauchia@gmx.es)
4+
* @brief LOVYANGFX TFT driver for ILI9488 8 Bits parallel Without Touch controller
5+
* @version 0.1.8
6+
* @date 2024-06
7+
*/
8+
9+
#ifndef ILI9488_NOTOUCH_8B_HPP
10+
#define ILI9488_NOTOUCH_8B_HPP
11+
12+
#define LGFX_USE_V1
13+
14+
#include <LovyanGFX.hpp>
15+
16+
extern const uint8_t TFT_WR;
17+
extern const uint8_t TFT_RD;
18+
extern const uint8_t TFT_RS;
19+
extern const uint8_t TFT_RST;
20+
extern const uint8_t TFT_CS;
21+
22+
extern const uint8_t TFT_D0;
23+
extern const uint8_t TFT_D1;
24+
extern const uint8_t TFT_D2;
25+
extern const uint8_t TFT_D3;
26+
extern const uint8_t TFT_D4;
27+
extern const uint8_t TFT_D5;
28+
extern const uint8_t TFT_D6;
29+
extern const uint8_t TFT_D7;
30+
31+
#define LARGE_SCREEN
32+
33+
class LGFX : public lgfx::LGFX_Device
34+
{
35+
lgfx::Panel_ILI9488 _panel_instance;
36+
lgfx::Bus_Parallel8 _bus_instance;
37+
38+
public:
39+
LGFX(void)
40+
{
41+
{
42+
auto cfg = _bus_instance.config();
43+
44+
cfg.port = 0;
45+
cfg.freq_write = 20000000;
46+
cfg.pin_wr = TFT_WR;
47+
cfg.pin_rd = TFT_RD;
48+
cfg.pin_rs = TFT_RS;
49+
50+
cfg.pin_d0 = TFT_D0;
51+
cfg.pin_d1 = TFT_D1;
52+
cfg.pin_d2 = TFT_D2;
53+
cfg.pin_d3 = TFT_D3;
54+
cfg.pin_d4 = TFT_D4;
55+
cfg.pin_d5 = TFT_D5;
56+
cfg.pin_d6 = TFT_D6;
57+
cfg.pin_d7 = TFT_D7;
58+
59+
_bus_instance.config(cfg);
60+
_panel_instance.setBus(&_bus_instance);
61+
}
62+
63+
{
64+
auto cfg = _panel_instance.config();
65+
66+
cfg.pin_cs = TFT_CS;
67+
cfg.pin_rst = TFT_RST;
68+
cfg.pin_busy = -1;
69+
70+
cfg.memory_width = 320;
71+
cfg.memory_height = 480;
72+
cfg.panel_width = 320;
73+
cfg.panel_height = 480;
74+
cfg.offset_x = 0;
75+
cfg.offset_y = 0;
76+
cfg.offset_rotation = 0;
77+
cfg.dummy_read_pixel = 8;
78+
cfg.dummy_read_bits = 1;
79+
cfg.readable = true;
80+
cfg.invert = false;
81+
cfg.rgb_order = false;
82+
cfg.dlen_16bit = false;
83+
cfg.bus_shared = true;
84+
85+
_panel_instance.config(cfg);
86+
}
87+
88+
setPanel(&_panel_instance);
89+
90+
}
91+
};
92+
93+
#endif

lib/panel/ILI9488_XPT2046_SPI.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ extern const uint8_t TCH_SPI_CS;
2727
extern const bool TFT_INVERT;
2828

2929
#define LARGE_SCREEN
30+
#define TOUCH_INPUT
3031

3132
class LGFX : public lgfx::LGFX_Device
3233
{

lib/tft/tft.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -147,5 +147,7 @@ void initTFT()
147147
ledcSetup(0, 5000, 8);
148148
ledcAttachPin(TFT_BL, 0);
149149
ledcWrite(0, 255);
150+
#ifdef TOUCH_INPUT
150151
touchCalibrate();
152+
#endif
151153
}

lib/tft/tft.hpp

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
#include "ILI9488_FT5x06_SPI.hpp"
3131
#endif
3232

33+
#ifdef ILI9488_NOTOUCH_8B
34+
#include "ILI9488_NOTOUCH_8B.hpp"
35+
#endif
36+
3337
#include <LGFX_TFT_eSPI.hpp>
3438

3539
extern TFT_eSPI tft;

platformio.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ default_envs = ESP32_N16R4
1616
platform = espressif32
1717
framework = arduino
1818
version = 0.1.8_dev
19-
revision = 69
19+
revision = 70
2020
monitor_speed = 115200
2121
;monitor_rts = 0
2222
;monitor_dtr = 0
@@ -109,6 +109,6 @@ build_flags =
109109
-D ILI9488_FT5x06_SPI=1
110110
-D SPI_SHARED=1
111111
-D AT6558D_GPS=1
112-
-D QMC5883=1
112+
;-D HMC5883L=1
113113
-D BME280=1
114114
-D TFT_BL=45

0 commit comments

Comments
 (0)