Use a Pimoroni Badger ePaper display as an i2c-controlled display for Golioth Reference Designs.
Precompiled .uf2 binaries can be found in the Releases section.
Micropython has known issues building with some CMake versions. This repository includes a Dockerfile that will install a known-working build environment. Installation and use of the Docker container has been simplified as much as possible.
-
After cloning the repo, run the bootstrap script to configure submodules
./bootstrap.sh
-
Install Docker on your system
Note: If you have installed Docker Desktop on macOS you can skip this step.
sudo apt install docker.io sudo usermod -a -G docker mike newgrp docker
-
Perform initialization of the Docker image/container
make docker_init # macOS make docker_init_mac -
Build firmware
make
The result of running make is a firmware.uf2 file in the root directory of
this repository that can be flashed onto the Pico.
If you encounter issues using this approach, please consult the Build with Docker guide for building the Ostentus binary.
It is recommended that you use the libostentus library to control Ostentus
from Zephyr. (This is included as a submodule of this repo.) Add
the libostentus repo to your Zephyr
project as a submodule.
Use any i2c-controller to write to the display on device-address 0x12.
The source of truth for the memory registers is from the golioth/libostentus
repository (included as a submodule). Please consult
libostentus/include/libostentus_regmap.h
Using micropython on a Raspberry Pi Pico:
>>> i2c.scan()
[18]
>>> i2c.writeto_mem(0x12, 0x20, "Hello World!")
>>> i2c.writeto_mem(0x12, 0x22, "Golioth rulez!")
>>> i2c.writeto_mem(0x12, 0x01, b'\x00')This example scans for and prints out the ostentus i2c device (address 0x12)
before writing to lines 0 and 2 in memory and using a full refresh to show those
values on the display.
This is based on the i2cperipheral library for the
RP2040. The .mpy file that is
included in this library is too old for the Badger2040 build. Use the following
steps to build a more modern version:
- Clone the
i2cperipheralrepo - Run
make initto initialize the library - Enter the
micropythonlibrary and rungit stash - Use
git checkout v1.19to check out the correct version - Go back to the i2cperipheral directory and run
make init - Run
maketo build i2cperipheral.mpy which can be placed on the Badger2040