diff --git a/drivers/lcd/Kconfig b/drivers/lcd/Kconfig index 666d7e71205..4a364c8755b 100644 --- a/drivers/lcd/Kconfig +++ b/drivers/lcd/Kconfig @@ -369,6 +369,24 @@ config ST7565_YRES ---help--- Specifies the Y resolution of the LCD. +config ST7565_MIRROR_X + bool "ST7565 apply mirror on X" + default n + ---help--- + Mirror X on LCD. + +config ST7565_MIRROR_Y + bool "ST7565 apply mirror on Y" + default n + ---help--- + Mirror Y on LCD. + +config ST7565_INVERSE_VIDEO + bool "ST7565 Inverse video" + default n + ---help--- + Inverse video on LCD. + endif # LCD_ST7565 config LCD_ST7567 diff --git a/drivers/lcd/st7565.c b/drivers/lcd/st7565.c index 87308181dde..592c39d3aed 100644 --- a/drivers/lcd/st7565.c +++ b/drivers/lcd/st7565.c @@ -1013,17 +1013,18 @@ FAR struct lcd_dev_s *st7565_initialize(FAR struct st7565_lcd_s *lcd, (void)st7565_send_one_data(priv, ST7565_EXIT_SOFTRST); - /* Follow NHD‐C12864KGZ DISPLAY INITIALIZATION... */ + /* Follow NHD-C12864KGZ DISPLAY INITIALIZATION... */ #ifdef CONFIG_NHD_C12864KGZ + (void)st7565_send_one_data(priv, ST7565_BIAS_1_9); - (void)st7565_send_one_data(priv, ST7565_ADCNORMAL); - (void)st7565_send_one_data(priv, ST7565_SETCOMNORMAL); + (void)st7565_send_one_data(priv, ST7565_REG_RES_5_5); (void)st7565_send_one_data(priv, ST7565_SETEVMODE); (void)st7565_send_one_data(priv, ST7565_SETEVREG(15)); (void)st7565_send_one_data(priv, ST7565_POWERCTRL_INT); (void)st7565_send_one_data(priv, ST7565_SETSTARTLINE); + #else # error "No initialization sequence selected" #endif @@ -1043,6 +1044,24 @@ FAR struct lcd_dev_s *st7565_initialize(FAR struct st7565_lcd_s *lcd, (void)st7565_send_one_data(priv, ST7565_DISPRAM); #endif +#ifdef CONFIG_ST7565_MIRROR_X + (void)st7565_send_one_data(priv, ST7565_ADCINVERSE); +#else + (void)st7565_send_one_data(priv, ST7565_ADCNORMAL); +#endif + +#ifdef CONFIG_ST7565_MIRROR_Y + (void)st7565_send_one_data(priv, ST7565_SETCOMREVERSE); +#else + (void)st7565_send_one_data(priv, ST7565_SETCOMNORMAL); +#endif + +#ifdef CONFIG_ST7565_INVERSE_VIDEO + (void)st7565_send_one_data(priv, ST7565_DISPINVERSE); +#else + (void)st7565_send_one_data(priv, ST7565_DISPNORMAL); +#endif + /* Let go of the SPI lock and de-select the device */ st7565_deselect(priv);