AtomGL is a display driver for a number of different display models and technologies.
This component is not meant for being used directly, instead an additional layer should take care of pushing updates to it. For this reason no additional NIFs are provided.
Please, use this component with a supported AtomVM version, such as v0.6.
ilitek,ili9341
/ilitek,ili9342c
: ILI9341 / ILI9342c: 240x320, 16 bit colors, supportedwaveshare,5in65-acep-7c
: Waveshare 7-color 5.65" ACeP display module: 600x480, 7 colors + software ditheringsharp,memory-lcd
: Sharp Memory LCDs: 400x240 1-bit monochromaticsolomon-systech,ssd1306
: Solomon Systech SSD1306: 128x64 1-bit monochromaticsino-wealth,sh1106
: Sino Wealth SH1106: 128x64 1-bit monochromatic
SDL Linux display is also supported and can be built as AtomVM plugin.
- Add this component to the ESP32 components directory
- Open a display port using the right options
- Start an avm_scene that will push updates to the display
The following is an example for ILI9341:
[...]
# spi is already open
ili_display_opts = [
width: 320,
height: 240,
compatible: "ilitek,ili9341",
reset: 18,
cs: 22,
dc: 21,
backlight: 5,
backlight_active: :low,
backlight_enabled: true,
rotation: 1,
enable_tft_invon: false,
spi_host: spi
]
:erlang.open_port({:spawn, "display"}, display_opts)
[...]
The display driver takes care of drawing a list of primitive items. Such as:
rendered = [
{:text, 10, 20, :default16px, 0x000000, 0x808080, "Hello."},
{:rect, 0, 0, width, height, 0x808080}
]
Following primitives are supported:
- image
- scaled_cropped_image
- rect
- text
See also documentation for more information.