summaryrefslogtreecommitdiff
path: root/urwid/lcd_display.py
diff options
context:
space:
mode:
authorIan Ward <ian@excess.org>2010-03-13 21:23:29 -0500
committerIan Ward <ian@excess.org>2010-03-13 21:23:29 -0500
commitcd3d63c86098487773c8f2542f3877b6ebe59755 (patch)
tree99bea9e329a1e24483357d055cb8e03661351be6 /urwid/lcd_display.py
parentc1e0781e5e8d8dc27131834cbb02d8e147c17cd9 (diff)
downloadurwid-cd3d63c86098487773c8f2542f3877b6ebe59755.tar.gz
lcd.py -> lcd_cf635.py, feature complete
--HG-- rename : lcd.py => lcd_cf635.py
Diffstat (limited to 'urwid/lcd_display.py')
-rw-r--r--urwid/lcd_display.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/urwid/lcd_display.py b/urwid/lcd_display.py
index 25f3d01..e742818 100644
--- a/urwid/lcd_display.py
+++ b/urwid/lcd_display.py
@@ -464,3 +464,31 @@ class CF635Screen(CFLCDScreen):
self.cursor_style = style
self._update_cursor = True
+ def set_backlight(self, value):
+ """
+ Set backlight brightness
+
+ value -- 0 to 100
+ """
+ assert 0 <= value <= 100
+ self.queue_command(self.CMD_BACKLIGHT, chr(value))
+
+ def set_lcd_contrast(self, value):
+ """
+ value -- 0 to 255
+ """
+ assert 0 <= value <= 255
+ self.queue_command(self.CMD_LCD_CONTRAST, chr(value))
+
+ def set_led_pin(self, led, rg, value):
+ """
+ led -- 0 to 3
+ rg -- 0 for red, 1 for green
+ value -- 0 to 100
+ """
+ assert 0 <= led <= 3
+ assert rg in (0, 1)
+ assert 0 <= value <= 100
+ self.queue_command(self.CMD_GPO, chr(12 - 2 * led - rg) +
+ chr(value))
+