Skip to content

Commit c7531f7

Browse files
authored
fix init sequence, remove auto brightness setting
The auto brightness setting caused a slow refresh rate below 1 Hz and a pixel noise error of one pixel height below the display. Removing this line fixed this issue. Further the init sequence from the Adafruit Feather esp32s3 tft was copied over with _MADCTL 0x36, 1, 0x68 and adjusted column and row start. The rotation is now 0 so the display is refreshed from top to bottom.
1 parent 2fd974e commit c7531f7

File tree

1 file changed

+6
-6
lines changed
  • ports/raspberrypi/boards/lilygo_t_display_rp2040

1 file changed

+6
-6
lines changed

ports/raspberrypi/boards/lilygo_t_display_rp2040/board.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ uint8_t display_init_sequence[] = {
4242
// normal display mode on
4343
0x13, 0,
4444
// display and color format settings
45-
0x36, 1, 0x08,
45+
0x36, 1, 0x68,
4646
0xB6, 2, 0x0A, 0x82,
4747
0x3A, 1 | DELAY, 0x55, 10,
4848
// ST7789V frame rate setting
@@ -99,9 +99,9 @@ static void display_init(void) {
9999
bus,
100100
240, // width (after rotation)
101101
135, // height (after rotation)
102-
53, // column start
103-
40, // row start
104-
90, // rotation
102+
40, // column start
103+
53, // row start
104+
0, // rotation
105105
16, // color depth
106106
false, // grayscale
107107
false, // pixels in a byte share a row. Only valid for depths < 8
@@ -116,13 +116,13 @@ static void display_init(void) {
116116
&pin_GPIO4, // backlight pin
117117
NO_BRIGHTNESS_COMMAND,
118118
1.0f, // brightness (ignored)
119-
false, // auto_brightness
120119
false, // single_byte_bounds
121120
false, // data_as_commands
122121
true, // auto_refresh
123122
60, // native_frames_per_second
124123
true, // backlight_on_high
125-
false // SH1107_addressing
124+
false, // SH1107_addressing
125+
50000 // backlight pwm frequency
126126
);
127127

128128
common_hal_never_reset_pin(&pin_GPIO4); // backlight pin

0 commit comments

Comments
 (0)