https://github.com/atomvm/atomgl
https://github.com/atomvm/atomgl
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/atomvm/atomgl
- Owner: atomvm
- License: apache-2.0
- Created: 2021-04-24T12:00:36.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-08-19T21:50:40.000Z (over 1 year ago)
- Last Synced: 2024-08-20T01:51:55.083Z (over 1 year ago)
- Language: C
- Size: 244 KB
- Stars: 7
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.Md
- License: LICENSE
Awesome Lists containing this project
README
# AtomGL
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.**
## Supported Hardware
* `ilitek,ili9341` / `ilitek,ili9342c`: ILI9341 / ILI9342c: 240x320, 16 bit colors, supported
* `waveshare,5in65-acep-7c`: Waveshare 7-color 5.65" ACeP display module: 600x480, 7 colors +
software dithering
* `sharp,memory-lcd`: Sharp Memory LCDs: 400x240 1-bit monochromatic
* `solomon-systech,ssd1306`: Solomon Systech SSD1306: 128x64 1-bit monochromatic
* `sino-wealth,sh1106`: Sino Wealth SH1106: 128x64 1-bit monochromatic
[SDL Linux display](sdl_display/) is also supported and can be built as AtomVM plugin.
## Getting Started
1. Add this component to the ESP32 components directory
2. Open a display port using the right options
3. Start an [avm_scene](https://github.com/atomvm/avm_scene) that will push updates to the display
### Display Option Example
The following is an example for ILI9341:
```elixir
[...]
# 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)
[...]
```
## Primitives
The display driver takes care of drawing a list of primitive items. Such as:
```elixir
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](docs/primitives.md) for more information.