From 3fbcbd15618a7e73f57bfb13976596becbb28d5b Mon Sep 17 00:00:00 2001 From: Benny Meisels Date: Mon, 6 Jan 2020 22:54:14 +0200 Subject: [PATCH 1/3] Fixed issue with passing inverted bits keyword arguments --- adafruit_il0373.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/adafruit_il0373.py b/adafruit_il0373.py index 1b0b3dc..c54a74e 100644 --- a/adafruit_il0373.py +++ b/adafruit_il0373.py @@ -83,15 +83,15 @@ def __init__(self, bus, swap_rams=False, **kwargs): start_sequence[27] = (height >> 8) & 0xFF start_sequence[28] = height & 0xFF if swap_rams: - color_bits_inverted = kwargs.get("black_bits_inverted", False) + color_bits_inverted = kwargs.pop("black_bits_inverted", False) write_color_ram_command = 0x10 - black_bits_inverted = kwargs.get("color_bits_inverted", True) + black_bits_inverted = kwargs.pop("color_bits_inverted", True) write_black_ram_command = 0x13 else: write_black_ram_command = 0x10 write_color_ram_command = 0x13 - color_bits_inverted = kwargs.get("color_bits_inverted", True) - black_bits_inverted = kwargs.get("black_bits_inverted", False) + color_bits_inverted = kwargs.pop("color_bits_inverted", True) + black_bits_inverted = kwargs.pop("black_bits_inverted", False) super().__init__(bus, start_sequence, _STOP_SEQUENCE, **kwargs, ram_width=160, ram_height=296, busy_state=False, From 409eff3cdd7a841baf7a41b68454ab8cb6aa25cf Mon Sep 17 00:00:00 2001 From: Benny Meisels Date: Tue, 7 Jan 2020 20:06:54 +0200 Subject: [PATCH 2/3] Fixed issue with swap_rams and bits_inverted keyword arguments --- adafruit_il0373.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adafruit_il0373.py b/adafruit_il0373.py index c54a74e..31ebeca 100644 --- a/adafruit_il0373.py +++ b/adafruit_il0373.py @@ -83,9 +83,9 @@ def __init__(self, bus, swap_rams=False, **kwargs): start_sequence[27] = (height >> 8) & 0xFF start_sequence[28] = height & 0xFF if swap_rams: - color_bits_inverted = kwargs.pop("black_bits_inverted", False) + color_bits_inverted = kwargs.pop("color_bits_inverted", False) write_color_ram_command = 0x10 - black_bits_inverted = kwargs.pop("color_bits_inverted", True) + black_bits_inverted = kwargs.pop("black_bits_inverted", True) write_black_ram_command = 0x13 else: write_black_ram_command = 0x10 From 6fe04ebf3719c8ff2037df38c1756585014c116b Mon Sep 17 00:00:00 2001 From: Benny Meisels Date: Thu, 9 Jan 2020 22:51:12 +0200 Subject: [PATCH 3/3] Added documentation --- adafruit_il0373.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/adafruit_il0373.py b/adafruit_il0373.py index 31ebeca..e5824ae 100644 --- a/adafruit_il0373.py +++ b/adafruit_il0373.py @@ -69,7 +69,25 @@ ) # pylint: disable=too-few-public-methods class IL0373(displayio.EPaperDisplay): - """IL0373 driver""" + r"""IL0373 driver + + :param bus: The data bus the display is on + :param bool swap_rams: Color and black rams/commands are swapped + :param \**kwargs: + See below + + :Keyword Arguments: + * *width* (``int``) -- + Display width + * *height* (``int``) -- + Display height + * *rotation* (``int``) -- + Display rotation + * *color_bits_inverted* (``bool``) -- + Invert color bit values + * *black_bits_inverted* (``bool``) -- + Invert black bit values + """ def __init__(self, bus, swap_rams=False, **kwargs): start_sequence = bytearray(_START_SEQUENCE)