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
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:
"""
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