X-Git-Url: https://git.ayoreis.com/hackapet/Adafruit_Blinka_Displayio.git/blobdiff_plain/07b3c4b67d4530d1b04e725899dcdf077d462d6e..7e3f147b76bfc585802c156d7447a34be08262dd:/displayio/_displaycore.py diff --git a/displayio/_displaycore.py b/displayio/_displaycore.py index 96c47a8..0672513 100644 --- a/displayio/_displaycore.py +++ b/displayio/_displaycore.py @@ -101,6 +101,7 @@ class _DisplayCore: if bus: if isinstance(bus, (FourWire, I2CDisplay, ParallelBus)): self._bus_reset = bus.reset + self._bus_free = bus._free self._begin_transaction = bus._begin_transaction self._send = bus._send self._end_transaction = bus._end_transaction @@ -342,7 +343,7 @@ class _DisplayCore: if not self.data_as_commands: self.send(DISPLAY_COMMAND, CHIP_SELECT_UNTOUCHED, data) data = bytearray(0) - if self.ram_width < 0x100: # Single Byte Bounds + if self.ram_height < 0x100: # Single Byte Bounds data += struct.pack(">BB", region_y1, region_y2) else: if self.address_little_endian: @@ -376,12 +377,14 @@ class _DisplayCore: """ Send the data to the current bus """ - print(len(data)) - if isinstance(data, memoryview): - data = data.tobytes() - print(data) self._send(data_type, chip_select, data) + def bus_free(self) -> bool: + """ + Check if the bus is free + """ + return self._bus_free() + def begin_transaction(self) -> bool: """ Begin Bus Transaction