mirror of
https://github.com/licsber/micropython.git
synced 2024-09-20 09:00:23 +08:00
stm: add function to LCD module to show text.
This commit is contained in:
parent
d3e59feb6b
commit
81cc0e8f00
@ -163,6 +163,11 @@ py_obj_t lcd_pix_show(void) {
|
|||||||
return py_const_none;
|
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) {
|
void lcd_init(void) {
|
||||||
// set the outputs high
|
// set the outputs high
|
||||||
PYB_LCD_PORT->BSRRL = PYB_LCD_CS1_PIN;
|
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("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("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("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);
|
rt_store_name(qstr_from_str_static("lcd"), m);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user