5050//| Most people should not use this class directly. Use a specific display driver instead that will
5151//| contain the initialization sequence at minimum.
5252//|
53- //| .. class:: Display(display_bus, init_sequence, *, width, height, colstart=0, rowstart=0, rotation=0, color_depth=16, set_column_command=0x2a, set_row_command=0x2b, write_ram_command=0x2c, set_vertical_scroll=0, backlight_pin=None)
53+ //| .. class:: Display(display_bus, init_sequence, *, width, height, colstart=0, rowstart=0, rotation=0, color_depth=16, set_column_command=0x2a, set_row_command=0x2b, write_ram_command=0x2c, set_vertical_scroll=0, backlight_pin=None, single_byte_bounds=False )
5454//|
5555//| Create a Display object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`).
5656//|
9191//| :param int write_ram_command: Command used to write pixels values into the update region
9292//| :param int set_vertical_scroll: Command used to set the first row to show
9393//| :param microcontroller.Pin backlight_pin: Pin connected to the display's backlight
94+ //| :param bool single_byte_bounds: Display column and row commands use single bytes
9495//|
9596STATIC mp_obj_t displayio_display_make_new (const mp_obj_type_t * type , size_t n_args , const mp_obj_t * pos_args , mp_map_t * kw_args ) {
96- enum { ARG_display_bus , ARG_init_sequence , ARG_width , ARG_height , ARG_colstart , ARG_rowstart , ARG_rotation , ARG_color_depth , ARG_set_column_command , ARG_set_row_command , ARG_write_ram_command , ARG_set_vertical_scroll , ARG_backlight_pin };
97+ enum { ARG_display_bus , ARG_init_sequence , ARG_width , ARG_height , ARG_colstart , ARG_rowstart , ARG_rotation , ARG_color_depth , ARG_set_column_command , ARG_set_row_command , ARG_write_ram_command , ARG_set_vertical_scroll , ARG_backlight_pin , ARG_single_byte_bounds };
9798 static const mp_arg_t allowed_args [] = {
9899 { MP_QSTR_display_bus , MP_ARG_REQUIRED | MP_ARG_OBJ },
99100 { MP_QSTR_init_sequence , MP_ARG_REQUIRED | MP_ARG_OBJ },
@@ -108,6 +109,7 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a
108109 { MP_QSTR_write_ram_command , MP_ARG_INT | MP_ARG_KW_ONLY , {.u_int = 0x2c } },
109110 { MP_QSTR_set_vertical_scroll , MP_ARG_INT | MP_ARG_KW_ONLY , {.u_int = 0x0 } },
110111 { MP_QSTR_backlight_pin , MP_ARG_OBJ | MP_ARG_KW_ONLY , {.u_obj = mp_const_none } },
112+ { MP_QSTR_single_byte_bounds , MP_ARG_BOOL | MP_ARG_KW_ONLY , {.u_bool = false} },
111113 };
112114 mp_arg_val_t args [MP_ARRAY_SIZE (allowed_args )];
113115 mp_arg_parse_all (n_args , pos_args , kw_args , MP_ARRAY_SIZE (allowed_args ), allowed_args , args );
@@ -146,7 +148,8 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a
146148 args [ARG_color_depth ].u_int , args [ARG_set_column_command ].u_int , args [ARG_set_row_command ].u_int ,
147149 args [ARG_write_ram_command ].u_int ,
148150 args [ARG_set_vertical_scroll ].u_int ,
149- bufinfo .buf , bufinfo .len , MP_OBJ_TO_PTR (backlight_pin ));
151+ bufinfo .buf , bufinfo .len , MP_OBJ_TO_PTR (backlight_pin ),
152+ args [ARG_single_byte_bounds ].u_bool );
150153
151154 return self ;
152155}
0 commit comments