summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-11-12 18:51:03 -0800
committerKeith Packard <keithp@keithp.com>2011-11-12 18:51:03 -0800
commit430b439b9a5cc98b32273a233505de2c2f975c59 (patch)
treebefe29a4ca94ca39066b1689eb09226fe17c8da8
parent75a8490a7bee2a2c7afd559b13f1d9c40c2aa08f (diff)
altosui: Add ao_lcd_cursor_on/off
This shows or hides a blinking cursor on the LCD. Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--src/core/ao.h6
-rw-r--r--src/drivers/ao_lcd.c16
2 files changed, 22 insertions, 0 deletions
diff --git a/src/core/ao.h b/src/core/ao.h
index 3c1aa156..8bd7a3d2 100644
--- a/src/core/ao.h
+++ b/src/core/ao.h
@@ -1719,6 +1719,12 @@ ao_lcd_contrast_set(uint8_t contrast);
void
ao_lcd_clear(void);
+void
+ao_lcd_cursor_on(void);
+
+void
+ao_lcd_cursor_off(void);
+
#define AO_LCD_ADDR(row,col) ((row << 6) | (col))
void
diff --git a/src/drivers/ao_lcd.c b/src/drivers/ao_lcd.c
index 8745b3f6..8ce32233 100644
--- a/src/drivers/ao_lcd.c
+++ b/src/drivers/ao_lcd.c
@@ -74,6 +74,22 @@ ao_lcd_contrast_set(uint8_t contrast)
}
void
+ao_lcd_cursor_on(void)
+{
+ ao_mutex_get(&ao_lcd_mutex);
+ ao_lcd_send_ins(0x08 | 0x04 | 0x02 | 0x01);
+ ao_mutex_put(&ao_lcd_mutex);
+}
+
+void
+ao_lcd_cursor_off(void)
+{
+ ao_mutex_get(&ao_lcd_mutex);
+ ao_lcd_send_ins(0x08 | 0x04);
+ ao_mutex_put(&ao_lcd_mutex);
+}
+
+void
ao_lcd_clear(void)
{
ao_mutex_get(&ao_lcd_mutex);