~alderwick/pico-uxn-sharpmemorydisplay

Pico-Uxn plugin for SHARP Memory Display
Update to latest Uxn.
Make all functions static except for screen_init.
Add proper plugin architecture.

refs

main
browse  log 

clone

read-only
https://git.sr.ht/~alderwick/pico-uxn-sharpmemorydisplay
read/write
git@git.sr.ht:~alderwick/pico-uxn-sharpmemorydisplay

You can also use your local clone with git send-email.

#pico-uxn plugin for the SHARP Memory Display

See the main repo for instructions on how to use this plugin.

#Hardware

This plugin works with the Adafruit 400x240 SHARP Memory Display breakout.

hardware overview

The SHARP Memory Display is connected as follows:

  • SCLK to GP7
  • MOSI to GP8
  • CS to GP9

These pins can be changed by editing config.h.

screen close-up

(The protective film is still on the screen, so that's why there's a yellow stripe there.)

#Using the Screen device

The SHARP Memory Display is only black and white, while Uxn provides four colors. The current color mapping is:

Layer Color number Result
fg 0 (transparent)
fg 1 White
fg 2 Black
fg 3 Blinking, mainly white
bg 0 Black
bg 1 White
bg 2 Blinking, mainly white
bg 3 Blinking, mainly black

It's a bit of a bizarre mapping, compared to Uxn's original scheme, and of course flashing can be achieved in the ROM that Uxn runs, but it's an easy way to provide simple UIs where, e.g., the selected tool in a toolbox blinks.

The color mapping is done entirely in the PIO program, so the Screen's memory can be transferred with DMA out to the SHARP display with hardly any work done by the ARM core.

Writing the whole screen takes around 50 ms or three standard Uxn frames, limited by the communication rate of the display hardware. Individual rows of the display can be written independently, so to improve the framerate only dirty rows are written when screen_redraw is called. Uxn's Screen vector is still called at 60 Hz so time-sensitive things run at the correct speed even if writing to the display falls behind.

#Todo

  • Fully implement blinking
  • Add Controller device over USB, perhaps Console too