adafruit_epd.epd - Adafruit EPD - ePaper display driver

CircuitPython driver for Adafruit ePaper display breakouts * Author(s): Dean Miller

class adafruit_epd.epd.Adafruit_EPD(width: int, height: int, spi: SPI, cs_pin: DigitalInOut, dc_pin: DigitalInOut, sramcs_pin: DigitalInOut, rst_pin: DigitalInOut, busy_pin: DigitalInOut)

Base class for EPD displays

command(cmd: int, data: bytearray | None = None, end: bool = True) int

Send command byte to display.

display() None

show the contents of the display buffer

fill(color: int) None

fill the screen with the passed color

fill_rect(x: int, y: int, width: int, height: int, color: int) None

fill a rectangle with the passed color

hardware_reset() None

If we have a reset pin, do a hardware reset by toggling it

property height: int

The height of the display, accounting for rotation

hline(x: int, y: int, width: int, color: int) None

draw a horizontal line

image(image: Image) None

Set buffer to value of Python Imaging Library image. The image should be in RGB mode and a size equal to the display size.

line(x_0: int, y_0: int, x_1: int, y_1: int, color: int) None

Draw a line from (x_0, y_0) to (x_1, y_1) in passed color

pixel(x: int, y: int, color: int) None

draw a single pixel in the display buffer

power_down() None

Power down the display, must be implemented in subclass

power_up() None

Power up the display in preparation for writing RAM and updating. must be implemented in subclass

rect(x: int, y: int, width: int, height: int, color: int) None

draw a rectangle

property rotation: Literal[0, 1, 2, 3]

The rotation of the display, can be one of (0, 1, 2, 3)

set_black_buffer(index: Literal[0, 1], inverted: bool) None

Set the index for the black buffer data (0 or 1) and whether its inverted

set_color_buffer(index: Literal[0, 1], inverted: bool) None

Set the index for the color buffer data (0 or 1) and whether its inverted

set_ram_address(x: int, y: int) None

Set the RAM address location, must be implemented in subclass

text(string: str, x: int, y: int, color: int, *, font_name: str = 'font5x8.bin', size: int = 1) None

Write text string at location (x, y) in given color, using font file

update() None

Update the display from internal memory, must be implemented in subclass

vline(x: int, y: int, height: int, color: int) None

draw a vertical line

property width: int

The width of the display, accounting for rotation

write_ram(index: int) None

Send the one byte command for starting the RAM write process. Returns the byte read at the same time over SPI. index is the RAM buffer, can be 0 or 1 for tri-color displays. must be implemented in subclass