Moving to a general flag for x-axis mirroring in MDxx380 display driver
This commit is contained in:
parent
e0b6be353b
commit
9458fd252b
|
|
@ -282,8 +282,8 @@ void display_init()
|
||||||
/** The registers and commands below are the same in HX8353-E controller **/
|
/** The registers and commands below are the same in HX8353-E controller **/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Configuring screen's memory access control: TYT MD390 has the screen
|
* Configuring screen's memory access control: TYT MD3x0 radios have the screen
|
||||||
* rotated by 90° degrees, so we have to exgange row and coloumn indexing.
|
* 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
|
* Moreover, we need to invert the vertical updating order to avoid painting
|
||||||
* an image from bottom to top (that is, horizontally mirrored).
|
* an image from bottom to top (that is, horizontally mirrored).
|
||||||
* For reference see, in HX8353-E datasheet, MADCTL description at page 149
|
* 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
|
* - bit 1 and 0: don't care
|
||||||
*/
|
*/
|
||||||
writeCmd(CMD_MADCTL);
|
writeCmd(CMD_MADCTL);
|
||||||
#ifndef PLATFORM_MD380
|
#ifndef DISPLAY_MIRROR_X
|
||||||
writeData(0x60); /* MD390 */
|
writeData(0x60); /* MD390 and similar radios: screen "normal" */
|
||||||
#else
|
#else
|
||||||
writeData(0xA0); /* MD380 */
|
writeData(0xA0); /* MD380 and similar radios: screen mirrored */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
writeCmd(CMD_CASET);
|
writeCmd(CMD_CASET);
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,9 @@
|
||||||
#define SCREEN_WIDTH 160
|
#define SCREEN_WIDTH 160
|
||||||
#define SCREEN_HEIGHT 128
|
#define SCREEN_HEIGHT 128
|
||||||
|
|
||||||
|
/* Screen needs x-axis mirroring */
|
||||||
|
#define DISPLAY_MIRROR_X
|
||||||
|
|
||||||
/* Display */
|
/* Display */
|
||||||
#define LCD_D0 GPIOD,14
|
#define LCD_D0 GPIOD,14
|
||||||
#define LCD_D1 GPIOD,15
|
#define LCD_D1 GPIOD,15
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue