mirror of
https://github.com/apache/nuttx.git
synced 2026-05-20 12:33:27 +08:00
drivers/lcd/st7565.c: Extend to include support for the AQM_1248A
This commit is contained in:
@@ -48,6 +48,7 @@ config LCD_NOGETRUN
|
||||
|
||||
config LCD_MAXCONTRAST
|
||||
int "LCD maximum contrast"
|
||||
default 31 if AQM_1248A
|
||||
default 63 if NOKIA6100_S1D15G10 || LCD_SHARP_MEMLCD
|
||||
default 127 if NOKIA6100_PCF8833
|
||||
default 255 if LCD_P14201 || LCD_LCD1602
|
||||
@@ -596,6 +597,9 @@ config NHD_C12864KGZ
|
||||
config ERC_12864_3
|
||||
bool "like ERC12864-3"
|
||||
|
||||
config AQM_1248A
|
||||
bool "like AQM1248A"
|
||||
|
||||
endchoice
|
||||
|
||||
config ST7565_NINTERFACES
|
||||
@@ -613,6 +617,7 @@ config ST7565_XRES
|
||||
|
||||
config ST7565_YRES
|
||||
int "ST7565 Y Resolution"
|
||||
default 48 if AQM_1248A
|
||||
default 64
|
||||
---help---
|
||||
Specifies the Y resolution of the LCD.
|
||||
@@ -625,6 +630,7 @@ config ST7565_MIRROR_X
|
||||
|
||||
config ST7565_MIRROR_Y
|
||||
bool "ST7565 apply mirror on Y"
|
||||
default y if AQM_1248A
|
||||
default n
|
||||
---help---
|
||||
Mirror Y on LCD.
|
||||
|
||||
@@ -1030,6 +1030,27 @@ FAR struct lcd_dev_s *st7565_initialize(FAR struct st7565_lcd_s *lcd,
|
||||
(void)st7565_send_one_data(priv, ST7565_SETEVREG(0x24));
|
||||
(void)st7565_send_one_data(priv, ST7565_SETSTARTLINE);
|
||||
|
||||
#elif defined(CONFIG_AQM_1248A)
|
||||
|
||||
(void)st7565_send_one_data(priv, ST7565_DISPOFF);
|
||||
(void)st7565_send_one_data(priv, ST7565_ADCNORMAL);
|
||||
(void)st7565_send_one_data(priv, ST7565_SETCOMREVERSE);
|
||||
(void)st7565_send_one_data(priv, ST7565_BIAS_1_7);
|
||||
|
||||
(void)st7565_send_one_data(priv, ST7565_POWERCTRL_B);
|
||||
up_mdelay(2);
|
||||
(void)st7565_send_one_data(priv, ST7565_POWERCTRL_BR);
|
||||
up_mdelay(2);
|
||||
(void)st7565_send_one_data(priv, ST7565_POWERCTRL_BRF);
|
||||
|
||||
(void)st7565_send_one_data(priv, ST7565_REG_RES_4_5);
|
||||
(void)st7565_send_one_data(priv, ST7565_SETEVMODE);
|
||||
(void)st7565_send_one_data(priv, ST7565_SETEVREG(0x1c));
|
||||
(void)st7565_send_one_data(priv, ST7565_DISPRAM);
|
||||
(void)st7565_send_one_data(priv, ST7565_SETSTARTLINE);
|
||||
(void)st7565_send_one_data(priv, ST7565_DISPNORMAL);
|
||||
(void)st7565_send_one_data(priv, ST7565_DISPON);
|
||||
|
||||
#else
|
||||
# error "No initialization sequence selected"
|
||||
#endif
|
||||
|
||||
@@ -100,6 +100,10 @@
|
||||
#define ST7565_POWERCTRL_VR 0x2b /* 0x2b: Only the voltage regulator circuit and the
|
||||
* voltage follower circuit are used
|
||||
*/
|
||||
#define ST7565_POWERCTRL_B 0x2c /* 0x2c: Booster=ON */
|
||||
#define ST7565_POWERCTRL_BR 0x2e /* 0x2e: Booster=ON V/R=ON */
|
||||
#define ST7565_POWERCTRL_BRF 0x2f /* 0x23: Booster=ON V/R=ON V/F=ON */
|
||||
|
||||
#define ST7565_POWERCTRL_INT 0x2f /* 0x2f: Only the internal power supply is used */
|
||||
|
||||
/* Regulation Resistior ratio V0 = (1+Rb/Ra)*Vev */
|
||||
|
||||
Reference in New Issue
Block a user