summaryrefslogtreecommitdiff
path: root/shared-bindings/displayio
diff options
context:
space:
mode:
authordherrada <dylan.herrada@adafruit.com>2020-07-03 13:49:00 -0400
committerdherrada <dylan.herrada@adafruit.com>2020-07-03 13:49:00 -0400
commit3df03a565069d6e8874eb678d4f010eee97305b0 (patch)
tree5a98c58eabc6b7d2654f899c9b7582fbea9daa94 /shared-bindings/displayio
parent843ff5d30271709186a117877ff0521b769ae8d1 (diff)
Made most of the requested changes
Diffstat (limited to 'shared-bindings/displayio')
-rw-r--r--shared-bindings/displayio/Display.c4
-rw-r--r--shared-bindings/displayio/EPaperDisplay.c2
-rw-r--r--shared-bindings/displayio/Group.c12
-rw-r--r--shared-bindings/displayio/I2CDisplay.c2
-rw-r--r--shared-bindings/displayio/Palette.c4
-rw-r--r--shared-bindings/displayio/ParallelBus.c2
-rw-r--r--shared-bindings/displayio/TileGrid.c12
7 files changed, 21 insertions, 17 deletions
diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c
index c3ddc6c14..e2e648876 100644
--- a/shared-bindings/displayio/Display.c
+++ b/shared-bindings/displayio/Display.c
@@ -49,7 +49,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: displayio, init_sequence: buffer, *, 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: microcontroller.Pin = None, brightness_command: int = None, brightness: bool = 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):
+//| def __init__(self, display_bus: displayio, init_sequence: buffer, *, 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: int = None, brightness: bool = 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):
//| r"""Create a Display object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`).
//|
//| The ``init_sequence`` is bitpacked to minimize the ram impact. Every command begins with a
@@ -372,7 +372,7 @@ const mp_obj_property_t displayio_display_height_obj = {
(mp_obj_t)&mp_const_none_obj},
};
-//| rotation: Optional[int] = ...
+//| rotation: int = ...
//| """The rotation of the display as an int in degrees."""
//|
STATIC mp_obj_t displayio_display_obj_get_rotation(mp_obj_t self_in) {
diff --git a/shared-bindings/displayio/EPaperDisplay.c b/shared-bindings/displayio/EPaperDisplay.c
index e5768572e..b9f7dd9a1 100644
--- a/shared-bindings/displayio/EPaperDisplay.c
+++ b/shared-bindings/displayio/EPaperDisplay.c
@@ -49,7 +49,7 @@
//| Most people should not use this class directly. Use a specific display driver instead that will
//| contain the startup and shutdown sequences at minimum."""
//|
-//| def __init__(self, display_bus: displayio, start_sequence: buffer, stop_sequence: buffer, *, width: int, height: int, ram_width: int, ram_height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, set_column_window_command: int = None, set_row_window_command: int = None, single_byte_bounds: bool = False, write_black_ram_command: int, black_bits_inverted: bool = False, write_color_ram_command: int = None, color_bits_inverted: bool = False, highlight_color: int = 0x000000, refresh_display_command: int, refresh_time: float = 40, busy_pin: microcontroller.Pin = None, busy_state: bool = True, seconds_per_frame: float = 180, always_toggle_chip_select: bool = False):
+//| def __init__(self, display_bus: displayio, start_sequence: buffer, stop_sequence: buffer, *, width: int, height: int, ram_width: int, ram_height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, set_column_window_command: Optional[int] = None, set_row_window_command: Optional[int] = None, single_byte_bounds: bool = False, write_black_ram_command: int, black_bits_inverted: bool = False, write_color_ram_command: Optional[int] = None, color_bits_inverted: bool = False, highlight_color: int = 0x000000, refresh_display_command: int, refresh_time: float = 40, busy_pin: Optional[microcontroller.Pin] = None, busy_state: bool = True, seconds_per_frame: float = 180, always_toggle_chip_select: bool = False):
//| """Create a EPaperDisplay object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`).
//|
//| The ``start_sequence`` and ``stop_sequence`` are bitpacked to minimize the ram impact. Every
diff --git a/shared-bindings/displayio/Group.c b/shared-bindings/displayio/Group.c
index d81bf5fdb..9d12ca161 100644
--- a/shared-bindings/displayio/Group.c
+++ b/shared-bindings/displayio/Group.c
@@ -86,7 +86,7 @@ displayio_group_t* native_group(mp_obj_t group_obj) {
return MP_OBJ_TO_PTR(native_group);
}
-//| hidden: Optional[bool] = ...
+//| hidden: bool = ...
//| """True when the Group and all of it's layers are not visible. When False, the Group's layers
//| are visible if they haven't been hidden."""
//|
@@ -111,7 +111,7 @@ const mp_obj_property_t displayio_group_hidden_obj = {
(mp_obj_t)&mp_const_none_obj},
};
-//| scale: Optional[int] = ...
+//| scale: int = ...
//| """Scales each pixel within the Group in both directions. For example, when scale=2 each pixel
//| will be represented by 2x2 pixels."""
//|
@@ -140,7 +140,7 @@ const mp_obj_property_t displayio_group_scale_obj = {
(mp_obj_t)&mp_const_none_obj},
};
-//| x: Optional[int] = ...
+//| x: int = ...
//| """X position of the Group in the parent."""
//|
STATIC mp_obj_t displayio_group_obj_get_x(mp_obj_t self_in) {
@@ -165,7 +165,7 @@ const mp_obj_property_t displayio_group_x_obj = {
(mp_obj_t)&mp_const_none_obj},
};
-//| y: Optional[int] = ...
+//| y: int = ...
//| """Y position of the Group in the parent."""
//|
STATIC mp_obj_t displayio_group_obj_get_y(mp_obj_t self_in) {
@@ -264,7 +264,9 @@ STATIC mp_obj_t displayio_group_obj_remove(mp_obj_t self_in, mp_obj_t layer) {
}
MP_DEFINE_CONST_FUN_OBJ_2(displayio_group_remove_obj, displayio_group_obj_remove);
-//| def __len__(self) -> Union[bool, int, None]:
+//| def __bool__(self) -> bool: ...
+//|
+//| def __len__(self) -> int:
//| """Returns the number of layers in a Group"""
//| ...
//|
diff --git a/shared-bindings/displayio/I2CDisplay.c b/shared-bindings/displayio/I2CDisplay.c
index 7bca2c36b..7c1827db3 100644
--- a/shared-bindings/displayio/I2CDisplay.c
+++ b/shared-bindings/displayio/I2CDisplay.c
@@ -91,7 +91,7 @@ STATIC mp_obj_t displayio_i2cdisplay_obj_reset(mp_obj_t self_in) {
}
MP_DEFINE_CONST_FUN_OBJ_1(displayio_i2cdisplay_reset_obj, displayio_i2cdisplay_obj_reset);
-//| def send(self, command: int, data: displayio) -> None:
+//| def send(self, command: int, data: ReadableBuffer) -> None:
//| """Sends the given command value followed by the full set of data. Display state, such as
//| vertical scroll, set via ``send`` may or may not be reset once the code is done."""
//| ...
diff --git a/shared-bindings/displayio/Palette.c b/shared-bindings/displayio/Palette.c
index 4b7756a11..a06dd38ff 100644
--- a/shared-bindings/displayio/Palette.c
+++ b/shared-bindings/displayio/Palette.c
@@ -70,7 +70,9 @@ STATIC mp_obj_t displayio_palette_make_new(const mp_obj_type_t *type, size_t n_a
return MP_OBJ_FROM_PTR(self);
}
-//| def __len__(self) -> Union[bool, int, None]:
+//| def __bool__(self) -> bool: ...
+//|
+//| def __len__(self) -> int:
//| """Returns the number of colors in a Palette"""
//| ...
//|
diff --git a/shared-bindings/displayio/ParallelBus.c b/shared-bindings/displayio/ParallelBus.c
index e3897a420..247ac5dd5 100644
--- a/shared-bindings/displayio/ParallelBus.c
+++ b/shared-bindings/displayio/ParallelBus.c
@@ -102,7 +102,7 @@ STATIC mp_obj_t displayio_parallelbus_obj_reset(mp_obj_t self_in) {
}
MP_DEFINE_CONST_FUN_OBJ_1(displayio_parallelbus_reset_obj, displayio_parallelbus_obj_reset);
-//| def send(self, command: int, data: displayio) -> None:
+//| def send(self, command: int, data: ReadableBuffer) -> None:
//| """Sends the given command value followed by the full set of data. Display state, such as
//| vertical scroll, set via ``send`` may or may not be reset once the code is done."""
//| ...
diff --git a/shared-bindings/displayio/TileGrid.c b/shared-bindings/displayio/TileGrid.c
index 9f17f4116..d3ad0f0fc 100644
--- a/shared-bindings/displayio/TileGrid.c
+++ b/shared-bindings/displayio/TileGrid.c
@@ -141,7 +141,7 @@ static displayio_tilegrid_t* native_tilegrid(mp_obj_t tilegrid_obj) {
mp_obj_assert_native_inited(native_tilegrid);
return MP_OBJ_TO_PTR(native_tilegrid);
}
-//| hidden: Optional[bool] = ...
+//| hidden: bool = ...
//| """True when the TileGrid is hidden. This may be False even when a part of a hidden Group."""
//|
STATIC mp_obj_t displayio_tilegrid_obj_get_hidden(mp_obj_t self_in) {
@@ -165,7 +165,7 @@ const mp_obj_property_t displayio_tilegrid_hidden_obj = {
(mp_obj_t)&mp_const_none_obj},
};
-//| x: Optional[int] = ...
+//| x: int = ...
//| """X position of the left edge in the parent."""
//|
STATIC mp_obj_t displayio_tilegrid_obj_get_x(mp_obj_t self_in) {
@@ -190,7 +190,7 @@ const mp_obj_property_t displayio_tilegrid_x_obj = {
(mp_obj_t)&mp_const_none_obj},
};
-//| y: Optional[int] = ...
+//| y: int = ...
//| """Y position of the top edge in the parent."""
//|
STATIC mp_obj_t displayio_tilegrid_obj_get_y(mp_obj_t self_in) {
@@ -215,7 +215,7 @@ const mp_obj_property_t displayio_tilegrid_y_obj = {
(mp_obj_t)&mp_const_none_obj},
};
-//| flip_x: Optional[bool] = ...
+//| flip_x: bool = ...
//| """If true, the left edge rendered will be the right edge of the right-most tile."""
//|
STATIC mp_obj_t displayio_tilegrid_obj_get_flip_x(mp_obj_t self_in) {
@@ -239,7 +239,7 @@ const mp_obj_property_t displayio_tilegrid_flip_x_obj = {
(mp_obj_t)&mp_const_none_obj},
};
-//| flip_y: Optional[bool] = ...
+//| flip_y: bool = ...
//| """If true, the top edge rendered will be the bottom edge of the bottom-most tile."""
//|
STATIC mp_obj_t displayio_tilegrid_obj_get_flip_y(mp_obj_t self_in) {
@@ -264,7 +264,7 @@ const mp_obj_property_t displayio_tilegrid_flip_y_obj = {
};
-//| transpose_xy: Optional[bool] = ...
+//| transpose_xy: bool = ...
//| """If true, the TileGrid's axis will be swapped. When combined with mirroring, any 90 degree
//| rotation can be achieved along with the corresponding mirrored version."""
//|