Moving to a general flag for x-axis mirroring in MDxx380 display driver

replace/719413b8e3ca6a14b5a7b916e4677a9be93b6287
Silvano Seva 2020-11-13 16:32:57 +01:00
rodzic e0b6be353b
commit 9458fd252b
2 zmienionych plików z 8 dodań i 5 usunięć

Wyświetl plik

@ -282,8 +282,8 @@ void display_init()
/** The registers and commands below are the same in HX8353-E controller **/
/*
* Configuring screen's memory access control: TYT MD390 has the screen
* rotated by 90° degrees, so we have to exgange row and coloumn indexing.
* Configuring screen's memory access control: TYT MD3x0 radios have the screen
* rotated by 90° degrees, so we have to exchange row and coloumn indexing.
* Moreover, we need to invert the vertical updating order to avoid painting
* an image from bottom to top (that is, horizontally mirrored).
* For reference see, in HX8353-E datasheet, MADCTL description at page 149
@ -299,10 +299,10 @@ void display_init()
* - bit 1 and 0: don't care
*/
writeCmd(CMD_MADCTL);
#ifndef PLATFORM_MD380
writeData(0x60); /* MD390 */
#ifndef DISPLAY_MIRROR_X
writeData(0x60); /* MD390 and similar radios: screen "normal" */
#else
writeData(0xA0); /* MD380 */
writeData(0xA0); /* MD380 and similar radios: screen mirrored */
#endif
writeCmd(CMD_CASET);

Wyświetl plik

@ -28,6 +28,9 @@
#define SCREEN_WIDTH 160
#define SCREEN_HEIGHT 128
/* Screen needs x-axis mirroring */
#define DISPLAY_MIRROR_X
/* Display */
#define LCD_D0 GPIOD,14
#define LCD_D1 GPIOD,15