diff options
| author | Scott Shawcroft <scott@tannewt.org> | 2019-07-05 19:01:54 -0700 |
|---|---|---|
| committer | Scott Shawcroft <scott@tannewt.org> | 2019-07-19 16:06:11 -0700 |
| commit | 6797ec6ed396f65916fe816f8b2b49114253dd86 (patch) | |
| tree | 31f26206469b803be6d1ef3d5d5b61c27e2fff0b /tools/gen_display_resources.py | |
| parent | a98bfa628e9f4469bbad5bafb042d7a2c3c15346 (diff) | |
Add support for grayscale displays that are < 8 bit depth.
This also improves Palette so it stores the original RGB888 colors.
Lastly, it adds I2CDisplay as a display bus to talk over I2C. Particularly
useful for the SSD1306.
Fixes #1828. Fixes #1956
Diffstat (limited to 'tools/gen_display_resources.py')
| -rw-r--r-- | tools/gen_display_resources.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/tools/gen_display_resources.py b/tools/gen_display_resources.py index 2c674c8eb..a731cbd9c 100644 --- a/tools/gen_display_resources.py +++ b/tools/gen_display_resources.py @@ -98,14 +98,21 @@ c_file.write("""\ """) c_file.write("""\ -uint32_t terminal_transparency[1] = {0x00000000}; - -// These colors are RGB 565 with the bytes swapped. -uint32_t terminal_colors[1] = {0xffff0000}; +_displayio_color_t terminal_colors[2] = { + { + .rgb888 = 0x000000, + .rgb565 = 0x0000, + .luma = 0x00 + }, + { + .rgb888 = 0xffffff, + .rgb565 = 0xffff, + .luma = 0xff + }, +}; displayio_palette_t supervisor_terminal_color = { .base = {.type = &displayio_palette_type }, - .opaque = terminal_transparency, .colors = terminal_colors, .color_count = 2, .needs_refresh = false |
