honey_the_codewitch

panels.h

Dec 31st, 2025
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 23.36 KB | None | 0 0
  1. #ifndef PANELS_H
  2. #define PANELS_H
  3.  
  4. // BEGIN devices (add more)
  5.  
  6. #ifdef TTGO_T1 // Works
  7. #define LCD_SPI_HOST    SPI_3
  8. #define LCD_PIN_NUM_MOSI 19
  9. #define LCD_PIN_NUM_CLK 18
  10. #define LCD_PIN_NUM_CS 5
  11. #define LCD_PIN_NUM_DC 16
  12. #define LCD_PIN_NUM_RST 23
  13. #define LCD_PIN_NUM_BCKL 4
  14. #define LCD_PANEL esp_lcd_new_panel_st7789
  15. #define LCD_HRES 135
  16. #define LCD_VRES 240
  17. #define LCD_COLOR_SPACE LCD_COLOR_RGB
  18. #define LCD_CLOCK_HZ (40 * 1000 * 1000)
  19. #define LCD_GAP_X 40
  20. #define LCD_GAP_Y 52
  21. #define LCD_MIRROR_X false
  22. #define LCD_MIRROR_Y true
  23. #define LCD_INVERT_COLOR true
  24. #define LCD_SWAP_XY true
  25. #define LCD_DIVISOR 2
  26. #define BUTTON_MASK (BUTTON_PIN(0)|BUTTON_PIN(35))
  27. #define BUTTON_ON_LEVEL 0
  28. #endif // TTGO_T1
  29.  
  30. #ifdef T_DISPLAY_S3 // untested, mine bricked
  31. #define LCD_PIN_NUM_CS 6
  32. #define LCD_PIN_NUM_RST 5
  33. #define LCD_PIN_NUM_WR 8
  34. #define LCD_PIN_NUM_RD 9
  35. #define LCD_PIN_NUM_RS 7
  36. #define LCD_PIN_NUM_D00 39
  37. #define LCD_PIN_NUM_D01 40
  38. #define LCD_PIN_NUM_D02 41
  39. #define LCD_PIN_NUM_D03 42
  40. #define LCD_PIN_NUM_D04 45
  41. #define LCD_PIN_NUM_D05 46
  42. #define LCD_PIN_NUM_D06 47
  43. #define LCD_PIN_NUM_D07 48
  44. #define LCD_PIN_NUM_BCKL 38
  45. #define LCD_PANEL esp_lcd_new_panel_st7789
  46. #define LCD_HRES 170
  47. #define LCD_VRES 320
  48. #define LCD_COLOR_SPACE LCD_COLOR_RGB
  49. #define LCD_CLOCK_HZ (6528 * 1000)
  50. #define LCD_GAP_X 0
  51. #define LCD_GAP_Y 35
  52. #define LCD_MIRROR_X false
  53. #define LCD_MIRROR_Y true
  54. #define LCD_INVERT_COLOR true
  55. #define LCD_SWAP_XY true
  56. #define BUTTON_MASK (BUTTON_PIN(0)|BUTTON_PIN(14))
  57. #define BUTTON_ON_LEVEL 0
  58. #endif // T_DISPLAY_S3
  59.  
  60. #ifdef T_QT_PRO // Untested (mine is lost)
  61. #define LCD_SPI_HOST    SPI_3
  62. #define LCD_BCKL_ON_LEVEL 0
  63. #define LCD_PIN_NUM_MOSI 2
  64. #define LCD_PIN_NUM_CLK 3
  65. #define LCD_PIN_NUM_CS 5
  66. #define LCD_PIN_NUM_DC 6
  67. #define LCD_PIN_NUM_RST 1
  68. #define LCD_PIN_NUM_BCKL 10
  69. #define LCD_PANEL esp_lcd_new_panel_st7789
  70. #define LCD_HRES 128
  71. #define LCD_VRES 128
  72. #define LCD_COLOR_SPACE LCD_COLOR_BGR
  73. #define LCD_CLOCK_HZ (40 * 1000 * 1000)
  74. #define LCD_GAP_X 2
  75. #define LCD_GAP_Y 1
  76. #define LCD_MIRROR_X true
  77. #define LCD_MIRROR_Y true
  78. #define LCD_INVERT_COLOR true
  79. #define LCD_SWAP_XY false
  80. #define BUTTON_MASK (BUTTON_PIN(0)|BUTTON_PIN(47))
  81. #define BUTTON_ON_LEVEL 0
  82. #endif // T_QT_PRO
  83.  
  84. #ifdef ESP_WROVER_KIT // Should work (Mine has a short)
  85. #ifdef PANEL_DEPENDENCIES
  86. // lib_deps = codewitch-honey-crisis/htcw_esp_lcd_panel_ili9341
  87. #include "esp_lcd_panel_ili9341.h"
  88. #endif
  89. #define LCD_BCKL_ON_LEVEL 0
  90. #define LCD_SPI_HOST    SPI_3
  91. #define LCD_PIN_NUM_MISO 25
  92. #define LCD_PIN_NUM_MOSI 23
  93. #define LCD_PIN_NUM_CLK  19
  94. #define LCD_PIN_NUM_CS   22
  95. #define LCD_PIN_NUM_DC   21
  96. #define LCD_PIN_NUM_RST  18
  97. #define LCD_PIN_NUM_BCKL 5
  98. #define LCD_PANEL esp_lcd_new_panel_ili9341
  99. #define LCD_HRES 240
  100. #define LCD_VRES 320
  101. #define LCD_COLOR_SPACE LCD_COLOR_BGR
  102. #define LCD_CLOCK_HZ (40 * 1000 * 1000)
  103. #define LCD_GAP_X 0
  104. #define LCD_GAP_Y 0
  105. #define LCD_MIRROR_X false
  106. #define LCD_MIRROR_Y false
  107. #define LCD_INVERT_COLOR false
  108. #define LCD_SWAP_XY true
  109. #define BUTTON_MASK (BUTTON_PIN(0))
  110. #define BUTTON_ON_LEVEL 0
  111. #endif // ESP_WROVER_KIT
  112.  
  113. #ifdef ESP_USB_OTG // Works
  114. #define LCD_SPI_HOST    SPI_2
  115. #define LCD_PIN_NUM_MOSI 7
  116. #define LCD_PIN_NUM_CLK 6
  117. #define LCD_PIN_NUM_CS 5
  118. #define LCD_PIN_NUM_DC 4
  119. #define LCD_PIN_NUM_RST 8
  120. #define LCD_PIN_NUM_BCKL 9
  121. #define LCD_PANEL esp_lcd_new_panel_st7789
  122. #define LCD_HRES 240
  123. #define LCD_VRES 240
  124. #define LCD_COLOR_SPACE LCD_COLOR_RGB
  125. #define LCD_CLOCK_HZ (40 * 1000 * 1000)
  126. #define LCD_GAP_X 0
  127. #define LCD_GAP_Y 0
  128. #define LCD_MIRROR_X false
  129. #define LCD_MIRROR_Y false
  130. #define LCD_INVERT_COLOR true
  131. #define LCD_SWAP_XY false
  132. #define BUTTON_MASK (BUTTON_PIN(0)|BUTTON_PIN(10)|BUTTON_PIN(11)|BUTTON_PIN(14))
  133. #define BUTTON_ON_LEVEL 0
  134. #define SD_PIN_NUM_CLK 36
  135. #define SD_PIN_NUM_D00 37
  136. #define SD_PIN_NUM_D01 38
  137. #define SD_PIN_NUM_D02 33
  138. #define SD_PIN_NUM_D03 34
  139. #define SD_CLOCK_HZ (40*1000)
  140. #endif // ESP_USB_OTG
  141.  
  142. #ifdef M5STACK_CORE2 // Works
  143. #ifdef PANEL_DEPENDENCIES
  144. // lib_deps = codewitch-honey-crisis/htcw_esp_lcd_touch_ft6x36
  145. //            codewitch-honey-crisis/htcw_esp_lcd_panel_ili9342
  146. //            codewitch-honey-crisis/htcw_m5_stack_core2_power
  147. #include "esp_lcd_panel_ili9342.h"
  148. #include "esp_lcd_touch_ft6x36.h"
  149. #include "m5_stack_core2_power.h"
  150. #endif
  151. #define LCD_SPI_HOST    SPI_3
  152. #define LCD_PIN_NUM_MOSI 23
  153. #define LCD_PIN_NUM_CLK 18
  154. #define LCD_PIN_NUM_CS 5
  155. #define LCD_PIN_NUM_DC 15
  156. #define LCD_PANEL esp_lcd_new_panel_ili9342
  157. #define LCD_HRES 320
  158. #define LCD_VRES 240
  159. #define LCD_COLOR_SPACE LCD_COLOR_BGR
  160. #define LCD_CLOCK_HZ (40 * 1000 * 1000)
  161. #define LCD_GAP_X 0
  162. #define LCD_GAP_Y 0
  163. #define LCD_MIRROR_X false
  164. #define LCD_MIRROR_Y false
  165. #define LCD_INVERT_COLOR true
  166. #define LCD_SWAP_XY false
  167. #define TOUCH_I2C_HOST I2C_1
  168. #define TOUCH_PIN_NUM_SDA 21
  169. #define TOUCH_PIN_NUM_SCL 22
  170. #define TOUCH_PANEL esp_lcd_touch_new_i2c_ft6x36
  171. #define TOUCH_I2C_ADDR ESP_LCD_TOUCH_IO_I2C_FT6x36_ADDRESS
  172. #define TOUCH_UPDATE_LIMIT_MS 13
  173. #define TOUCH_CMD_BITS 8
  174. #define TOUCH_PARAM_BITS 0
  175. #define TOUCH_DISABLE_CONTROL_PHASE
  176. #define TOUCH_CLOCK_HZ (200*1000)
  177. #define TOUCH_PIN_NUM_RST -1
  178. #define TOUCH_VRES 280
  179. #define TOUCH_BOTTOM_OVERHANG 40
  180. #define POWER_I2C_HOST I2C_1
  181. #define POWER_PIN_NUM_SDA 21
  182. #define POWER_PIN_NUM_SCL 22
  183. #define POWER_CLOCK_HZ (200*1000)
  184. #define POWER_I2C_PULLUP 1
  185. #define POWER_INIT m5_stack_core2_power_init(false)
  186. #define SD_SPI_HOST SPI_3
  187. #define SD_PIN_NUM_CS 4
  188. #define SD_PIN_NUM_MOSI 23
  189. #define SD_PIN_NUM_MISO 38
  190. #endif // M5STACK_CORE2
  191.  
  192. #ifdef M5STACK_FIRE // Mine bricked so it's untested
  193. #ifdef PANEL_DEPENDENCIES
  194. // lib_deps = codewitch-honey-crisis/htcw_esp_lcd_panel_ili9342
  195. #include "esp_lcd_panel_ili9342.h"
  196. #endif
  197. #define LCD_SPI_HOST    SPI_3
  198. #define LCD_PIN_NUM_MOSI 23
  199. #define LCD_PIN_NUM_CLK 18
  200. #define LCD_PIN_NUM_CS 14
  201. #define LCD_PIN_NUM_DC 27
  202. #define LCD_PIN_NUM_RST 33
  203. #define LCD_PIN_NUM_BCKL 32
  204. #define LCD_PANEL esp_lcd_new_panel_ili9342
  205. #define LCD_HRES 320
  206. #define LCD_VRES 240
  207. #define LCD_COLOR_SPACE LCD_COLOR_BGR
  208. #define LCD_CLOCK_HZ (40 * 1000 * 1000)
  209. #define LCD_GAP_X 0
  210. #define LCD_GAP_Y 0
  211. #define LCD_MIRROR_X false
  212. #define LCD_MIRROR_Y false
  213. #define LCD_INVERT_COLOR true
  214. #define LCD_SWAP_XY false
  215. #define BUTTON_MASK (BUTTON_PIN(39)|BUTTON_PIN(38)|BUTTON_PIN(37))
  216. #define BUTTON_ON_LEVEL 0
  217. #define SD_SPI_HOST    SPI_3
  218. #define SD_PIN_NUM_MOSI 23
  219. #define SD_PIN_NUM_MISO 19
  220. #define SD_PIN_NUM_CLK 18
  221. #define SD_PIN_NUM_CS 4
  222. #endif // M5STACK_FIRE
  223.  
  224. #ifdef M5STACK_S3_ATOM // Untested (mine is bricked)
  225. #define LCD_SPI_HOST    SPI_3
  226. #define LCD_PIN_NUM_MOSI 21
  227. #define LCD_PIN_NUM_CLK 17
  228. #define LCD_PIN_NUM_CS 15
  229. #define LCD_PIN_NUM_DC 33
  230. #define LCD_PIN_NUM_RST 34
  231. #define LCD_PIN_NUM_BCKL 16
  232. #define LCD_PANEL esp_lcd_new_panel_st7789
  233. #define LCD_HRES 128
  234. #define LCD_VRES 128
  235. #define LCD_COLOR_SPACE LCD_COLOR_BGR
  236. #define LCD_CLOCK_HZ (40 * 1000 * 1000)
  237. #define LCD_GAP_X 2
  238. #define LCD_GAP_Y 1
  239. #define LCD_MIRROR_X true
  240. #define LCD_MIRROR_Y true
  241. #define LCD_INVERT_COLOR true
  242. #define LCD_SWAP_XY false
  243. #define BUTTON_MASK (BUTTON_PIN(41))
  244. #define BUTTON_ON_LEVEL 0
  245. #endif // M5STACK_S3_ATOM
  246.  
  247. #ifdef MATOUCH_ESP_DISPLAY_PARALLEL_35 // Untested. Mine died eventually
  248. #ifdef PANEL_DEPENDENCIES
  249. // lib_deps = codewitch-honey-crisis/htcw_esp_lcd_panel_ili9488
  250. //      codewitch-honey-crisis/htcw_esp_lcd_touch_ft6x36
  251. #include "esp_lcd_panel_ili9488.h"
  252. #include "esp_lcd_touch_ft6x36.h"
  253. #endif
  254. #define LCD_PIN_NUM_CS 37
  255. #define LCD_PIN_NUM_WR 35
  256. #define LCD_PIN_NUM_RD 48
  257. #define LCD_PIN_NUM_RS 36
  258. #define LCD_PIN_NUM_D00 47
  259. #define LCD_PIN_NUM_D01 21
  260. #define LCD_PIN_NUM_D02 14
  261. #define LCD_PIN_NUM_D03 13
  262. #define LCD_PIN_NUM_D04 12
  263. #define LCD_PIN_NUM_D05 11
  264. #define LCD_PIN_NUM_D06 10
  265. #define LCD_PIN_NUM_D07 9
  266. #define LCD_PIN_NUM_D08 3
  267. #define LCD_PIN_NUM_D09 8
  268. #define LCD_PIN_NUM_D10 16
  269. #define LCD_PIN_NUM_D11 15
  270. #define LCD_PIN_NUM_D12 7
  271. #define LCD_PIN_NUM_D13 6
  272. #define LCD_PIN_NUM_D14 5
  273. #define LCD_PIN_NUM_D15 4
  274. #define LCD_PIN_NUM_BCKL 45
  275. #define LCD_PANEL esp_lcd_new_panel_ili9488
  276. #define LCD_HRES 320
  277. #define LCD_VRES 480
  278. #define LCD_COLOR_SPACE LCD_COLOR_BGR
  279. #define LCD_CLOCK_HZ (20 * 1000 * 1000)
  280. #define LCD_GAP_X 0
  281. #define LCD_GAP_Y 0
  282. #define LCD_MIRROR_X true
  283. #define LCD_MIRROR_Y true
  284. #define LCD_INVERT_COLOR false
  285. #define LCD_SWAP_XY true
  286. #define LCD_SWAP_COLOR_BYTES true
  287. #define TOUCH_I2C_HOST I2C_1
  288. #define TOUCH_PIN_NUM_SCL 39
  289. #define TOUCH_PIN_NUM_SDA 38
  290. #define TOUCH_PANEL esp_lcd_touch_new_i2c_ft6x36
  291. #define TOUCH_I2C_ADDR ESP_LCD_TOUCH_IO_I2C_FT6x36_ADDRESS
  292. #define TOUCH_UPDATE_LIMIT_MS 13
  293. #define TOUCH_CMD_BITS 8
  294. #define TOUCH_PARAM_BITS 0
  295. #define TOUCH_DISABLE_CONTROL_PHASE
  296. #define TOUCH_CLOCK_HZ (200*1000)
  297. #define TOUCH_PIN_NUM_RST -1
  298. #endif // MATOUCH_ESP_DISPLAY_PARALLEL_35
  299.  
  300. #ifdef MATOUCH_ESP_DISPLAY_PARALLEL_4 // Untested (I have one but it's in use right now, and inside something so I can't test touch)
  301. #ifdef PANEL_DEPENDENCIES
  302. // lib_deps = codewitch-honey-crisis/htcw_esp_lcd_touch_gt911
  303. #include "esp_lcd_touch_gt911.h"
  304. #endif
  305. #define LCD_PIN_NUM_CS 1
  306. #define LCD_PIN_NUM_CLK 12
  307. #define LCD_PIN_NUM_MOSI 11
  308. #define LCD_PIN_NUM_DE 45
  309. #define LCD_PIN_NUM_VSYNC 4
  310. #define LCD_PIN_NUM_HSYNC 5
  311. #define LCD_PIN_NUM_CLK 21
  312. #define LCD_PIN_NUM_D00 6
  313. #define LCD_PIN_NUM_D01 7
  314. #define LCD_PIN_NUM_D02 15
  315. #define LCD_PIN_NUM_D03 16
  316. #define LCD_PIN_NUM_D04 8
  317. #define LCD_PIN_NUM_D05 0
  318. #define LCD_PIN_NUM_D06 9
  319. #define LCD_PIN_NUM_D07 14
  320. #define LCD_PIN_NUM_D08 47
  321. #define LCD_PIN_NUM_D09 48
  322. #define LCD_PIN_NUM_D10 3
  323. #define LCD_PIN_NUM_D11 39
  324. #define LCD_PIN_NUM_D12 40
  325. #define LCD_PIN_NUM_D13 41
  326. #define LCD_PIN_NUM_D14 42
  327. #define LCD_PIN_NUM_D15 2
  328. #define LCD_PIN_NUM_BCKL -1
  329. #define LCD_HSYNC_POLARITY 1
  330. #define LCD_HSYNC_FRONT_PORCH 10
  331. #define LCD_HSYNC_PULSE_WIDTH 8
  332. #define LCD_HSYNC_BACK_PORCH 50
  333. #define LCD_VSYNC_POLARITY 1
  334. #define LCD_VSYNC_FRONT_PORCH 10
  335. #define LCD_VSYNC_PULSE_WIDTH 8
  336. #define LCD_VSYNC_BACK_PORCH 10
  337. #define LCD_CLK_IDLE_HIGH 0
  338. #define LCD_DE_IDLE_HIGH 1
  339. #define LCD_BIT_DEPTH 16
  340. #define LCD_PANEL esp_lcd_new_panel_st7701
  341. #define LCD_HRES 480
  342. #define LCD_VRES 480
  343. #define LCD_COLOR_SPACE LCD_COLOR_BGR
  344. #define LCD_SWAP_COLOR_BYTES true
  345. #ifdef CONFIG_SPIRAM_MODE_QUAD
  346.     #define LCD_CLOCK_HZ (6 * 1000 * 1000)
  347. #else
  348.     #define LCD_CLOCK_HZ (10 * 1000 * 1000)
  349. #endif
  350. #define TOUCH_I2C_HOST I2C_1
  351. #define TOUCH_PIN_NUM_SDA 17
  352. #define TOUCH_PIN_NUM_SCL 18
  353. #define TOUCH_PIN_NUM_INT -1
  354. #define TOUCH_PIN_NUM_RST 38
  355. #define TOUCH_PANEL esp_lcd_touch_new_i2c_gt911
  356. #define TOUCH_I2C_ADDR ESP_LCD_TOUCH_IO_I2C_GT911_ADDRESS
  357. #define TOUCH_CLOCK_HZ (400*1000)
  358. #define TOUCH_RST_ON_LEVEL 0
  359. #define TOUCH_INT_ON_LEVEL 0
  360. #define TOUCH_DC_BIT_OFFSET 0
  361. #define TOUCH_CMD_BITS 16
  362. #define TOUCH_PARAM_BITS 0
  363. #define TOUCH_DISABLE_CONTROL_PHASE
  364. #define SD_PIN_NUM_CLK 12
  365. #define SD_PIN_NUM_MISO 13
  366. #define SD_PIN_NUM_MOSI 11
  367. #define SD_PIN_NUM_CS 10
  368.  
  369. #endif // MATOUCH_ESP_DISPLAY_PARALLEL_4
  370.  
  371. #ifdef MATOUCH_ESP_DISPLAY_PARALLEL_43 // Works
  372. #ifdef PANEL_DEPENDENCIES
  373. // lib_deps = codewitch-honey-crisis/htcw_esp_lcd_touch_gt911
  374. #include "esp_lcd_touch_gt911.h"
  375. #endif
  376. #define LCD_PIN_NUM_DE 40
  377. #define LCD_PIN_NUM_VSYNC 41
  378. #define LCD_PIN_NUM_HSYNC 39
  379. #define LCD_PIN_NUM_CLK 42
  380. #define LCD_PIN_NUM_D00 8
  381. #define LCD_PIN_NUM_D01 2
  382. #define LCD_PIN_NUM_D02 46
  383. #define LCD_PIN_NUM_D03 9
  384. #define LCD_PIN_NUM_D04 1
  385. #define LCD_PIN_NUM_D05 5
  386. #define LCD_PIN_NUM_D06 6
  387. #define LCD_PIN_NUM_D07 7
  388. #define LCD_PIN_NUM_D08 15
  389. #define LCD_PIN_NUM_D09 16
  390. #define LCD_PIN_NUM_D10 4
  391. #define LCD_PIN_NUM_D11 45
  392. #define LCD_PIN_NUM_D12 48
  393. #define LCD_PIN_NUM_D13 47
  394. #define LCD_PIN_NUM_D14 21
  395. #define LCD_PIN_NUM_D15 14
  396. #define LCD_PIN_NUM_BCKL -1
  397. #define LCD_HSYNC_POLARITY 0
  398. #define LCD_HSYNC_FRONT_PORCH 8
  399. #define LCD_HSYNC_PULSE_WIDTH 4
  400. #define LCD_HSYNC_BACK_PORCH 8
  401. #define LCD_VSYNC_POLARITY 0
  402. #define LCD_VSYNC_FRONT_PORCH 8
  403. #define LCD_VSYNC_PULSE_WIDTH 4
  404. #define LCD_VSYNC_BACK_PORCH 8
  405. #define LCD_CLK_IDLE_HIGH 0
  406. #define LCD_DE_IDLE_HIGH 0
  407. #define LCD_BIT_DEPTH 16
  408. #define LCD_HRES 800
  409. #define LCD_VRES 480
  410. #define LCD_COLOR_SPACE LCD_COLOR_RGB
  411. #define LCD_SWAP_COLOR_BYTES true
  412. #define LCD_TRANSFER_IN_SPIRAM
  413. #ifdef CONFIG_SPIRAM_MODE_QUAD
  414.     #define LCD_CLOCK_HZ (6 * 1000 * 1000)
  415. #else
  416.     #define LCD_CLOCK_HZ (16 * 1000 * 1000)
  417. #endif
  418. #define TOUCH_I2C_HOST I2C_1
  419. #define TOUCH_PIN_NUM_SCL 18
  420. #define TOUCH_PIN_NUM_SDA 17
  421. #define TOUCH_PANEL esp_lcd_touch_new_i2c_gt911
  422. #define TOUCH_I2C_ADDR ESP_LCD_TOUCH_IO_I2C_GT911_ADDRESS
  423. #define TOUCH_CLOCK_HZ (400*1000)
  424. #define TOUCH_PIN_NUM_RST 38
  425. #define TOUCH_HRES 480
  426. #define TOUCH_VRES 272
  427. #define TOUCH_RST_ON_LEVEL 0
  428. #define TOUCH_INT_ON_LEVEL 0
  429. #define TOUCH_DC_BIT_OFFSET 0
  430. #define TOUCH_CMD_BITS 16
  431. #define TOUCH_PARAM_BITS 0
  432. #define TOUCH_DISABLE_CONTROL_PHASE
  433. #define SD_SPI_HOST SPI_3
  434. #define SD_PIN_NUM_CLK 12
  435. #define SD_PIN_NUM_MISO 13
  436. #define SD_PIN_NUM_MOSI 11
  437. #define SD_PIN_NUM_CS 10
  438. #endif // MATOUCH_ESP_DISPLAY_PARALLEL_43
  439.  
  440. #ifdef MATOUCH_ESP_DISPLAY_PARALLEL_7 // untested 1024x600 only (I gave mine away)
  441. // lib_deps = codewitch-honey-crisis/htcw_esp_lcd_touch_gt911
  442. #define LCD_BCKL_ON_LEVEL 0
  443. #define LCD_PIN_NUM_DE 40
  444. #define LCD_PIN_NUM_VSYNC 41
  445. #define LCD_PIN_NUM_HSYNC 39
  446. #define LCD_PIN_NUM_CLK 42
  447. #define LCD_PIN_NUM_D00 8
  448. #define LCD_PIN_NUM_D01 3
  449. #define LCD_PIN_NUM_D02 46
  450. #define LCD_PIN_NUM_D03 9
  451. #define LCD_PIN_NUM_D04 1
  452. #define LCD_PIN_NUM_D05 5
  453. #define LCD_PIN_NUM_D06 6
  454. #define LCD_PIN_NUM_D07 7
  455. #define LCD_PIN_NUM_D08 15
  456. #define LCD_PIN_NUM_D09 16
  457. #define LCD_PIN_NUM_D10 4
  458. #define LCD_PIN_NUM_D11 45
  459. #define LCD_PIN_NUM_D12 48
  460. #define LCD_PIN_NUM_D13 47
  461. #define LCD_PIN_NUM_D14 21
  462. #define LCD_PIN_NUM_D15 14
  463. #define LCD_PIN_NUM_BCKL 10
  464. #define LCD_HSYNC_POLARITY 1
  465. #define LCD_HSYNC_FRONT_PORCH 210
  466. #define LCD_HSYNC_PULSE_WIDTH 30
  467. #define LCD_HSYNC_BACK_PORCH 16
  468. #define LCD_VSYNC_POLARITY 0
  469. #define LCD_VSYNC_FRONT_PORCH 22
  470. #define LCD_VSYNC_PULSE_WIDTH 13
  471. #define LCD_VSYNC_BACK_PORCH 10
  472. #define LCD_CLK_IDLE_HIGH 1
  473. #define LCD_DE_IDLE_HIGH 0
  474. #define LCD_BIT_DEPTH 16
  475. #define LCD_HRES 1024
  476. #define LCD_VRES 600
  477. #define LCD_TRANSFER_IN_SPIRAM
  478. #define LCD_COLOR_SPACE LCD_COLOR_BGR
  479. #define LCD_SWAP_COLOR_BYTES false
  480. #ifdef CONFIG_SPIRAM_MODE_QUAD
  481.     #define LCD_CLOCK_HZ (6 * 1000 * 1000)
  482. #else
  483.     #define LCD_CLOCK_HZ (10 * 1000 * 1000)
  484. #endif
  485. #define TOUCH_I2C_HOST I2C_1
  486. #define TOUCH_PIN_NUM_SCL 18
  487. #define TOUCH_PIN_NUM_SDA 17
  488. #define TOUCH_PANEL esp_lcd_touch_new_i2c_gt911
  489. #define TOUCH_I2C_ADDR ESP_LCD_TOUCH_IO_I2C_GT911_ADDRESS
  490. #define TOUCH_CLOCK_HZ (400*1000)
  491. #define TOUCH_PIN_NUM_RST 38
  492. #define TOUCH_HRES 480
  493. #define TOUCH_VRES 272
  494. #define TOUCH_RST_ON_LEVEL 0
  495. #define TOUCH_INT_ON_LEVEL 0
  496. #define TOUCH_DC_BIT_OFFSET 0
  497. #define TOUCH_CMD_BITS 16
  498. #define TOUCH_PARAM_BITS 0
  499. #define TOUCH_DISABLE_CONTROL_PHASE
  500. #define SD_PIN_NUM_CMD 11
  501. #define SD_PIN_NUM_CLK 12
  502. #define SD_PIN_NUM_D00 13
  503. #define SD_CLOCK_HZ (40*1000)
  504. #endif // MATOUCH_ESP_DISPLAY_PARALLEL_7
  505.  
  506. #ifdef WAVESHARE_S3_43_DEVKIT // works, sometimes reboots on initting the touch controller
  507. #ifdef PANEL_DEPENDENCIES
  508. #include "esp_lcd_touch_gt911.h"
  509. #endif
  510. #define LCD_PIN_NUM_DE 5
  511. #define LCD_PIN_NUM_VSYNC 3
  512. #define LCD_PIN_NUM_HSYNC 46
  513. #define LCD_PIN_NUM_CLK 7
  514. #define LCD_PIN_NUM_D00 14
  515. #define LCD_PIN_NUM_D01 38
  516. #define LCD_PIN_NUM_D02 18
  517. #define LCD_PIN_NUM_D03 17
  518. #define LCD_PIN_NUM_D04 10
  519. #define LCD_PIN_NUM_D05 39
  520. #define LCD_PIN_NUM_D06 0
  521. #define LCD_PIN_NUM_D07 45
  522. #define LCD_PIN_NUM_D08 48
  523. #define LCD_PIN_NUM_D09 47
  524. #define LCD_PIN_NUM_D10 21
  525. #define LCD_PIN_NUM_D11 1
  526. #define LCD_PIN_NUM_D12 2
  527. #define LCD_PIN_NUM_D13 42
  528. #define LCD_PIN_NUM_D14 41
  529. #define LCD_PIN_NUM_D15 40
  530. #define LCD_PIN_NUM_BCKL -1
  531. #define LCD_HSYNC_POLARITY 0
  532. #define LCD_HSYNC_FRONT_PORCH 20
  533. #define LCD_HSYNC_PULSE_WIDTH 10
  534. #define LCD_HSYNC_BACK_PORCH 10
  535. #define LCD_VSYNC_POLARITY 0
  536. #define LCD_VSYNC_FRONT_PORCH 10
  537. #define LCD_VSYNC_PULSE_WIDTH 10
  538. #define LCD_VSYNC_BACK_PORCH 10
  539. #define LCD_CLK_IDLE_HIGH 0
  540. #define LCD_DE_IDLE_HIGH 0
  541. #define LCD_BIT_DEPTH 16
  542. #define LCD_HRES 800
  543. #define LCD_VRES 480
  544. #define LCD_COLOR_SPACE LCD_COLOR_RGB
  545. #define LCD_SWAP_COLOR_BYTES true
  546. #define LCD_TRANSFER_IN_SPIRAM
  547. #ifdef CONFIG_SPIRAM_MODE_QUAD
  548.     #define LCD_CLOCK_HZ (6 * 1000 * 1000)
  549. #else
  550.     #define LCD_CLOCK_HZ (14 * 1000 * 1000)
  551. #endif
  552. #define TOUCH_I2C_HOST I2C_1
  553. #define TOUCH_PIN_NUM_SCL           9
  554. #define TOUCH_PIN_NUM_SDA           8
  555. #define TOUCH_I2C_PULLUP 1
  556. #define TOUCH_PANEL esp_lcd_touch_new_i2c_gt911
  557. #define TOUCH_I2C_ADDR ESP_LCD_TOUCH_IO_I2C_GT911_ADDRESS
  558. #define TOUCH_CLOCK_HZ (400*1000)
  559. #define TOUCH_HRES LCD_HRES
  560. #define TOUCH_VRES LCD_VRES
  561. #define TOUCH_RST_ON_LEVEL 0
  562. #define TOUCH_INT_ON_LEVEL 0
  563. #define TOUCH_DC_BIT_OFFSET 0
  564. #define TOUCH_CMD_BITS 16
  565. #define TOUCH_PARAM_BITS 0
  566. #define TOUCH_DISABLE_CONTROL_PHASE
  567. #ifndef LEGACY_I2C
  568. #define TOUCH_RESET \
  569.     i2c_master_bus_handle_t bus; \
  570.     ESP_ERROR_CHECK(i2c_master_get_bus_handle((i2c_port_num_t)TOUCH_I2C_HOST,&bus)); \
  571.     i2c_master_dev_handle_t i2c=NULL; \
  572.     i2c_device_config_t dev_cfg; \
  573.     memset(&dev_cfg,0,sizeof(dev_cfg)); \
  574.     dev_cfg.scl_speed_hz = 200*1000; \
  575.     dev_cfg.device_address = 0x24; \
  576.     dev_cfg.dev_addr_length = I2C_ADDR_BIT_LEN_7; \
  577.     ESP_ERROR_CHECK(i2c_master_bus_add_device(bus, &dev_cfg,&i2c)); \
  578.     uint8_t write_buf = 0x01; \
  579.     ESP_ERROR_CHECK(i2c_master_transmit(i2c,&write_buf,1,1000 )); \
  580.     ESP_ERROR_CHECK(i2c_master_bus_rm_device(i2c)); \
  581.     dev_cfg.device_address = 0x38; \
  582.     ESP_ERROR_CHECK(i2c_master_bus_add_device(bus, &dev_cfg,&i2c)); \
  583.     write_buf = 0x2C; \
  584.     ESP_ERROR_CHECK(i2c_master_transmit(i2c,&write_buf,1,1000 )); \
  585.     esp_rom_delay_us(100 * 1000); \
  586.     gpio_set_level((gpio_num_t)4, 0); \
  587.     esp_rom_delay_us(100 * 1000); \
  588.     write_buf = 0x2E; \
  589.     ESP_ERROR_CHECK(i2c_master_transmit(i2c,&write_buf,1,1000 )); \
  590.     esp_rom_delay_us(200 * 1000); \
  591.     ESP_ERROR_CHECK(i2c_master_bus_rm_device(i2c))
  592. #else
  593. #define TOUCH_RESET \
  594.     uint8_t write_buf = 0x01;\
  595.     ESP_ERROR_CHECK(i2c_master_write_to_device((i2c_port_t)TOUCH_I2C_HOST,0x24,&write_buf,1,portMAX_DELAY));\
  596.     write_buf = 0x2c;\
  597.     ESP_ERROR_CHECK(i2c_master_write_to_device((i2c_port_t)TOUCH_I2C_HOST,0x38,&write_buf,1,portMAX_DELAY));\
  598.     esp_rom_delay_us(100 * 1000);\
  599.     gpio_set_level((gpio_num_t)4, 0);\
  600.     write_buf = 0x2E;\
  601.     ESP_ERROR_CHECK(i2c_master_write_to_device((i2c_port_t)TOUCH_I2C_HOST,0x38,&write_buf,1,portMAX_DELAY));\
  602.     esp_rom_delay_us(200 * 1000)
  603. #endif
  604. #define SD_SPI_HOST SPI_3
  605. #define SD_PIN_NUM_CS 4
  606. #define SD_PIN_NUM_MOSI 11    // SD card master output slave input pin
  607. #define SD_PIN_NUM_CLK  12    // SD card clock pin
  608. #define SD_PIN_NUM_MISO 13    // SD card master input slave output pin
  609. #endif // WAVESHARE_S3_43_DEVKIT
  610.  
  611. #ifdef WAVESHARE_P4_SMART86BOX // Works
  612. #ifdef PANEL_DEPENDENCIES
  613. // lib_deps = codewitch-honey-crisis/htcw_esp_lcd_st7703
  614. //    codewitch-honey-crisis/htcw_esp_lcd_touch_gt911
  615. #include "esp_lcd_st7703.h"
  616. #include "esp_lcd_touch_gt911.h"
  617. #endif
  618. #define LCD_TRANSFER_IN_SPIRAM
  619. #define LCD_BCKL_ON_LEVEL 0
  620. #define LCD_HRES 720
  621. #define LCD_VRES 720
  622. #define LCD_HSYNC_FRONT_PORCH 80
  623. #define LCD_HSYNC_PULSE_WIDTH 20
  624. #define LCD_HSYNC_BACK_PORCH 80
  625. #define LCD_VSYNC_FRONT_PORCH 30
  626. #define LCD_VSYNC_PULSE_WIDTH 4
  627. #define LCD_VSYNC_BACK_PORCH 12
  628. #define LCD_BIT_DEPTH 16
  629. #define LCD_MIPI_DMA2D
  630. #define LCD_PANEL esp_lcd_new_panel_st7703
  631. #define LCD_DATA_ENDIAN_LITTLE
  632. #define LCD_MIPI_DSI_PHY_PWR_LDO_CHAN (3)
  633. #define LCD_MIPI_DSI_PHY_PWR_LDO_VOLTAGE_MV (2500)
  634. #define LCD_VENDOR_CONFIG \
  635. st7703_vendor_config_t vendor_config = { \
  636.     .mipi_config = { \
  637.         .dsi_bus = mipi_dsi_bus, \
  638.         .dpi_config = &dpi_config, \
  639.     }, \
  640.     .flags = { \
  641.         .use_mipi_interface = 1, \
  642.     }, \
  643. }
  644. #define LCD_PIN_NUM_RST 27
  645. #define LCD_PIN_NUM_BCKL 26
  646. #define LCD_PHY_PWR_LDO_CHAN
  647. #define LCD_CLOCK_HZ (46 * 1000 * 1000)
  648. #define TOUCH_I2C_HOST I2C_1
  649. #define TOUCH_PIN_NUM_SDA 7
  650. #define TOUCH_PIN_NUM_SCL 8
  651. #define TOUCH_CLOCK_HZ (100*1000)
  652. #define TOUCH_PANEL esp_lcd_touch_new_i2c_gt911
  653. #define TOUCH_RST_ON_LEVEL 0
  654. #define TOUCH_INT_ON_LEVEL 0
  655. #define TOUCH_DC_BIT_OFFSET 0
  656. #define TOUCH_CMD_BITS 16
  657. #define TOUCH_PARAM_BITS 0
  658. #define TOUCH_DISABLE_CONTROL_PHASE
  659. #define TOUCH_I2C_ADDR ESP_LCD_TOUCH_IO_I2C_GT911_ADDRESS
  660. #endif // WAVESHARE_P4_SMART86BOX
  661.  
  662. #ifdef HELTEC_WIFI_LORA_KIT_V2 // should work. the display broke on mine though
  663. #define LCD_I2C_HOST    I2C_1
  664. #define LCD_I2C_ADDR 0x3C
  665. #define LCD_CONTROL_PHASE_BYTES 1
  666. #define LCD_DC_BIT_OFFSET 6
  667. #define LCD_BIT_DEPTH 1
  668. #define LCD_PIN_NUM_SCL 15
  669. #define LCD_PIN_NUM_SDA 4
  670. #define LCD_PIN_NUM_RST 16
  671. #define LCD_PANEL esp_lcd_new_panel_ssd1306
  672. #define LCD_HRES 128
  673. #define LCD_VRES 64
  674. #define LCD_COLOR_SPACE LCD_COLOR_GSC
  675. #define LCD_CLOCK_HZ (400 * 1000)
  676. #define LCD_GAP_X 0
  677. #define LCD_GAP_Y 0
  678. #define LCD_INVERT_COLOR false
  679. #define LCD_SWAP_XY false
  680. #define LCD_MIRROR_X true
  681. #define LCD_MIRROR_Y true
  682. #define LCD_INVERT_COLOR false
  683. #define LCD_SWAP_XY false
  684. #define LCD_DIVISOR 1
  685. #define LCD_Y_ALIGN 8
  686. #define LCD_VENDOR_CONFIG esp_lcd_panel_ssd1306_config_t vendor_config = {\
  687.     .height = LCD_VRES,\
  688. };
  689. #define LCD_TRANSLATE static uint8_t ssd1306_buffer[LCD_TRANSFER_SIZE];\
  690.      int src_width = x2 - x1 + 1;\
  691.      int dst_width = src_width;\
  692.      int dst_height_pages = (y2 - y1 + 1) >> 3;  /* Height in pages (8-pixel groups) */\
  693.      \
  694.      for (int page = 0; page < dst_height_pages; page++) {\
  695.         for (int x = 0; x < dst_width; x++) {\
  696.             uint8_t dst_byte = 0;\
  697.             for (int bit = 0; bit < 8; bit++) {\
  698.                 /* Calculate source bit position */\
  699.                 int src_y = page * 8 + bit;\
  700.                 int total_bit_offset = src_y * src_width + x;\
  701.                 int src_byte_index = total_bit_offset >> 3;\
  702.                 int src_bit = 7 - (total_bit_offset & 7);\
  703.                 \
  704.                 if (((uint8_t*)bitmap)[src_byte_index] & (1 << src_bit)) {\
  705.                     dst_byte |= (1 << bit);\
  706.                 }\
  707.             }\
  708.             ssd1306_buffer[page * dst_width + x] = dst_byte;\
  709.         }\
  710.      }\
  711.      bitmap = ssd1306_buffer;
  712. #endif // HELTEC_WIFI_LORA_KIT_V2
  713.  
  714. #ifdef FREENOVE_S3_DEVKIT // Works (This is their full development kit with the integrated display, not just the s3 devkit)
  715. #ifdef PANEL_DEPENDENCIES
  716. // lib_deps = codewitch-honey-crisis/htcw_esp_lcd_touch_ft6x36
  717. #include "esp_lcd_touch_ft6x36.h"
  718. #endif
  719. #define LCD_SPI_HOST SPI_3
  720. #define LCD_PIN_NUM_DC 0
  721. #define LCD_PIN_NUM_CS 47
  722. #define LCD_PIN_NUM_MOSI 20
  723. #define LCD_PIN_NUM_CLK 21
  724. #define LCD_HRES 240
  725. #define LCD_VRES 320
  726. #define LCD_COLOR_SPACE LCD_COLOR_RGB
  727. #define LCD_CLOCK_HZ (80 * 1000 * 1000)
  728. #define LCD_MIRROR_X true
  729. #define LCD_MIRROR_Y false
  730. #define LCD_PANEL esp_lcd_new_panel_st7789
  731. #define LCD_INVERT_COLOR false
  732. #define LCD_SWAP_XY true
  733. #define TOUCH_I2C_HOST I2C_1
  734. #define TOUCH_I2C_PULLUP 1
  735. #define TOUCH_PIN_NUM_SCL 1
  736. #define TOUCH_PIN_NUM_SDA 2
  737. #define TOUCH_PANEL esp_lcd_touch_new_i2c_ft6x36
  738. #define TOUCH_I2C_ADDR ESP_LCD_TOUCH_IO_I2C_FT6x36_ADDRESS
  739. #define TOUCH_UPDATE_LIMIT_MS 13
  740. #define TOUCH_CMD_BITS 8
  741. #define TOUCH_PARAM_BITS 0
  742. #define TOUCH_DISABLE_CONTROL_PHASE
  743. #define TOUCH_CLOCK_HZ (200*1000)
  744. #define TOUCH_PIN_NUM_RST -1
  745. #define SD_PIN_NUM_D00 40
  746. #define SD_PIN_NUM_CMD 38
  747. #define SD_PIN_NUM_CLK 39
  748. #define SD_CLOCK_HZ (40*1000)
  749. #endif // FREENOVE_S3_DEVKIT
  750.  
  751. // END devices
  752.  
  753. #endif // PANELS_H
Advertisement
Add Comment
Please, Sign In to add comment