altosui: Add ao_lcd_cursor_on/off
authorKeith Packard <keithp@keithp.com>
Sun, 13 Nov 2011 02:51:03 +0000 (18:51 -0800)
committerKeith Packard <keithp@keithp.com>
Sun, 13 Nov 2011 02:51:03 +0000 (18:51 -0800)
This shows or hides a blinking cursor on the LCD.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/core/ao.h
src/drivers/ao_lcd.c

index 3c1aa156bb4925b985ca53536b80c2c1aca43aed..8bd7a3d2ba9f43396e9f641d3f1135700043b4ac 100644 (file)
@@ -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
index 8745b3f631509858b7a83b1fc9aa29c63841a6e2..8ce3223366362712213a767c626f8bff1ad85bf8 100644 (file)
@@ -73,6 +73,22 @@ ao_lcd_contrast_set(uint8_t contrast)
        ao_mutex_put(&ao_lcd_mutex);
 }
 
+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)
 {