Adds the 4.2" e-paper panel and the status screen it draws
Adds the renderer, the panel driver and the controller that decides when to redraw, plus the dependencies and configuration all three need.
The panel shows network, robot and system status — including, when the robot is running its own access point, the passphrase for it. That is the only place that passphrase can be read, since it is derived from the board's serial number rather than stored anywhere.
Redraws are driven by change, not by a clock
A refresh takes the better part of three seconds, so the controller watches the robot's safety state and the WiFi interface and coalesces a burst of changes into one redraw. A slower periodic redraw keeps uptime and load from going stale and does the full refresh that clears the ghosting the partial ones leave behind.
Nothing walks a pixel in Elixir
Emerge rasterises with Skia in a Rustler NIF and packs to one or two bits per pixel on the Rust side. That is the point: the panel is 120,000 pixels and 15,000 bytes, and anything that walks that in Elixir costs about as long as the panel takes to show it.
Which is also why this task adds two aliases to your mix.exs. The NIF cache
is shared between every build, so a host mix test leaves an x86_64
library where the firmware build can see it and Nerves' release scrub rejects
the whole image. BB.NSK.MixHelpers handles the host and target copies as a
pair; see its docs for the whole story.
Two of the three dependencies are not on Hex
eink is a git branch — the packed-greyscale UC8276 driver and the
imperative API are only there — and emerge is a beta. Both are deliberate
and temporary.
Example
mix bb_nsk.add_display
Check it end to end, once the firmware is on a board:
BB.NSK.Display.TestCard.show(MyBot.Robot)Options
--robot- The robot module (defaults to{AppPrefix}.Robot).