mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
LCD:jhd1313m1:HD44780 Adding workaround of errata on init
HD44780 fails to initialize unsuccessfully without the workaround. Adding workaround based on HD77480 datasheet for initialization and software reset. Signed-off-by: Akira Tsukamoto <akira.tsukamoto@linaro.org> Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
This commit is contained in:
parent
33e2c03b48
commit
25c0f8ebb1
@ -46,13 +46,19 @@ Jhd1313m1::Jhd1313m1(int bus, int lcdAddress, int rgbAddress)
|
||||
": I2c.address() failed");
|
||||
}
|
||||
|
||||
/* HD44780 requires writing three times to initialize or reset
|
||||
according to the hardware errata on page 45 figure 23 of
|
||||
the Hitachi HD44780 datasheet */
|
||||
/* First try */
|
||||
usleep(50000);
|
||||
ret = command(LCD_FUNCTIONSET | LCD_2LINE);
|
||||
|
||||
if (!ret) {
|
||||
ret = command(LCD_FUNCTIONSET | LCD_2LINE);
|
||||
UPM_CHECK_MRAA_SUCCESS(ret, "Unable to initialise the LCD controller");
|
||||
}
|
||||
ret = command(LCD_FUNCTIONSET | LCD_8BITMODE);
|
||||
/* Second try */
|
||||
usleep(4500);
|
||||
ret = command(LCD_FUNCTIONSET | LCD_8BITMODE);
|
||||
/* Third try */
|
||||
usleep(150);
|
||||
ret = command(LCD_FUNCTIONSET | LCD_8BITMODE);
|
||||
UPM_CHECK_MRAA_SUCCESS(ret, "Unable to initialise the LCD controller");
|
||||
|
||||
usleep(100);
|
||||
ret = displayOn();
|
||||
|
Loading…
x
Reference in New Issue
Block a user