honey_the_codewitch

htcw_esp_panel device definitions

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