roo_display
API Documentation for roo_display
Loading...
Searching...
No Matches
esp32s3_parallel_ips_capacitive.cpp
Go to the documentation of this file.
1
3
4#if defined(ESP_PLATFORM) && CONFIG_IDF_TARGET_ESP32S3
5
7
9
10namespace {
11constexpr esp32s3_dma::Config kTftConfig800x480 = {.width = 800,
12 .height = 480,
13 .de = 40,
14 .hsync = 39,
15 .vsync = 41,
16 .pclk = 42,
17
18 .hsync_pulse_width = 4,
19 .hsync_back_porch = 16,
20 .hsync_front_porch = 80,
21 .hsync_polarity = 0,
22 .vsync_pulse_width = 4,
23 .vsync_back_porch = 4,
24 .vsync_front_porch = 22,
25 .vsync_polarity = 0,
26 .pclk_active_neg = 1,
27 .prefer_speed = -1,
28
29 .r0 = 45,
30 .r1 = 48,
31 .r2 = 47,
32 .r3 = 21,
33 .r4 = 14,
34 .g0 = 5,
35 .g1 = 6,
36 .g2 = 7,
37 .g3 = 15,
38 .g4 = 16,
39 .g5 = 4,
40 .b0 = 8,
41 .b1 = 3,
42 .b2 = 46,
43 .b3 = 9,
44 .b4 = 1,
45 .bswap = false};
46
47constexpr esp32s3_dma::Config kTftConfig1024x600 = {.width = 1024,
48 .height = 600,
49 .de = 40,
50 .hsync = 39,
51 .vsync = 41,
52 .pclk = 42,
53
54 .hsync_pulse_width = 4,
55 .hsync_back_porch = 16,
56 .hsync_front_porch = 80,
57 .hsync_polarity = 0,
58 .vsync_pulse_width = 4,
59 .vsync_back_porch = 4,
60 .vsync_front_porch = 22,
61 .vsync_polarity = 0,
62 .pclk_active_neg = 1,
63 .prefer_speed = -1,
64
65 .r0 = 45,
66 .r1 = 48,
67 .r2 = 47,
68 .r3 = 21,
69 .r4 = 14,
70 .g0 = 5,
71 .g1 = 6,
72 .g2 = 7,
73 .g3 = 15,
74 .g4 = 16,
75 .g5 = 4,
76 .b0 = 8,
77 .b1 = 3,
78 .b2 = 46,
79 .b3 = 9,
80 .b4 = 1,
81 .bswap = false};
82} // namespace
83
84Esp32s3ParallelIpsCapacitive::Esp32s3ParallelIpsCapacitive(
85 Resolution resolution, Orientation orientation, I2cMasterBusHandle i2c)
86 : resolution_(resolution),
87 i2c_(std::move(i2c)),
88 display_(resolution_ == k800x480 ? kTftConfig800x480
89 : kTftConfig1024x600),
90 // Note: UART 'nack' errors have been observed when reset hold down time
91 // is below 300ms. This startup delay isn't very painful because the
92 // driver performs reset asynchronously.
93 touch_(i2c_, -1, 38, 300) {
94 display_.setOrientation(orientation);
95}
96
97TouchCalibration Esp32s3ParallelIpsCapacitive::touch_calibration() {
98 return resolution_ == k800x480
99 ? TouchCalibration(0, 0, 800, 480)
100 : TouchCalibration(0, 0, 1024,
101 768); // Yes, 768 is the correct value.
102}
103
104} // namespace roo_display::products::makerfabs
105
106#endif // defined(ESP_PLATFORM) && CONFIG_IDF_TARGET_ESP32S3