diff --git a/stmhal/mpconfigport.h b/stmhal/mpconfigport.h index 9c90608e53229..44ff9e518b259 100644 --- a/stmhal/mpconfigport.h +++ b/stmhal/mpconfigport.h @@ -111,6 +111,7 @@ extern const struct _mp_obj_module_t sensor_module; extern const struct _mp_obj_module_t image_module; extern const struct _mp_obj_module_t gif_module; extern const struct _mp_obj_module_t mjpeg_module; +extern const struct _mp_obj_module_t lcd_module; extern const struct _mp_obj_module_t mlx_module; #define MICROPY_PORT_BUILTIN_MODULES \ @@ -126,6 +127,7 @@ extern const struct _mp_obj_module_t mlx_module; { MP_OBJ_NEW_QSTR(MP_QSTR_image), (mp_obj_t)&image_module }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_gif), (mp_obj_t)&gif_module }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_mjpeg), (mp_obj_t)&mjpeg_module }, \ + { MP_OBJ_NEW_QSTR(MP_QSTR_lcd), (mp_obj_t)&lcd_module }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_mlx), (mp_obj_t)&mlx_module }, #define MICROPY_PORT_BUILTIN_MODULE_WEAK_LINKS \ diff --git a/stmhal/qstrdefsport.h b/stmhal/qstrdefsport.h index c95e906fb1ee2..a5deb3978ed1a 100644 --- a/stmhal/qstrdefsport.h +++ b/stmhal/qstrdefsport.h @@ -812,6 +812,14 @@ Q(loop) Q(mjpeg) Q(Mjpeg) +// Lcd Module +Q(lcd) +Q(type) +Q(set_backlight) +Q(get_backlight) +Q(display) +Q(clear) + // Led Module Q(led) Q(RED) diff --git a/stmhal/spi.c b/stmhal/spi.c index 4ef654c829b04..b51beba70488f 100644 --- a/stmhal/spi.c +++ b/stmhal/spi.c @@ -366,7 +366,7 @@ STATIC mp_obj_t pyb_spi_init_helper(const pyb_spi_obj_t *self, mp_uint_t n_args, /// /// At the moment, the NSS pin is not used by the SPI driver and is free /// for other use. -STATIC mp_obj_t pyb_spi_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { +/*STATIC*/ mp_obj_t pyb_spi_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { // check arguments mp_arg_check_num(n_args, n_kw, 1, MP_OBJ_FUN_ARGS_MAX, true); @@ -413,14 +413,14 @@ STATIC mp_obj_t pyb_spi_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n return (mp_obj_t)spi_obj; } -STATIC mp_obj_t pyb_spi_init(mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { +/*STATIC*/ mp_obj_t pyb_spi_init(mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { return pyb_spi_init_helper(args[0], n_args - 1, args + 1, kw_args); } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(pyb_spi_init_obj, 1, pyb_spi_init); /// \method deinit() /// Turn off the SPI bus. -STATIC mp_obj_t pyb_spi_deinit(mp_obj_t self_in) { +/*STATIC*/ mp_obj_t pyb_spi_deinit(mp_obj_t self_in) { pyb_spi_obj_t *self = self_in; spi_deinit(self->spi); return mp_const_none; @@ -434,7 +434,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(pyb_spi_deinit_obj, pyb_spi_deinit); /// - `timeout` is the timeout in milliseconds to wait for the send. /// /// Return value: `None`. -STATIC mp_obj_t pyb_spi_send(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { +/*STATIC*/ mp_obj_t pyb_spi_send(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { // TODO assumes transmission size is 8-bits wide static const mp_arg_t allowed_args[] = {