From 379461df7d81b87d4fe59a63e78d1f353dff938f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 23 Aug 2021 09:17:59 -0500 Subject: [PATCH] Deprecate Display's constructor arg set_vertical_scroll --- ports/atmel-samd/boards/hallowing_m0_express/board.c | 1 - ports/atmel-samd/boards/hallowing_m4_express/board.c | 1 - ports/atmel-samd/boards/monster_m4sk/board.c | 1 - ports/atmel-samd/boards/pewpew_m4/board.c | 1 - ports/atmel-samd/boards/pybadge/board.c | 1 - ports/atmel-samd/boards/pygamer/board.c | 1 - ports/atmel-samd/boards/pyportal/board.c | 1 - ports/atmel-samd/boards/pyportal_titano/board.c | 1 - ports/atmel-samd/boards/seeeduino_wio_terminal/board.c | 1 - ports/atmel-samd/boards/ugame10/board.c | 1 - .../boards/adafruit_feather_esp32s2_tftback_nopsram/board.c | 1 - ports/esp32s2/boards/adafruit_funhouse/board.c | 1 - ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/board.c | 1 - ports/esp32s2/boards/morpheans_morphesp-240/board.c | 1 - ports/nrf/boards/clue_nrf52840_express/board.c | 1 - ports/nrf/boards/hiibot_bluefi/board.c | 1 - ports/nrf/boards/makerdiary_nrf52840_m2_devkit/board.c | 1 - ports/nrf/boards/ohs2020_badge/board.c | 1 - ports/raspberrypi/boards/adafruit_macropad_rp2040/board.c | 1 - ports/stm/boards/meowbit_v121/board.c | 1 - shared-bindings/displayio/Display.c | 5 ++--- shared-bindings/displayio/Display.h | 2 +- shared-module/displayio/Display.c | 2 +- 23 files changed, 4 insertions(+), 25 deletions(-) diff --git a/ports/atmel-samd/boards/hallowing_m0_express/board.c b/ports/atmel-samd/boards/hallowing_m0_express/board.c index 76551426e3..e22a4bbe17 100644 --- a/ports/atmel-samd/boards/hallowing_m0_express/board.c +++ b/ports/atmel-samd/boards/hallowing_m0_express/board.c @@ -100,7 +100,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 0x37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), &pin_PA00, diff --git a/ports/atmel-samd/boards/hallowing_m4_express/board.c b/ports/atmel-samd/boards/hallowing_m4_express/board.c index f9cdbdbafb..d98bc57676 100644 --- a/ports/atmel-samd/boards/hallowing_m4_express/board.c +++ b/ports/atmel-samd/boards/hallowing_m4_express/board.c @@ -80,7 +80,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 0x37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), &pin_PB14, // backlight pin diff --git a/ports/atmel-samd/boards/monster_m4sk/board.c b/ports/atmel-samd/boards/monster_m4sk/board.c index 8ef0c6ff95..eec24e1677 100644 --- a/ports/atmel-samd/boards/monster_m4sk/board.c +++ b/ports/atmel-samd/boards/monster_m4sk/board.c @@ -81,7 +81,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 0x37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), &pin_PA23, // backlight pin diff --git a/ports/atmel-samd/boards/pewpew_m4/board.c b/ports/atmel-samd/boards/pewpew_m4/board.c index 88c5bd9698..6ce97f7b3f 100644 --- a/ports/atmel-samd/boards/pewpew_m4/board.c +++ b/ports/atmel-samd/boards/pewpew_m4/board.c @@ -133,7 +133,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 0x37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), NULL, // backlight pin diff --git a/ports/atmel-samd/boards/pybadge/board.c b/ports/atmel-samd/boards/pybadge/board.c index 4adf10710e..5d0642e5c2 100644 --- a/ports/atmel-samd/boards/pybadge/board.c +++ b/ports/atmel-samd/boards/pybadge/board.c @@ -103,7 +103,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 0x37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), &pin_PA01, // backlight pin diff --git a/ports/atmel-samd/boards/pygamer/board.c b/ports/atmel-samd/boards/pygamer/board.c index 11e18f1271..d9d9f11eda 100644 --- a/ports/atmel-samd/boards/pygamer/board.c +++ b/ports/atmel-samd/boards/pygamer/board.c @@ -103,7 +103,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 0x37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), &pin_PA01, // backlight pin diff --git a/ports/atmel-samd/boards/pyportal/board.c b/ports/atmel-samd/boards/pyportal/board.c index abeeab8e79..166b14fd5b 100644 --- a/ports/atmel-samd/boards/pyportal/board.c +++ b/ports/atmel-samd/boards/pyportal/board.c @@ -90,7 +90,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 0x37, // Set vertical scroll command display_init_sequence, sizeof(display_init_sequence), &pin_PB31, // Backlight pin diff --git a/ports/atmel-samd/boards/pyportal_titano/board.c b/ports/atmel-samd/boards/pyportal_titano/board.c index e2b231980b..6c05e47d92 100644 --- a/ports/atmel-samd/boards/pyportal_titano/board.c +++ b/ports/atmel-samd/boards/pyportal_titano/board.c @@ -107,7 +107,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 0x37, // Set vertical scroll command display_init_sequence, sizeof(display_init_sequence), &pin_PB31, // Backlight pin diff --git a/ports/atmel-samd/boards/seeeduino_wio_terminal/board.c b/ports/atmel-samd/boards/seeeduino_wio_terminal/board.c index fe2393a572..0476932e67 100644 --- a/ports/atmel-samd/boards/seeeduino_wio_terminal/board.c +++ b/ports/atmel-samd/boards/seeeduino_wio_terminal/board.c @@ -98,7 +98,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 0x37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), &pin_PC05, // backlight pin diff --git a/ports/atmel-samd/boards/ugame10/board.c b/ports/atmel-samd/boards/ugame10/board.c index f17b60ff60..7799e83e6f 100644 --- a/ports/atmel-samd/boards/ugame10/board.c +++ b/ports/atmel-samd/boards/ugame10/board.c @@ -100,7 +100,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 0x37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), NULL, diff --git a/ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/board.c b/ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/board.c index 799494006d..943d91feda 100644 --- a/ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/board.c +++ b/ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/board.c @@ -94,7 +94,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 0x37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), &pin_GPIO7, // backlight pin diff --git a/ports/esp32s2/boards/adafruit_funhouse/board.c b/ports/esp32s2/boards/adafruit_funhouse/board.c index 8451edef95..a4a1d07947 100644 --- a/ports/esp32s2/boards/adafruit_funhouse/board.c +++ b/ports/esp32s2/boards/adafruit_funhouse/board.c @@ -97,7 +97,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 0x37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), &pin_GPIO21, // backlight pin diff --git a/ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/board.c b/ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/board.c index 1002fa6b76..b00a1ed8ed 100644 --- a/ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/board.c +++ b/ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/board.c @@ -113,7 +113,6 @@ static void display_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // set row command MIPI_COMMAND_WRITE_MEMORY_START, // write memory command - 0x37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), &pin_GPIO33, // backlight pin diff --git a/ports/esp32s2/boards/morpheans_morphesp-240/board.c b/ports/esp32s2/boards/morpheans_morphesp-240/board.c index 3dcf6d2465..aad2f0257a 100644 --- a/ports/esp32s2/boards/morpheans_morphesp-240/board.c +++ b/ports/esp32s2/boards/morpheans_morphesp-240/board.c @@ -198,7 +198,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // set row command MIPI_COMMAND_WRITE_MEMORY_START, // write memory command - 0x37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), NULL, // There is no backlight pin, defined for now. diff --git a/ports/nrf/boards/clue_nrf52840_express/board.c b/ports/nrf/boards/clue_nrf52840_express/board.c index b5c0f56ba3..c926813732 100644 --- a/ports/nrf/boards/clue_nrf52840_express/board.c +++ b/ports/nrf/boards/clue_nrf52840_express/board.c @@ -80,7 +80,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 0x37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), &pin_P1_05, // backlight pin diff --git a/ports/nrf/boards/hiibot_bluefi/board.c b/ports/nrf/boards/hiibot_bluefi/board.c index daca539619..29d0927dfe 100644 --- a/ports/nrf/boards/hiibot_bluefi/board.c +++ b/ports/nrf/boards/hiibot_bluefi/board.c @@ -81,7 +81,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 0x37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), &pin_P1_13, // backlight pin diff --git a/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/board.c b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/board.c index 51e453c1f0..0ed150f2b1 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/board.c +++ b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/board.c @@ -81,7 +81,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), &pin_P0_20, // backlight pin diff --git a/ports/nrf/boards/ohs2020_badge/board.c b/ports/nrf/boards/ohs2020_badge/board.c index 1522e45c9a..da90e08239 100644 --- a/ports/nrf/boards/ohs2020_badge/board.c +++ b/ports/nrf/boards/ohs2020_badge/board.c @@ -80,7 +80,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 0x37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), &pin_P0_02, // backlight pin diff --git a/ports/raspberrypi/boards/adafruit_macropad_rp2040/board.c b/ports/raspberrypi/boards/adafruit_macropad_rp2040/board.c index 2882e57922..1e16629f30 100644 --- a/ports/raspberrypi/boards/adafruit_macropad_rp2040/board.c +++ b/ports/raspberrypi/boards/adafruit_macropad_rp2040/board.c @@ -91,7 +91,6 @@ void board_init(void) { 0, // Set column command 0, // Set row command 0, // Write memory command - 0xd3, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), NULL, diff --git a/ports/stm/boards/meowbit_v121/board.c b/ports/stm/boards/meowbit_v121/board.c index 7a31c14e7e..150325556e 100644 --- a/ports/stm/boards/meowbit_v121/board.c +++ b/ports/stm/boards/meowbit_v121/board.c @@ -100,7 +100,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 0x37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), &pin_PB03, diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index f5df146455..3dcc26f691 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -54,7 +54,7 @@ //| Most people should not use this class directly. Use a specific display driver instead that will //| contain the initialization sequence at minimum.""" //| -//| def __init__(self, display_bus: _DisplayBus, init_sequence: ReadableBuffer, *, width: int, height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, color_depth: int = 16, grayscale: bool = False, pixels_in_byte_share_row: bool = True, bytes_per_cell: int = 1, reverse_pixels_in_byte: bool = False, set_column_command: int = 0x2a, set_row_command: int = 0x2b, write_ram_command: int = 0x2c, set_vertical_scroll: int = 0, backlight_pin: Optional[microcontroller.Pin] = None, brightness_command: Optional[int] = None, brightness: float = 1.0, auto_brightness: bool = False, single_byte_bounds: bool = False, data_as_commands: bool = False, auto_refresh: bool = True, native_frames_per_second: int = 60, backlight_on_high: bool = True, SH1107_addressing: bool = False) -> None: +//| def __init__(self, display_bus: _DisplayBus, init_sequence: ReadableBuffer, *, width: int, height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, color_depth: int = 16, grayscale: bool = False, pixels_in_byte_share_row: bool = True, bytes_per_cell: int = 1, reverse_pixels_in_byte: bool = False, set_column_command: int = 0x2a, set_row_command: int = 0x2b, write_ram_command: int = 0x2c, backlight_pin: Optional[microcontroller.Pin] = None, brightness_command: Optional[int] = None, brightness: float = 1.0, auto_brightness: bool = False, single_byte_bounds: bool = False, data_as_commands: bool = False, auto_refresh: bool = True, native_frames_per_second: int = 60, backlight_on_high: bool = True, SH1107_addressing: bool = False) -> None: //| r"""Create a Display object on the given display bus (`FourWire`, `ParallelBus` or `I2CDisplay`). //| //| The ``init_sequence`` is bitpacked to minimize the ram impact. Every command begins with a @@ -100,7 +100,6 @@ //| :param int set_column_command: Command used to set the start and end columns to update //| :param int set_row_command: Command used so set the start and end rows to update //| :param int write_ram_command: Command used to write pixels values into the update region. Ignored if data_as_commands is set. -//| :param int set_vertical_scroll: Command used to set the first row to show //| :param microcontroller.Pin backlight_pin: Pin connected to the display's backlight //| :param int brightness_command: Command to set display brightness. Usually available in OLED controllers. //| :param float brightness: Initial display brightness. This value is ignored if auto_brightness is True. @@ -111,6 +110,7 @@ //| :param int native_frames_per_second: Number of display refreshes per second that occur with the given init_sequence. //| :param bool backlight_on_high: If True, pulling the backlight pin high turns the backlight on. //| :param bool SH1107_addressing: Special quirk for SH1107, use upper/lower column set and page set +//| :param int set_vertical_scroll: This parameter is accepted but ignored for backwards compatibility. It will be removed in a future release. //| """ //| ... //| @@ -184,7 +184,6 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a args[ARG_reverse_bytes_in_word].u_bool, args[ARG_set_column_command].u_int, args[ARG_set_row_command].u_int, args[ARG_write_ram_command].u_int, - args[ARG_set_vertical_scroll].u_int, bufinfo.buf, bufinfo.len, MP_OBJ_TO_PTR(backlight_pin), args[ARG_brightness_command].u_int, diff --git a/shared-bindings/displayio/Display.h b/shared-bindings/displayio/Display.h index 36015cd56f..54a4ec84df 100644 --- a/shared-bindings/displayio/Display.h +++ b/shared-bindings/displayio/Display.h @@ -42,7 +42,7 @@ void common_hal_displayio_display_construct(displayio_display_obj_t *self, mp_obj_t bus, uint16_t width, uint16_t height, int16_t colstart, int16_t rowstart, uint16_t rotation, uint16_t color_depth, bool grayscale, bool pixels_in_byte_share_row, uint8_t bytes_per_cell, bool reverse_pixels_in_byte, bool reverse_bytes_in_word, - uint8_t set_column_command, uint8_t set_row_command, uint8_t write_ram_command, uint8_t set_vertical_scroll, + uint8_t set_column_command, uint8_t set_row_command, uint8_t write_ram_command, uint8_t *init_sequence, uint16_t init_sequence_len, const mcu_pin_obj_t *backlight_pin, uint16_t brightness_command, mp_float_t brightness, bool auto_brightness, bool single_byte_bounds, bool data_as_commands, bool auto_refresh, uint16_t native_frames_per_second, diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index ba509c6986..4c30a85970 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -45,7 +45,7 @@ void common_hal_displayio_display_construct(displayio_display_obj_t *self, mp_obj_t bus, uint16_t width, uint16_t height, int16_t colstart, int16_t rowstart, uint16_t rotation, uint16_t color_depth, bool grayscale, bool pixels_in_byte_share_row, uint8_t bytes_per_cell, bool reverse_pixels_in_byte, bool reverse_bytes_in_word, uint8_t set_column_command, - uint8_t set_row_command, uint8_t write_ram_command, uint8_t set_vertical_scroll, + uint8_t set_row_command, uint8_t write_ram_command, uint8_t *init_sequence, uint16_t init_sequence_len, const mcu_pin_obj_t *backlight_pin, uint16_t brightness_command, mp_float_t brightness, bool auto_brightness, bool single_byte_bounds, bool data_as_commands, bool auto_refresh, uint16_t native_frames_per_second,