Download firmware/src/screen.h from eoinedge/pose-micro: direct link, hf CLI and curl.
- Browser
- Download file 2.35 kB
-
https://huggingface.co/eoinedge/pose-micro/resolve/main/firmware/src/screen.h
- Command line
-
hf download hf://eoinedge/pose-micro/firmware/src/screen.h
-
curl -L -o screen.h https://huggingface.co/eoinedge/pose-micro/resolve/main/firmware/src/screen.h
2.35 kB
| /* Copyright (c) 2026 Eoin Jordan | |
| * SPDX-License-Identifier: Apache-2.0 | |
| * | |
| * The Seeed Studio Round Display for XIAO (GC9A01, 240 x 240) through | |
| * Zephyr's display API. | |
| * | |
| * There is no frame buffer: 240 x 240 RGB565 pixels would take 115 KiB. A | |
| * frame is drawn in horizontal bands instead. screen_render() calls the | |
| * draw function once per band; the drawing calls below clip to the band | |
| * being drawn, so the draw function simply paints the whole picture each | |
| * time it is called. | |
| */ | |
| extern "C" { | |
| /* Glyphs are 6 x 8 pixels times the scale given to screen_text(). */ | |
| typedef void (*screen_draw_fn)(void *ctx); | |
| /* Clear the panel and switch it on. Returns 0 or a negative errno. The | |
| * backlight of the round display is on by default. */ | |
| int screen_init(void); | |
| /* Draw one frame on a black background and send it to the panel. */ | |
| void screen_render(screen_draw_fn draw, void *ctx); | |
| /* For use inside a draw function. */ | |
| void screen_fill(int x, int y, int w, int h, uint16_t color); | |
| void screen_text(int x, int y, const char *s, int scale, uint16_t color); | |
| /* 8-bit grayscale image with an integer scale (28 x 28 at scale 3 is 84 x 84). */ | |
| void screen_gray(int x, int y, const uint8_t *img, int w, int h, int scale); | |
| /* RGB565 image in host byte order with an integer scale. */ | |
| void screen_rgb565(int x, int y, const uint16_t *img, int w, int h, int scale); | |
| /* The outline of a rectangle, t pixels thick. */ | |
| void screen_frame(int x, int y, int w, int h, int t, uint16_t color); | |
| /* Make the next screen_render() also print what it draws on the console: | |
| * "SCR 240 240 rgb565", one line of four hex digits a pixel for each row, | |
| * then "END SCR", for a host script to turn into a PNG. */ | |
| void screen_dump_next(void); | |
| } | |