adafruit_rgb_display.rgb

Base class for all RGB Display devices

  • Author(s): Radomir Dopieralski, Michael McWethy
class adafruit_rgb_display.rgb.Display(width, height, rotation)[source]

Base class for all RGB display devices :param width: number of pixels wide :param height: number of pixels high

fill(color=0)[source]

Fill the whole display with the specified color.

fill_rectangle(x, y, width, height, color)[source]

Draw a rectangle at specified position with specified width and height, and fill it with the specified color.

hline(x, y, width, color)[source]

Draw a horizontal line.

image(img, rotation=None, x=0, y=0)[source]

Set buffer to value of Python Imaging Library image. The image should be in 1 bit mode and a size not exceeding the display size when drawn at the supplied origin.

init()[source]

Run the initialization commands.

pixel(x, y, color=None)[source]

Read or write a pixel at a given position.

rotation

Set the default rotation

vline(x, y, height, color)[source]

Draw a vertical line.

class adafruit_rgb_display.rgb.DisplaySPI(spi, dc, cs, rst=None, width=1, height=1, baudrate=12000000, polarity=0, phase=0, *, x_offset=0, y_offset=0, rotation=0)[source]

Base class for SPI type devices

read(command=None, count=0)[source]

SPI read from device with optional command

reset()[source]

Reset the device

write(command=None, data=None)[source]

SPI write to the device: commands and data

class adafruit_rgb_display.rgb.DummyPin[source]

Can be used in place of a DigitalInOut() when you don’t want to skip it.

deinit()[source]

Dummy DigitalInOut deinit

direction

Dummy direction DigitalInOut property

pull

Dummy pull DigitalInOut property

switch_to_input(*args, **kwargs)[source]

Dummy switch_to_input method

switch_to_output(*args, **kwargs)[source]

Dummy switch_to_output method

value

Dummy value DigitalInOut property

adafruit_rgb_display.rgb.color565(r, g=0, b=0)[source]

Convert red, green and blue values (0-255) into a 16-bit 565 encoding. As a convenience this is also available in the parent adafruit_rgb_display package namespace.

adafruit_rgb_display.rgb.image_to_data(image)[source]

Generator function to convert a PIL image to 16-bit 565 RGB bytes.

adafruit_rgb_display.hx8353

A simple driver for the HX8353-based displays.

  • Author(s): Radomir Dopieralski, Michael McWethy
class adafruit_rgb_display.hx8353.HX8353(spi, dc, cs, rst=None, width=128, height=128, rotation=0)[source]

A simple driver for the HX8353-based displays.

>>> import busio
>>> import digitalio
>>> import board
>>> from adafruit_rgb_display import color565
>>> import adafruit_rgb_display.hx8353 as hx8353
>>> spi = busio.SPI(clock=board.SCK, MOSI=board.MOSI, MISO=board.MISO)
>>> display = hx8353.HX8383(spi, cs=digitalio.DigitalInOut(board.GPIO0),
...    dc=digitalio.DigitalInOut(board.GPIO15))
>>> display.fill(0x7521)
>>> display.pixel(64, 64, 0)

adafruit_rgb_display.ili9341

A simple driver for the ILI9341/ILI9340-based displays.

  • Author(s): Radomir Dopieralski, Michael McWethy
class adafruit_rgb_display.ili9341.ILI9341(spi, dc, cs, rst=None, width=240, height=320, baudrate=16000000, polarity=0, phase=0, rotation=0)[source]

A simple driver for the ILI9341/ILI9340-based displays.

>>> import busio
>>> import digitalio
>>> import board
>>> from adafruit_rgb_display import color565
>>> import adafruit_rgb_display.ili9341 as ili9341
>>> spi = busio.SPI(clock=board.SCK, MOSI=board.MOSI, MISO=board.MISO)
>>> display = ili9341.ILI9341(spi, cs=digitalio.DigitalInOut(board.GPIO0),
...    dc=digitalio.DigitalInOut(board.GPIO15))
>>> display.fill(color565(0xff, 0x11, 0x22))
>>> display.pixel(120, 160, 0)
scroll(dy=None)[source]

Scroll the display by delta y

adafruit_rgb_display.s6d02a1

A simple driver for the S6D02A1-based displays.

  • Author(s): Radomir Dopieralski, Michael McWethy
class adafruit_rgb_display.s6d02a1.S6D02A1(spi, dc, cs, rst=None, width=128, height=160, rotation=0)[source]

A simple driver for the S6D02A1-based displays.

>>> import busio
>>> import digitalio
>>> import board
>>> from adafruit_rgb_display import color565
>>> import adafruit_rgb_display.s6d02a1 as s6d02a1
>>> spi = busio.SPI(clock=board.SCK, MOSI=board.MOSI, MISO=board.MISO)
>>> display = s6d02a1.S6D02A1(spi, cs=digitalio.DigitalInOut(board.GPIO0),
...    dc=digitalio.DigitalInOut(board.GPIO15), rst=digitalio.DigitalInOut(board.GPIO16))
>>> display.fill(0x7521)
>>> display.pixel(64, 64, 0)

adafruit_rgb_display.ssd1331

A simple driver for the SSD1331-based displays.

  • Author(s): Radomir Dopieralski, Michael McWethy
class adafruit_rgb_display.ssd1331.SSD1331(spi, dc, cs, rst=None, width=96, height=64, baudrate=16000000, polarity=0, phase=0, *, rotation=0)[source]

A simple driver for the SSD1331-based displays.

import busio
import digitalio
import board
from adafruit_rgb_display import color565
import adafruit_rgb_display.ssd1331 as ssd1331
spi = busio.SPI(clock=board.SCK, MOSI=board.MOSI, MISO=board.MISO)
display = ssd1331.SSD1331(spi, cs=digitalio.DigitalInOut(board.GPIO0),
                            dc=digitalio.DigitalInOut(board.GPIO15),
                            rst=digitalio.DigitalInOut(board.GPIO16))

display.fill(0x7521)
display.pixel(32, 32, 0)
write(command=None, data=None)[source]

write procedure specific to SSD1331

adafruit_rgb_display.ssd1351

A simple driver for the SSD1351-based displays.

  • Author(s): Radomir Dopieralski, Michael McWethy
class adafruit_rgb_display.ssd1351.SSD1351(spi, dc, cs, rst=None, width=128, height=128, baudrate=16000000, polarity=0, phase=0, *, x_offset=0, y_offset=0, rotation=0)[source]

A simple driver for the SSD1351-based displays.

>>> import busio
>>> import digitalio
>>> import board
>>> from adafruit_rgb_display import color565
>>> import adafruit_rgb_display.ssd1351 as ssd1351
>>> spi = busio.SPI(clock=board.SCK, MOSI=board.MOSI, MISO=board.MISO)
>>> display = ssd1351.SSD1351(spi, cs=digitalio.DigitalInOut(board.GPIO0),
...    dc=digitalio.DigitalInOut(board.GPIO15), rst=digitalio.DigitalInOut(board.GPIO16))
>>> display.fill(0x7521)
>>> display.pixel(32, 32, 0)

adafruit_rgb_display.st7735

A simple driver for the ST7735-based displays.

  • Author(s): Radomir Dopieralski, Michael McWethy
class adafruit_rgb_display.st7735.ST7735(spi, dc, cs, rst=None, width=128, height=128, baudrate=16000000, polarity=0, phase=0, *, x_offset=0, y_offset=0, rotation=0)[source]

A simple driver for the ST7735-based displays.

>>> import busio
>>> import digitalio
>>> import board
>>> from adafruit_rgb_display import color565
>>> import adafruit_rgb_display.st7735 as st7735
>>> spi = busio.SPI(clock=board.SCK, MOSI=board.MOSI, MISO=board.MISO)
>>> display = st7735.ST7735(spi, cs=digitalio.DigitalInOut(board.GPIO0),
...    dc=digitalio.DigitalInOut(board.GPIO15), rst=digitalio.DigitalInOut(board.GPIO16))
>>> display.fill(0x7521)
>>> display.pixel(64, 64, 0)
class adafruit_rgb_display.st7735.ST7735R(spi, dc, cs, rst=None, width=128, height=160, baudrate=16000000, polarity=0, phase=0, *, x_offset=0, y_offset=0, rotation=0, bgr=False)[source]

A simple driver for the ST7735R-based displays.

init()[source]

Run the initialization commands.

class adafruit_rgb_display.st7735.ST7735S(spi, dc, cs, bl, rst=None, width=128, height=160, baudrate=16000000, polarity=0, phase=0, *, x_offset=2, y_offset=1, rotation=0)[source]

A simple driver for the ST7735S-based displays.

adafruit_rgb_display.st7789

A simple driver for the ST7789-based displays.

  • Author(s): Melissa LeBlanc-Williams
class adafruit_rgb_display.st7789.ST7789(spi, dc, cs, rst=None, width=240, height=320, baudrate=16000000, polarity=0, phase=0, *, x_offset=0, y_offset=0, rotation=0)[source]

A simple driver for the ST7789-based displays.

>>> import busio
>>> import digitalio
>>> import board
>>> from adafruit_rgb_display import color565
>>> import adafruit_rgb_display.st7789 as st7789
>>> spi = busio.SPI(clock=board.SCK, MOSI=board.MOSI, MISO=board.MISO)
>>> display = st7789.ST7789(spi, cs=digitalio.DigitalInOut(board.GPIO0),
...    dc=digitalio.DigitalInOut(board.GPIO15), rst=digitalio.DigitalInOut(board.GPIO16))
>>> display.fill(0x7521)
>>> display.pixel(64, 64, 0)
init()[source]

Run the initialization commands.