Top-level API for driving e-paper panels.

EInk wraps a display driver module that implements the EInk.Driver behaviour (for example EInk.Driver.UC8179 or EInk.Driver.UC8276) and exposes a single interface for clearing and drawing to the panel, regardless of which controller chip is underneath.

{:ok, eink} =
  EInk.new(EInk.Driver.UC8276,
    spi_device: "spidev0.0",
    reset_pin: 17,
    busy_pin: 24,
    dc_pin: 25
  )

EInk.clear(eink, :white)
EInk.draw(eink, image_binary)

Summary

Functions

Fills the panel with a solid color.

Draws a raw image to the panel.

Initializes a display using the given driver module.

Types

t()

@type t() :: %EInk{driver: term(), driver_mod: term()}

Functions

clear(eink, color \\ :white, eink_opts \\ [])

Fills the panel with a solid color.

color is :white (default) or :black. eink_opts are passed through to draw/3, e.g. refresh_type: :full or refresh_type: :partial.

draw(eink, image, opts \\ [])

Draws a raw image to the panel.

image is a 1-bit-per-pixel binary, row-major, sized to the driver's width * height capability. opts are driver-specific; the built-in drivers accept refresh_type: :full | :partial.

new(driver_module, opts \\ [])

Initializes a display using the given driver module.

driver_module must implement the EInk.Driver behaviour. opts are passed through to the driver's new/1 callback and typically include the GPIO pins and SPI device used to talk to the panel.

Resets and initializes the panel before returning.