Home

Awesome

Inkplate 6 & Inkplate 10

This repository contains MicroPython drivers for the E-Radionica Inkplates 6 and 10: an ESP32 board with a 6", respectively 10", E-paper display and three capacitive touch buttons/sensors.

Inkplate info

Features

Getting started

Info

Partial Updates

The partial update works as follows. An InkplateMono is allocated as well as an InkplatePartial based on it. Then an initial image is drawn using InkplateMono and InkplatePartial.start() is called, which makes a copy of the image from InkplateMono. The desired screen changes are drawn normally on the InkplateMono and when they're ready to display, InkplatePartial.display() is called.

What InkplatePartial.display does is to render the attached InkplateMono but as it renders it compares the pixels with those saved by the call to start(). For pixels that have not changed it sends a "no change" code to the display and for ones that have changed it sends the appropriate waveform. Sending "no change" is faster than sending the waveform and the partial update waveform is shorter (thus faster) than the standard refresh-the-screen waveform.

In addition, a bounding box can be passed to InkplatePartial.display and it will skip rows outside of the bounding box, which is faster than sending a full rows of "no change". (The x/width parameters to InkplatePartial.display are currently unused and cannot be used to exclude the update of pixels that were changed but shouldn't be displayed.)

Greyscale

Greyscale display is supported using InkplateGS2 providing 2 bits per pixel. 2-bit greyscale was chosen because it nicely packs 4 pixels into a byte, doesn't use a ton of memory, and is still fast. Using 3-bit greyscale is not supported by the MicroPython framebuf module, and doesn't pack nicely into bytes. 4-bit greyscale uses a lot of memory and becomes rather slow, plus it's not clear decent open source ePaper waveforms can be worked out to actually display that many levels.

It seems that the main use for more than 2-bit greyscale is the display of images. The results of the Arduino C driver displaying images quantized to 8 levels (3 bits per pixel) look rather unconvincing (IMHO) with large flat blotches where the original images has a gradient (for example portions showing the sky). It seems that images dithered to 2-bit greyscale with Floyd-Steinberg or equivalent ought to look better than that.

All this being said, it shouldn't be all that much work to make a clone of InkplateGS2 that supports 4-bit greyscale.

Performance and Timing

The update speed relies heavily on the MicroPython viper compile-to-native functionality. It's great because it allows a pure python library. But it also sucks because it's not really that good and the code starts to become pretty obscure. It would be smart to recode the key functions in C and provide an optional pre-compiled mpy file with that. This is probably only worth doing once all the kinks are worked out and the intricacies of the ePaper displaya are better understood.

The timing of the display update is based on "it seems to work". It appears that the rate at which rows are updated is really faster than spec. This can have some very unintuitive side-effects. For example, if the speed at which rows are skipped is increased in the partial update, the rows that are subsequently updated are washed out (even if they are written as slowly as before)! It would be good to exert more care with the update speed in the future C primitives.

Display background info

ESP32 GPIO map

GPIOStd funcInkplateDescription
0pup/ftdiEPD-CLClock byte, positive pulse
1U0TXDTX
2pdnEPD-LELatch (row) enable: positive pulse
3U0RXDRX
4EPD-D0
5pupEPD-D1
12pdn, mmisoSPI-MISO
13msckSPI-MOSI
14SPI-CK
15mmosiSPI-CS
16PSRAM
17PSRAM
18vsckEPD-D2
19vmosiEPD-D3
21SDA
22SCL
23vmisoEPD-D4
25dac1EPD-D5
26dac2EPD-D6
27EPD-D7
32adc4EPD-CKVClock vertical: positive pulse
33adc9EPD-SPHStart pulse horizontal, active low
34in, adc6INTBinterrupt from MCP23017
35in, adc7BATV
36in, adc0
39in, adc3

I2C I/O Expander MCP23017

IOFunctionDescription
A0EPD-OE
A1EPD-GMODEGate output mode: high to enable
A2EPD-SPVStart pulse vertical, active low
A3TPS65186 WAKEUP
A4TPS65186 PWRUP
A5TPS65186 VCOM-CTRL
A6TPS65186 INT
A7TPS65186 PWR-GOOD
B0GPIO0-MOSFET (EPD-CL)low pulls gpio0/EPD-CL high via 1K Ohm
B1VBAT-MOSFETlow enables VBAT
B2TOUCH1
B3TOUCH2
B4TOUCH3
B5K19
B6K20
B7K21