summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien <damien.p.george@gmail.com>2013-11-30 15:02:29 +0000
committerDamien <damien.p.george@gmail.com>2013-11-30 15:02:29 +0000
commit81cc0e8f00caaca3230a93bb41f4517103754127 (patch)
tree3035947fb2df9063813a2990eaf842039ec9a663
parentd3e59feb6bbb8039ff3d02a2a25fbcb1e2eeefd0 (diff)
downloadmicropython-81cc0e8f00caaca3230a93bb41f4517103754127.tar.gz
micropython-81cc0e8f00caaca3230a93bb41f4517103754127.zip
stm: add function to LCD module to show text.
-rw-r--r--stm/lcd.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/stm/lcd.c b/stm/lcd.c
index 28064c24bf..5d2c677349 100644
--- a/stm/lcd.c
+++ b/stm/lcd.c
@@ -163,6 +163,11 @@ py_obj_t lcd_pix_show(void) {
return py_const_none;
}
+py_obj_t lcd_print(py_obj_t text) {
+ lcd_print_str(qstr_str(py_obj_get_qstr(text)));
+ return py_const_none;
+}
+
void lcd_init(void) {
// set the outputs high
PYB_LCD_PORT->BSRRL = PYB_LCD_CS1_PIN;
@@ -221,6 +226,7 @@ void lcd_init(void) {
rt_store_attr(m, qstr_from_str_static("set"), rt_make_function_2(lcd_pix_set));
rt_store_attr(m, qstr_from_str_static("reset"), rt_make_function_2(lcd_pix_reset));
rt_store_attr(m, qstr_from_str_static("show"), rt_make_function_0(lcd_pix_show));
+ rt_store_attr(m, qstr_from_str_static("text"), rt_make_function_1(lcd_print));
rt_store_name(qstr_from_str_static("lcd"), m);
}