diff --git a/Makefile b/Makefile index d752f37..c3e1a5c 100644 --- a/Makefile +++ b/Makefile @@ -8,8 +8,20 @@ PROGRAMMER_TYPE = avrispmkII PROGRAMMER_ARGS = +# Display dimensions +DISPLAY_WIDTH = 320 +DISPLAY_HEIGHT = 240 +# 1 = BGR, 0 = RGB +BGR = 1 +# Invert color +INVERT = 1 +# Flip image +HFLIP = 1 +VFLIP = 0 + MAIN = avrrfm.c -SRC = i2c.c mcp9808.c rfm69.c spi.c usart.c +SRC = bitmaps.h colorspace.c dejavu.c display.c font.c i2c.c mcp9808.c rfm69.c \ + spi.c tft.c usart.c CC = avr-gcc OBJCOPY = avr-objcopy @@ -18,6 +30,8 @@ AVRDUDE = avrdude CFLAGS = -mmcu=$(MCU) -DF_CPU=$(F_CPU)UL -DBAUD=$(BAUD) +CFLAGS += -DDISPLAY_WIDTH=$(DISPLAY_WIDTH) -DDISPLAY_HEIGHT=$(DISPLAY_HEIGHT) +CFLAGS += -DINVERT=$(INVERT) -DBGR=$(BGR) -DHFLIP=$(HFLIP) -DVFLIP=$(VFLIP) CFLAGS += -O2 -I. CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums CFLAGS += -Wall -Wstrict-prototypes @@ -33,7 +47,8 @@ OBJ = $(SRC:.c=.o) OBJ = $(SRC:.S=.o) -$(TARGET).elf: i2c.h mcp9808.h pins.h rfm69.h spi.h usart.h utils.h Makefile +$(TARGET).elf: bitmaps.h colorspace.h dejavu.h display.h font.h i2c.h \ + mcp9808.h pins.h rfm69.h spi.h tft.h types.h usart.h utils.h Makefile all: $(TARGET).hex diff --git a/avrrfm.c b/avrrfm.c index 09862ad..0fa323e 100644 --- a/avrrfm.c +++ b/avrrfm.c @@ -28,12 +28,18 @@ #include "utils.h" #include "rfm69.h" #include "mcp9808.h" +#include "tft.h" +#include "display.h" +#include "dejavu.h" -#define MEASURE_INTS 4 +#define MEASURE_INTS 8 /* 1 int = 8 seconds */ static volatile uint8_t ints = 0; +static uint16_t xoff = 0; +static uint16_t yoff = 0; + ISR(WDT_vect) { ints++; } @@ -56,9 +62,17 @@ // set radio CS and RST pin as output pin DDR_RFM |= (1 << PIN_RCS); DDR_RFM |= (1 << PIN_RRST); + + // set display CS, D/C and RST pin as output pin + DDR_DISP |= (1 << PIN_DCS); + DDR_DISP |= (1 << PIN_DDC); + DDR_DISP |= (1 << PIN_DRST); // drive output pins high - PORT_RFM |= (1 << PIN_RCS); + PORT_RFM |= (1 << PIN_RCS); + PORT_DISP |= (1 << PIN_DCS); + PORT_DISP |= (1 << PIN_DDC); + PORT_DISP |= (1 << PIN_DRST); } /** @@ -144,7 +158,7 @@ * Receives the temperature and converts it to °C. */ static void receiveTemp(void) { - printString("Receiving... "); + // printString("Receiving... "); uint8_t payload[2]; receivePayload(payload, sizeof (payload)); uint16_t raw = 0; @@ -154,8 +168,18 @@ int16_t tempx10 = convertTemp(raw); div_t temp = div(tempx10, 10); static char buf[16]; - snprintf(buf, sizeof (buf), "%d.%d°C\r\n", temp.quot, abs(temp.rem)); - printString(buf); + + // snprintf(buf, sizeof (buf), "%d.%d°C\r\n", temp.quot, abs(temp.rem)); + // printString(buf); + + setFrame(0xffff); + const __flash Font *dejaVu = &dejaVuFont; + snprintf(buf, sizeof (buf), "%4d.%d°", temp.quot, abs(temp.rem)); + width_t width = writeString(xoff, yoff, dejaVu, buf); + xoff += 10; + yoff += 10; + if (xoff > DISPLAY_WIDTH - width) xoff = 0; + if (yoff > DISPLAY_HEIGHT - dejaVu->height) yoff = 0; } int main(void) { @@ -171,9 +195,12 @@ printString("Hello Radio!\r\n"); - initRadio(868600); - - bool tx = true; + initRadio(868600); + initDisplay(); + + setFrame(0xffff); + + bool tx = false; while (true) { if (tx) { diff --git a/bitmaps.c b/bitmaps.c new file mode 100644 index 0000000..1d209f6 --- /dev/null +++ b/bitmaps.c @@ -0,0 +1,19 @@ +/* + * File: bitmaps.c + * Author: torsten.roemer@luniks.net + * + * Created on 6. November 2023, 18:45 + */ + +#include "bitmaps.h" + +const __flash uint8_t SOME_DATA[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +const __flash Bitmap bitmaps[] = { + {16, 16, SPACE_MONO1, SOME_DATA} +}; diff --git a/bitmaps.h b/bitmaps.h new file mode 100644 index 0000000..dbf36ae --- /dev/null +++ b/bitmaps.h @@ -0,0 +1,36 @@ +/* + * File: bitmaps.h + * Author: torsten.roemer@luniks.net + * + * Created on 16. April 2023, 18:19 + */ + +#ifndef BITMAPS_H +#define BITMAPS_H + +#include +#include +#include "types.h" +#include "colorspace.h" + +/** + * A bitmap with its width and height, and data. + */ +typedef struct { + /** Width of the bitmap. */ + const width_t width; + /** Height of the bitmap. */ + const height_t height; + /** Color space of the bitmap. */ + const space_t space; + /** The actual bitmap. */ + const __flash uint8_t *bitmap; +} Bitmap; + +/** + * Available bitmaps. + */ +extern const __flash Bitmap bitmaps[]; + +#endif /* BITMAPS_H */ + diff --git a/colorspace.c b/colorspace.c new file mode 100644 index 0000000..36a5124 --- /dev/null +++ b/colorspace.c @@ -0,0 +1,83 @@ +/* + * File: colorspace.c + * Author: torsten.roemer@luniks.net + * + * Created on 3. Juli 2024, 19:03 + */ + +#include "colorspace.h" + +/** + * Converts the given 8 pixel in 1-Bit monochrome to 16-Bit RGB (5/6/5) color + * stored in the given array of 16 bytes. + * + * @param mono 8 pixel in 1-Bit monochrome + * @param rgb 8 pixel in 16-Bit RGB (5/6/5) color + */ +static void mono1ToRGB16(uint8_t mono, uint8_t *rgb) { + for (uint8_t i = 0; i < 16; i++) { + rgb[i] = (mono & (1 << ((15 - i) >> 1))) ? 0x0 : 0xff; + } +} + +/* + * Converts the given two pixel in 4-Bit greyscale to 16-Bit RGB (5/6/5) color + * stored in the given array of four bytes. + * + * @param grey two pixel in 4-Bit greyscale + * @param rgb two pixel in 16-Bit RGB (5/6/5) color + */ +static void grey4ToRGB16(uint8_t grey, uint8_t *rgb) { + uint8_t grey4 = ((grey >> 4) & 1); + uint8_t grey0 = ((grey >> 0) & 1); + + rgb[0] = (grey & 0xf0); + rgb[0] |= (grey4 << 3); + rgb[0] |= (grey >> 5); + + rgb[1] = ((grey & 0xf0) << 3); + rgb[1] |= ((grey & 0xf0) >> 3); + rgb[1] |= (grey4 << 6) | (grey4 << 5) | (grey4 << 0); + + rgb[2] = (grey << 4); + rgb[2] |= (grey0 << 3); + rgb[2] |= ((grey & 0x0f) >> 1); + + rgb[3] = (grey << 7); + rgb[3] |= ((grey & 0x0f) << 1); + rgb[3] |= (grey0 << 6) | (grey0 << 5) | (grey0 << 0); +} + +void writeSpace(const __flash uint8_t *bitmap, + width_t width, height_t height, + space_t space) { + switch (space) { + case SPACE_MONO1: { + bytes_t bytes = width * height / 8; + for (uint16_t i = 0; i < bytes; i++) { + uint8_t rgb[16]; + mono1ToRGB16(bitmap[i], rgb); + for (uint8_t j = 0; j < 16; j++) { + transmit(rgb[j]); + } + } + }; break; + case SPACE_GREY4: { + bytes_t bytes = width * height / 2; + for (uint16_t i = 0; i < bytes; i++) { + uint8_t rgb[4]; + grey4ToRGB16(bitmap[i], rgb); + for (uint8_t j = 0; j < 4; j++) { + transmit(rgb[j]); + } + } + }; break; + default: { + // SPACE_RGB16 + bytes_t bytes = width * height * 2; + for (uint16_t i = 0; i < bytes; i++) { + transmit(bitmap[i]); + } + } + } +} \ No newline at end of file diff --git a/colorspace.h b/colorspace.h new file mode 100644 index 0000000..7d47e86 --- /dev/null +++ b/colorspace.h @@ -0,0 +1,34 @@ +/* + * File: colorspace.h + * Author: torsten.roemer@luniks.net + * + * Created on 3. Juli 2024, 19:02 + */ + +#ifndef COLORSPACE_H +#define COLORSPACE_H + +// TODO use enum? typedef? +#define SPACE_MONO1 1 +#define SPACE_GREY4 4 +#define SPACE_RGB16 16 + +#include +#include "types.h" +#include "spi.h" + +/** + * Helper to write image data to the display, converting from the given + * color space to that of the display. + * + * @param bitmap pointer to bitmap data in program memory + * @param width width of the bitmap in pixels + * @param height height of the bitmap in pixels + * @param space color space of the bitmap + */ +void writeSpace(const __flash uint8_t *bitmap, + width_t width, height_t height, + space_t space); + +#endif /* COLORSPACE_H */ + diff --git a/dejavu.c b/dejavu.c new file mode 100644 index 0000000..df07eac --- /dev/null +++ b/dejavu.c @@ -0,0 +1,796 @@ +/* + * File: dejavu.c + * Author: torsten.roemer@luniks.net + * https://dejavu-fonts.github.io/License.html + * + * Created on 23. April 2023, 18:41 + */ + +#include +#include "font.h" +#include "dejavu.h" +#include "utils.h" + +#define HEIGHT 56 + +static const __flash uint8_t SPACE[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +static const __flash uint8_t EXCLAMATION_MARK[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x03, 0xc0, + 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, + 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, + 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, + 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, + 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, + 0x03, 0xc0, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, + 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, + 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +static const __flash uint8_t NUMBER_SIGN[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x03, 0xc0, 0xf0, 0x00, 0x03, 0xc0, 0xe0, + 0x00, 0x03, 0xc1, 0xe0, 0x00, 0x07, 0x81, 0xe0, + 0x00, 0x07, 0x81, 0xe0, 0x00, 0x07, 0x81, 0xc0, + 0x00, 0x07, 0x83, 0xc0, 0x00, 0x0f, 0x03, 0xc0, + 0x00, 0x0f, 0x03, 0xc0, 0x00, 0x0f, 0x03, 0x80, + 0x07, 0xff, 0xff, 0xfe, 0x07, 0xff, 0xff, 0xfe, + 0x07, 0xff, 0xff, 0xfe, 0x07, 0xff, 0xff, 0xfe, + 0x00, 0x1e, 0x0f, 0x00, 0x00, 0x1c, 0x0f, 0x00, + 0x00, 0x3c, 0x0f, 0x00, 0x00, 0x3c, 0x0e, 0x00, + 0x00, 0x3c, 0x1e, 0x00, 0x00, 0x78, 0x1e, 0x00, + 0x00, 0x78, 0x1e, 0x00, 0x3f, 0xff, 0xff, 0xf0, + 0x3f, 0xff, 0xff, 0xf0, 0x3f, 0xff, 0xff, 0xf0, + 0x3f, 0xff, 0xff, 0xf0, 0x00, 0xf0, 0x38, 0x00, + 0x00, 0xf0, 0x78, 0x00, 0x01, 0xe0, 0x78, 0x00, + 0x01, 0xe0, 0x78, 0x00, 0x01, 0xe0, 0x70, 0x00, + 0x01, 0xe0, 0xf0, 0x00, 0x03, 0xc0, 0xf0, 0x00, + 0x03, 0xc0, 0xf0, 0x00, 0x03, 0xc0, 0xe0, 0x00, + 0x03, 0xc1, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +static const __flash uint8_t PERCENT_SIGN[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, + 0x03, 0xfe, 0x00, 0x00, 0x07, 0xff, 0x00, 0x00, + 0x0f, 0x07, 0x80, 0x00, 0x0e, 0x03, 0x80, 0x00, + 0x1c, 0x01, 0xc0, 0x00, 0x1c, 0x01, 0xc0, 0x00, + 0x1c, 0x01, 0xc0, 0x00, 0x1c, 0x01, 0xc0, 0x00, + 0x1c, 0x01, 0xc0, 0x00, 0x0e, 0x03, 0x80, 0x00, + 0x0f, 0x07, 0x80, 0x18, 0x07, 0xff, 0x00, 0xf8, + 0x03, 0xfe, 0x03, 0xf0, 0x00, 0xf8, 0x1f, 0xc0, + 0x00, 0x00, 0x7e, 0x00, 0x00, 0x03, 0xf8, 0x00, + 0x00, 0x0f, 0xc0, 0x00, 0x00, 0x3f, 0x00, 0x00, + 0x01, 0xf8, 0x0f, 0x80, 0x07, 0xe0, 0x3f, 0xe0, + 0x0f, 0x80, 0x7f, 0xf0, 0x04, 0x00, 0xf0, 0x78, + 0x00, 0x00, 0xe0, 0x38, 0x00, 0x01, 0xc0, 0x1c, + 0x00, 0x01, 0xc0, 0x1c, 0x00, 0x01, 0xc0, 0x1c, + 0x00, 0x01, 0xc0, 0x1c, 0x00, 0x01, 0xc0, 0x1c, + 0x00, 0x00, 0xe0, 0x38, 0x00, 0x00, 0xf0, 0x78, + 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x3f, 0xe0, + 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +static const __flash uint8_t ASTERISK[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x38, + 0x00, 0x00, 0x38, 0x00, 0x00, 0x38, 0x00, 0x20, + 0x38, 0x08, 0x78, 0x38, 0x3c, 0x7c, 0x38, 0x7c, + 0x1f, 0x39, 0xf0, 0x07, 0xbb, 0xc0, 0x01, 0xff, + 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00, 0x01, + 0xff, 0x00, 0x07, 0xbb, 0xc0, 0x1f, 0x39, 0xf0, + 0x7c, 0x38, 0x7c, 0x78, 0x38, 0x3c, 0x20, 0x38, + 0x08, 0x00, 0x38, 0x00, 0x00, 0x38, 0x00, 0x00, + 0x38, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +static const __flash uint8_t PLUS_SIGN[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, + 0x00, 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, 0x00, + 0x3c, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, + 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x3c, + 0x00, 0x00, 0x3c, 0x00, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x3c, + 0x00, 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, 0x00, + 0x3c, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, + 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +static const __flash uint8_t COMMA[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x07, 0xe0, 0x07, 0xe0, + 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, + 0x07, 0xc0, 0x0f, 0xc0, 0x0f, 0x80, 0x0f, 0x80, + 0x0f, 0x80, 0x0f, 0x00, 0x1f, 0x00, 0x1e, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +static const __flash uint8_t HYPHEN_MINUS[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x03, 0xff, 0xc0, 0x03, 0xff, 0xc0, + 0x03, 0xff, 0xc0, 0x03, 0xff, 0xc0, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +static const __flash uint8_t FULL_STOP[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x07, 0xe0, 0x07, 0xe0, + 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, + 0x07, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +static const __flash uint8_t SOLIDUS[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x07, 0x80, + 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x0f, 0x00, + 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x1e, 0x00, + 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x1e, 0x00, + 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x3c, 0x00, + 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x78, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xf0, 0x00, + 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, + 0x00, 0x03, 0xc0, 0x00, 0x00, 0x03, 0xc0, 0x00, + 0x00, 0x07, 0x80, 0x00, 0x00, 0x07, 0x80, 0x00, + 0x00, 0x07, 0x80, 0x00, 0x00, 0x0f, 0x00, 0x00, + 0x00, 0x0f, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, + 0x00, 0x1e, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, + 0x00, 0x3c, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, + 0x00, 0x78, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, + 0x00, 0xf0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, + 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, + 0x03, 0xc0, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, + 0x07, 0x80, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, + 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +static const __flash uint8_t DIGIT_0[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf0, 0x00, + 0x00, 0x1f, 0xfc, 0x00, 0x00, 0x3f, 0xfe, 0x00, + 0x00, 0x7f, 0xff, 0x00, 0x00, 0xfc, 0x1f, 0x80, + 0x01, 0xf0, 0x07, 0xc0, 0x01, 0xf0, 0x07, 0xc0, + 0x01, 0xe0, 0x03, 0xc0, 0x03, 0xc0, 0x01, 0xe0, + 0x03, 0xc0, 0x01, 0xe0, 0x03, 0xc0, 0x01, 0xe0, + 0x03, 0xc0, 0x01, 0xe0, 0x07, 0x80, 0x00, 0xf0, + 0x07, 0x80, 0x00, 0xf0, 0x07, 0x80, 0x00, 0xf0, + 0x07, 0x80, 0x00, 0xf0, 0x07, 0x80, 0x00, 0xf0, + 0x07, 0x80, 0x00, 0xf0, 0x07, 0x80, 0x00, 0xf0, + 0x07, 0x80, 0x00, 0xf0, 0x07, 0x80, 0x00, 0xf0, + 0x07, 0x80, 0x00, 0xf0, 0x07, 0x80, 0x00, 0xf0, + 0x07, 0x80, 0x00, 0xf0, 0x07, 0x80, 0x00, 0xf0, + 0x03, 0xc0, 0x01, 0xe0, 0x03, 0xc0, 0x01, 0xe0, + 0x03, 0xc0, 0x01, 0xe0, 0x03, 0xc0, 0x01, 0xe0, + 0x01, 0xe0, 0x03, 0xc0, 0x01, 0xf0, 0x07, 0xc0, + 0x01, 0xf0, 0x07, 0xc0, 0x00, 0xfc, 0x1f, 0x80, + 0x00, 0x7f, 0xff, 0x00, 0x00, 0x3f, 0xfe, 0x00, + 0x00, 0x1f, 0xfc, 0x00, 0x00, 0x07, 0xf0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +static const __flash uint8_t DIGIT_1[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x03, 0xf0, 0x00, 0x00, 0x3f, 0xf0, 0x00, + 0x00, 0xff, 0xf0, 0x00, 0x00, 0xff, 0xf0, 0x00, + 0x00, 0xfc, 0xf0, 0x00, 0x00, 0xc0, 0xf0, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xf0, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xf0, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xf0, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xf0, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xf0, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xf0, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xf0, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xf0, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xf0, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xf0, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xf0, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xf0, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x7f, 0xff, 0xe0, + 0x00, 0x7f, 0xff, 0xe0, 0x00, 0x7f, 0xff, 0xe0, + 0x00, 0x7f, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +static const __flash uint8_t DIGIT_2[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xf8, 0x00, + 0x01, 0xff, 0xff, 0x00, 0x03, 0xff, 0xff, 0x80, + 0x03, 0xff, 0xff, 0xc0, 0x03, 0xf8, 0x07, 0xe0, + 0x03, 0xc0, 0x01, 0xf0, 0x02, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x78, + 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x78, + 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x78, + 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x01, 0xf0, 0x00, 0x00, 0x03, 0xe0, + 0x00, 0x00, 0x07, 0xe0, 0x00, 0x00, 0x0f, 0xc0, + 0x00, 0x00, 0x1f, 0x80, 0x00, 0x00, 0x3f, 0x00, + 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0xfc, 0x00, + 0x00, 0x01, 0xf8, 0x00, 0x00, 0x03, 0xf0, 0x00, + 0x00, 0x07, 0xe0, 0x00, 0x00, 0x0f, 0xc0, 0x00, + 0x00, 0x1f, 0x80, 0x00, 0x00, 0x3f, 0x00, 0x00, + 0x00, 0x7e, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, + 0x01, 0xf0, 0x00, 0x00, 0x03, 0xff, 0xff, 0xf8, + 0x03, 0xff, 0xff, 0xf8, 0x03, 0xff, 0xff, 0xf8, + 0x03, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +static const __flash uint8_t DIGIT_3[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xf0, 0x00, + 0x00, 0xff, 0xfc, 0x00, 0x03, 0xff, 0xff, 0x00, + 0x03, 0xff, 0xff, 0x80, 0x03, 0xe0, 0x1f, 0xc0, + 0x02, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x03, 0xe0, + 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, + 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, + 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x03, 0xc0, + 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x1f, 0x80, + 0x00, 0x1f, 0xff, 0x00, 0x00, 0x1f, 0xfe, 0x00, + 0x00, 0x1f, 0xfe, 0x00, 0x00, 0x1f, 0xff, 0x00, + 0x00, 0x00, 0x1f, 0xc0, 0x00, 0x00, 0x07, 0xc0, + 0x00, 0x00, 0x03, 0xe0, 0x00, 0x00, 0x01, 0xe0, + 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x01, 0xf0, 0x04, 0x00, 0x03, 0xe0, + 0x07, 0x00, 0x07, 0xe0, 0x07, 0xe0, 0x1f, 0xc0, + 0x07, 0xff, 0xff, 0x80, 0x07, 0xff, 0xff, 0x00, + 0x03, 0xff, 0xfe, 0x00, 0x00, 0x3f, 0xf0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +static const __flash uint8_t DIGIT_4[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x7e, 0x00, + 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xfe, 0x00, + 0x00, 0x01, 0xde, 0x00, 0x00, 0x03, 0xde, 0x00, + 0x00, 0x03, 0x9e, 0x00, 0x00, 0x07, 0x9e, 0x00, + 0x00, 0x0f, 0x1e, 0x00, 0x00, 0x0f, 0x1e, 0x00, + 0x00, 0x1e, 0x1e, 0x00, 0x00, 0x1c, 0x1e, 0x00, + 0x00, 0x3c, 0x1e, 0x00, 0x00, 0x78, 0x1e, 0x00, + 0x00, 0x78, 0x1e, 0x00, 0x00, 0xf0, 0x1e, 0x00, + 0x00, 0xf0, 0x1e, 0x00, 0x01, 0xe0, 0x1e, 0x00, + 0x03, 0xc0, 0x1e, 0x00, 0x03, 0xc0, 0x1e, 0x00, + 0x07, 0x80, 0x1e, 0x00, 0x07, 0x80, 0x1e, 0x00, + 0x0f, 0x00, 0x1e, 0x00, 0x0f, 0xff, 0xff, 0xf0, + 0x0f, 0xff, 0xff, 0xf0, 0x0f, 0xff, 0xff, 0xf0, + 0x0f, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x1e, 0x00, + 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x1e, 0x00, + 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x1e, 0x00, + 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x1e, 0x00, + 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +static const __flash uint8_t DIGIT_5[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0xff, 0xff, 0xc0, 0x01, 0xff, 0xff, 0xc0, + 0x01, 0xff, 0xff, 0xc0, 0x01, 0xff, 0xff, 0xc0, + 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, + 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, + 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, + 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, + 0x01, 0xef, 0xf0, 0x00, 0x01, 0xff, 0xfc, 0x00, + 0x01, 0xff, 0xff, 0x00, 0x01, 0xff, 0xff, 0x80, + 0x01, 0xe0, 0x1f, 0xc0, 0x01, 0x00, 0x07, 0xc0, + 0x00, 0x00, 0x03, 0xe0, 0x00, 0x00, 0x01, 0xe0, + 0x00, 0x00, 0x01, 0xf0, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x01, 0xf0, + 0x00, 0x00, 0x01, 0xe0, 0x04, 0x00, 0x03, 0xe0, + 0x07, 0x00, 0x07, 0xc0, 0x07, 0xe0, 0x1f, 0xc0, + 0x07, 0xff, 0xff, 0x80, 0x07, 0xff, 0xff, 0x00, + 0x03, 0xff, 0xfc, 0x00, 0x00, 0x7f, 0xe0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +static const __flash uint8_t DIGIT_6[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0x00, + 0x00, 0x0f, 0xff, 0x80, 0x00, 0x3f, 0xff, 0x80, + 0x00, 0x7f, 0xff, 0x80, 0x00, 0x7e, 0x01, 0x80, + 0x00, 0xf8, 0x00, 0x00, 0x01, 0xf0, 0x00, 0x00, + 0x01, 0xe0, 0x00, 0x00, 0x03, 0xe0, 0x00, 0x00, + 0x03, 0xc0, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, + 0x03, 0xc0, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, + 0x07, 0x83, 0xf8, 0x00, 0x07, 0x8f, 0xfe, 0x00, + 0x07, 0x9f, 0xff, 0x00, 0x07, 0xbf, 0xff, 0x80, + 0x07, 0xfc, 0x0f, 0xc0, 0x07, 0xf8, 0x03, 0xe0, + 0x07, 0xf0, 0x01, 0xe0, 0x07, 0xe0, 0x01, 0xe0, + 0x07, 0xe0, 0x00, 0xf0, 0x07, 0xc0, 0x00, 0xf0, + 0x07, 0xc0, 0x00, 0xf0, 0x07, 0xc0, 0x00, 0xf0, + 0x07, 0xc0, 0x00, 0xf0, 0x03, 0xc0, 0x00, 0xf0, + 0x03, 0xc0, 0x00, 0xf0, 0x03, 0xe0, 0x00, 0xf0, + 0x03, 0xe0, 0x01, 0xe0, 0x01, 0xf0, 0x01, 0xe0, + 0x01, 0xf8, 0x03, 0xe0, 0x00, 0xfc, 0x0f, 0xc0, + 0x00, 0x7f, 0xff, 0x80, 0x00, 0x3f, 0xff, 0x00, + 0x00, 0x1f, 0xfe, 0x00, 0x00, 0x07, 0xf8, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +static const __flash uint8_t DIGIT_7[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x07, 0xff, 0xff, 0xf0, 0x07, 0xff, 0xff, 0xf0, + 0x07, 0xff, 0xff, 0xf0, 0x07, 0xff, 0xff, 0xe0, + 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x03, 0xe0, + 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x07, 0xc0, + 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x07, 0x80, + 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x0f, 0x00, + 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x1e, 0x00, + 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x3c, 0x00, + 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x7c, 0x00, + 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xf8, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xf0, 0x00, + 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x00, + 0x00, 0x03, 0xe0, 0x00, 0x00, 0x03, 0xc0, 0x00, + 0x00, 0x03, 0xc0, 0x00, 0x00, 0x07, 0x80, 0x00, + 0x00, 0x07, 0x80, 0x00, 0x00, 0x0f, 0x80, 0x00, + 0x00, 0x0f, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, + 0x00, 0x1e, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, + 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +static const __flash uint8_t DIGIT_8[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf0, 0x00, + 0x00, 0x3f, 0xfe, 0x00, 0x00, 0x7f, 0xff, 0x00, + 0x00, 0xff, 0xff, 0x80, 0x01, 0xf8, 0x0f, 0xc0, + 0x01, 0xf0, 0x07, 0xc0, 0x03, 0xe0, 0x03, 0xe0, + 0x03, 0xc0, 0x01, 0xe0, 0x03, 0xc0, 0x01, 0xe0, + 0x03, 0xc0, 0x01, 0xe0, 0x03, 0xc0, 0x01, 0xe0, + 0x03, 0xc0, 0x01, 0xe0, 0x01, 0xe0, 0x03, 0xc0, + 0x01, 0xf0, 0x07, 0xc0, 0x00, 0xf8, 0x0f, 0x80, + 0x00, 0x7f, 0xff, 0x00, 0x00, 0x1f, 0xfc, 0x00, + 0x00, 0x3f, 0xfe, 0x00, 0x00, 0xff, 0xff, 0x80, + 0x01, 0xf8, 0x0f, 0xc0, 0x01, 0xe0, 0x03, 0xc0, + 0x03, 0xc0, 0x01, 0xe0, 0x03, 0xc0, 0x01, 0xe0, + 0x07, 0x80, 0x00, 0xf0, 0x07, 0x80, 0x00, 0xf0, + 0x07, 0x80, 0x00, 0xf0, 0x07, 0x80, 0x00, 0xf0, + 0x07, 0x80, 0x00, 0xf0, 0x07, 0x80, 0x00, 0xf0, + 0x07, 0xc0, 0x01, 0xf0, 0x03, 0xc0, 0x01, 0xe0, + 0x03, 0xe0, 0x03, 0xe0, 0x01, 0xf8, 0x0f, 0xc0, + 0x01, 0xff, 0xff, 0xc0, 0x00, 0xff, 0xff, 0x80, + 0x00, 0x3f, 0xfe, 0x00, 0x00, 0x0f, 0xf8, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +static const __flash uint8_t DIGIT_9[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xf0, 0x00, + 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x7f, 0xfe, 0x00, + 0x00, 0xff, 0xff, 0x00, 0x01, 0xf8, 0x1f, 0x80, + 0x03, 0xe0, 0x0f, 0xc0, 0x03, 0xc0, 0x07, 0xc0, + 0x03, 0xc0, 0x03, 0xe0, 0x07, 0x80, 0x03, 0xe0, + 0x07, 0x80, 0x01, 0xe0, 0x07, 0x80, 0x01, 0xe0, + 0x07, 0x80, 0x01, 0xf0, 0x07, 0x80, 0x01, 0xf0, + 0x07, 0x80, 0x01, 0xf0, 0x07, 0x80, 0x01, 0xf0, + 0x07, 0x80, 0x03, 0xf0, 0x03, 0xc0, 0x03, 0xf0, + 0x03, 0xc0, 0x07, 0xf0, 0x03, 0xe0, 0x0f, 0xf0, + 0x01, 0xf8, 0x1f, 0xf0, 0x00, 0xff, 0xfe, 0xf0, + 0x00, 0x7f, 0xfc, 0xf0, 0x00, 0x3f, 0xf8, 0xf0, + 0x00, 0x0f, 0xe0, 0xf0, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x01, 0xe0, + 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x03, 0xe0, + 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x07, 0xc0, + 0x00, 0x00, 0x0f, 0x80, 0x00, 0xc0, 0x3f, 0x00, + 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xfe, 0x00, + 0x00, 0xff, 0xf8, 0x00, 0x00, 0x3f, 0xe0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +static const __flash uint8_t COLON[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, + 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x07, 0xe0, 0x07, 0xe0, + 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, + 0x07, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +static const __flash uint8_t SEMICOLON[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, + 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x07, 0xe0, 0x07, 0xe0, + 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, + 0x07, 0xc0, 0x0f, 0xc0, 0x0f, 0x80, 0x0f, 0x80, + 0x0f, 0x80, 0x0f, 0x00, 0x1f, 0x00, 0x1e, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +static const __flash uint8_t LESS_THAN_SIGN[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x78, + 0x00, 0x00, 0x03, 0xf8, 0x00, 0x00, 0x0f, 0xf8, + 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x01, 0xff, 0x80, + 0x00, 0x0f, 0xfe, 0x00, 0x00, 0x7f, 0xf0, 0x00, + 0x01, 0xff, 0x80, 0x00, 0x0f, 0xfc, 0x00, 0x00, + 0x0f, 0xf0, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, + 0x0f, 0xf0, 0x00, 0x00, 0x0f, 0xfc, 0x00, 0x00, + 0x01, 0xff, 0x80, 0x00, 0x00, 0x7f, 0xf0, 0x00, + 0x00, 0x0f, 0xfe, 0x00, 0x00, 0x01, 0xff, 0x80, + 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x0f, 0xf8, + 0x00, 0x00, 0x03, 0xf8, 0x00, 0x00, 0x00, 0x78, + 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +static const __flash uint8_t EQUALS_SIGN[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xf8, + 0x0f, 0xff, 0xff, 0xf8, 0x0f, 0xff, 0xff, 0xf8, + 0x0f, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xf8, + 0x0f, 0xff, 0xff, 0xf8, 0x0f, 0xff, 0xff, 0xf8, + 0x0f, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +static const __flash uint8_t GREATER_THAN_SIGN[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, + 0x0f, 0xe0, 0x00, 0x00, 0x0f, 0xf8, 0x00, 0x00, + 0x07, 0xff, 0x00, 0x00, 0x00, 0xff, 0xc0, 0x00, + 0x00, 0x3f, 0xf8, 0x00, 0x00, 0x07, 0xff, 0x00, + 0x00, 0x00, 0xff, 0xc0, 0x00, 0x00, 0x1f, 0xf8, + 0x00, 0x00, 0x07, 0xf8, 0x00, 0x00, 0x00, 0xf8, + 0x00, 0x00, 0x07, 0xf8, 0x00, 0x00, 0x1f, 0xf8, + 0x00, 0x00, 0xff, 0xc0, 0x00, 0x07, 0xff, 0x00, + 0x00, 0x3f, 0xf8, 0x00, 0x00, 0xff, 0xc0, 0x00, + 0x07, 0xff, 0x00, 0x00, 0x0f, 0xf8, 0x00, 0x00, + 0x0f, 0xe0, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +static const __flash uint8_t QUESTION_MARK[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0xfe, 0x00, 0x07, 0xff, + 0x80, 0x1f, 0xff, 0xe0, 0x3f, 0xff, 0xe0, 0x3f, + 0x03, 0xf0, 0x38, 0x00, 0xf8, 0x20, 0x00, 0x78, + 0x00, 0x00, 0x78, 0x00, 0x00, 0x78, 0x00, 0x00, + 0x78, 0x00, 0x00, 0xf8, 0x00, 0x00, 0xf0, 0x00, + 0x01, 0xf0, 0x00, 0x03, 0xe0, 0x00, 0x07, 0xe0, + 0x00, 0x0f, 0xc0, 0x00, 0x1f, 0x80, 0x00, 0x3f, + 0x00, 0x00, 0x7c, 0x00, 0x00, 0x78, 0x00, 0x00, + 0xf8, 0x00, 0x00, 0xf0, 0x00, 0x00, 0xf0, 0x00, + 0x00, 0xf0, 0x00, 0x00, 0xf0, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, + 0x00, 0xf0, 0x00, 0x00, 0xf0, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0xf0, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +static const __flash uint8_t COMMERCIAL_AT[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0xfe, 0x00, 0x00, 0x0f, 0xff, 0x80, + 0x00, 0x1f, 0xff, 0xc0, 0x00, 0x7f, 0x03, 0xe0, + 0x00, 0xfc, 0x00, 0xf0, 0x01, 0xf0, 0x00, 0x78, + 0x01, 0xe0, 0x00, 0x38, 0x03, 0xc0, 0x00, 0x3c, + 0x07, 0xc0, 0x00, 0x1c, 0x07, 0x80, 0x00, 0x1c, + 0x07, 0x80, 0x1f, 0x1c, 0x0f, 0x00, 0x7f, 0xdc, + 0x0f, 0x00, 0xff, 0xfc, 0x0f, 0x01, 0xf0, 0xfc, + 0x1e, 0x03, 0xe0, 0x7c, 0x1e, 0x03, 0xc0, 0x3c, + 0x1e, 0x07, 0xc0, 0x3c, 0x1e, 0x07, 0x80, 0x1c, + 0x1e, 0x07, 0x80, 0x1c, 0x1e, 0x07, 0x80, 0x1c, + 0x1e, 0x07, 0x80, 0x1c, 0x1e, 0x07, 0x80, 0x1c, + 0x1e, 0x07, 0x80, 0x1c, 0x1e, 0x07, 0xc0, 0x3c, + 0x1e, 0x03, 0xc0, 0x3c, 0x0f, 0x03, 0xe0, 0x7c, + 0x0f, 0x01, 0xf0, 0xfc, 0x0f, 0x00, 0xff, 0xfc, + 0x0f, 0x80, 0x7f, 0xdc, 0x07, 0x80, 0x1f, 0x1c, + 0x07, 0xc0, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, + 0x03, 0xe0, 0x00, 0x00, 0x01, 0xf0, 0x00, 0x00, + 0x00, 0xf8, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, + 0x00, 0x3f, 0x80, 0x40, 0x00, 0x0f, 0xff, 0xe0, + 0x00, 0x07, 0xff, 0xe0, 0x00, 0x00, 0x7f, 0x80, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +static const __flash uint8_t DEGREE_SIGN[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x07, 0xc0, 0x1f, 0xf0, 0x3f, 0xf8, + 0x78, 0x3c, 0x70, 0x1c, 0xe0, 0x0e, 0xe0, 0x0e, + 0xe0, 0x0e, 0xe0, 0x0e, 0xe0, 0x0e, 0x70, 0x1c, + 0x78, 0x3c, 0x3f, 0xf8, 0x1f, 0xf0, 0x07, 0xc0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +const __flash Glyph glyphs[] = { + {0x0020, 24, SPACE}, + {0x0021, 16, EXCLAMATION_MARK}, + {0x0023, 32, NUMBER_SIGN}, + {0x0025, 32, PERCENT_SIGN}, + {0x002a, 24, ASTERISK}, + {0x002b, 24, PLUS_SIGN}, + {0x002c, 16, COMMA}, + {0x002d, 24, HYPHEN_MINUS}, + {0x002e, 16, FULL_STOP}, + {0x002f, 32, SOLIDUS}, + {0x0030, 32, DIGIT_0}, + {0x0031, 32, DIGIT_1}, + {0x0032, 32, DIGIT_2}, + {0x0033, 32, DIGIT_3}, + {0x0034, 32, DIGIT_4}, + {0x0035, 32, DIGIT_5}, + {0x0036, 32, DIGIT_6}, + {0x0037, 32, DIGIT_7}, + {0x0038, 32, DIGIT_8}, + {0x0039, 32, DIGIT_9}, + {0x003a, 16, COLON}, + {0x003b, 16, SEMICOLON}, + {0x003c, 32, LESS_THAN_SIGN}, + {0x003d, 32, EQUALS_SIGN}, + {0x003e, 32, GREATER_THAN_SIGN}, + {0x003f, 24, QUESTION_MARK}, + {0x0040, 32, COMMERCIAL_AT}, + {0x00b0, 16, DEGREE_SIGN} +}; + +const __flash Font dejaVuFont = {glyphs, array_length(glyphs), HEIGHT, SPACE_MONO1}; diff --git a/dejavu.h b/dejavu.h new file mode 100644 index 0000000..68d9272 --- /dev/null +++ b/dejavu.h @@ -0,0 +1,21 @@ +/* + * File: dejavu.h + * Author: torsten.roemer@luniks.net + * https://dejavu-fonts.github.io/License.html + * + * Created on 23. April 2023, 18:41 + */ + +#ifndef DEJAVU_H +#define DEJAVU_H + +#include "font.h" +#include "colorspace.h" + +/** + * DejaVu font. + */ +extern const __flash Font dejaVuFont; + +#endif /* DEJAVU_H */ + diff --git a/display.c b/display.c new file mode 100644 index 0000000..195fdaf --- /dev/null +++ b/display.c @@ -0,0 +1,48 @@ +/* + * File: display.c + * Author: torsten.roemer@luniks.net + * + * Created on 18. April 2023, 21:56 + */ + +#include "display.h" + +void setFrame(uint16_t color) { + fillArea(0, 0, DISPLAY_WIDTH, DISPLAY_HEIGHT, color); +} + +width_t writeBitmap(x_t x, y_t y, uint16_t index) { + const __flash Bitmap *bitmap = &bitmaps[index]; + setArea(x, y, bitmap->width, bitmap->height, false, false); + writeData(bitmap->bitmap, bitmap->width, bitmap->height, bitmap->space); + + return bitmap->width; +} + +width_t writeGlyph(x_t x, y_t y, const __flash Font *font, code_t code) { + const __flash Glyph *glyph = getGlyphAddress(font, code); + setArea(x, y, glyph->width, font->height, false, false); + writeData(glyph->bitmap, glyph->width, font->height, font->space); + + return glyph->width; +} + +width_t writeString(x_t x, y_t y, const __flash Font *font, const char *string) { + width_t xorig = x; + uint8_t offset = 0; + for (; *string != '\0'; string++) { + uint8_t c = (uint8_t) *string; + if (c == 194) { + // multibyte + } else if (c == 195) { + // multibyte, add 64 to get code point + offset = 64; + } else { + code_t code = c + offset; + x += writeGlyph(x, y, font, code); + offset = 0; + } + } + + return x - xorig; +} diff --git a/display.h b/display.h new file mode 100644 index 0000000..34b516d --- /dev/null +++ b/display.h @@ -0,0 +1,65 @@ +/* + * File: display.h + * Author: torsten.roemer@luniks.net + * + * Created on 18. April 2023, 21:56 + */ + +#ifndef DISPLAY_H +#define DISPLAY_H + +#include +#include +#include +#include +#include +#include "types.h" +#include "bitmaps.h" +#include "font.h" +#include "bitmaps.h" +#include "spi.h" +#include "tft.h" +#include "usart.h" +#include "utils.h" + +/** + * Sets the whole display to the given 16-Bit (5/6/5) RGB color. + * + * @param color + */ +void setFrame(uint16_t color); + +/** + * Writes the bitmap with the given index to the given row and column + * and returns the width of the bitmap. + * + * @param x + * @param y + * @param index + * @return bitmap width + */ +width_t writeBitmap(x_t x, y_t y, uint16_t index); + +/** + * Writes the glyph with the given pseudo UTF-8 code point with the given + * font to the given row and column and returns the width of the glyph. + * + * @param x + * @param y + * @param font + * @param code + * @return glyph width + */ +width_t writeGlyph(x_t x, y_t y, const __flash Font *font, code_t code); + +/** + * Writes the given string with the given font to the given row and column. + * + * @param x + * @param y + * @param font + * @param string + */ +width_t writeString(x_t x, y_t y, const __flash Font *font, const char *string); + +#endif /* DISPLAY_H */ diff --git a/font.c b/font.c new file mode 100644 index 0000000..4739809 --- /dev/null +++ b/font.c @@ -0,0 +1,32 @@ +/* + * File: font.c + * Author: torsten.roemer@luniks.net + * + * Created on 25. April 2023, 21:00 + */ + +#include +#include "font.h" + +const __flash Glyph* getGlyphAddress(const __flash Font *font, code_t code) { + + // https://en.wikipedia.org/wiki/Binary_search_algorithm + code_t l = 0; + code_t r = font->length - 1; + + while (l <= r) { + code_t m = (l + r) / 2; + const __flash Glyph *pglyph = &font->glyphs[m]; + if (pglyph->code < code) { + l = m + 1; + } else if (pglyph->code > code) { + r = m - 1; + } else { + // found code point, return address of glyph + return pglyph; + } + } + + // return question mark if unknown code point + return getGlyphAddress(font, 0x003f); +} diff --git a/font.h b/font.h new file mode 100644 index 0000000..c9e7f3e --- /dev/null +++ b/font.h @@ -0,0 +1,50 @@ +/* + * File: font.h + * Author: torsten.roemer@luniks.net + * + * Created on 24. April 2023, 21:21 + */ + +#ifndef FONT_H +#define FONT_H + +#include "types.h" + +/** + * A glyph with its pseudo UTF-8 code point, width and bitmap. + */ +typedef struct { + /** Pseudo UTF-8 code point of the glyph. */ + const code_t code; + /** Width of the glyph. */ + const width_t width; + /** Bitmap of the glyph. */ + const __flash uint8_t *bitmap; +} Glyph; + +/** + * Fonts available here. Since the height is the same for all glyphs, + * it is stored in the font instead of redundantly in each glyph. + */ +typedef struct { + /** Glyphs of this font. */ + const __flash Glyph *glyphs; + /** Number of glyphs of this font. */ + const length_t length; + /** Height of (the glyphs of) this font. */ + const height_t height; + /** Color space of the glyph bitmap. */ + const space_t space; +} Font; + +/** + * Returns the flash address of the glyph at the given pseudo UTF-8 code + * point, i.e. 0x00f6 for U+00F6 from the given font. + * If there is no glyph for that code point, a question mark is returned. + * @param font + * @param code + * @return Glyph + */ +const __flash Glyph* getGlyphAddress(const __flash Font *font, code_t code); + +#endif /* FONT_H */ diff --git a/mcp9808.c b/mcp9808.c index 756d97a..59db9c7 100644 --- a/mcp9808.c +++ b/mcp9808.c @@ -63,7 +63,7 @@ // TODO need to wait for first conversion result after wake up // can use an alert irq to wake up sleeping MCU instead? - _delay_ms(500); + _delay_ms(300); } uint16_t readTemp(void) { diff --git a/pins.h b/pins.h index 7a6018d..4c23d66 100644 --- a/pins.h +++ b/pins.h @@ -33,4 +33,11 @@ #define PIN_RCS PB1 // radio chip select #define PIN_RRST PB0 // radio reset +/* Display */ +#define DDR_DISP DDRD +#define PORT_DISP PORTD +#define PIN_DCS PD5 // display chip select +#define PIN_DDC PD6 // display data/command +#define PIN_DRST PD7 // display reset + #endif /* PINS_H */ diff --git a/rfm69.c b/rfm69.c index 8e11934..2cb0c79 100644 --- a/rfm69.c +++ b/rfm69.c @@ -45,7 +45,7 @@ */ static uint8_t regRead(uint8_t reg) { spiSel(); - transmit(reg); + transmit(reg & 0x7f); uint8_t value = transmit(0x00); spiDes(); @@ -144,7 +144,8 @@ // variable payload length, crc on, no address matching // regWrite(PCK_CFG1, 0x90); - regWrite(PCK_CFG1, 0x94); // match broadcast or node address + // match broadcast or node address + regWrite(PCK_CFG1, 0x94); // node and broadcast address regWrite(NODE_ADDR, NODE_ADDRESS); @@ -153,7 +154,7 @@ // set TX start condition to "at least one byte in FIFO" regWrite(FIFO_THRESH, 0x8f); - printString("Init done\r\n"); + printString("Radio init done\r\n"); } void sleepRadio(void) { diff --git a/tft.c b/tft.c new file mode 100644 index 0000000..c6a9a11 --- /dev/null +++ b/tft.c @@ -0,0 +1,268 @@ +/* + * File: tft.c + * Author: torsten.roemer@luniks.net + * + * Created on 6. November 2023, 18:45 + */ + +#include "tft.h" + +/** + * Does a hardware reset. + */ +static void hwReset(void) { + PORT_DISP &= ~(1 << PIN_DRST); + _delay_ms(10); + PORT_DISP |= (1 << PIN_DRST); +} + +static void displaySel(void) { + PORT_DISP &= ~(1 << PIN_DCS); +} + +static void displayDes(void) { + PORT_DISP |= (1 << PIN_DCS); +} + +/** + * Sets display to send a command. + */ +static void displaySetCmd(void) { + PORT_DISP &= ~(1 << PIN_DDC); +} + +/** + * Sets display to send data. + */ +static void displaySetData(void) { + PORT_DISP |= (1 << PIN_DDC); +} + +/** + * Sends the given command to the display. + * + * @param cmd + */ +static void displayCmd(uint8_t cmd) { + displaySetCmd(); + transmit(cmd); +} + +/** + * Sends the given data to the display. + * + * @param data + */ +static void displayData(uint8_t data) { + displaySetData(); + transmit(data); +} + +/** + * Sets horizontal and/or vertical flip. + * + * @param hflip + * @param vflip + */ +static void madctl(bool hflip, bool vflip) { + // Memory data access control + uint8_t madctl = 0b00110110; + madctl |= (HFLIP << 7); + madctl |= (VFLIP << 6); + madctl |= (BGR << 3); + + if (hflip) { + // Row Address Order (MY) + madctl ^= (1 << 7); + } + if (vflip) { + // Column Address Order (MX) + madctl ^= (1 << 6); + } + + displaySel(); + displayCmd(MADCTL); + displayData(madctl); + displayDes(); +} + +/** + * Sets the given column start and end address. + * + * @param xs start address + * @param xe end address + */ +static void caset(x_t xs, x_t xe) { + displaySel(); + displayCmd(CASET); + displayData(xs >> 8); + displayData(xs); + displayData(xe >> 8); + displayData(xe); + displayDes(); +} + +/** + * Sets the given row start and end address. + * + * @param ys start address + * @param ye end address + */ +static void raset(y_t ys, y_t ye) { + displaySel(); + displayCmd(RASET); + displayData(ys >> 8); + displayData(ys); + displayData(ye >> 8); + displayData(ye); + displayDes(); +} + +void initDisplay(void) { + _delay_ms(10); + + // Hardware reset + hwReset(); + + // TODO necessary? + _delay_ms(10); + + // Software reset + displaySel(); + displayCmd(SWRESET); + displayDes(); + + // TODO necessary? + _delay_ms(10); + + // Sleep out & booster on + displaySel(); + displayCmd(SLPOUT); + displayDes(); + + // Partial off (Normal) + displaySel(); + displayCmd(NORON); + displayDes(); + + // Display Inversion on/off + displaySel(); + displayCmd(INVOFF + INVERT); // INVOFF + 1 = INVON + displayDes(); + + // Interface pixel format + displaySel(); + displayCmd(COLMOD); + displayData(0b00111101); + displayDes(); + + // Display on + displaySel(); + displayCmd(DISPON); + displayDes(); + + // Sleep in & booster off + // displaySel(); + // displayCmd(SLPIN); + // displayDes(); + + printString("Display init done\r\n"); +} + +void demoDisplay(void) { + // TODO +} + +void drawPixel(x_t x, y_t y, uint16_t color) { + // TODO +} + +void drawCircle(x_t x, y_t y, uint16_t radius, uint16_t color) { + // TODO +} + +void drawRectangle(x_t x, y_t y, width_t width, height_t height, + uint16_t color) { + // TODO +} + +void writeStart(void) { + // Memory write + displaySel(); + displayCmd(RAMWR); + displaySetData(); +} + +void writeRestart(void) { + displaySel(); +} + +void writeByte(uint8_t byte) { + // Memory write + transmit(byte); +} + +void writeEnd(void) { + // Memory write + displayDes(); +} + +void fillArea(x_t x, x_t y, + width_t width, height_t height, + uint16_t color) { + + madctl(false, false); + + // X address start/end + uint16_t xs = x; + uint16_t xe = x + width - 1; + caset(xs, xe); + + // Y address start/end + uint16_t ys = y; + uint16_t ye = y + height - 1; + raset(ys, ye); + + writeStart(); + + bytes_t pixels = (bytes_t)width * (bytes_t)height; + for (bytes_t i = 0; i < pixels; i++) { + transmit(color >> 8); + transmit(color); + } + + writeEnd(); +} + +void setArea(x_t x, y_t y, + width_t width, height_t height, + bool hflip, bool vflip) { + + madctl(hflip, vflip); + + // X address start/end + uint16_t xs = x; + uint16_t xe = x + width - 1; + if (hflip) { + xs = DISPLAY_WIDTH - x - width; + xe = DISPLAY_WIDTH - x - 1; + } + caset(xs, xe); + + // Y address start/end + uint16_t ys = y; + uint16_t ye = y + height - 1; + if (vflip) { + ys = DISPLAY_HEIGHT - y - height; + ye = DISPLAY_HEIGHT - y - 1; + } + raset(ys, ye); +} + +void writeData(const __flash uint8_t *bitmap, + width_t width, height_t height, + space_t space) { + writeStart(); + writeSpace(bitmap, width, height, space); + writeEnd(); +} diff --git a/tft.h b/tft.h new file mode 100644 index 0000000..12325f2 --- /dev/null +++ b/tft.h @@ -0,0 +1,161 @@ +/* + * File: tft.h + * Author: torsten.roemer@luniks.net + * + * Created on 6. November 2023, 18:45 + */ + +#ifndef TFT_H +#define TFT_H + +#include +#include +#include +#include +#include +#include "types.h" +#include "pins.h" +#include "usart.h" +#include "spi.h" +#include "colorspace.h" + +#define SWRESET 0x01 +#define SLPIN 0x10 +#define SLPOUT 0x11 +#define NORON 0x13 +#define INVOFF 0x20 +#define INVON 0x21 +#define DISPON 0x29 +#define CASET 0x2a +#define RASET 0x2b +#define RAMWR 0x2c +#define MADCTL 0x36 +#define COLMOD 0x3a + +#ifndef DISPLAY_WIDTH + #define DISPLAY_WIDTH 160 +#endif + +#ifndef DISPLAY_HEIGHT + #define DISPLAY_HEIGHT 128 +#endif + +#ifndef BGR + #define BGR 0 +#endif + +#ifndef INVERT + #define INVERT 0 +#endif + +#ifndef HFLIP + #define HFLIP 0 +#endif + +#ifndef VFLIP + #define VFLIP 0 +#endif + +/** + * Initializes the display. + */ +void initDisplay(void); + +/** + * Displays a demo. + */ +void demoDisplay(void); + +/** + * Draws a pixel at given coordinates and color. + * + * @param x + * @param y + * @param color + */ +void drawPixel(x_t x, y_t y, uint16_t color); + +/** + * Draws a circle at given center coordinates, with given radius and color. + * + * @param x + * @param y + * @param radius + * @param color + */ +void drawCircle(x_t x, y_t y, uint16_t radius, uint16_t color); + +/** + * Draws a rectangle at given origin, with given width, height and color. + * + * @param x + * @param y + * @param width + * @param height + * @param color + */ +void drawRectangle(x_t x, y_t y, width_t width, height_t height, + uint16_t color); + +/** + * Sets to write data to display RAM. + */ +void writeStart(void); + +/** + * Restart writing to display after SPI deselecting it. + */ +void writeRestart(void); + +/** + * Writes the given byte to display RAM. + * + * @param byte + */ +void writeByte(uint8_t byte); + +/** + * Completes writing data to display RAM. + */ +void writeEnd(void); + +/** + * Sets the given color in the given area of the display. + * + * @param x in pixels, origin top left + * @param y in pixels, origin top left + * @param width width in pixels + * @param height height in pixels + * @param color 16-Bit (5/6/5) RGB color + */ +void fillArea(x_t x, y_t y, + width_t width, height_t height, + uint16_t color); + +/** + * Sets the area to write image data to. + * + * @param x in pixels, origin top left + * @param y in pixels, origin top left + * @param width width of the bitmap in pixels + * @param height height of the bitmap in pixels + * @param hflip if image should be flipped horizontally + * @param vflip if image should be flipped vertically + */ +void setArea(x_t x, y_t y, + width_t width, height_t height, + bool hflip, bool vflip); + +/** + * Writes image data to the previously set area. + * + * @param bitmap pointer to bitmap data in program memory + * @param width width of the bitmap in pixels + * @param height height of the bitmap in pixels + * @param space color space of the bitmap + */ +void writeData(const __flash uint8_t *bitmap, + width_t width, height_t height, + space_t space); + +#endif /* TFT_H */ diff --git a/types.h b/types.h new file mode 100644 index 0000000..af5ebfd --- /dev/null +++ b/types.h @@ -0,0 +1,47 @@ +/* + * File: types.h + * Author: torsten.roemer@luniks.net + * + * Created on 17. September 2023, 20:33 + */ + +#ifndef TYPES_H +#define TYPES_H + +#include +#include + +/* Width, height and color space of bitmaps and glyphs */ +typedef uint16_t width_t; +typedef uint16_t height_t; +typedef uint8_t space_t; + +/* Width * height * bytes per pixel */ +typedef uint32_t bytes_t; + +/* X and Y coordinates of the display */ +typedef uint16_t x_t; +typedef uint16_t y_t; + +/* Char code (like UTF-8 code point) */ +typedef uint8_t code_t; + +/* Number of glyphs of a font */ +typedef uint8_t length_t; + +/** + * A point with its x and y coordinates. + */ +typedef struct { + int16_t x; + int16_t y; +} Point; + +/** + * Pointer to a function that takes an array of bytes + * and returns a boolean. + */ +typedef bool (*Consumer)(uint8_t*); + +#endif /* TYPES_H */ +