Inky Base Class¶
- class inky.inky.Inky(resolution=(400, 300), colour='black', cs_channel=0, dc_pin=22, reset_pin=27, busy_pin=17, h_flip=False, v_flip=False, spi_bus=None, i2c_bus=None, gpio=None)[source]¶
Inky e-Ink Display Driver.
Generally it is more convenient to use either the
inky.InkyPHAT
orinky.InkyWHAT
classes.Initialise an Inky Display.
- Parameters:
resolution (tuple(int, int)) – Display resolution (width, height) in pixels, default: (400, 300).
colour (str) – One of ‘red’, ‘black’ or ‘yellow’, default: ‘black’.
cs_channel (int) – Chip-select channel for SPI communication, default: 0.
dc_pin (int) – Data/command pin for SPI communication, default: 22.
reset_pin (int) – Device reset pin, default: 27.
busy_pin (int) – Device busy/wait pin: 17.
h_flip (bool) – Enable horizontal display flip, default: False.
v_flip (bool) – Enable vertical display flip, default: False.
spi_bus (
spidev.SpiDev
) – SPI device. If None then a defaultspidev.SpiDev
object is used. Default: None.i2c_bus (
smbus2.SMBus
) – SMB object. If None thensmbus2.SMBus(1)
is used.gpio (
RPi.GPIO
) – GPIO module. If None then RPi.GPIO is imported. Default: None.
- set_border(colour)[source]¶
Set the border colour.
- Parameters:
colour (int) – The border colour. Valid values are inky.BLACK, inky.WHITE, inky.RED and inky.YELLOW.
- set_image(image)[source]¶
Copy an image to the buffer.
The dimensions of image should match the dimensions of the display being used.
- Parameters:
image (
PIL.Image.Image
ornumpy.ndarray
or list) – Image to copy.