Add mirror (x/y) and inverse video (black<->white) options to the ST7565 LCD driver. From Pierre-noel Bouteville.

This commit is contained in:
Gregory Nutt 2014-11-15 06:43:12 -06:00
parent 64d18bfe12
commit 8d00912207
2 changed files with 40 additions and 3 deletions

View File

@ -369,6 +369,24 @@ config ST7565_YRES
---help--- ---help---
Specifies the Y resolution of the LCD. 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 endif # LCD_ST7565
config LCD_ST7567 config LCD_ST7567

View File

@ -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); (void)st7565_send_one_data(priv, ST7565_EXIT_SOFTRST);
/* Follow NHDC12864KGZ DISPLAY INITIALIZATION... */ /* Follow NHD-C12864KGZ DISPLAY INITIALIZATION... */
#ifdef CONFIG_NHD_C12864KGZ #ifdef CONFIG_NHD_C12864KGZ
(void)st7565_send_one_data(priv, ST7565_BIAS_1_9); (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_REG_RES_5_5);
(void)st7565_send_one_data(priv, ST7565_SETEVMODE); (void)st7565_send_one_data(priv, ST7565_SETEVMODE);
(void)st7565_send_one_data(priv, ST7565_SETEVREG(15)); (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_POWERCTRL_INT);
(void)st7565_send_one_data(priv, ST7565_SETSTARTLINE); (void)st7565_send_one_data(priv, ST7565_SETSTARTLINE);
#else #else
# error "No initialization sequence selected" # error "No initialization sequence selected"
#endif #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); (void)st7565_send_one_data(priv, ST7565_DISPRAM);
#endif #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 */ /* Let go of the SPI lock and de-select the device */
st7565_deselect(priv); st7565_deselect(priv);