63
63
//| refresh_display_command: int, refresh_time: float = 40,
64
64
//| busy_pin: Optional[microcontroller.Pin] = None, busy_state: bool = True,
65
65
//| seconds_per_frame: float = 180, always_toggle_chip_select: bool = False,
66
- //| grayscale: bool = False) -> None:
66
+ //| grayscale: bool = False, two_byte_sequence_length: bool = False ) -> None:
67
67
//| """Create a EPaperDisplay object on the given display bus (`displayio.FourWire` or `paralleldisplay.ParallelBus`).
68
68
//|
69
69
//| The ``start_sequence`` and ``stop_sequence`` are bitpacked to minimize the ram impact. Every
100
100
//| :param bool busy_state: State of the busy pin when the display is busy
101
101
//| :param float seconds_per_frame: Minimum number of seconds between screen refreshes
102
102
//| :param bool always_toggle_chip_select: When True, chip select is toggled every byte
103
- //| :param bool grayscale: When true, the color ram is the low bit of 2-bit grayscale"""
103
+ //| :param bool grayscale: When true, the color ram is the low bit of 2-bit grayscale
104
+ //| :param bool two_byte_sequence_length: When true, use two bytes to define sequence length"""
104
105
//| ...
105
106
//|
106
107
STATIC mp_obj_t displayio_epaperdisplay_make_new (const mp_obj_type_t * type , size_t n_args , size_t n_kw , const mp_obj_t * all_args ) {
@@ -110,7 +111,7 @@ STATIC mp_obj_t displayio_epaperdisplay_make_new(const mp_obj_type_t *type, size
110
111
ARG_set_current_row_command , ARG_write_black_ram_command , ARG_black_bits_inverted ,
111
112
ARG_write_color_ram_command , ARG_color_bits_inverted , ARG_highlight_color ,
112
113
ARG_refresh_display_command , ARG_refresh_time , ARG_busy_pin , ARG_busy_state ,
113
- ARG_seconds_per_frame , ARG_always_toggle_chip_select , ARG_grayscale };
114
+ ARG_seconds_per_frame , ARG_always_toggle_chip_select , ARG_grayscale , ARG_two_byte_sequence_length };
114
115
static const mp_arg_t allowed_args [] = {
115
116
{ MP_QSTR_display_bus , MP_ARG_REQUIRED | MP_ARG_OBJ },
116
117
{ MP_QSTR_start_sequence , MP_ARG_REQUIRED | MP_ARG_OBJ },
@@ -138,6 +139,7 @@ STATIC mp_obj_t displayio_epaperdisplay_make_new(const mp_obj_type_t *type, size
138
139
{ MP_QSTR_seconds_per_frame , MP_ARG_OBJ | MP_ARG_KW_ONLY , {.u_obj = MP_OBJ_NEW_SMALL_INT (180 )} },
139
140
{ MP_QSTR_always_toggle_chip_select , MP_ARG_BOOL | MP_ARG_KW_ONLY , {.u_bool = false} },
140
141
{ MP_QSTR_grayscale , MP_ARG_BOOL | MP_ARG_KW_ONLY , {.u_bool = false} },
142
+ { MP_QSTR_two_byte_sequence_length , MP_ARG_BOOL | MP_ARG_KW_ONLY , {.u_bool = false} },
141
143
};
142
144
mp_arg_val_t args [MP_ARRAY_SIZE (allowed_args )];
143
145
mp_arg_parse_all_kw_array (n_args , n_kw , all_args , MP_ARRAY_SIZE (allowed_args ), allowed_args , args );
@@ -182,7 +184,7 @@ STATIC mp_obj_t displayio_epaperdisplay_make_new(const mp_obj_type_t *type, size
182
184
args [ARG_write_black_ram_command ].u_int , args [ARG_black_bits_inverted ].u_bool , write_color_ram_command ,
183
185
args [ARG_color_bits_inverted ].u_bool , highlight_color , args [ARG_refresh_display_command ].u_int , refresh_time ,
184
186
busy_pin , args [ARG_busy_state ].u_bool , seconds_per_frame ,
185
- args [ARG_always_toggle_chip_select ].u_bool , args [ARG_grayscale ].u_bool
187
+ args [ARG_always_toggle_chip_select ].u_bool , args [ARG_grayscale ].u_bool , args [ ARG_two_byte_sequence_length ]. u_bool
186
188
);
187
189
188
190
return self ;
0 commit comments