From: asterix Date: Tue, 20 May 2008 15:52:20 +0000 (+0000) Subject: Add lcd_hd44 test module. X-Git-Tag: 2.0.0~632 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=8d1c9a89e29527488e2456e29f56f14310c09c08;p=bertos.git Add lcd_hd44 test module. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1302 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/drv/lcd_hd44_test.c b/bertos/drv/lcd_hd44_test.c new file mode 100644 index 00000000..412e43e9 --- /dev/null +++ b/bertos/drv/lcd_hd44_test.c @@ -0,0 +1,88 @@ +/** + * \file + * + * + * \brief LM044L type LCD hardware module (impl.) + * + * \version $Id$ + * \author Bernardo Innocenti + * \author Stefano Fedrigo + */ + +#include + +#include + +#include +#include + +void lcd_hw_test(void) +{ + lcd_regWrite(LCD_CMD_SET_DDRAMADDR | 3); + timer_delay(1); + kprintf("3 -> %02X\n", lcd_regRead()); + timer_delay(1); + + for (int i = 0; i < 10; i++) + { + lcd_dataWrite('c'); + timer_delay(1); + kprintf("addr = %02X\n", lcd_regRead()); + timer_delay(1); + } + + lcd_regWrite(LCD_CMD_SET_DDRAMADDR | 0x4a); + timer_delay(1); + kprintf("4A -> %02X\n", lcd_regRead()); + timer_delay(1); + + lcd_regWrite(LCD_CMD_SET_DDRAMADDR | 0x52); + timer_delay(1); + kprintf("52 -> %02X\n", lcd_regRead()); + timer_delay(1); + + lcd_regWrite(LCD_CMD_SET_DDRAMADDR | 0x1F); + timer_delay(1); + kprintf("1F -> %02X\n", lcd_regRead()); + timer_delay(1); +} + + +int main(void) +{ + lcd_hw_test(); + + for(;;) + { + } + + return 0; +}