Fix horizontal mirroring for ILI9488 display by updating MADCTL settings and resetting rotation to 0
This commit is contained in:
@@ -10,6 +10,15 @@ esphome:
|
|||||||
then:
|
then:
|
||||||
- light.turn_on: backlight
|
- light.turn_on: backlight
|
||||||
- delay: 300ms
|
- delay: 300ms
|
||||||
|
- lambda: |-
|
||||||
|
// Override MADCTL to 0x48: MX=1, BGR=1 — fixes horizontal mirror
|
||||||
|
// DC pin (GPIO2) is regular GPIO; use SPIDevice for CS/data
|
||||||
|
digitalWrite(2, LOW); // DC = command
|
||||||
|
id(my_display)->enable(); // assert CS
|
||||||
|
id(my_display)->transfer(0x36); // MADCTL command
|
||||||
|
digitalWrite(2, HIGH); // DC = data
|
||||||
|
id(my_display)->transfer(0x48); // MX=1, BGR=1
|
||||||
|
id(my_display)->disable(); // deassert CS
|
||||||
- component.update: my_display
|
- component.update: my_display
|
||||||
|
|
||||||
esp32:
|
esp32:
|
||||||
@@ -64,7 +73,7 @@ display:
|
|||||||
cs_pin: GPIO15
|
cs_pin: GPIO15
|
||||||
dc_pin: GPIO2
|
dc_pin: GPIO2
|
||||||
reset_pin: GPIO4
|
reset_pin: GPIO4
|
||||||
rotation: 180
|
rotation: 0
|
||||||
invert_colors: false
|
invert_colors: false
|
||||||
color_order: bgr
|
color_order: bgr
|
||||||
data_rate: 10MHz
|
data_rate: 10MHz
|
||||||
|
|||||||
Reference in New Issue
Block a user