File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -804,6 +804,7 @@ elseif(TARGET_DEVICE STREQUAL "MOY-UNK") # P8b mirrored
804804 add_definitions (-DCLOCK_CONFIG_LF_SRC=0) # RC
805805 add_definitions (-DMYNEWT_VAL_BLE_LL_SCA=500)
806806 add_definitions (-DCLOCK_CONFIG_LF_CAL_ENABLED=1)
807+ add_definitions (-DDRIVER_DISPLAY_MIRROR)
807808else ()
808809 message (FATAL_ERROR "Invalid TARGET_DEVICE" )
809810endif ()
Original file line number Diff line number Diff line change @@ -21,7 +21,10 @@ void St7789::Init() {
2121 MemoryDataAccessControl ();
2222 ColumnAddressSet ();
2323 RowAddressSet ();
24+ // P8B Mirrored version does not need display inversion.
25+ #ifndef DRIVER_DISPLAY_MIRROR
2426 DisplayInversionOn ();
27+ #endif
2528 NormalModeOn ();
2629 SetVdv ();
2730 DisplayOn ();
@@ -62,7 +65,18 @@ void St7789::ColMod() {
6265
6366void St7789::MemoryDataAccessControl () {
6467 WriteCommand (static_cast <uint8_t >(Commands::MemoryDataAccessControl));
68+ #ifdef DRIVER_DISPLAY_MIRROR
69+ // [7] = MY = Page Address Order, 0 = Top to bottom, 1 = Bottom to top
70+ // [6] = MX = Column Address Order, 0 = Left to right, 1 = Right to left
71+ // [5] = MV = Page/Column Order, 0 = Normal mode, 1 = Reverse mode
72+ // [4] = ML = Line Address Order, 0 = LCD refresh from top to bottom, 1 = Bottom to top
73+ // [3] = RGB = RGB/BGR Order, 0 = RGB, 1 = BGR
74+ // [2] = MH = Display Data Latch Order, 0 = LCD refresh from left to right, 1 = Right to left
75+ // [0 .. 1] = Unused
76+ WriteData (0b01000000 );
77+ #else
6578 WriteData (0x00 );
79+ #endif
6680}
6781
6882void St7789::ColumnAddressSet () {
You can’t perform that action at this time.
0 commit comments