Frustration-free e-paper usage for Linux
Intro
E-paper (electrophoretic display technology) has found its way into more and more products and personal projects over the last few years. One thing that hasn't come with this widespread adoption is a way to make them easier to use - they're uniquely difficult and frankly they're frustrating. Why frustrating? There are some aspects of using these displays that offer unique challenges. These tend to be one of the following:
- They need an external DC/DC boost circuit and 24-pin 0.5mm FPC. Difficult to create on your own
- Many displays share the same exact size/look, but are incompatible. There are two main families of controller chips (Solomon Systech and UltraChip), but even within those two there are multiple versions that can be incompatible.
- They behave very differently compared to other all-points-addressable displays. It is unfortunately necessary to learn a bit about the physical properties of them in order to use them correctly.
- The vendors don't provide good documentation nor good example code. The provided code may work on your hardware, but offers a minimal starting point for your project.
The Library
I've been working with these displays for several years and have written a lot of code to talk to them. About a year ago I decided to start from a clean slate and write a comprehensive, well designed library to control them ALL. The result is bb_epaper. A portable C (with C++ wrapper) library which can talk to nearly every SPI-connected e-paper display in the market. It includes 2D graphics primitives, compressed fonts and images and uses the same API as my other display libraries. The C code is completely portable to any target hardware and I've included I/O wrapper functions to allow it to build on Arduino, ESP-IDF, and Linux. If you want to use it on STM32 or some other system, it's quite easy to provide a few lines of wrapper code to enable it. I've included a bunch of examples and relatively voluminous documentation.
A library and documentation aren't always sufficient to get things working with these displays. There are some fundamental barriers to getting them to function that create significant frustration for a large portion of the people using them.
The Tool (show_png)
To display the image above, you need to provide the tool with some info:
The e-paper adapter (GPIO connections are implied from that)
The epaper panel type
The update mode (full, fast, partial)
The input filename
All of the above can be provided in a JSON file (epaper.json) or command line parameters or both. To display that image above, you pass the following parameters:
./show_png file=~/snoopy.png adapter=pimoroni panel_2bit=EP213R_122x250
The only real challenge is correctly choosing the panel. I created a Wiki page which maps product names to my internal panel names.


Comments
Post a Comment