FourWire – Manage updating a display over SPI four wire protocol

Manage updating a display over SPI four wire protocol in the background while Python code runs. It doesn’t handle display initialization.

class displayio.FourWire(spi_bus, *, command, chip_select, reset=None, baudrate=24000000, polarity=0, phase=0)

Create a FourWire object associated with the given pins.

The SPI 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 you should call :py:func`displayio.release_displays` first, otherwise it will error after the first run.

  • spi_bus (busio.SPI) – The SPI bus that make up the clock and data lines
  • command (microcontroller.Pin) – Data or command pin
  • chip_select (microcontroller.Pin) – Chip select pin
  • reset (microcontroller.Pin) – Reset pin. When None only software reset can be used
  • baudrate (int) – Maximum baudrate in Hz for the display on the bus
  • polarity (int) – the base state of the clock line (0 or 1)
  • phase (int) – the edge of the clock that data is captured. First (0) or second (1). Rising or falling depends on clock polarity.

Performs a hardware reset via the reset pin. Raises an exception if called when no reset pin is available.

send(command, data, *, toggle_every_byte=False)

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.