lilygo_tdeck

CircuitPython drivers for the LILYGO T-Deck peripherals.

  • Author(s): Robert Grizzell

Implementation Notes

Hardware:

Software and Dependencies:

class lilygo_tdeck.Keyboard(i2c: busio.I2C, device_address: int = None)

Controls the keyboard peripheral. This class can be extended to support additional functionality if the keyboard is utilizing custom firmware.

Parameters:
  • i2c (I2C) – Object representing the I2C interface used to communicate with the keyboard.

  • device_address (int) – The I2C address of the keyboard device. Default is 0x55 (85).

get_keypress() str | None

Get the last keypress.

Returns:

character representing the key that was pressed

class lilygo_tdeck.TDeck(keyboard: Keyboard = None, trackball: Trackball = None, debug: bool = False)

Class representing the LILYGO T-Deck.

Parameters:
  • keyboard (Keyboard) – Object representing the keyboard. If none is provided, one is created.

  • trackball (Trackball) – Object representing the trackball. If none is provided, one is created.

  • debug (bool) – Print extra debug statements during initialization.

class lilygo_tdeck.Trackball(up_pin: microcontroller.Pin, down_pin: microcontroller.Pin, left_pin: microcontroller.Pin, right_pin: microcontroller.Pin, click_pin: microcontroller.Pin = None)

Controls the trackball peripheral.

Parameters:
  • up_pin (Pin) – Pin tracking upward movement from the trackball.

  • down_pin (Pin) – Pin tracking downward movement from the trackball.

  • left_pin (Pin) – Pin tracking leftward movement from the trackball.

  • right_pin (Pin) – Pin tracking rightward movement from the trackball.

  • click_pin (Pin) – Pin tracking presses on the trackball.

get_click() keypad.Event

Get the last click event.

Returns:

Press or release event

get_trackball() Iterator[tuple[str, int]]

Get the last positional movement in units.

Returns:

List of directions and the units of travel since last poll.