i2cdisplaybus
– Communicates to a display IC over I2C
Available on these boards
- class i2cdisplaybus.I2CDisplayBus(i2c_bus: busio.I2C, *, device_address: int, reset: microcontroller.Pin | None = None)
Manage updating a display over I2C in the background while Python code runs. It doesn’t handle display initialization.
Create a I2CDisplayBus object associated with the given I2C bus and reset pin.
The I2C bus and pins are then in use by the display until
displayio.release_displays()
is called even after a reload. (It does this so CircuitPython can use the display after your code is done.) So, the first time you initialize a display bus in code.py you should calldisplayio.release_displays()
first, otherwise it will error after the first code.py run.- Parameters:
i2c_bus (busio.I2C) – The I2C bus that make up the clock and data lines
device_address (int) – The I2C address of the device
reset (microcontroller.Pin) – Reset pin. When None only software reset can be used
- reset() None
Performs a hardware reset via the reset pin. Raises an exception if called when no reset pin is available.
- send(command: int, data: circuitpython_typing.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.