1From 0b4d4d99d1e2aba86b62d20785fedced28039728 Mon Sep 17 00:00:00 2001
2From: Jiajian Wu <jair.wu@rock-chips.com>
3Date: Tue, 27 Sep 2022 16:14:23 +0800
4Subject: [PATCH 3/6] lv_drivers: Add lv_conf.h and lv_drv_conf.h
5
6Signed-off-by: Jiajian Wu <jair.wu@rock-chips.com>
7---
8 lv_conf.h     |   1 +
9 lv_drv_conf.h | 494 ++++++++++++++++++++++++++++++++++++++++++++++++++
10 2 files changed, 495 insertions(+)
11 create mode 100644 lv_conf.h
12 create mode 100644 lv_drv_conf.h
13
14diff --git a/lv_conf.h b/lv_conf.h
15new file mode 100644
16index 0000000..1d5f183
17--- /dev/null
18+++ b/lv_conf.h
19@@ -0,0 +1 @@
20+#include "lvgl/lv_conf.h"
21diff --git a/lv_drv_conf.h b/lv_drv_conf.h
22new file mode 100644
23index 0000000..6dd6af1
24--- /dev/null
25+++ b/lv_drv_conf.h
26@@ -0,0 +1,494 @@
27+/**
28+ * @file lv_drv_conf.h
29+ * Configuration file for v8.2.0
30+ */
31+
32+/*
33+ * COPY THIS FILE AS lv_drv_conf.h
34+ */
35+
36+/* clang-format off */
37+#if 1 /*Set it to "1" to enable the content*/
38+
39+#ifndef LV_DRV_CONF_H
40+#define LV_DRV_CONF_H
41+
42+#include "lv_conf.h"
43+
44+/*********************
45+ * DELAY INTERFACE
46+ *********************/
47+#define LV_DRV_DELAY_INCLUDE  <stdint.h>            /*Dummy include by default*/
48+#define LV_DRV_DELAY_US(us)  /*delay_us(us)*/       /*Delay the given number of microseconds*/
49+#define LV_DRV_DELAY_MS(ms)  /*delay_ms(ms)*/       /*Delay the given number of milliseconds*/
50+
51+/*********************
52+ * DISPLAY INTERFACE
53+ *********************/
54+
55+/*------------
56+ *  Common
57+ *------------*/
58+#define LV_DRV_DISP_INCLUDE         <stdint.h>           /*Dummy include by default*/
59+#define LV_DRV_DISP_CMD_DATA(val)  /*pin_x_set(val)*/    /*Set the command/data pin to 'val'*/
60+#define LV_DRV_DISP_RST(val)       /*pin_x_set(val)*/    /*Set the reset pin to 'val'*/
61+
62+/*---------
63+ *  SPI
64+ *---------*/
65+#define LV_DRV_DISP_SPI_CS(val)          /*spi_cs_set(val)*/     /*Set the SPI's Chip select to 'val'*/
66+#define LV_DRV_DISP_SPI_WR_BYTE(data)    /*spi_wr(data)*/        /*Write a byte the SPI bus*/
67+#define LV_DRV_DISP_SPI_WR_ARRAY(adr, n) /*spi_wr_mem(adr, n)*/  /*Write 'n' bytes to SPI bus from 'adr'*/
68+
69+/*------------------
70+ *  Parallel port
71+ *-----------------*/
72+#define LV_DRV_DISP_PAR_CS(val)          /*par_cs_set(val)*/   /*Set the Parallel port's Chip select to 'val'*/
73+#define LV_DRV_DISP_PAR_SLOW             /*par_slow()*/        /*Set low speed on the parallel port*/
74+#define LV_DRV_DISP_PAR_FAST             /*par_fast()*/        /*Set high speed on the parallel port*/
75+#define LV_DRV_DISP_PAR_WR_WORD(data)    /*par_wr(data)*/      /*Write a word to the parallel port*/
76+#define LV_DRV_DISP_PAR_WR_ARRAY(adr, n) /*par_wr_mem(adr,n)*/ /*Write 'n' bytes to Parallel ports from 'adr'*/
77+
78+/***************************
79+ * INPUT DEVICE INTERFACE
80+ ***************************/
81+
82+/*----------
83+ *  Common
84+ *----------*/
85+#define LV_DRV_INDEV_INCLUDE     <stdint.h>             /*Dummy include by default*/
86+#define LV_DRV_INDEV_RST(val)    /*pin_x_set(val)*/     /*Set the reset pin to 'val'*/
87+#define LV_DRV_INDEV_IRQ_READ    0 /*pn_x_read()*/      /*Read the IRQ pin*/
88+
89+/*---------
90+ *  SPI
91+ *---------*/
92+#define LV_DRV_INDEV_SPI_CS(val)            /*spi_cs_set(val)*/     /*Set the SPI's Chip select to 'val'*/
93+#define LV_DRV_INDEV_SPI_XCHG_BYTE(data)    0 /*spi_xchg(val)*/     /*Write 'val' to SPI and give the read value*/
94+
95+/*---------
96+ *  I2C
97+ *---------*/
98+#define LV_DRV_INDEV_I2C_START              /*i2c_start()*/       /*Make an I2C start*/
99+#define LV_DRV_INDEV_I2C_STOP               /*i2c_stop()*/        /*Make an I2C stop*/
100+#define LV_DRV_INDEV_I2C_RESTART            /*i2c_restart()*/     /*Make an I2C restart*/
101+#define LV_DRV_INDEV_I2C_WR(data)           /*i2c_wr(data)*/      /*Write a byte to the I1C bus*/
102+#define LV_DRV_INDEV_I2C_READ(last_read)    0 /*i2c_rd()*/        /*Read a byte from the I2C bud*/
103+
104+
105+/*********************
106+ *  DISPLAY DRIVERS
107+ *********************/
108+
109+/*-------------------
110+ *  SDL
111+ *-------------------*/
112+
113+/* SDL based drivers for display, mouse, mousewheel and keyboard*/
114+#ifndef USE_SDL
115+# define USE_SDL 0
116+#endif
117+
118+/* Hardware accelerated SDL driver */
119+#ifndef USE_SDL_GPU
120+# define USE_SDL_GPU 0
121+#endif
122+
123+#if USE_SDL || USE_SDL_GPU
124+#  define SDL_HOR_RES     720
125+#  define SDL_VER_RES     1280
126+
127+/* Scale window by this factor (useful when simulating small screens) */
128+#  define SDL_ZOOM        1
129+
130+/* Used to test true double buffering with only address changing.
131+ * Use 2 draw buffers, bith with SDL_HOR_RES x SDL_VER_RES size*/
132+#  define SDL_DOUBLE_BUFFERED 0
133+
134+/*Eclipse: <SDL2/SDL.h>    Visual Studio: <SDL.h>*/
135+#  define SDL_INCLUDE_PATH    <SDL2/SDL.h>
136+
137+/*Open two windows to test multi display support*/
138+#  define SDL_DUAL_DISPLAY            0
139+#endif
140+
141+/*-------------------
142+ *  Monitor of PC
143+ *-------------------*/
144+
145+/*DEPRECATED: Use the SDL driver instead. */
146+#ifndef USE_MONITOR
147+#  define USE_MONITOR         0
148+#endif
149+
150+#if USE_MONITOR
151+#  define MONITOR_HOR_RES     480
152+#  define MONITOR_VER_RES     320
153+
154+/* Scale window by this factor (useful when simulating small screens) */
155+#  define MONITOR_ZOOM        1
156+
157+/* Used to test true double buffering with only address changing.
158+ * Use 2 draw buffers, bith with MONITOR_HOR_RES x MONITOR_VER_RES size*/
159+#  define MONITOR_DOUBLE_BUFFERED 0
160+
161+/*Eclipse: <SDL2/SDL.h>    Visual Studio: <SDL.h>*/
162+#  define MONITOR_SDL_INCLUDE_PATH    <SDL2/SDL.h>
163+
164+/*Open two windows to test multi display support*/
165+#  define MONITOR_DUAL            0
166+#endif
167+
168+/*-----------------------------------
169+ *  Native Windows (including mouse)
170+ *----------------------------------*/
171+#ifndef USE_WINDOWS
172+#  define USE_WINDOWS       0
173+#endif
174+
175+#if USE_WINDOWS
176+#  define WINDOW_HOR_RES      480
177+#  define WINDOW_VER_RES      320
178+#endif
179+
180+/*----------------------------
181+ *  Native Windows (win32drv)
182+ *---------------------------*/
183+#ifndef USE_WIN32DRV
184+#  define USE_WIN32DRV       0
185+#endif
186+
187+#if USE_WIN32DRV
188+/* Scale window by this factor (useful when simulating small screens) */
189+#  define WIN32DRV_MONITOR_ZOOM        1
190+#endif
191+
192+/*----------------------------------------
193+ *  GTK drivers (monitor, mouse, keyboard
194+ *---------------------------------------*/
195+#ifndef USE_GTK
196+#  define USE_GTK       0
197+#endif
198+
199+/*----------------------------------------
200+ *  Wayland drivers (monitor, mouse, keyboard, touchscreen)
201+ *---------------------------------------*/
202+#ifndef USE_WAYLAND
203+#  define USE_WAYLAND       0
204+#endif
205+
206+#if USE_WAYLAND
207+/* Support for client-side decorations */
208+#  ifndef LV_WAYLAND_CLIENT_SIDE_DECORATIONS
209+#    define LV_WAYLAND_CLIENT_SIDE_DECORATIONS 1
210+#  endif
211+/* Support for (deprecated) wl-shell protocol */
212+#  ifndef LV_WAYLAND_WL_SHELL
213+#    define LV_WAYLAND_WL_SHELL 1
214+#  endif
215+/* Support for xdg-shell protocol */
216+#  ifndef LV_WAYLAND_XDG_SHELL
217+#    define LV_WAYLAND_XDG_SHELL 0
218+#  endif
219+#endif
220+
221+/*----------------
222+ *    SSD1963
223+ *--------------*/
224+#ifndef USE_SSD1963
225+#  define USE_SSD1963         0
226+#endif
227+
228+#if USE_SSD1963
229+#  define SSD1963_HOR_RES     LV_HOR_RES
230+#  define SSD1963_VER_RES     LV_VER_RES
231+#  define SSD1963_HT          531
232+#  define SSD1963_HPS         43
233+#  define SSD1963_LPS         8
234+#  define SSD1963_HPW         10
235+#  define SSD1963_VT          288
236+#  define SSD1963_VPS         12
237+#  define SSD1963_FPS         4
238+#  define SSD1963_VPW         10
239+#  define SSD1963_HS_NEG      0   /*Negative hsync*/
240+#  define SSD1963_VS_NEG      0   /*Negative vsync*/
241+#  define SSD1963_ORI         0   /*0, 90, 180, 270*/
242+#  define SSD1963_COLOR_DEPTH 16
243+#endif
244+
245+/*----------------
246+ *    R61581
247+ *--------------*/
248+#ifndef USE_R61581
249+#  define USE_R61581          0
250+#endif
251+
252+#if USE_R61581
253+#  define R61581_HOR_RES      LV_HOR_RES
254+#  define R61581_VER_RES      LV_VER_RES
255+#  define R61581_HSPL         0       /*HSYNC signal polarity*/
256+#  define R61581_HSL          10      /*HSYNC length (Not Implemented)*/
257+#  define R61581_HFP          10      /*Horitontal Front poarch (Not Implemented)*/
258+#  define R61581_HBP          10      /*Horitontal Back poarch (Not Implemented */
259+#  define R61581_VSPL         0       /*VSYNC signal polarity*/
260+#  define R61581_VSL          10      /*VSYNC length (Not Implemented)*/
261+#  define R61581_VFP          8       /*Vertical Front poarch*/
262+#  define R61581_VBP          8       /*Vertical Back poarch */
263+#  define R61581_DPL          0       /*DCLK signal polarity*/
264+#  define R61581_EPL          1       /*ENABLE signal polarity*/
265+#  define R61581_ORI          0       /*0, 180*/
266+#  define R61581_LV_COLOR_DEPTH 16    /*Fix 16 bit*/
267+#endif
268+
269+/*------------------------------
270+ *  ST7565 (Monochrome, low res.)
271+ *-----------------------------*/
272+#ifndef USE_ST7565
273+#  define USE_ST7565          0
274+#endif
275+
276+#if USE_ST7565
277+/*No settings*/
278+#endif  /*USE_ST7565*/
279+
280+/*------------------------------
281+ *  GC9A01 (color, low res.)
282+ *-----------------------------*/
283+#ifndef USE_GC9A01
284+#  define USE_GC9A01          0
285+#endif
286+
287+#if USE_GC9A01
288+/*No settings*/
289+#endif  /*USE_GC9A01*/
290+
291+/*------------------------------------------
292+ *  UC1610 (4 gray 160*[104|128])
293+ *  (EA DOGXL160 160x104 tested)
294+ *-----------------------------------------*/
295+#ifndef USE_UC1610
296+#  define USE_UC1610          0
297+#endif
298+
299+#if USE_UC1610
300+#  define UC1610_HOR_RES         LV_HOR_RES
301+#  define UC1610_VER_RES         LV_VER_RES
302+#  define UC1610_INIT_CONTRAST   33   /* init contrast, values in [%] */
303+#  define UC1610_INIT_HARD_RST   0    /* 1 : hardware reset at init, 0 : software reset */
304+#  define UC1610_TOP_VIEW        0    /* 0 : Bottom View, 1 : Top View */
305+#endif  /*USE_UC1610*/
306+
307+/*-------------------------------------------------
308+ *  SHARP memory in pixel monochrome display series
309+ *      LS012B7DD01 (184x38  pixels.)
310+ *      LS013B7DH03 (128x128 pixels.)
311+ *      LS013B7DH05 (144x168 pixels.)
312+ *      LS027B7DH01 (400x240 pixels.) (tested)
313+ *      LS032B7DD02 (336x536 pixels.)
314+ *      LS044Q7DH01 (320x240 pixels.)
315+ *------------------------------------------------*/
316+#ifndef USE_SHARP_MIP
317+#  define USE_SHARP_MIP       0
318+#endif
319+
320+#if USE_SHARP_MIP
321+#  define SHARP_MIP_HOR_RES             LV_HOR_RES
322+#  define SHARP_MIP_VER_RES             LV_VER_RES
323+#  define SHARP_MIP_SOFT_COM_INVERSION  0
324+#  define SHARP_MIP_REV_BYTE(b)         /*((uint8_t) __REV(__RBIT(b)))*/  /*Architecture / compiler dependent byte bits order reverse*/
325+#endif  /*USE_SHARP_MIP*/
326+
327+/*-------------------------------------------------
328+ *  ILI9341 240X320 TFT LCD
329+ *------------------------------------------------*/
330+#ifndef USE_ILI9341
331+#  define USE_ILI9341       0
332+#endif
333+
334+#if USE_ILI9341
335+#  define ILI9341_HOR_RES       LV_HOR_RES
336+#  define ILI9341_VER_RES       LV_VER_RES
337+#  define ILI9341_GAMMA         1
338+#  define ILI9341_TEARING       0
339+#endif  /*USE_ILI9341*/
340+
341+/*-----------------------------------------
342+ *  Linux frame buffer device (/dev/fbx)
343+ *-----------------------------------------*/
344+#ifndef USE_FBDEV
345+#  define USE_FBDEV           0
346+#endif
347+
348+#if USE_FBDEV
349+#  define FBDEV_PATH          "/dev/fb0"
350+#endif
351+
352+/*-----------------------------------------
353+ *  FreeBSD frame buffer device (/dev/fbx)
354+ *.........................................*/
355+#ifndef USE_BSD_FBDEV
356+#  define USE_BSD_FBDEV		0
357+#endif
358+
359+#if USE_BSD_FBDEV
360+# define FBDEV_PATH		"/dev/fb0"
361+#endif
362+
363+/*-----------------------------------------
364+ *  DRM/KMS device (/dev/dri/cardX)
365+ *-----------------------------------------*/
366+#ifndef USE_DRM
367+#  define USE_DRM           0
368+#endif
369+
370+#if USE_DRM
371+#  define DRM_CARD          "/dev/dri/card0"
372+#  define DRM_CONNECTOR_ID  -1	/* -1 for the first connected one */
373+#endif
374+
375+/*********************
376+ *  INPUT DEVICES
377+ *********************/
378+
379+/*--------------
380+ *    XPT2046
381+ *--------------*/
382+#ifndef USE_XPT2046
383+#  define USE_XPT2046         0
384+#endif
385+
386+#if USE_XPT2046
387+#  define XPT2046_HOR_RES     480
388+#  define XPT2046_VER_RES     320
389+#  define XPT2046_X_MIN       200
390+#  define XPT2046_Y_MIN       200
391+#  define XPT2046_X_MAX       3800
392+#  define XPT2046_Y_MAX       3800
393+#  define XPT2046_AVG         4
394+#  define XPT2046_X_INV       0
395+#  define XPT2046_Y_INV       0
396+#  define XPT2046_XY_SWAP     0
397+#endif
398+
399+/*-----------------
400+ *    FT5406EE8
401+ *-----------------*/
402+#ifndef USE_FT5406EE8
403+#  define USE_FT5406EE8       0
404+#endif
405+
406+#if USE_FT5406EE8
407+# define FT5406EE8_I2C_ADR   0x38                  /*7 bit address*/
408+#endif
409+
410+/*---------------
411+ *  AD TOUCH
412+ *--------------*/
413+#ifndef USE_AD_TOUCH
414+#  define USE_AD_TOUCH        0
415+#endif
416+
417+#if USE_AD_TOUCH
418+/*No settings*/
419+#endif
420+
421+
422+/*---------------------------------------
423+ * Mouse or touchpad on PC (using SDL)
424+ *-------------------------------------*/
425+/*DEPRECATED: Use the SDL driver instead. */
426+#ifndef USE_MOUSE
427+#  define USE_MOUSE           0
428+#endif
429+
430+#if USE_MOUSE
431+/*No settings*/
432+#endif
433+
434+/*-------------------------------------------
435+ * Mousewheel as encoder on PC (using SDL)
436+ *------------------------------------------*/
437+/*DEPRECATED: Use the SDL driver instead. */
438+#ifndef USE_MOUSEWHEEL
439+#  define USE_MOUSEWHEEL      0
440+#endif
441+
442+#if USE_MOUSEWHEEL
443+/*No settings*/
444+#endif
445+
446+/*-------------------------------------------------
447+ * Touchscreen, mouse/touchpad or keyboard as libinput interface (for Linux based systems)
448+ *------------------------------------------------*/
449+#ifndef USE_LIBINPUT
450+#  define USE_LIBINPUT           0
451+#endif
452+
453+#ifndef USE_BSD_LIBINPUT
454+#  define USE_BSD_LIBINPUT       0
455+#endif
456+
457+#if USE_LIBINPUT || USE_BSD_LIBINPUT
458+/*If only a single device of the same type is connected, you can also auto detect it, e.g.:
459+ *#define LIBINPUT_NAME   libinput_find_dev(LIBINPUT_CAPABILITY_TOUCH, false)*/
460+#  define LIBINPUT_NAME   "/dev/input/event0"        /*You can use the "evtest" Linux tool to get the list of devices and test them*/
461+
462+#endif  /*USE_LIBINPUT || USE_BSD_LIBINPUT*/
463+
464+/*-------------------------------------------------
465+ * Mouse or touchpad as evdev interface (for Linux based systems)
466+ *------------------------------------------------*/
467+#ifndef USE_EVDEV
468+#  define USE_EVDEV           0
469+#endif
470+
471+#ifndef USE_BSD_EVDEV
472+#  define USE_BSD_EVDEV       0
473+#endif
474+
475+#if USE_EVDEV || USE_BSD_EVDEV
476+#  define EVDEV_NAME   "/dev/input/event0"        /*You can use the "evtest" Linux tool to get the list of devices and test them*/
477+#  define EVDEV_SWAP_AXES         0               /*Swap the x and y axes of the touchscreen*/
478+
479+#  define EVDEV_CALIBRATE         0               /*Scale and offset the touchscreen coordinates by using maximum and minimum values for each axis*/
480+
481+#  if EVDEV_CALIBRATE
482+#    define EVDEV_HOR_MIN         0               /*to invert axis swap EVDEV_XXX_MIN by EVDEV_XXX_MAX*/
483+#    define EVDEV_HOR_MAX      4096               /*"evtest" Linux tool can help to get the correct calibraion values>*/
484+#    define EVDEV_VER_MIN         0
485+#    define EVDEV_VER_MAX      4096
486+#  endif  /*EVDEV_CALIBRATE*/
487+#endif  /*USE_EVDEV*/
488+
489+/*-------------------------------------------------
490+ * Full keyboard support for evdev and libinput interface
491+ *------------------------------------------------*/
492+#  ifndef USE_XKB
493+#    define USE_XKB           0
494+#  endif
495+
496+#if USE_LIBINPUT || USE_BSD_LIBINPUT || USE_EVDEV || USE_BSD_EVDEV
497+#  if USE_XKB
498+#    define XKB_KEY_MAP       { .rules = NULL, \
499+                                .model = "pc101", \
500+                                .layout = "us", \
501+                                .variant = NULL, \
502+                                .options = NULL } /*"setxkbmap -query" can help find the right values for your keyboard*/
503+#  endif  /*USE_XKB*/
504+#endif  /*USE_LIBINPUT || USE_BSD_LIBINPUT || USE_EVDEV || USE_BSD_EVDEV*/
505+
506+/*-------------------------------
507+ *   Keyboard of a PC (using SDL)
508+ *------------------------------*/
509+/*DEPRECATED: Use the SDL driver instead. */
510+#ifndef USE_KEYBOARD
511+#  define USE_KEYBOARD        0
512+#endif
513+
514+#if USE_KEYBOARD
515+/*No settings*/
516+#endif
517+
518+#endif  /*LV_DRV_CONF_H*/
519+
520+#endif /*End of "Content enable"*/
521--
5222.25.1
523
524