|
105 | 105 | //| :param bool auto_brightness: If True, brightness is controlled via an ambient light sensor or other mechanism. |
106 | 106 | //| :param bool single_byte_bounds: Display column and row commands use single bytes |
107 | 107 | //| :param bool data_as_commands: Treat all init and boundary data as SPI commands. Certain displays require this. |
108 | | -//| :param bool column_and_page_addressing: Special quirk for SH1107, use upper/lower column set and page set |
| 108 | +//| :param bool SH1107_addressing: Special quirk for SH1107, use upper/lower column set and page set |
109 | 109 | //| :param bool auto_refresh: Automatically refresh the screen |
110 | 110 | //| :param int native_frames_per_second: Number of display refreshes per second that occur with the given init_sequence. |
111 | 111 | //| :param bool backlight_on_high: If True, pulling the backlight pin high turns the backlight on.""" |
112 | 112 | //| ... |
113 | 113 | //| |
114 | | -STATIC 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) { |
115 | | - enum { ARG_display_bus, ARG_init_sequence, ARG_width, ARG_height, ARG_colstart, ARG_rowstart, ARG_rotation, ARG_color_depth, ARG_grayscale, ARG_pixels_in_byte_share_row, ARG_bytes_per_cell, ARG_reverse_pixels_in_byte, ARG_reverse_bytes_in_word, ARG_set_column_command, ARG_set_row_command, ARG_write_ram_command, ARG_set_vertical_scroll, ARG_backlight_pin, ARG_brightness_command, ARG_brightness, ARG_auto_brightness, ARG_single_byte_bounds, ARG_data_as_commands, ARG_auto_refresh, ARG_native_frames_per_second, ARG_backlight_on_high, ARG_column_and_page_addressing }; |
| 114 | +STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_args, |
| 115 | + const mp_obj_t *pos_args, mp_map_t *kw_args) { |
| 116 | + enum { ARG_display_bus, ARG_init_sequence, ARG_width, ARG_height, ARG_colstart, ARG_rowstart, |
| 117 | + ARG_rotation, ARG_color_depth, ARG_grayscale, ARG_pixels_in_byte_share_row, |
| 118 | + ARG_bytes_per_cell, ARG_reverse_pixels_in_byte, ARG_reverse_bytes_in_word, |
| 119 | + ARG_set_column_command, ARG_set_row_command, ARG_write_ram_command, |
| 120 | + ARG_set_vertical_scroll, ARG_backlight_pin, ARG_brightness_command, |
| 121 | + ARG_brightness, ARG_auto_brightness, ARG_single_byte_bounds, ARG_data_as_commands, |
| 122 | + ARG_auto_refresh, ARG_native_frames_per_second, ARG_backlight_on_high, |
| 123 | + ARG_SH1107_addressing }; |
116 | 124 | static const mp_arg_t allowed_args[] = { |
117 | 125 | { MP_QSTR_display_bus, MP_ARG_REQUIRED | MP_ARG_OBJ }, |
118 | 126 | { MP_QSTR_init_sequence, MP_ARG_REQUIRED | MP_ARG_OBJ }, |
@@ -140,7 +148,7 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a |
140 | 148 | { MP_QSTR_auto_refresh, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = true} }, |
141 | 149 | { MP_QSTR_native_frames_per_second, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 60} }, |
142 | 150 | { MP_QSTR_backlight_on_high, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = true} }, |
143 | | - { MP_QSTR_column_and_page_addressing, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} }, |
| 151 | + { MP_QSTR_SH1107_addressing, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} } |
144 | 152 | }; |
145 | 153 | mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; |
146 | 154 | mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); |
@@ -183,7 +191,7 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a |
183 | 191 | args[ARG_auto_refresh].u_bool, |
184 | 192 | args[ARG_native_frames_per_second].u_int, |
185 | 193 | args[ARG_backlight_on_high].u_bool, |
186 | | - args[ARG_column_and_page_addressing].u_bool |
| 194 | + args[ARG_SH1107_addressing].u_bool |
187 | 195 | ); |
188 | 196 |
|
189 | 197 | return self; |
|
0 commit comments