lv_drv_conf.h 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. /**
  2. * @file lv_drv_conf.h
  3. *
  4. */
  5. /*
  6. * COPY THIS FILE AS lv_drv_conf.h
  7. */
  8. #if 1 /*Set it to "1" to enable the content*/
  9. #ifndef LV_DRV_CONF_H
  10. #define LV_DRV_CONF_H
  11. #include "lv_conf.h"
  12. /*********************
  13. * DELAY INTERFACE
  14. *********************/
  15. #define LV_DRV_DELAY_INCLUDE <stdint.h> /*Dummy include by default*/
  16. #define LV_DRV_DELAY_US(us) /*delay_us(us)*/ /*Delay the given number of microseconds*/
  17. #define LV_DRV_DELAY_MS(ms) /*delay_ms(ms)*/ /*Delay the given number of milliseconds*/
  18. /*********************
  19. * DISPLAY INTERFACE
  20. *********************/
  21. /*------------
  22. * Common
  23. *------------*/
  24. #define LV_DRV_DISP_INCLUDE <stdint.h> /*Dummy include by default*/
  25. #define LV_DRV_DISP_CMD_DATA(val) /*pin_x_set(val)*/ /*Set the command/data pin to 'val'*/
  26. #define LV_DRV_DISP_RST(val) /*pin_x_set(val)*/ /*Set the reset pin to 'val'*/
  27. /*---------
  28. * SPI
  29. *---------*/
  30. #define LV_DRV_DISP_SPI_CS(val) /*spi_cs_set(val)*/ /*Set the SPI's Chip select to 'val'*/
  31. #define LV_DRV_DISP_SPI_WR_BYTE(data) /*spi_wr(data)*/ /*Write a byte the SPI bus*/
  32. #define LV_DRV_DISP_SPI_WR_ARRAY(adr, n) /*spi_wr_mem(adr, n)*/ /*Write 'n' bytes to SPI bus from 'adr'*/
  33. /*------------------
  34. * Parallel port
  35. *-----------------*/
  36. #define LV_DRV_DISP_PAR_CS(val) /*par_cs_set(val)*/ /*Set the Parallel port's Chip select to 'val'*/
  37. #define LV_DRV_DISP_PAR_SLOW /*par_slow()*/ /*Set low speed on the parallel port*/
  38. #define LV_DRV_DISP_PAR_FAST /*par_fast()*/ /*Set high speed on the parallel port*/
  39. #define LV_DRV_DISP_PAR_WR_WORD(data) /*par_wr(data)*/ /*Write a word to the parallel port*/
  40. #define LV_DRV_DISP_PAR_WR_ARRAY(adr, n) /*par_wr_mem(adr,n)*/ /*Write 'n' bytes to Parallel ports from 'adr'*/
  41. /***************************
  42. * INPUT DEVICE INTERFACE
  43. ***************************/
  44. /*----------
  45. * Common
  46. *----------*/
  47. #define LV_DRV_INDEV_INCLUDE <stdint.h> /*Dummy include by default*/
  48. #define LV_DRV_INDEV_RST(val) /*pin_x_set(val)*/ /*Set the reset pin to 'val'*/
  49. #define LV_DRV_INDEV_IRQ_READ 0 /*pn_x_read()*/ /*Read the IRQ pin*/
  50. /*---------
  51. * SPI
  52. *---------*/
  53. #define LV_DRV_INDEV_SPI_CS(val) /*spi_cs_set(val)*/ /*Set the SPI's Chip select to 'val'*/
  54. #define LV_DRV_INDEV_SPI_XCHG_BYTE(data) 0 /*spi_xchg(val)*/ /*Write 'val' to SPI and give the read value*/
  55. /*---------
  56. * I2C
  57. *---------*/
  58. #define LV_DRV_INDEV_I2C_START /*i2c_start()*/ /*Make an I2C start*/
  59. #define LV_DRV_INDEV_I2C_STOP /*i2c_stop()*/ /*Make an I2C stop*/
  60. #define LV_DRV_INDEV_I2C_RESTART /*i2c_restart()*/ /*Make an I2C restart*/
  61. #define LV_DRV_INDEV_I2C_WR(data) /*i2c_wr(data)*/ /*Write a byte to the I1C bus*/
  62. #define LV_DRV_INDEV_I2C_READ(last_read) 0 /*i2c_rd()*/ /*Read a byte from the I2C bud*/
  63. /*********************
  64. * DISPLAY DRIVERS
  65. *********************/
  66. /*-------------------
  67. * Monitor of PC
  68. *-------------------*/
  69. #ifndef USE_MONITOR
  70. # define USE_MONITOR 1
  71. #endif
  72. #if USE_MONITOR
  73. # define MONITOR_HOR_RES LV_HOR_RES_MAX
  74. # define MONITOR_VER_RES LV_VER_RES_MAX
  75. /* Scale window by this factor (useful when simulating small screens) */
  76. # define MONITOR_ZOOM 1
  77. /* Used to test true double buffering with only address changing.
  78. * Set LV_VDB_SIZE = (LV_HOR_RES * LV_VER_RES) and LV_VDB_DOUBLE = 1 and LV_COLOR_DEPTH = 32" */
  79. # define MONITOR_DOUBLE_BUFFERED 0
  80. /*Eclipse: <SDL2/SDL.h> Visual Studio: <SDL.h>*/
  81. # define MONITOR_SDL_INCLUDE_PATH <SDL2/SDL.h>
  82. /*Different rendering might be used if running in a Virtual machine*/
  83. # define MONITOR_VIRTUAL_MACHINE 0
  84. /*Open two windows to test multi display support*/
  85. # define MONITOR_DUAL 0
  86. #endif
  87. /*-----------------------------------
  88. * Native Windows (including mouse)
  89. *----------------------------------*/
  90. #ifndef USE_WINDOWS
  91. # define USE_WINDOWS 0
  92. #endif
  93. #define USE_WINDOWS 0
  94. #if USE_WINDOWS
  95. # define WINDOW_HOR_RES 480
  96. # define WINDOW_VER_RES 320
  97. #endif
  98. /*----------------
  99. * SSD1963
  100. *--------------*/
  101. #ifndef USE_SSD1963
  102. # define USE_SSD1963 0
  103. #endif
  104. #if USE_SSD1963
  105. # define SSD1963_HOR_RES LV_HOR_RES
  106. # define SSD1963_VER_RES LV_VER_RES
  107. # define SSD1963_HT 531
  108. # define SSD1963_HPS 43
  109. # define SSD1963_LPS 8
  110. # define SSD1963_HPW 10
  111. # define SSD1963_VT 288
  112. # define SSD1963_VPS 12
  113. # define SSD1963_FPS 4
  114. # define SSD1963_VPW 10
  115. # define SSD1963_HS_NEG 0 /*Negative hsync*/
  116. # define SSD1963_VS_NEG 0 /*Negative vsync*/
  117. # define SSD1963_ORI 0 /*0, 90, 180, 270*/
  118. # define SSD1963_COLOR_DEPTH 16
  119. #endif
  120. /*----------------
  121. * R61581
  122. *--------------*/
  123. #ifndef USE_R61581
  124. # define USE_R61581 0
  125. #endif
  126. #if USE_R61581
  127. # define R61581_HOR_RES LV_HOR_RES
  128. # define R61581_VER_RES LV_VER_RES
  129. # define R61581_HSPL 0 /*HSYNC signal polarity*/
  130. # define R61581_HSL 10 /*HSYNC length (Not Implemented)*/
  131. # define R61581_HFP 10 /*Horitontal Front poarch (Not Implemented)*/
  132. # define R61581_HBP 10 /*Horitontal Back poarch (Not Implemented */
  133. # define R61581_VSPL 0 /*VSYNC signal polarity*/
  134. # define R61581_VSL 10 /*VSYNC length (Not Implemented)*/
  135. # define R61581_VFP 8 /*Vertical Front poarch*/
  136. # define R61581_VBP 8 /*Vertical Back poarch */
  137. # define R61581_DPL 0 /*DCLK signal polarity*/
  138. # define R61581_EPL 1 /*ENABLE signal polarity*/
  139. # define R61581_ORI 0 /*0, 180*/
  140. # define R61581_LV_COLOR_DEPTH 16 /*Fix 16 bit*/
  141. #endif
  142. /*------------------------------
  143. * ST7565 (Monochrome, low res.)
  144. *-----------------------------*/
  145. #ifndef USE_ST7565
  146. # define USE_ST7565 0
  147. #endif
  148. #if USE_ST7565
  149. /*No settings*/
  150. #endif /*USE_ST7565*/
  151. /*-----------------------------------------
  152. * Linux frame buffer device (/dev/fbx)
  153. *-----------------------------------------*/
  154. #ifndef USE_FBDEV
  155. # define USE_FBDEV 1
  156. #endif
  157. #if USE_FBDEV
  158. # define FBDEV_PATH "/dev/fb0"
  159. #endif
  160. /*********************
  161. * INPUT DEVICES
  162. *********************/
  163. /*--------------
  164. * XPT2046
  165. *--------------*/
  166. #ifndef USE_XPT2046
  167. # define USE_XPT2046 0
  168. #endif
  169. #if USE_XPT2046
  170. # define XPT2046_HOR_RES 480
  171. # define XPT2046_VER_RES 320
  172. # define XPT2046_X_MIN 200
  173. # define XPT2046_Y_MIN 200
  174. # define XPT2046_X_MAX 3800
  175. # define XPT2046_Y_MAX 3800
  176. # define XPT2046_AVG 4
  177. # define XPT2046_INV 0
  178. #endif
  179. /*-----------------
  180. * FT5406EE8
  181. *-----------------*/
  182. #ifndef USE_FT5406EE8
  183. # define USE_FT5406EE8 0
  184. #endif
  185. #if USE_FT5406EE8
  186. # define FT5406EE8_I2C_ADR 0x38 /*7 bit address*/
  187. #endif
  188. /*---------------
  189. * AD TOUCH
  190. *--------------*/
  191. #ifndef USE_AD_TOUCH
  192. # define USE_AD_TOUCH 0
  193. #endif
  194. #if USE_AD_TOUCH
  195. /*No settings*/
  196. #endif
  197. /*---------------------------------------
  198. * Mouse or touchpad on PC (using SDL)
  199. *-------------------------------------*/
  200. #ifndef USE_MOUSE
  201. # define USE_MOUSE 1
  202. #endif
  203. #if USE_MOUSE
  204. /*No settings*/
  205. #endif
  206. /*-------------------------------------------
  207. * Mousewheel as encoder on PC (using SDL)
  208. *------------------------------------------*/
  209. #ifndef USE_MOUSEWHEEL
  210. # define USE_MOUSEWHEEL 1
  211. #endif
  212. #if USE_MOUSEWHEEL
  213. /*No settings*/
  214. #endif
  215. /*-------------------------------------------------
  216. * Touchscreen as libinput interface (for Linux based systems)
  217. *------------------------------------------------*/
  218. #ifndef USE_LIBINPUT
  219. # define USE_LIBINPUT 0
  220. #endif
  221. #if USE_LIBINPUT
  222. # define LIBINPUT_NAME "/dev/input/event0" /*You can use the "evtest" Linux tool to get the list of devices and test them*/
  223. #endif /*USE_LIBINPUT*/
  224. /*-------------------------------------------------
  225. * Mouse or touchpad as evdev interface (for Linux based systems)
  226. *------------------------------------------------*/
  227. #ifndef USE_EVDEV
  228. # define USE_EVDEV 0
  229. #endif
  230. #if USE_EVDEV
  231. # define EVDEV_NAME "/dev/input/event0" /*You can use the "evtest" Linux tool to get the list of devices and test them*/
  232. # define EVDEV_SWAP_AXES 0 /*Swap the x and y axes of the touchscreen*/
  233. # define EVDEV_SCALE 0 /* Scale input, e.g. if touchscreen resolution does not match display resolution */
  234. # if EVDEV_SCALE
  235. # define EVDEV_SCALE_HOR_RES (4096) /* Horizontal resolution of touchscreen */
  236. # define EVDEV_SCALE_VER_RES (4096) /* Vertical resolution of touchscreen */
  237. # endif /*EVDEV_SCALE*/
  238. # define EVDEV_CALIBRATE 0 /*Scale and offset the touchscreen coordinates by using maximum and minimum values for each axis*/
  239. # if EVDEV_CALIBRATE
  240. # define EVDEV_HOR_MIN 3800 /*If EVDEV_XXX_MIN > EVDEV_XXX_MAX the XXX axis is automatically inverted*/
  241. # define EVDEV_HOR_MAX 200
  242. # define EVDEV_VER_MIN 200
  243. # define EVDEV_VER_MAX 3800
  244. # endif /*EVDEV_SCALE*/
  245. #endif /*USE_EVDEV*/
  246. /*-------------------------------
  247. * Keyboard of a PC (using SDL)
  248. *------------------------------*/
  249. #ifndef USE_KEYBOARD
  250. # define USE_KEYBOARD 1
  251. #endif
  252. #if USE_KEYBOARD
  253. /*No settings*/
  254. #endif
  255. #endif /*LV_DRV_CONF_H*/
  256. #endif /*End of "Content enable"*/