Skip to content

Commit 81cc0e8

Browse files
committed
stm: add function to LCD module to show text.
1 parent d3e59fe commit 81cc0e8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

stm/lcd.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,11 @@ py_obj_t lcd_pix_show(void) {
163163
return py_const_none;
164164
}
165165

166+
py_obj_t lcd_print(py_obj_t text) {
167+
lcd_print_str(qstr_str(py_obj_get_qstr(text)));
168+
return py_const_none;
169+
}
170+
166171
void lcd_init(void) {
167172
// set the outputs high
168173
PYB_LCD_PORT->BSRRL = PYB_LCD_CS1_PIN;
@@ -221,6 +226,7 @@ void lcd_init(void) {
221226
rt_store_attr(m, qstr_from_str_static("set"), rt_make_function_2(lcd_pix_set));
222227
rt_store_attr(m, qstr_from_str_static("reset"), rt_make_function_2(lcd_pix_reset));
223228
rt_store_attr(m, qstr_from_str_static("show"), rt_make_function_0(lcd_pix_show));
229+
rt_store_attr(m, qstr_from_str_static("text"), rt_make_function_1(lcd_print));
224230
rt_store_name(qstr_from_str_static("lcd"), m);
225231
}
226232

0 commit comments

Comments
 (0)