diff --git a/examples/ssd1306_fps/Makefile b/examples/ssd1306_fps/Makefile new file mode 100644 index 0000000..8e9c71b --- /dev/null +++ b/examples/ssd1306_fps/Makefile @@ -0,0 +1,3 @@ +PROGRAM=SSD1306_fps +EXTRA_COMPONENTS = extras/ssd1306 extras/i2c extras/fonts +include ../../common.mk diff --git a/examples/ssd1306_fps/main.c b/examples/ssd1306_fps/main.c new file mode 100644 index 0000000..ece836b --- /dev/null +++ b/examples/ssd1306_fps/main.c @@ -0,0 +1,150 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#define LOAD_ICON_X 54 +#define LOAD_ICON_Y 32 +#define LOAD_ICON_SIZE 20 + +#define CIRCLE_COUNT_ICON_X 94 +#define CIRCLE_COUNT_ICON_Y 42 + + +/* Remove this line if your display connected by SPI */ +#define I2C_CONNECTION + +#ifdef I2C_CONNECTION + #include +#endif +#include "fonts/fonts.h" + +/* Change this according to you schematics and display size */ +#define DISPLAY_WIDTH 128 +#define DISPLAY_HEIGHT 64 + +#ifdef I2C_CONNECTION + #define PROTOCOL SSD1306_PROTO_I2C + #define ADDR SSD1306_I2C_ADDR_0 + #define SCL_PIN 14 + #define SDA_PIN 13 +#else + #define PROTOCOL SSD1306_PROTO_SPI4 + #define CS_PIN 5 + #define DC_PIN 4 +#endif + +/* Declare device descriptor */ +static const ssd1306_t dev = { + .protocol = PROTOCOL, +#ifdef I2C_CONNECTION + .addr = ADDR, +#else + .cs_pin = CS_PIN, + .dc_pin = DC_PIN, +#endif + .width = DISPLAY_WIDTH, + .height = DISPLAY_HEIGHT +}; + +/* Local frame buffer */ +static uint8_t buffer[DISPLAY_WIDTH * DISPLAY_HEIGHT / 8]; + +TimerHandle_t timerHandle = 0 ; // Timer handler +uint8_t frame_done = 0 ; // number of frame send. +uint8_t fps = 0 ; // image per second. + + +static void ssd1306_task(void *pvParameters) +{ + printf("%s: Started user interface task\n", __FUNCTION__); + vTaskDelay(1000/portTICK_PERIOD_MS); + + ssd1306_set_whole_display_lighting(&dev, false); + + + char text[20] ; + uint8_t x0 = LOAD_ICON_X ; + uint8_t y0 = LOAD_ICON_Y ; + uint8_t x1 = LOAD_ICON_X + LOAD_ICON_SIZE ; + uint8_t y1 = LOAD_ICON_Y + LOAD_ICON_SIZE ; + uint16_t count = 0 ; + ssd1306_select_font(1); + + while (1) { + + ssd1306_draw_string(&dev, buffer, 10, 10,"Hello, esp-open-rtos !", OLED_COLOR_WHITE, OLED_COLOR_BLACK) ; + sprintf(text,"FPS: %u",fps); + ssd1306_draw_string(&dev, buffer, 10, 40, text, OLED_COLOR_WHITE, OLED_COLOR_BLACK) ; + + //generate loading icon + ssd1306_draw_line(&dev, buffer, x0, y0, x1, y1, OLED_COLOR_BLACK); + if (x0 < (LOAD_ICON_X + LOAD_ICON_SIZE)) { x0++ ; x1-- ; } + else if(y0< (LOAD_ICON_Y + LOAD_ICON_SIZE)) { y0++ ; y1-- ; } + else { x0 = LOAD_ICON_X ; y0 = LOAD_ICON_Y ; x1 = LOAD_ICON_X + LOAD_ICON_SIZE ; y1 = LOAD_ICON_Y + LOAD_ICON_SIZE ; } + ssd1306_draw_line(&dev, buffer, x0, y0, x1, y1, OLED_COLOR_WHITE); + ssd1306_draw_rectangle(&dev, buffer, LOAD_ICON_X, LOAD_ICON_Y, LOAD_ICON_SIZE+1, LOAD_ICON_SIZE+1, OLED_COLOR_WHITE); + + //generate circle counting + for (uint8_t i = 0 ; i < 10 ; i++ ) { + if ((count>>i) & 0x01) ssd1306_draw_circle(&dev,buffer,CIRCLE_COUNT_ICON_X, CIRCLE_COUNT_ICON_Y, i, OLED_COLOR_BLACK); + } + + if(count != 0x03FF) count++; + else count = 0 ; + + for (uint8_t i = 0 ; i < 10 ; i++ ) { + if ((count>>i) & 0x01) ssd1306_draw_circle(&dev,buffer, CIRCLE_COUNT_ICON_X, CIRCLE_COUNT_ICON_Y, i, OLED_COLOR_WHITE); + } + + if (ssd1306_load_frame_buffer(&dev, buffer)) + goto error_loop; + frame_done++ ; + } + +error_loop: + printf("%s: error while loading framebuffer into SSD1306\n", __func__); + for(;;){ + vTaskDelay(2000 / portTICK_PERIOD_MS); + printf("%s: error loop\n", __FUNCTION__); + } +} + +void SoftTimer( TimerHandle_t xTimer ){ + fps = frame_done ; // Save number of frame already send to screen + frame_done = 0 ; + +} + + +void user_init(void) +{ + //uncomment to test with CPU overclocked + //sdk_system_update_cpu_freq(160); + + // Setup HW + uart_set_baud(0, 115200); + + printf("SDK version:%s\n", sdk_system_get_sdk_version()); + +#ifdef I2C_CONNECTION + i2c_init(SCL_PIN, SDA_PIN); +#endif + + while (ssd1306_init(&dev) != 0) + { + printf("%s: failed to init SSD1306 lcd\n", __func__); + vTaskDelay(1000/portTICK_PERIOD_MS); + } + ssd1306_set_whole_display_lighting(&dev, true); + vTaskDelay(1000/portTICK_PERIOD_MS); + // Create user interface task + + xTaskCreate(ssd1306_task, "ssd1306_task", 256, NULL, 2, NULL); + timerHandle = xTimerCreate("Timer", 1000/portTICK_PERIOD_MS, pdTRUE, NULL, SoftTimer); + xTimerStart(timerHandle,0); +} diff --git a/extras/fonts/component.mk b/extras/fonts/component.mk new file mode 100644 index 0000000..0e63aa8 --- /dev/null +++ b/extras/fonts/component.mk @@ -0,0 +1,9 @@ +# Component makefile for extras/fonts + +# expected anyone using bmp driver includes it as 'fonts/fonts.h' +INC_DIRS += $(fonts_ROOT).. + +# args for passing into compile rule generation +fonts_SRC_DIR = $(fonts_ROOT) + +$(eval $(call component_compile_rules,fonts)) diff --git a/extras/fonts/config.h b/extras/fonts/config.h new file mode 100644 index 0000000..dcff3a4 --- /dev/null +++ b/extras/fonts/config.h @@ -0,0 +1,8 @@ +#ifndef _EXTRAS_FONTS_CONFIG_H_ +#define _EXTRAS_FONTS_CONFIG_H_ + +#ifndef NUM_FONTS +#define NUM_FONTS 3 +#endif + +#endif /* _EXTRAS_FONTS_CONFIG_H_ */ diff --git a/extras/fonts/font_glcd_5x7.c b/extras/fonts/font_glcd_5x7.c new file mode 100644 index 0000000..e80db97 --- /dev/null +++ b/extras/fonts/font_glcd_5x7.c @@ -0,0 +1,2591 @@ +/* + * font_glcd_5x7.c + * + * Created on: 8 dec. 2016 + * Author: zaltora + */ + +#include "fonts.h" + +/* Standard ASCII 5x7 font */ +const uint8_t glcd_5x7_bitmaps[] = +{ + /* @0 '\x0' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + /* @7 '\x1' (5 pixels wide) */ + 0x70, // ### + 0xF8, // ##### + 0xA8, // # # # + 0xF8, // ##### + 0xD8, // ## ## + 0x88, // # # + 0x70, // ### + + /* @14 '\x2' (5 pixels wide) */ + 0x70, // ### + 0xF8, // ##### + 0xA8, // # # # + 0xF8, // ##### + 0x88, // # # + 0xD8, // ## ## + 0x70, // ### + + /* @21 '\x3' (5 pixels wide) */ + 0x00, // + 0x50, // # # + 0xF8, // ##### + 0xF8, // ##### + 0xF8, // ##### + 0x70, // ### + 0x20, // # + + /* @28 '\x4' (5 pixels wide) */ + 0x00, // + 0x20, // # + 0x70, // ### + 0xF8, // ##### + 0xF8, // ##### + 0x70, // ### + 0x20, // # + + /* @35 '\x5' (5 pixels wide) */ + 0x70, // ### + 0x50, // # # + 0xF8, // ##### + 0xA8, // # # # + 0xF8, // ##### + 0x20, // # + 0x70, // ### + + /* @42 '\x6' (5 pixels wide) */ + 0x20, // # + 0x70, // ### + 0xF8, // ##### + 0xF8, // ##### + 0xF8, // ##### + 0x20, // # + 0x70, // ### + + /* @49 '\x7' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x20, // # + 0x70, // ### + 0x70, // ### + 0x20, // # + 0x00, // + + /* @56 '\x8' (5 pixels wide) */ + 0xF8, // ##### + 0xF8, // ##### + 0xD8, // ## ## + 0x88, // # # + 0x88, // # # + 0xD8, // ## ## + 0xF8, // ##### + + /* @63 '\x9' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x20, // # + 0x50, // # # + 0x50, // # # + 0x20, // # + 0x00, // + + /* @70 '\xA' (5 pixels wide) */ + 0xF8, // ##### + 0xF8, // ##### + 0xD8, // ## ## + 0xA8, // # # # + 0xA8, // # # # + 0xD8, // ## ## + 0xF8, // ##### + + /* @77 '\xB' (5 pixels wide) */ + 0x00, // + 0x38, // ### + 0x18, // ## + 0x68, // ## # + 0xA0, // # # + 0xA0, // # # + 0x40, // # + + /* @84 '\xC' (5 pixels wide) */ + 0x70, // ### + 0x88, // # # + 0x88, // # # + 0x70, // ### + 0x20, // # + 0xF8, // ##### + 0x20, // # + + /* @91 '\xD' (5 pixels wide) */ + 0x78, // #### + 0x48, // # # + 0x78, // #### + 0x40, // # + 0x40, // # + 0x40, // # + 0xC0, // ## + + /* @98 '\xE' (5 pixels wide) */ + 0x78, // #### + 0x48, // # # + 0x78, // #### + 0x48, // # # + 0x48, // # # + 0x58, // # ## + 0xC0, // ## + + /* @105 '\xF' (5 pixels wide) */ + 0x20, // # + 0xA8, // # # # + 0x70, // ### + 0xD8, // ## ## + 0xD8, // ## ## + 0x70, // ### + 0xA8, // # # # + + /* @112 '\x10' (5 pixels wide) */ + 0x80, // # + 0xC0, // ## + 0xF0, // #### + 0xF8, // ##### + 0xF0, // #### + 0xC0, // ## + 0x80, // # + + /* @119 '\x11' (5 pixels wide) */ + 0x08, // # + 0x18, // ## + 0x78, // #### + 0xF8, // ##### + 0x78, // #### + 0x18, // ## + 0x08, // # + + /* @126 '\x12' (5 pixels wide) */ + 0x20, // # + 0x70, // ### + 0xA8, // # # # + 0x20, // # + 0xA8, // # # # + 0x70, // ### + 0x20, // # + + /* @133 '\x13' (5 pixels wide) */ + 0xD8, // ## ## + 0xD8, // ## ## + 0xD8, // ## ## + 0xD8, // ## ## + 0xD8, // ## ## + 0x00, // + 0xD8, // ## ## + + /* @140 '\x14' (5 pixels wide) */ + 0x78, // #### + 0xA8, // # # # + 0xA8, // # # # + 0x68, // ## # + 0x28, // # # + 0x28, // # # + 0x28, // # # + + /* @147 '\x15' (5 pixels wide) */ + 0x30, // ## + 0x48, // # # + 0x50, // # # + 0x28, // # # + 0x10, // # + 0x48, // # # + 0x48, // # # + + /* @154 '\x16' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0xF8, // ##### + 0xF8, // ##### + + /* @161 '\x17' (5 pixels wide) */ + 0x20, // # + 0x70, // ### + 0xA8, // # # # + 0x20, // # + 0xA8, // # # # + 0x70, // ### + 0x20, // # + + /* @168 '\x18' (5 pixels wide) */ + 0x00, // + 0x20, // # + 0x70, // ### + 0xA8, // # # # + 0x20, // # + 0x20, // # + 0x20, // # + + /* @175 '\x19' (5 pixels wide) */ + 0x00, // + 0x20, // # + 0x20, // # + 0x20, // # + 0xA8, // # # # + 0x70, // ### + 0x20, // # + + /* @182 '\x1A' (5 pixels wide) */ + 0x00, // + 0x20, // # + 0x10, // # + 0xF8, // ##### + 0x10, // # + 0x20, // # + 0x00, // + + /* @189 '\x1B' (5 pixels wide) */ + 0x00, // + 0x20, // # + 0x40, // # + 0xF8, // ##### + 0x40, // # + 0x20, // # + 0x00, // + + /* @196 '\x1C' (5 pixels wide) */ + 0x00, // + 0x80, // # + 0x80, // # + 0x80, // # + 0xF8, // ##### + 0x00, // + 0x00, // + + /* @203 '\x1D' (5 pixels wide) */ + 0x00, // + 0x50, // # # + 0xF8, // ##### + 0xF8, // ##### + 0x50, // # # + 0x00, // + 0x00, // + + /* @210 '\x1E' (5 pixels wide) */ + 0x00, // + 0x20, // # + 0x20, // # + 0x70, // ### + 0xF8, // ##### + 0xF8, // ##### + 0x00, // + + /* @217 '\x1F' (5 pixels wide) */ + 0x00, // + 0xF8, // ##### + 0xF8, // ##### + 0x70, // ### + 0x20, // # + 0x20, // # + 0x00, // + + /* @224 ' ' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + /* @231 '!' (5 pixels wide) */ + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x00, // + 0x20, // # + + /* @238 '"' (5 pixels wide) */ + 0x50, // # # + 0x50, // # # + 0x50, // # # + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + /* @245 '#' (5 pixels wide) */ + 0x50, // # # + 0x50, // # # + 0xF8, // ##### + 0x50, // # # + 0xF8, // ##### + 0x50, // # # + 0x50, // # # + + /* @252 '$' (5 pixels wide) */ + 0x20, // # + 0x78, // #### + 0xA0, // # # + 0x70, // ### + 0x28, // # # + 0xF0, // #### + 0x20, // # + + /* @259 '%' (5 pixels wide) */ + 0xC0, // ## + 0xC8, // ## # + 0x10, // # + 0x20, // # + 0x40, // # + 0x98, // # ## + 0x18, // ## + + /* @266 '&' (5 pixels wide) */ + 0x40, // # + 0xA0, // # # + 0xA0, // # # + 0x40, // # + 0xA8, // # # # + 0x90, // # # + 0x68, // ## # + + /* @273 ''' (5 pixels wide) */ + 0x30, // ## + 0x30, // ## + 0x20, // # + 0x40, // # + 0x00, // + 0x00, // + 0x00, // + + /* @280 '(' (5 pixels wide) */ + 0x10, // # + 0x20, // # + 0x40, // # + 0x40, // # + 0x40, // # + 0x20, // # + 0x10, // # + + /* @287 ')' (5 pixels wide) */ + 0x40, // # + 0x20, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x20, // # + 0x40, // # + + /* @294 '*' (5 pixels wide) */ + 0x20, // # + 0xA8, // # # # + 0x70, // ### + 0xF8, // ##### + 0x70, // ### + 0xA8, // # # # + 0x20, // # + + /* @301 '+' (5 pixels wide) */ + 0x00, // + 0x20, // # + 0x20, // # + 0xF8, // ##### + 0x20, // # + 0x20, // # + 0x00, // + + /* @308 ',' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x30, // ## + 0x30, // ## + 0x20, // # + + /* @315 '-' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x00, // + 0xF8, // ##### + 0x00, // + 0x00, // + 0x00, // + + /* @322 '.' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x30, // ## + 0x30, // ## + + /* @329 '/' (5 pixels wide) */ + 0x00, // + 0x08, // # + 0x10, // # + 0x20, // # + 0x40, // # + 0x80, // # + 0x00, // + + /* @336 '0' (5 pixels wide) */ + 0x70, // ### + 0x88, // # # + 0x98, // # ## + 0xA8, // # # # + 0xC8, // ## # + 0x88, // # # + 0x70, // ### + + /* @343 '1' (5 pixels wide) */ + 0x20, // # + 0x60, // ## + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x70, // ### + + /* @350 '2' (5 pixels wide) */ + 0x70, // ### + 0x88, // # # + 0x08, // # + 0x70, // ### + 0x80, // # + 0x80, // # + 0xF8, // ##### + + /* @357 '3' (5 pixels wide) */ + 0xF8, // ##### + 0x08, // # + 0x10, // # + 0x30, // ## + 0x08, // # + 0x88, // # # + 0x70, // ### + + /* @364 '4' (5 pixels wide) */ + 0x10, // # + 0x30, // ## + 0x50, // # # + 0x90, // # # + 0xF8, // ##### + 0x10, // # + 0x10, // # + + /* @371 '5' (5 pixels wide) */ + 0xF8, // ##### + 0x80, // # + 0xF0, // #### + 0x08, // # + 0x08, // # + 0x88, // # # + 0x70, // ### + + /* @378 '6' (5 pixels wide) */ + 0x38, // ### + 0x40, // # + 0x80, // # + 0xF0, // #### + 0x88, // # # + 0x88, // # # + 0x70, // ### + + /* @385 '7' (5 pixels wide) */ + 0xF8, // ##### + 0x08, // # + 0x08, // # + 0x10, // # + 0x20, // # + 0x40, // # + 0x80, // # + + /* @392 '8' (5 pixels wide) */ + 0x70, // ### + 0x88, // # # + 0x88, // # # + 0x70, // ### + 0x88, // # # + 0x88, // # # + 0x70, // ### + + /* @399 '9' (5 pixels wide) */ + 0x70, // ### + 0x88, // # # + 0x88, // # # + 0x78, // #### + 0x08, // # + 0x10, // # + 0xE0, // ### + + /* @406 ':' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x20, // # + 0x00, // + 0x20, // # + 0x00, // + 0x00, // + + /* @413 ';' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x20, // # + 0x00, // + 0x20, // # + 0x20, // # + 0x40, // # + + /* @420 '<' (5 pixels wide) */ + 0x08, // # + 0x10, // # + 0x20, // # + 0x40, // # + 0x20, // # + 0x10, // # + 0x08, // # + + /* @427 '=' (5 pixels wide) */ + 0x00, // + 0x00, // + 0xF8, // ##### + 0x00, // + 0xF8, // ##### + 0x00, // + 0x00, // + + /* @434 '>' (5 pixels wide) */ + 0x40, // # + 0x20, // # + 0x10, // # + 0x08, // # + 0x10, // # + 0x20, // # + 0x40, // # + + /* @441 '?' (5 pixels wide) */ + 0x70, // ### + 0x88, // # # + 0x08, // # + 0x30, // ## + 0x20, // # + 0x00, // + 0x20, // # + + /* @448 '@' (5 pixels wide) */ + 0x70, // ### + 0x88, // # # + 0xA8, // # # # + 0xB8, // # ### + 0xB0, // # ## + 0x80, // # + 0x78, // #### + + /* @455 'A' (5 pixels wide) */ + 0x20, // # + 0x50, // # # + 0x88, // # # + 0x88, // # # + 0xF8, // ##### + 0x88, // # # + 0x88, // # # + + /* @462 'B' (5 pixels wide) */ + 0xF0, // #### + 0x88, // # # + 0x88, // # # + 0xF0, // #### + 0x88, // # # + 0x88, // # # + 0xF0, // #### + + /* @469 'C' (5 pixels wide) */ + 0x70, // ### + 0x88, // # # + 0x80, // # + 0x80, // # + 0x80, // # + 0x88, // # # + 0x70, // ### + + /* @476 'D' (5 pixels wide) */ + 0xF0, // #### + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0xF0, // #### + + /* @483 'E' (5 pixels wide) */ + 0xF8, // ##### + 0x80, // # + 0x80, // # + 0xF0, // #### + 0x80, // # + 0x80, // # + 0xF8, // ##### + + /* @490 'F' (5 pixels wide) */ + 0xF8, // ##### + 0x80, // # + 0x80, // # + 0xF0, // #### + 0x80, // # + 0x80, // # + 0x80, // # + + /* @497 'G' (5 pixels wide) */ + 0x78, // #### + 0x88, // # # + 0x80, // # + 0x80, // # + 0x98, // # ## + 0x88, // # # + 0x78, // #### + + /* @504 'H' (5 pixels wide) */ + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0xF8, // ##### + 0x88, // # # + 0x88, // # # + 0x88, // # # + + /* @511 'I' (5 pixels wide) */ + 0x70, // ### + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x70, // ### + + /* @518 'J' (5 pixels wide) */ + 0x38, // ### + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x90, // # # + 0x60, // ## + + /* @525 'K' (5 pixels wide) */ + 0x88, // # # + 0x90, // # # + 0xA0, // # # + 0xC0, // ## + 0xA0, // # # + 0x90, // # # + 0x88, // # # + + /* @532 'L' (5 pixels wide) */ + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0xF8, // ##### + + /* @539 'M' (5 pixels wide) */ + 0x88, // # # + 0xD8, // ## ## + 0xA8, // # # # + 0xA8, // # # # + 0xA8, // # # # + 0x88, // # # + 0x88, // # # + + /* @546 'N' (5 pixels wide) */ + 0x88, // # # + 0x88, // # # + 0xC8, // ## # + 0xA8, // # # # + 0x98, // # ## + 0x88, // # # + 0x88, // # # + + /* @553 'O' (5 pixels wide) */ + 0x70, // ### + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x70, // ### + + /* @560 'P' (5 pixels wide) */ + 0xF0, // #### + 0x88, // # # + 0x88, // # # + 0xF0, // #### + 0x80, // # + 0x80, // # + 0x80, // # + + /* @567 'Q' (5 pixels wide) */ + 0x70, // ### + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0xA8, // # # # + 0x90, // # # + 0x68, // ## # + + /* @574 'R' (5 pixels wide) */ + 0xF0, // #### + 0x88, // # # + 0x88, // # # + 0xF0, // #### + 0xA0, // # # + 0x90, // # # + 0x88, // # # + + /* @581 'S' (5 pixels wide) */ + 0x70, // ### + 0x88, // # # + 0x80, // # + 0x70, // ### + 0x08, // # + 0x88, // # # + 0x70, // ### + + /* @588 'T' (5 pixels wide) */ + 0xF8, // ##### + 0xA8, // # # # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + + /* @595 'U' (5 pixels wide) */ + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x70, // ### + + /* @602 'V' (5 pixels wide) */ + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x50, // # # + 0x20, // # + + /* @609 'W' (5 pixels wide) */ + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0xA8, // # # # + 0xA8, // # # # + 0xA8, // # # # + 0x50, // # # + + /* @616 'X' (5 pixels wide) */ + 0x88, // # # + 0x88, // # # + 0x50, // # # + 0x20, // # + 0x50, // # # + 0x88, // # # + 0x88, // # # + + /* @623 'Y' (5 pixels wide) */ + 0x88, // # # + 0x88, // # # + 0x50, // # # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + + /* @630 'Z' (5 pixels wide) */ + 0xF8, // ##### + 0x08, // # + 0x10, // # + 0x70, // ### + 0x40, // # + 0x80, // # + 0xF8, // ##### + + /* @637 '[' (5 pixels wide) */ + 0x78, // #### + 0x40, // # + 0x40, // # + 0x40, // # + 0x40, // # + 0x40, // # + 0x78, // #### + + /* @644 '\' (5 pixels wide) */ + 0x00, // + 0x80, // # + 0x40, // # + 0x20, // # + 0x10, // # + 0x08, // # + 0x00, // + + /* @651 ']' (5 pixels wide) */ + 0x78, // #### + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x78, // #### + + /* @658 '^' (5 pixels wide) */ + 0x20, // # + 0x50, // # # + 0x88, // # # + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + /* @665 '_' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0xF8, // ##### + + /* @672 '`' (5 pixels wide) */ + 0x60, // ## + 0x60, // ## + 0x20, // # + 0x10, // # + 0x00, // + 0x00, // + 0x00, // + + /* @679 'a' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x60, // ## + 0x10, // # + 0x70, // ### + 0x90, // # # + 0x78, // #### + + /* @686 'b' (5 pixels wide) */ + 0x80, // # + 0x80, // # + 0xB0, // # ## + 0xC8, // ## # + 0x88, // # # + 0xC8, // ## # + 0xB0, // # ## + + /* @693 'c' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x70, // ### + 0x88, // # # + 0x80, // # + 0x88, // # # + 0x70, // ### + + /* @700 'd' (5 pixels wide) */ + 0x08, // # + 0x08, // # + 0x68, // ## # + 0x98, // # ## + 0x88, // # # + 0x98, // # ## + 0x68, // ## # + + /* @707 'e' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x70, // ### + 0x88, // # # + 0xF8, // ##### + 0x80, // # + 0x70, // ### + + /* @714 'f' (5 pixels wide) */ + 0x10, // # + 0x28, // # # + 0x20, // # + 0x70, // ### + 0x20, // # + 0x20, // # + 0x20, // # + + /* @721 'g' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x70, // ### + 0x98, // # ## + 0x98, // # ## + 0x68, // ## # + 0x08, // # + + /* @728 'h' (5 pixels wide) */ + 0x80, // # + 0x80, // # + 0xB0, // # ## + 0xC8, // ## # + 0x88, // # # + 0x88, // # # + 0x88, // # # + + /* @735 'i' (5 pixels wide) */ + 0x20, // # + 0x00, // + 0x60, // ## + 0x20, // # + 0x20, // # + 0x20, // # + 0x70, // ### + + /* @742 'j' (5 pixels wide) */ + 0x10, // # + 0x00, // + 0x10, // # + 0x10, // # + 0x10, // # + 0x90, // # # + 0x60, // ## + + /* @749 'k' (5 pixels wide) */ + 0x80, // # + 0x80, // # + 0x90, // # # + 0xA0, // # # + 0xC0, // ## + 0xA0, // # # + 0x90, // # # + + /* @756 'l' (5 pixels wide) */ + 0x60, // ## + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x70, // ### + + /* @763 'm' (5 pixels wide) */ + 0x00, // + 0x00, // + 0xD0, // ## # + 0xA8, // # # # + 0xA8, // # # # + 0xA8, // # # # + 0xA8, // # # # + + /* @770 'n' (5 pixels wide) */ + 0x00, // + 0x00, // + 0xB0, // # ## + 0xC8, // ## # + 0x88, // # # + 0x88, // # # + 0x88, // # # + + /* @777 'o' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x70, // ### + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x70, // ### + + /* @784 'p' (5 pixels wide) */ + 0x00, // + 0x00, // + 0xB0, // # ## + 0xC8, // ## # + 0xC8, // ## # + 0xB0, // # ## + 0x80, // # + + /* @791 'q' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x68, // ## # + 0x98, // # ## + 0x98, // # ## + 0x68, // ## # + 0x08, // # + + /* @798 'r' (5 pixels wide) */ + 0x00, // + 0x00, // + 0xB0, // # ## + 0xC8, // ## # + 0x80, // # + 0x80, // # + 0x80, // # + + /* @805 's' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x78, // #### + 0x80, // # + 0x70, // ### + 0x08, // # + 0xF0, // #### + + /* @812 't' (5 pixels wide) */ + 0x20, // # + 0x20, // # + 0xF8, // ##### + 0x20, // # + 0x20, // # + 0x28, // # # + 0x10, // # + + /* @819 'u' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x98, // # ## + 0x68, // ## # + + /* @826 'v' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x50, // # # + 0x20, // # + + /* @833 'w' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x88, // # # + 0x88, // # # + 0xA8, // # # # + 0xA8, // # # # + 0x50, // # # + + /* @840 'x' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x88, // # # + 0x50, // # # + 0x20, // # + 0x50, // # # + 0x88, // # # + + /* @847 'y' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x88, // # # + 0x88, // # # + 0x78, // #### + 0x08, // # + 0x88, // # # + + /* @854 'z' (5 pixels wide) */ + 0x00, // + 0x00, // + 0xF8, // ##### + 0x10, // # + 0x20, // # + 0x40, // # + 0xF8, // ##### + + /* @861 '{' (5 pixels wide) */ + 0x10, // # + 0x20, // # + 0x20, // # + 0x40, // # + 0x20, // # + 0x20, // # + 0x10, // # + + /* @868 '|' (5 pixels wide) */ + 0x20, // # + 0x20, // # + 0x20, // # + 0x00, // + 0x20, // # + 0x20, // # + 0x20, // # + + /* @875 '}' (5 pixels wide) */ + 0x40, // # + 0x20, // # + 0x20, // # + 0x10, // # + 0x20, // # + 0x20, // # + 0x40, // # + + /* @882 '~' (5 pixels wide) */ + 0x40, // # + 0xA8, // # # # + 0x10, // # + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + /* @889 '\x7F' (5 pixels wide) */ + 0x20, // # + 0x70, // ### + 0xD8, // ## ## + 0x88, // # # + 0x88, // # # + 0xF8, // ##### + 0x00, // + + /* @896 '\x80' (5 pixels wide) */ + 0x70, // ### + 0x88, // # # + 0x80, // # + 0x80, // # + 0x88, // # # + 0x70, // ### + 0x10, // # + + /* @903 '\x81' (5 pixels wide) */ + 0x00, // + 0x88, // # # + 0x00, // + 0x88, // # # + 0x88, // # # + 0x98, // # ## + 0x68, // ## # + + /* @910 '\x82' (5 pixels wide) */ + 0x18, // ## + 0x00, // + 0x70, // ### + 0x88, // # # + 0xF8, // ##### + 0x80, // # + 0x78, // #### + + /* @917 '\x83' (5 pixels wide) */ + 0xF8, // ##### + 0x00, // + 0x60, // ## + 0x10, // # + 0x70, // ### + 0x90, // # # + 0x78, // #### + + /* @924 '\x84' (5 pixels wide) */ + 0x00, // + 0x88, // # # + 0x60, // ## + 0x10, // # + 0x70, // ### + 0x90, // # # + 0x78, // #### + + /* @931 '\x85' (5 pixels wide) */ + 0xC0, // ## + 0x00, // + 0x60, // ## + 0x10, // # + 0x70, // ### + 0x90, // # # + 0x78, // #### + + /* @938 '\x86' (5 pixels wide) */ + 0x30, // ## + 0x00, // + 0x60, // ## + 0x10, // # + 0x70, // ### + 0x90, // # # + 0x78, // #### + + /* @945 '\x87' (5 pixels wide) */ + 0x00, // + 0x78, // #### + 0xC0, // ## + 0xC0, // ## + 0x78, // #### + 0x10, // # + 0x30, // ## + + /* @952 '\x88' (5 pixels wide) */ + 0xF8, // ##### + 0x00, // + 0x70, // ### + 0x88, // # # + 0xF8, // ##### + 0x80, // # + 0x78, // #### + + /* @959 '\x89' (5 pixels wide) */ + 0x88, // # # + 0x00, // + 0x70, // ### + 0x88, // # # + 0xF8, // ##### + 0x80, // # + 0x78, // #### + + /* @966 '\x8A' (5 pixels wide) */ + 0xC0, // ## + 0x00, // + 0x70, // ### + 0x88, // # # + 0xF8, // ##### + 0x80, // # + 0x78, // #### + + /* @973 '\x8B' (5 pixels wide) */ + 0x28, // # # + 0x00, // + 0x30, // ## + 0x10, // # + 0x10, // # + 0x10, // # + 0x38, // ### + + /* @980 '\x8C' (5 pixels wide) */ + 0x30, // ## + 0x48, // # # + 0x30, // ## + 0x10, // # + 0x10, // # + 0x10, // # + 0x38, // ### + + /* @987 '\x8D' (5 pixels wide) */ + 0x60, // ## + 0x00, // + 0x30, // ## + 0x10, // # + 0x10, // # + 0x10, // # + 0x38, // ### + + /* @994 '\x8E' (5 pixels wide) */ + 0xA8, // # # # + 0x50, // # # + 0x88, // # # + 0x88, // # # + 0xF8, // ##### + 0x88, // # # + 0x88, // # # + + /* @1001 '\x8F' (5 pixels wide) */ + 0x20, // # + 0x00, // + 0x20, // # + 0x50, // # # + 0x88, // # # + 0xF8, // ##### + 0x88, // # # + + /* @1008 '\x90' (5 pixels wide) */ + 0x30, // ## + 0x00, // + 0xF0, // #### + 0x80, // # + 0xE0, // ### + 0x80, // # + 0xF0, // #### + + /* @1015 '\x91' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x78, // #### + 0x10, // # + 0x78, // #### + 0x90, // # # + 0x78, // #### + + /* @1022 '\x92' (5 pixels wide) */ + 0x38, // ### + 0x50, // # # + 0x90, // # # + 0xF8, // ##### + 0x90, // # # + 0x90, // # # + 0x98, // # ## + + /* @1029 '\x93' (5 pixels wide) */ + 0x70, // ### + 0x88, // # # + 0x00, // + 0x70, // ### + 0x88, // # # + 0x88, // # # + 0x70, // ### + + /* @1036 '\x94' (5 pixels wide) */ + 0x00, // + 0x88, // # # + 0x70, // ### + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x70, // ### + + /* @1043 '\x95' (5 pixels wide) */ + 0x00, // + 0xC0, // ## + 0x00, // + 0x70, // ### + 0x88, // # # + 0x88, // # # + 0x70, // ### + + /* @1050 '\x96' (5 pixels wide) */ + 0x70, // ### + 0x88, // # # + 0x00, // + 0x88, // # # + 0x88, // # # + 0x98, // # ## + 0x68, // ## # + + /* @1057 '\x97' (5 pixels wide) */ + 0x00, // + 0xC0, // ## + 0x00, // + 0x88, // # # + 0x88, // # # + 0x98, // # ## + 0x68, // ## # + + /* @1064 '\x98' (5 pixels wide) */ + 0x48, // # # + 0x00, // + 0x48, // # # + 0x48, // # # + 0x48, // # # + 0x38, // ### + 0x08, // # + + /* @1071 '\x99' (5 pixels wide) */ + 0x88, // # # + 0x70, // ### + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x70, // ### + + /* @1078 '\x9A' (5 pixels wide) */ + 0x88, // # # + 0x00, // + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x70, // ### + + /* @1085 '\x9B' (5 pixels wide) */ + 0x20, // # + 0x20, // # + 0xF8, // ##### + 0xA0, // # # + 0xA0, // # # + 0xF8, // ##### + 0x20, // # + + /* @1092 '\x9C' (5 pixels wide) */ + 0x30, // ## + 0x58, // # ## + 0x48, // # # + 0xE0, // ### + 0x40, // # + 0x48, // # # + 0xF8, // ##### + + /* @1099 '\x9D' (5 pixels wide) */ + 0xD8, // ## ## + 0xD8, // ## ## + 0x70, // ### + 0xF8, // ##### + 0x20, // # + 0xF8, // ##### + 0x20, // # + + /* @1106 '\x9E' (5 pixels wide) */ + 0xE0, // ### + 0x90, // # # + 0x90, // # # + 0xE0, // ### + 0x90, // # # + 0xB8, // # ### + 0x90, // # # + + /* @1113 '\x9F' (5 pixels wide) */ + 0x18, // ## + 0x28, // # # + 0x20, // # + 0x70, // ### + 0x20, // # + 0x20, // # + 0xA0, // # # + + /* @1120 '\xA0' (5 pixels wide) */ + 0x18, // ## + 0x00, // + 0x60, // ## + 0x10, // # + 0x70, // ### + 0x90, // # # + 0x78, // #### + + /* @1127 '\xA1' (5 pixels wide) */ + 0x18, // ## + 0x00, // + 0x30, // ## + 0x10, // # + 0x10, // # + 0x10, // # + 0x38, // ### + + /* @1134 '\xA2' (5 pixels wide) */ + 0x00, // + 0x18, // ## + 0x00, // + 0x70, // ### + 0x88, // # # + 0x88, // # # + 0x70, // ### + + /* @1141 '\xA3' (5 pixels wide) */ + 0x00, // + 0x18, // ## + 0x00, // + 0x88, // # # + 0x88, // # # + 0x98, // # ## + 0x68, // ## # + + /* @1148 '\xA4' (5 pixels wide) */ + 0x00, // + 0x78, // #### + 0x00, // + 0x70, // ### + 0x48, // # # + 0x48, // # # + 0x48, // # # + + /* @1155 '\xA5' (5 pixels wide) */ + 0xF8, // ##### + 0x00, // + 0xC8, // ## # + 0xE8, // ### # + 0xB8, // # ### + 0x98, // # ## + 0x88, // # # + + /* @1162 '\xA6' (5 pixels wide) */ + 0x70, // ### + 0x90, // # # + 0x90, // # # + 0x78, // #### + 0x00, // + 0xF8, // ##### + 0x00, // + + /* @1169 '\xA7' (5 pixels wide) */ + 0x70, // ### + 0x88, // # # + 0x88, // # # + 0x70, // ### + 0x00, // + 0xF8, // ##### + 0x00, // + + /* @1176 '\xA8' (5 pixels wide) */ + 0x20, // # + 0x00, // + 0x20, // # + 0x60, // ## + 0x80, // # + 0x88, // # # + 0x70, // ### + + /* @1183 '\xA9' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x00, // + 0xF8, // ##### + 0x80, // # + 0x80, // # + 0x00, // + + /* @1190 '\xAA' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x00, // + 0xF8, // ##### + 0x08, // # + 0x08, // # + 0x00, // + + /* @1197 '\xAB' (5 pixels wide) */ + 0x80, // # + 0x88, // # # + 0x90, // # # + 0xB8, // # ### + 0x48, // # # + 0x98, // # ## + 0x20, // # + + /* @1204 '\xAC' (5 pixels wide) */ + 0x80, // # + 0x88, // # # + 0x90, // # # + 0xA8, // # # # + 0x58, // # ## + 0xB8, // # ### + 0x08, // # + + /* @1211 '\xAD' (5 pixels wide) */ + 0x20, // # + 0x20, // # + 0x00, // + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + + /* @1218 '\xAE' (5 pixels wide) */ + 0x00, // + 0x28, // # # + 0x50, // # # + 0xA0, // # # + 0x50, // # # + 0x28, // # # + 0x00, // + + /* @1225 '\xAF' (5 pixels wide) */ + 0x00, // + 0xA0, // # # + 0x50, // # # + 0x28, // # # + 0x50, // # # + 0xA0, // # # + 0x00, // + + /* @1232 '\xB0' (5 pixels wide) */ + 0x20, // # + 0x88, // # # + 0x20, // # + 0x88, // # # + 0x20, // # + 0x88, // # # + 0x20, // # + + /* @1239 '\xB1' (5 pixels wide) */ + 0x50, // # # + 0xA8, // # # # + 0x50, // # # + 0xA8, // # # # + 0x50, // # # + 0xA8, // # # # + 0x50, // # # + + /* @1246 '\xB2' (5 pixels wide) */ + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + + /* @1253 '\xB3' (5 pixels wide) */ + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0xF0, // #### + 0x10, // # + 0x10, // # + + /* @1260 '\xB4' (5 pixels wide) */ + 0x10, // # + 0x10, // # + 0xF0, // #### + 0x10, // # + 0xF0, // #### + 0x10, // # + 0x10, // # + + /* @1267 '\xB5' (5 pixels wide) */ + 0x28, // # # + 0x28, // # # + 0x28, // # # + 0x28, // # # + 0xE8, // ### # + 0x28, // # # + 0x28, // # # + + /* @1274 '\xB6' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0xF8, // ##### + 0x28, // # # + 0x28, // # # + + /* @1281 '\xB7' (5 pixels wide) */ + 0x00, // + 0x00, // + 0xF0, // #### + 0x10, // # + 0xF0, // #### + 0x10, // # + 0x10, // # + + /* @1288 '\xB8' (5 pixels wide) */ + 0x28, // # # + 0x28, // # # + 0xE8, // ### # + 0x08, // # + 0xE8, // ### # + 0x28, // # # + 0x28, // # # + + /* @1295 '\xB9' (5 pixels wide) */ + 0x28, // # # + 0x28, // # # + 0x28, // # # + 0x28, // # # + 0x28, // # # + 0x28, // # # + 0x28, // # # + + /* @1302 '\xBA' (5 pixels wide) */ + 0x00, // + 0x00, // + 0xF8, // ##### + 0x08, // # + 0xE8, // ### # + 0x28, // # # + 0x28, // # # + + /* @1309 '\xBB' (5 pixels wide) */ + 0x28, // # # + 0x28, // # # + 0xE8, // ### # + 0x08, // # + 0xF8, // ##### + 0x00, // + 0x00, // + + /* @1316 '\xBC' (5 pixels wide) */ + 0x28, // # # + 0x28, // # # + 0x28, // # # + 0x28, // # # + 0xF8, // ##### + 0x00, // + 0x00, // + + /* @1323 '\xBD' (5 pixels wide) */ + 0x10, // # + 0x10, // # + 0xF0, // #### + 0x10, // # + 0xF0, // #### + 0x00, // + 0x00, // + + /* @1330 '\xBE' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0xF0, // #### + 0x10, // # + 0x10, // # + + /* @1337 '\xBF' (5 pixels wide) */ + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x18, // ## + 0x00, // + 0x00, // + + /* @1344 '\xC0' (5 pixels wide) */ + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0xF8, // ##### + 0x00, // + 0x00, // + + /* @1351 '\xC1' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0xF8, // ##### + 0x10, // # + 0x10, // # + + /* @1358 '\xC2' (5 pixels wide) */ + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x18, // ## + 0x10, // # + 0x10, // # + + /* @1365 '\xC3' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0xF8, // ##### + 0x00, // + 0x00, // + + /* @1372 '\xC4' (5 pixels wide) */ + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0xF8, // ##### + 0x10, // # + 0x10, // # + + /* @1379 '\xC5' (5 pixels wide) */ + 0x10, // # + 0x10, // # + 0x18, // ## + 0x10, // # + 0x18, // ## + 0x10, // # + 0x10, // # + + /* @1386 '\xC6' (5 pixels wide) */ + 0x28, // # # + 0x28, // # # + 0x28, // # # + 0x28, // # # + 0x28, // # # + 0x28, // # # + 0x28, // # # + + /* @1393 '\xC7' (5 pixels wide) */ + 0x28, // # # + 0x28, // # # + 0x28, // # # + 0x20, // # + 0x38, // ### + 0x00, // + 0x00, // + + /* @1400 '\xC8' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x38, // ### + 0x20, // # + 0x28, // # # + 0x28, // # # + 0x28, // # # + + /* @1407 '\xC9' (5 pixels wide) */ + 0x28, // # # + 0x28, // # # + 0xE8, // ### # + 0x00, // + 0xF8, // ##### + 0x00, // + 0x00, // + + /* @1414 '\xCA' (5 pixels wide) */ + 0x00, // + 0x00, // + 0xF8, // ##### + 0x00, // + 0xE8, // ### # + 0x28, // # # + 0x28, // # # + + /* @1421 '\xCB' (5 pixels wide) */ + 0x28, // # # + 0x28, // # # + 0x28, // # # + 0x20, // # + 0x28, // # # + 0x28, // # # + 0x28, // # # + + /* @1428 '\xCC' (5 pixels wide) */ + 0x00, // + 0x00, // + 0xF8, // ##### + 0x00, // + 0xF8, // ##### + 0x00, // + 0x00, // + + /* @1435 '\xCD' (5 pixels wide) */ + 0x28, // # # + 0x28, // # # + 0xE8, // ### # + 0x00, // + 0xE8, // ### # + 0x28, // # # + 0x28, // # # + + /* @1442 '\xCE' (5 pixels wide) */ + 0x10, // # + 0x10, // # + 0xF8, // ##### + 0x00, // + 0xF8, // ##### + 0x00, // + 0x00, // + + /* @1449 '\xCF' (5 pixels wide) */ + 0x28, // # # + 0x28, // # # + 0x28, // # # + 0x28, // # # + 0xF8, // ##### + 0x00, // + 0x00, // + + /* @1456 '\xD0' (5 pixels wide) */ + 0x00, // + 0x00, // + 0xF8, // ##### + 0x00, // + 0xF8, // ##### + 0x10, // # + 0x10, // # + + /* @1463 '\xD1' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0xF8, // ##### + 0x28, // # # + 0x28, // # # + + /* @1470 '\xD2' (5 pixels wide) */ + 0x28, // # # + 0x28, // # # + 0x28, // # # + 0x28, // # # + 0x38, // ### + 0x00, // + 0x00, // + + /* @1477 '\xD3' (5 pixels wide) */ + 0x10, // # + 0x10, // # + 0x18, // ## + 0x10, // # + 0x18, // ## + 0x00, // + 0x00, // + + /* @1484 '\xD4' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x18, // ## + 0x10, // # + 0x18, // ## + 0x10, // # + 0x10, // # + + /* @1491 '\xD5' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x38, // ### + 0x28, // # # + 0x28, // # # + + /* @1498 '\xD6' (5 pixels wide) */ + 0x28, // # # + 0x28, // # # + 0x28, // # # + 0x28, // # # + 0xF8, // ##### + 0x28, // # # + 0x28, // # # + + /* @1505 '\xD7' (5 pixels wide) */ + 0x10, // # + 0x10, // # + 0xF8, // ##### + 0x10, // # + 0xF8, // ##### + 0x10, // # + 0x10, // # + + /* @1512 '\xD8' (5 pixels wide) */ + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0xF0, // #### + 0x00, // + 0x00, // + + /* @1519 '\xD9' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x18, // ## + 0x10, // # + 0x10, // # + + /* @1526 '\xDA' (5 pixels wide) */ + 0xF8, // ##### + 0xF8, // ##### + 0xF8, // ##### + 0xF8, // ##### + 0xF8, // ##### + 0xF8, // ##### + 0xF8, // ##### + + /* @1533 '\xDB' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0xF8, // ##### + 0xF8, // ##### + 0xF8, // ##### + + /* @1540 '\xDC' (5 pixels wide) */ + 0xE0, // ### + 0xE0, // ### + 0xE0, // ### + 0xE0, // ### + 0xE0, // ### + 0xE0, // ### + 0xE0, // ### + + /* @1547 '\xDD' (5 pixels wide) */ + 0x18, // ## + 0x18, // ## + 0x18, // ## + 0x18, // ## + 0x18, // ## + 0x18, // ## + 0x18, // ## + + /* @1554 '\xDE' (5 pixels wide) */ + 0xF8, // ##### + 0xF8, // ##### + 0xF8, // ##### + 0xF8, // ##### + 0x00, // + 0x00, // + 0x00, // + + /* @1561 '\xDF' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x68, // ## # + 0x90, // # # + 0x90, // # # + 0x90, // # # + 0x68, // ## # + + /* @1568 '\xE0' (5 pixels wide) */ + 0x00, // + 0x70, // ### + 0x88, // # # + 0xF0, // #### + 0x88, // # # + 0x88, // # # + 0xF0, // #### + + /* @1575 '\xE1' (5 pixels wide) */ + 0x00, // + 0xF8, // ##### + 0x98, // # ## + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + + /* @1582 '\xE2' (5 pixels wide) */ + 0x00, // + 0xF8, // ##### + 0x50, // # # + 0x50, // # # + 0x50, // # # + 0x50, // # # + 0x50, // # # + + /* @1589 '\xE3' (5 pixels wide) */ + 0xF8, // ##### + 0x88, // # # + 0x40, // # + 0x20, // # + 0x40, // # + 0x88, // # # + 0xF8, // ##### + + /* @1596 '\xE4' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x78, // #### + 0x90, // # # + 0x90, // # # + 0x90, // # # + 0x60, // ## + + /* @1603 '\xE5' (5 pixels wide) */ + 0x00, // + 0x50, // # # + 0x50, // # # + 0x50, // # # + 0x50, // # # + 0x68, // ## # + 0xC0, // ## + + /* @1610 '\xE6' (5 pixels wide) */ + 0x00, // + 0xF8, // ##### + 0xA0, // # # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + + /* @1617 '\xE7' (5 pixels wide) */ + 0xF8, // ##### + 0x20, // # + 0x70, // ### + 0x88, // # # + 0x88, // # # + 0x70, // ### + 0x20, // # + + /* @1624 '\xE8' (5 pixels wide) */ + 0x20, // # + 0x50, // # # + 0x88, // # # + 0xF8, // ##### + 0x88, // # # + 0x50, // # # + 0x20, // # + + /* @1631 '\xE9' (5 pixels wide) */ + 0x20, // # + 0x50, // # # + 0x88, // # # + 0x88, // # # + 0x50, // # # + 0x50, // # # + 0xD8, // ## ## + + /* @1638 '\xEA' (5 pixels wide) */ + 0x30, // ## + 0x40, // # + 0x30, // ## + 0x70, // ### + 0x88, // # # + 0x88, // # # + 0x70, // ### + + /* @1645 '\xEB' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x00, // + 0x70, // ### + 0xA8, // # # # + 0xA8, // # # # + 0x70, // ### + + /* @1652 '\xEC' (5 pixels wide) */ + 0x08, // # + 0x70, // ### + 0x98, // # ## + 0xA8, // # # # + 0xA8, // # # # + 0xC8, // ## # + 0x70, // ### + + /* @1659 '\xED' (5 pixels wide) */ + 0x70, // ### + 0x80, // # + 0x80, // # + 0xF0, // #### + 0x80, // # + 0x80, // # + 0x70, // ### + + /* @1666 '\xEE' (5 pixels wide) */ + 0x70, // ### + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x88, // # # + + /* @1673 '\xEF' (5 pixels wide) */ + 0x00, // + 0xF8, // ##### + 0x00, // + 0xF8, // ##### + 0x00, // + 0xF8, // ##### + 0x00, // + + /* @1680 '\xF0' (5 pixels wide) */ + 0x20, // # + 0x20, // # + 0xF8, // ##### + 0x20, // # + 0x20, // # + 0x00, // + 0xF8, // ##### + + /* @1687 '\xF1' (5 pixels wide) */ + 0x40, // # + 0x20, // # + 0x10, // # + 0x20, // # + 0x40, // # + 0x00, // + 0xF8, // ##### + + /* @1694 '\xF2' (5 pixels wide) */ + 0x10, // # + 0x20, // # + 0x40, // # + 0x20, // # + 0x10, // # + 0x00, // + 0xF8, // ##### + + /* @1701 '\xF3' (5 pixels wide) */ + 0x38, // ### + 0x28, // # # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + + /* @1708 '\xF4' (5 pixels wide) */ + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0xA0, // # # + 0xA0, // # # + + /* @1715 '\xF5' (5 pixels wide) */ + 0x30, // ## + 0x30, // ## + 0x00, // + 0xF8, // ##### + 0x00, // + 0x30, // ## + 0x30, // ## + + /* @1722 '\xF6' (5 pixels wide) */ + 0x00, // + 0xE8, // ### # + 0xB8, // # ### + 0x00, // + 0xE8, // ### # + 0xB8, // # ### + 0x00, // + + /* @1729 '\xF7' (5 pixels wide) */ + 0x70, // ### + 0xD8, // ## ## + 0xD8, // ## ## + 0x70, // ### + 0x00, // + 0x00, // + 0x00, // + + /* @1736 '\xF8' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x00, // + 0x30, // ## + 0x30, // ## + 0x00, // + 0x00, // + + /* @1743 '\xF9' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x30, // ## + 0x00, // + 0x00, // + + /* @1750 '\xFA' (5 pixels wide) */ + 0x38, // ### + 0x20, // # + 0x20, // # + 0x20, // # + 0xA0, // # # + 0xA0, // # # + 0x60, // ## + + /* @1757 '\xFB' (5 pixels wide) */ + 0x70, // ### + 0x48, // # # + 0x48, // # # + 0x48, // # # + 0x48, // # # + 0x00, // + 0x00, // + + /* @1764 '\xFC' (5 pixels wide) */ + 0x70, // ### + 0x18, // ## + 0x30, // ## + 0x60, // ## + 0x78, // #### + 0x00, // + 0x00, // + + /* @1771 '\xFD' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x78, // #### + 0x78, // #### + 0x78, // #### + 0x78, // #### + 0x00, // + + /* @1778 '\xFE' (5 pixels wide) */ + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + /* @1785 '\xFF' (5 pixels wide) */ + 0x08, // # + 0x28, // # # + 0x08, // # + 0x28, // # # + 0x00, // + 0x78, // #### + 0x08, // # + +}; + +/* Character descriptors for glcd 5x7 */ +/* { [Char width in bits], [Offset into glcd_5x7_bitmaps in bytes] } */ +const font_char_desc_t glcd_5x7_descriptors[] = +{ + {5, 0}, /* \x00 */ + {5, 7}, /* \x01 */ + {5, 14}, /* \x02 */ + {5, 21}, /* \x03 */ + {5, 28}, /* \x04 */ + {5, 35}, /* \x05 */ + {5, 42}, /* \x06 */ + {5, 49}, /* \x07 */ + {5, 56}, /* \x08 */ + {5, 63}, /* \x09 */ + {5, 70}, /* \x0A */ + {5, 77}, /* \x0B */ + {5, 84}, /* \x0C */ + {5, 91}, /* \x0D */ + {5, 98}, /* \x0E */ + {5, 105}, /* \x0F */ + {5, 112}, /* \x10 */ + {5, 119}, /* \x11 */ + {5, 126}, /* \x12 */ + {5, 133}, /* \x13 */ + {5, 140}, /* \x14 */ + {5, 147}, /* \x15 */ + {5, 154}, /* \x16 */ + {5, 161}, /* \x17 */ + {5, 168}, /* \x18 */ + {5, 175}, /* \x19 */ + {5, 182}, /* \x1A */ + {5, 189}, /* \x1B */ + {5, 196}, /* \x1C */ + {5, 203}, /* \x1D */ + {5, 210}, /* \x1E */ + {5, 217}, /* \x1F */ + {5, 224}, /* */ + {5, 231}, /* ! */ + {5, 238}, /* " */ + {5, 245}, /* # */ + {5, 252}, /* $ */ + {5, 259}, /* % */ + {5, 266}, /* & */ + {5, 273}, /* ' */ + {5, 280}, /* ( */ + {5, 287}, /* ) */ + {5, 294}, /* * */ + {5, 301}, /* + */ + {5, 308}, /* , */ + {5, 315}, /* - */ + {5, 322}, /* . */ + {5, 329}, /* / */ + {5, 336}, /* 0 */ + {5, 343}, /* 1 */ + {5, 350}, /* 2 */ + {5, 357}, /* 3 */ + {5, 364}, /* 4 */ + {5, 371}, /* 5 */ + {5, 378}, /* 6 */ + {5, 385}, /* 7 */ + {5, 392}, /* 8 */ + {5, 399}, /* 9 */ + {5, 406}, /* : */ + {5, 413}, /* ; */ + {5, 420}, /* < */ + {5, 427}, /* = */ + {5, 434}, /* > */ + {5, 441}, /* ? */ + {5, 448}, /* @ */ + {5, 455}, /* A */ + {5, 462}, /* B */ + {5, 469}, /* C */ + {5, 476}, /* D */ + {5, 483}, /* E */ + {5, 490}, /* F */ + {5, 497}, /* G */ + {5, 504}, /* H */ + {5, 511}, /* I */ + {5, 518}, /* J */ + {5, 525}, /* K */ + {5, 532}, /* L */ + {5, 539}, /* M */ + {5, 546}, /* N */ + {5, 553}, /* O */ + {5, 560}, /* P */ + {5, 567}, /* Q */ + {5, 574}, /* R */ + {5, 581}, /* S */ + {5, 588}, /* T */ + {5, 595}, /* U */ + {5, 602}, /* V */ + {5, 609}, /* W */ + {5, 616}, /* X */ + {5, 623}, /* Y */ + {5, 630}, /* Z */ + {5, 637}, /* [ */ + {5, 644}, /* \ */ + {5, 651}, /* ] */ + {5, 658}, /* ^ */ + {5, 665}, /* _ */ + {5, 672}, /* ` */ + {5, 679}, /* a */ + {5, 686}, /* b */ + {5, 693}, /* c */ + {5, 700}, /* d */ + {5, 707}, /* e */ + {5, 714}, /* f */ + {5, 721}, /* g */ + {5, 728}, /* h */ + {5, 735}, /* i */ + {5, 742}, /* j */ + {5, 749}, /* k */ + {5, 756}, /* l */ + {5, 763}, /* m */ + {5, 770}, /* n */ + {5, 777}, /* o */ + {5, 784}, /* p */ + {5, 791}, /* q */ + {5, 798}, /* r */ + {5, 805}, /* s */ + {5, 812}, /* t */ + {5, 819}, /* u */ + {5, 826}, /* v */ + {5, 833}, /* w */ + {5, 840}, /* x */ + {5, 847}, /* y */ + {5, 854}, /* z */ + {5, 861}, /* { */ + {5, 868}, /* | */ + {5, 875}, /* } */ + {5, 882}, /* ~ */ + {5, 889}, /* \x7F */ + {5, 896}, /* \x80 */ + {5, 903}, /* \x81 */ + {5, 910}, /* \x82 */ + {5, 917}, /* \x83 */ + {5, 924}, /* \x84 */ + {5, 931}, /* \x85 */ + {5, 938}, /* \x86 */ + {5, 945}, /* \x87 */ + {5, 952}, /* \x88 */ + {5, 959}, /* \x89 */ + {5, 966}, /* \x8A */ + {5, 973}, /* \x8B */ + {5, 980}, /* \x8C */ + {5, 987}, /* \x8D */ + {5, 994}, /* \x8E */ + {5, 1001}, /* \x8F */ + {5, 1008}, /* \x90 */ + {5, 1015}, /* \x91 */ + {5, 1022}, /* \x92 */ + {5, 1029}, /* \x93 */ + {5, 1036}, /* \x94 */ + {5, 1043}, /* \x95 */ + {5, 1050}, /* \x96 */ + {5, 1057}, /* \x97 */ + {5, 1064}, /* \x98 */ + {5, 1071}, /* \x99 */ + {5, 1078}, /* \x9A */ + {5, 1085}, /* \x9B */ + {5, 1092}, /* \x9C */ + {5, 1099}, /* \x9D */ + {5, 1106}, /* \x9E */ + {5, 1113}, /* \x9F */ + {5, 1120}, /* \xA0 */ + {5, 1127}, /* \xA1 */ + {5, 1134}, /* \xA2 */ + {5, 1141}, /* \xA3 */ + {5, 1148}, /* \xA4 */ + {5, 1155}, /* \xA5 */ + {5, 1162}, /* \xA6 */ + {5, 1169}, /* \xA7 */ + {5, 1176}, /* \xA8 */ + {5, 1183}, /* \xA9 */ + {5, 1190}, /* \xAA */ + {5, 1197}, /* \xAB */ + {5, 1204}, /* \xAC */ + {5, 1211}, /* \xAD */ + {5, 1218}, /* \xAE */ + {5, 1225}, /* \xAF */ + {5, 1232}, /* \xB0 */ + {5, 1239}, /* \xB1 */ + {5, 1246}, /* \xB2 */ + {5, 1253}, /* \xB3 */ + {5, 1260}, /* \xB4 */ + {5, 1267}, /* \xB5 */ + {5, 1274}, /* \xB6 */ + {5, 1281}, /* \xB7 */ + {5, 1288}, /* \xB8 */ + {5, 1295}, /* \xB9 */ + {5, 1302}, /* \xBA */ + {5, 1309}, /* \xBB */ + {5, 1316}, /* \xBC */ + {5, 1323}, /* \xBD */ + {5, 1330}, /* \xBE */ + {5, 1337}, /* \xBF */ + {5, 1344}, /* \xC0 */ + {5, 1351}, /* \xC1 */ + {5, 1358}, /* \xC2 */ + {5, 1365}, /* \xC3 */ + {5, 1372}, /* \xC4 */ + {5, 1379}, /* \xC5 */ + {5, 1386}, /* \xC6 */ + {5, 1393}, /* \xC7 */ + {5, 1400}, /* \xC8 */ + {5, 1407}, /* \xC9 */ + {5, 1414}, /* \xCA */ + {5, 1421}, /* \xCB */ + {5, 1428}, /* \xCC */ + {5, 1435}, /* \xCD */ + {5, 1442}, /* \xCE */ + {5, 1449}, /* \xCF */ + {5, 1456}, /* \xD0 */ + {5, 1463}, /* \xD1 */ + {5, 1470}, /* \xD2 */ + {5, 1477}, /* \xD3 */ + {5, 1484}, /* \xD4 */ + {5, 1491}, /* \xD5 */ + {5, 1498}, /* \xD6 */ + {5, 1505}, /* \xD7 */ + {5, 1512}, /* \xD8 */ + {5, 1519}, /* \xD9 */ + {5, 1526}, /* \xDA */ + {5, 1533}, /* \xDB */ + {5, 1540}, /* \xDC */ + {5, 1547}, /* \xDD */ + {5, 1554}, /* \xDE */ + {5, 1561}, /* \xDF */ + {5, 1568}, /* \xE0 */ + {5, 1575}, /* \xE1 */ + {5, 1582}, /* \xE2 */ + {5, 1589}, /* \xE3 */ + {5, 1596}, /* \xE4 */ + {5, 1603}, /* \xE5 */ + {5, 1610}, /* \xE6 */ + {5, 1617}, /* \xE7 */ + {5, 1624}, /* \xE8 */ + {5, 1631}, /* \xE9 */ + {5, 1638}, /* \xEA */ + {5, 1645}, /* \xEB */ + {5, 1652}, /* \xEC */ + {5, 1659}, /* \xED */ + {5, 1666}, /* \xEE */ + {5, 1673}, /* \xEF */ + {5, 1680}, /* \xF0 */ + {5, 1687}, /* \xF1 */ + {5, 1694}, /* \xF2 */ + {5, 1701}, /* \xF3 */ + {5, 1708}, /* \xF4 */ + {5, 1715}, /* \xF5 */ + {5, 1722}, /* \xF6 */ + {5, 1729}, /* \xF7 */ + {5, 1736}, /* \xF8 */ + {5, 1743}, /* \xF9 */ + {5, 1750}, /* \xFA */ + {5, 1757}, /* \xFB */ + {5, 1764}, /* \xFC */ + {5, 1771}, /* \xFD */ + {5, 1778}, /* \xFE */ + {5, 1785}, /* \xFF */ +}; + +/* Font information for glcd 5x7 */ +const font_info_t glcd_5x7_font_info = +{ + 7, /* Character height */ + 1, /* C */ + 0, /* Start character */ + 255, /* End character */ + glcd_5x7_descriptors, /* Character descriptor array */ + glcd_5x7_bitmaps, /* Character bitmap array */ +}; + diff --git a/extras/fonts/font_roboto_10.c b/extras/fonts/font_roboto_10.c new file mode 100644 index 0000000..698d997 --- /dev/null +++ b/extras/fonts/font_roboto_10.c @@ -0,0 +1,1623 @@ +// +// Font data for Roboto 10pt +// +#include "fonts.h" + +// Character bitmaps for Roboto 10pt +const uint8_t roboto_10ptBitmaps[] = +{ + // @0 '!' (1 pixels wide) + 0x00, // + 0x00, // + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x00, // + 0x00, // + 0x80, // # + 0x00, // + 0x00, // + 0x00, // + + // @14 '"' (3 pixels wide) + 0x00, // + 0x00, // + 0xA0, // # # + 0xA0, // # # + 0xA0, // # # + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @28 '#' (8 pixels wide) + 0x00, // + 0x00, // + 0x12, // # # + 0x14, // # # + 0x7F, // ####### + 0x24, // # # + 0x24, // # # + 0xFE, // ####### + 0x28, // # # + 0x28, // # # + 0x08, // # + 0x00, // + 0x00, // + 0x00, // + + // @42 '$' (6 pixels wide) + 0x20, // # + 0x30, // ## + 0x58, // # ## + 0x8C, // # ## + 0xC0, // ## + 0x60, // ## + 0x38, // ### + 0x0C, // ## + 0x8C, // # ## + 0xCC, // ## ## + 0x70, // ### + 0x20, // # + 0x00, // + 0x00, // + + // @56 '%' (8 pixels wide) + 0x00, // + 0x00, // + 0xE0, // ### + 0xA4, // # # # + 0x84, // # # + 0xA8, // # # # + 0x10, // # + 0x19, // ## # + 0x29, // # # # + 0x49, // # # # + 0x06, // ## + 0x00, // + 0x00, // + 0x00, // + + // @70 '&' (8 pixels wide) + 0x00, // + 0x00, // + 0x38, // ### + 0x64, // ## # + 0x64, // ## # + 0x38, // ### + 0x30, // ## + 0x5B, // # ## ## + 0xCE, // ## ### + 0x46, // # ## + 0x7A, // #### # + 0x00, // + 0x00, // + 0x00, // + + // @84 ''' (1 pixels wide) + 0x00, // + 0x00, // + 0x80, // # + 0x80, // # + 0x80, // # + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @98 '(' (3 pixels wide) + 0x00, // + 0x20, // # + 0x40, // # + 0x40, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0xC0, // ## + 0x40, // # + 0x60, // ## + 0x20, // # + + // @112 ')' (3 pixels wide) + 0x00, // + 0x80, // # + 0x40, // # + 0x60, // ## + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x40, // # + 0x40, // # + 0x80, // # + + // @126 '*' (4 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x40, // # + 0xD0, // ## # + 0x60, // ## + 0xA0, // # # + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @140 '+' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x10, // # + 0x10, // # + 0x10, // # + 0xFE, // ####### + 0x10, // # + 0x10, // # + 0x10, // # + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @154 ',' (2 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x40, // # + 0x40, // # + 0x80, // # + 0x00, // + + // @168 '-' (4 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0xF0, // #### + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @182 '.' (1 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x80, // # + 0x00, // + 0x00, // + 0x00, // + + // @196 '/' (5 pixels wide) + 0x00, // + 0x00, // + 0x08, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x20, // # + 0x20, // # + 0x60, // ## + 0x40, // # + 0x40, // # + 0x80, // # + 0x00, // + 0x00, // + + // @210 '0' (6 pixels wide) + 0x00, // + 0x00, // + 0x70, // ### + 0x88, // # # + 0x8C, // # ## + 0x8C, // # ## + 0x8C, // # ## + 0x8C, // # ## + 0x8C, // # ## + 0x88, // # # + 0x70, // ### + 0x00, // + 0x00, // + 0x00, // + + // @224 '1' (4 pixels wide) + 0x00, // + 0x00, // + 0xF0, // #### + 0x30, // ## + 0x30, // ## + 0x30, // ## + 0x30, // ## + 0x30, // ## + 0x30, // ## + 0x30, // ## + 0x30, // ## + 0x00, // + 0x00, // + 0x00, // + + // @238 '2' (6 pixels wide) + 0x00, // + 0x00, // + 0x78, // #### + 0x88, // # # + 0x88, // # # + 0x08, // # + 0x10, // # + 0x30, // ## + 0x60, // ## + 0x40, // # + 0xFC, // ###### + 0x00, // + 0x00, // + 0x00, // + + // @252 '3' (6 pixels wide) + 0x00, // + 0x00, // + 0x78, // #### + 0x88, // # # + 0x88, // # # + 0x08, // # + 0x38, // ### + 0x08, // # + 0x8C, // # ## + 0x88, // # # + 0x78, // #### + 0x00, // + 0x00, // + 0x00, // + + // @266 '4' (7 pixels wide) + 0x00, // + 0x00, // + 0x0C, // ## + 0x1C, // ### + 0x1C, // ### + 0x2C, // # ## + 0x2C, // # ## + 0x4C, // # ## + 0xFE, // ####### + 0x0C, // ## + 0x0C, // ## + 0x00, // + 0x00, // + 0x00, // + + // @280 '5' (6 pixels wide) + 0x00, // + 0x00, // + 0x78, // #### + 0xC0, // ## + 0xC0, // ## + 0xF8, // ##### + 0x88, // # # + 0x0C, // ## + 0x8C, // # ## + 0x88, // # # + 0x78, // #### + 0x00, // + 0x00, // + 0x00, // + + // @294 '6' (6 pixels wide) + 0x00, // + 0x00, // + 0x78, // #### + 0xC0, // ## + 0x80, // # + 0xB0, // # ## + 0x88, // # # + 0x8C, // # ## + 0x8C, // # ## + 0xC8, // ## # + 0x78, // #### + 0x00, // + 0x00, // + 0x00, // + + // @308 '7' (6 pixels wide) + 0x00, // + 0x00, // + 0xFC, // ###### + 0x08, // # + 0x18, // ## + 0x10, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x00, // + 0x00, // + 0x00, // + + // @322 '8' (6 pixels wide) + 0x00, // + 0x00, // + 0x78, // #### + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x70, // ### + 0x88, // # # + 0x8C, // # ## + 0x88, // # # + 0x78, // #### + 0x00, // + 0x00, // + 0x00, // + + // @336 '9' (5 pixels wide) + 0x00, // + 0x00, // + 0x70, // ### + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x78, // #### + 0x08, // # + 0x08, // # + 0xF0, // #### + 0x00, // + 0x00, // + 0x00, // + + // @350 ':' (1 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x80, // # + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x80, // # + 0x00, // + 0x00, // + 0x00, // + + // @364 ';' (2 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x40, // # + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x40, // # + 0x40, // # + 0x80, // # + 0x00, // + + // @378 '<' (6 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x0C, // ## + 0x70, // ### + 0xC0, // ## + 0x30, // ## + 0x0C, // ## + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @392 '=' (5 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0xF8, // ##### + 0x00, // + 0xF8, // ##### + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @406 '>' (5 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0xC0, // ## + 0x70, // ### + 0x08, // # + 0x30, // ## + 0xC0, // ## + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @420 '?' (6 pixels wide) + 0x00, // + 0x00, // + 0x78, // #### + 0xC8, // ## # + 0x0C, // ## + 0x08, // # + 0x18, // ## + 0x30, // ## + 0x30, // ## + 0x00, // + 0x30, // ## + 0x00, // + 0x00, // + 0x00, // + + // @434 '@' (10 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x1F, 0x00, // ##### + 0x61, 0x80, // ## ## + 0x4C, 0x80, // # ## # + 0x9A, 0x40, // # ## # # + 0x92, 0x40, // # # # # + 0x92, 0x40, // # # # # + 0xB2, 0x40, // # ## # # + 0x92, 0x40, // # # # # + 0x9B, 0x80, // # ## ### + 0x80, 0x00, // # + 0x60, 0x00, // ## + 0x3E, 0x00, // ##### + + // @462 'A' (8 pixels wide) + 0x00, // + 0x00, // + 0x18, // ## + 0x18, // ## + 0x1C, // ### + 0x24, // # # + 0x24, // # # + 0x26, // # ## + 0x7E, // ###### + 0x42, // # # + 0xC1, // ## # + 0x00, // + 0x00, // + 0x00, // + + // @476 'B' (7 pixels wide) + 0x00, // + 0x00, // + 0xF8, // ##### + 0x84, // # # + 0x84, // # # + 0x84, // # # + 0xFC, // ###### + 0x86, // # ## + 0x82, // # # + 0x86, // # ## + 0xFC, // ###### + 0x00, // + 0x00, // + 0x00, // + + // @490 'C' (7 pixels wide) + 0x00, // + 0x00, // + 0x78, // #### + 0xC4, // ## # + 0x86, // # ## + 0x80, // # + 0x80, // # + 0x80, // # + 0x86, // # ## + 0xC4, // ## # + 0x78, // #### + 0x00, // + 0x00, // + 0x00, // + + // @504 'D' (7 pixels wide) + 0x00, // + 0x00, // + 0xF8, // ##### + 0x84, // # # + 0x86, // # ## + 0x82, // # # + 0x82, // # # + 0x82, // # # + 0x86, // # ## + 0x84, // # # + 0xF8, // ##### + 0x00, // + 0x00, // + 0x00, // + + // @518 'E' (6 pixels wide) + 0x00, // + 0x00, // + 0xFC, // ###### + 0x80, // # + 0x80, // # + 0x80, // # + 0xF8, // ##### + 0x80, // # + 0x80, // # + 0x80, // # + 0xFC, // ###### + 0x00, // + 0x00, // + 0x00, // + + // @532 'F' (6 pixels wide) + 0x00, // + 0x00, // + 0xFC, // ###### + 0x80, // # + 0x80, // # + 0x80, // # + 0xF8, // ##### + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x00, // + 0x00, // + 0x00, // + + // @546 'G' (7 pixels wide) + 0x00, // + 0x00, // + 0x78, // #### + 0xC4, // ## # + 0x86, // # ## + 0x80, // # + 0x9E, // # #### + 0x86, // # ## + 0x86, // # ## + 0xC6, // ## ## + 0x7C, // ##### + 0x00, // + 0x00, // + 0x00, // + + // @560 'H' (7 pixels wide) + 0x00, // + 0x00, // + 0x82, // # # + 0x82, // # # + 0x82, // # # + 0x82, // # # + 0xFE, // ####### + 0x82, // # # + 0x82, // # # + 0x82, // # # + 0x82, // # # + 0x00, // + 0x00, // + 0x00, // + + // @574 'I' (1 pixels wide) + 0x00, // + 0x00, // + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x00, // + 0x00, // + 0x00, // + + // @588 'J' (6 pixels wide) + 0x00, // + 0x00, // + 0x04, // # + 0x04, // # + 0x04, // # + 0x04, // # + 0x04, // # + 0x04, // # + 0xC4, // ## # + 0x4C, // # ## + 0x78, // #### + 0x00, // + 0x00, // + 0x00, // + + // @602 'K' (7 pixels wide) + 0x00, // + 0x00, // + 0x84, // # # + 0x8C, // # ## + 0x98, // # ## + 0x90, // # # + 0xE0, // ### + 0x90, // # # + 0x88, // # # + 0x8C, // # ## + 0x86, // # ## + 0x00, // + 0x00, // + 0x00, // + + // @616 'L' (6 pixels wide) + 0x00, // + 0x00, // + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0xFC, // ###### + 0x00, // + 0x00, // + 0x00, // + + // @630 'M' (9 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0xC1, 0x80, // ## ## + 0xC1, 0x80, // ## ## + 0xA1, 0x80, // # # ## + 0xA2, 0x80, // # # # # + 0xB2, 0x80, // # ## # # + 0x96, 0x80, // # # ## # + 0x94, 0x80, // # # # # + 0x8C, 0x80, // # ## # + 0x88, 0x80, // # # # + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @658 'N' (7 pixels wide) + 0x00, // + 0x00, // + 0xC2, // ## # + 0xC2, // ## # + 0xA2, // # # # + 0xB2, // # ## # + 0x92, // # # # + 0x8A, // # # # + 0x8E, // # ### + 0x86, // # ## + 0x86, // # ## + 0x00, // + 0x00, // + 0x00, // + + // @672 'O' (7 pixels wide) + 0x00, // + 0x00, // + 0x78, // #### + 0xC4, // ## # + 0x82, // # # + 0x82, // # # + 0x82, // # # + 0x82, // # # + 0x82, // # # + 0xC4, // ## # + 0x78, // #### + 0x00, // + 0x00, // + 0x00, // + + // @686 'P' (7 pixels wide) + 0x00, // + 0x00, // + 0xFC, // ###### + 0x84, // # # + 0x86, // # ## + 0x86, // # ## + 0x8C, // # ## + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x00, // + 0x00, // + 0x00, // + + // @700 'Q' (7 pixels wide) + 0x00, // + 0x00, // + 0x78, // #### + 0xC4, // ## # + 0x82, // # # + 0x82, // # # + 0x82, // # # + 0x82, // # # + 0x82, // # # + 0xC4, // ## # + 0x7E, // ###### + 0x00, // + 0x00, // + 0x00, // + + // @714 'R' (6 pixels wide) + 0x00, // + 0x00, // + 0xF8, // ##### + 0x84, // # # + 0x84, // # # + 0x84, // # # + 0xF8, // ##### + 0x84, // # # + 0x84, // # # + 0x84, // # # + 0x84, // # # + 0x00, // + 0x00, // + 0x00, // + + // @728 'S' (6 pixels wide) + 0x00, // + 0x00, // + 0x78, // #### + 0xCC, // ## ## + 0x84, // # # + 0xC0, // ## + 0x38, // ### + 0x0C, // ## + 0x84, // # # + 0x84, // # # + 0x78, // #### + 0x00, // + 0x00, // + 0x00, // + + // @742 'T' (8 pixels wide) + 0x00, // + 0x00, // + 0xFF, // ######## + 0x18, // ## + 0x18, // ## + 0x18, // ## + 0x18, // ## + 0x18, // ## + 0x18, // ## + 0x18, // ## + 0x18, // ## + 0x00, // + 0x00, // + 0x00, // + + // @756 'U' (7 pixels wide) + 0x00, // + 0x00, // + 0x82, // # # + 0x82, // # # + 0x82, // # # + 0x82, // # # + 0x82, // # # + 0x82, // # # + 0x82, // # # + 0xC4, // ## # + 0x78, // #### + 0x00, // + 0x00, // + 0x00, // + + // @770 'V' (8 pixels wide) + 0x00, // + 0x00, // + 0xC1, // ## # + 0x43, // # ## + 0x42, // # # + 0x66, // ## ## + 0x24, // # # + 0x24, // # # + 0x1C, // ### + 0x18, // ## + 0x18, // ## + 0x00, // + 0x00, // + 0x00, // + + // @784 'W' (11 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0xC4, 0x60, // ## # ## + 0x46, 0x60, // # ## ## + 0x4A, 0x40, // # # # # + 0x4A, 0x40, // # # # # + 0x6A, 0x40, // ## # # # + 0x39, 0xC0, // ### ### + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x31, 0x80, // ## ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @812 'X' (7 pixels wide) + 0x00, // + 0x00, // + 0x84, // # # + 0xCC, // ## ## + 0x48, // # # + 0x38, // ### + 0x30, // ## + 0x38, // ### + 0x48, // # # + 0xCC, // ## ## + 0x86, // # ## + 0x00, // + 0x00, // + 0x00, // + + // @826 'Y' (7 pixels wide) + 0x00, // + 0x00, // + 0x86, // # ## + 0x84, // # # + 0x4C, // # ## + 0x68, // ## # + 0x30, // ## + 0x30, // ## + 0x30, // ## + 0x30, // ## + 0x30, // ## + 0x00, // + 0x00, // + 0x00, // + + // @840 'Z' (6 pixels wide) + 0x00, // + 0x00, // + 0xFC, // ###### + 0x0C, // ## + 0x18, // ## + 0x10, // # + 0x20, // # + 0x60, // ## + 0x40, // # + 0x80, // # + 0xFC, // ###### + 0x00, // + 0x00, // + 0x00, // + + // @854 '[' (2 pixels wide) + 0xC0, // ## + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0xC0, // ## + 0x00, // + + // @868 '\' (5 pixels wide) + 0x00, // + 0x00, // + 0xC0, // ## + 0x40, // # + 0x40, // # + 0x20, // # + 0x20, // # + 0x30, // ## + 0x10, // # + 0x10, // # + 0x08, // # + 0x08, // # + 0x00, // + 0x00, // + + // @882 ']' (3 pixels wide) + 0xE0, // ### + 0x60, // ## + 0x60, // ## + 0x60, // ## + 0x60, // ## + 0x60, // ## + 0x60, // ## + 0x60, // ## + 0x60, // ## + 0x60, // ## + 0x60, // ## + 0x60, // ## + 0xE0, // ### + 0x00, // + + // @896 '^' (5 pixels wide) + 0x00, // + 0x00, // + 0x20, // # + 0x30, // ## + 0x50, // # # + 0x58, // # ## + 0xC8, // ## # + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @910 '_' (6 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0xFC, // ###### + 0x00, // + 0x00, // + + // @924 '`' (2 pixels wide) + 0x00, // + 0x80, // # + 0x40, // # + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @938 'a' (5 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x70, // ### + 0x88, // # # + 0x08, // # + 0xF8, // ##### + 0x88, // # # + 0x88, // # # + 0xE8, // ### # + 0x00, // + 0x00, // + 0x00, // + + // @952 'b' (6 pixels wide) + 0x00, // + 0x80, // # + 0x80, // # + 0x80, // # + 0xB8, // # ### + 0xC8, // ## # + 0x8C, // # ## + 0x84, // # # + 0x8C, // # ## + 0xC8, // ## # + 0xB8, // # ### + 0x00, // + 0x00, // + 0x00, // + + // @966 'c' (5 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x70, // ### + 0x88, // # # + 0x80, // # + 0x80, // # + 0x80, // # + 0x88, // # # + 0x70, // ### + 0x00, // + 0x00, // + 0x00, // + + // @980 'd' (5 pixels wide) + 0x00, // + 0x08, // # + 0x08, // # + 0x08, // # + 0x78, // #### + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x78, // #### + 0x00, // + 0x00, // + 0x00, // + + // @994 'e' (5 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x70, // ### + 0x88, // # # + 0x88, // # # + 0xF8, // ##### + 0x80, // # + 0x88, // # # + 0x78, // #### + 0x00, // + 0x00, // + 0x00, // + + // @1008 'f' (4 pixels wide) + 0x00, // + 0x30, // ## + 0x60, // ## + 0x60, // ## + 0xF0, // #### + 0x60, // ## + 0x60, // ## + 0x60, // ## + 0x60, // ## + 0x60, // ## + 0x60, // ## + 0x00, // + 0x00, // + 0x00, // + + // @1022 'g' (6 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x7C, // ##### + 0xCC, // ## ## + 0x8C, // # ## + 0x8C, // # ## + 0x8C, // # ## + 0x8C, // # ## + 0x7C, // ##### + 0x08, // # + 0x08, // # + 0xF0, // #### + + // @1036 'h' (6 pixels wide) + 0x00, // + 0x80, // # + 0x80, // # + 0x80, // # + 0xB8, // # ### + 0x88, // # # + 0x88, // # # + 0x8C, // # ## + 0x8C, // # ## + 0x8C, // # ## + 0x8C, // # ## + 0x00, // + 0x00, // + 0x00, // + + // @1050 'i' (1 pixels wide) + 0x00, // + 0x80, // # + 0x00, // + 0x00, // + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x00, // + 0x00, // + 0x00, // + + // @1064 'j' (2 pixels wide) + 0x00, // + 0x40, // # + 0x00, // + 0x00, // + 0x40, // # + 0x40, // # + 0x40, // # + 0x40, // # + 0x40, // # + 0x40, // # + 0x40, // # + 0x40, // # + 0x40, // # + 0xC0, // ## + + // @1078 'k' (5 pixels wide) + 0x00, // + 0x80, // # + 0x80, // # + 0x80, // # + 0x98, // # ## + 0x90, // # # + 0xA0, // # # + 0xE0, // ### + 0xB0, // # ## + 0x90, // # # + 0x88, // # # + 0x00, // + 0x00, // + 0x00, // + + // @1092 'l' (1 pixels wide) + 0x00, // + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x00, // + 0x00, // + 0x00, // + + // @1106 'm' (9 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0xBB, 0x80, // # ### ### + 0x8C, 0x80, // # ## # + 0x88, 0x80, // # # # + 0x88, 0x80, // # # # + 0x88, 0x80, // # # # + 0x88, 0x80, // # # # + 0x88, 0x80, // # # # + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1134 'n' (5 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0xB8, // # ### + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x00, // + 0x00, // + 0x00, // + + // @1148 'o' (6 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x70, // ### + 0x88, // # # + 0x8C, // # ## + 0x84, // # # + 0x8C, // # ## + 0x88, // # # + 0x70, // ### + 0x00, // + 0x00, // + 0x00, // + + // @1162 'p' (6 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0xB8, // # ### + 0x88, // # # + 0x8C, // # ## + 0x84, // # # + 0x8C, // # ## + 0x88, // # # + 0xB8, // # ### + 0x80, // # + 0x80, // # + 0x80, // # + + // @1176 'q' (5 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x78, // #### + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x78, // #### + 0x08, // # + 0x08, // # + 0x08, // # + + // @1190 'r' (3 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0xA0, // # # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x00, // + 0x00, // + 0x00, // + + // @1204 's' (5 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x70, // ### + 0x88, // # # + 0x80, // # + 0x70, // ### + 0x08, // # + 0x88, // # # + 0x70, // ### + 0x00, // + 0x00, // + 0x00, // + + // @1218 't' (4 pixels wide) + 0x00, // + 0x00, // + 0x60, // ## + 0x60, // ## + 0xF0, // #### + 0x60, // ## + 0x60, // ## + 0x60, // ## + 0x60, // ## + 0x60, // ## + 0x30, // ## + 0x00, // + 0x00, // + 0x00, // + + // @1232 'u' (5 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x78, // #### + 0x00, // + 0x00, // + 0x00, // + + // @1246 'v' (6 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0xC4, // ## # + 0x44, // # # + 0x48, // # # + 0x28, // # # + 0x28, // # # + 0x30, // ## + 0x10, // # + 0x00, // + 0x00, // + 0x00, // + + // @1260 'w' (9 pixels wide) + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + 0xCC, 0x80, // ## ## # + 0x4C, 0x80, // # ## # + 0x4C, 0x80, // # ## # + 0x57, 0x80, // # # #### + 0x33, 0x00, // ## ## + 0x33, 0x00, // ## ## + 0x23, 0x00, // # ## + 0x00, 0x00, // + 0x00, 0x00, // + 0x00, 0x00, // + + // @1288 'x' (5 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x98, // # ## + 0xD0, // ## # + 0x70, // ### + 0x20, // # + 0x70, // ### + 0xD0, // ## # + 0x98, // # ## + 0x00, // + 0x00, // + 0x00, // + + // @1302 'y' (6 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0xC4, // ## # + 0x4C, // # ## + 0x48, // # # + 0x68, // ## # + 0x28, // # # + 0x30, // ## + 0x10, // # + 0x10, // # + 0x20, // # + 0x60, // ## + + // @1316 'z' (5 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0xF8, // ##### + 0x10, // # + 0x30, // ## + 0x60, // ## + 0x40, // # + 0x80, // # + 0xF8, // ##### + 0x00, // + 0x00, // + 0x00, // + + // @1330 '{' (4 pixels wide) + 0x00, // + 0x10, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x60, // ## + 0xC0, // ## + 0x60, // ## + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x10, // # + + // @1344 '|' (1 pixels wide) + 0x00, // + 0x00, // + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x00, // + + // @1358 '}' (4 pixels wide) + 0x00, // + 0x80, // # + 0x40, // # + 0x60, // ## + 0x60, // ## + 0x60, // ## + 0x20, // # + 0x10, // # + 0x20, // # + 0x60, // ## + 0x60, // ## + 0x60, // ## + 0x40, // # + 0x80, // # + + // @1372 '~' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0xF2, // #### # + 0x8C, // # ## + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // +}; + +// Character descriptors for Roboto 10pt +// { [Char width in bits], [Offset into roboto_10ptCharBitmaps in bytes] } +const font_char_desc_t roboto_10ptDescriptors[] = +{ + {1, 0}, // ! + {3, 14}, // " + {8, 28}, // # + {6, 42}, // $ + {8, 56}, // % + {8, 70}, // & + {1, 84}, // ' + {3, 98}, // ( + {3, 112}, // ) + {4, 126}, // * + {7, 140}, // + + {2, 154}, // , + {4, 168}, // - + {1, 182}, // . + {5, 196}, // / + {6, 210}, // 0 + {4, 224}, // 1 + {6, 238}, // 2 + {6, 252}, // 3 + {7, 266}, // 4 + {6, 280}, // 5 + {6, 294}, // 6 + {6, 308}, // 7 + {6, 322}, // 8 + {5, 336}, // 9 + {1, 350}, // : + {2, 364}, // ; + {6, 378}, // < + {5, 392}, // = + {5, 406}, // > + {6, 420}, // ? + {10, 434}, // @ + {8, 462}, // A + {7, 476}, // B + {7, 490}, // C + {7, 504}, // D + {6, 518}, // E + {6, 532}, // F + {7, 546}, // G + {7, 560}, // H + {1, 574}, // I + {6, 588}, // J + {7, 602}, // K + {6, 616}, // L + {9, 630}, // M + {7, 658}, // N + {7, 672}, // O + {7, 686}, // P + {7, 700}, // Q + {6, 714}, // R + {6, 728}, // S + {8, 742}, // T + {7, 756}, // U + {8, 770}, // V + {11, 784}, // W + {7, 812}, // X + {7, 826}, // Y + {6, 840}, // Z + {2, 854}, // [ + {5, 868}, /* \ */ + {3, 882}, // ] + {5, 896}, // ^ + {6, 910}, // _ + {2, 924}, // ` + {5, 938}, // a + {6, 952}, // b + {5, 966}, // c + {5, 980}, // d + {5, 994}, // e + {4, 1008}, // f + {6, 1022}, // g + {6, 1036}, // h + {1, 1050}, // i + {2, 1064}, // j + {5, 1078}, // k + {1, 1092}, // l + {9, 1106}, // m + {5, 1134}, // n + {6, 1148}, // o + {6, 1162}, // p + {5, 1176}, // q + {3, 1190}, // r + {5, 1204}, // s + {4, 1218}, // t + {5, 1232}, // u + {6, 1246}, // v + {9, 1260}, // w + {5, 1288}, // x + {6, 1302}, // y + {5, 1316}, // z + {4, 1330}, // { + {1, 1344}, // | + {4, 1358}, // } + {7, 1372}, // ~ +}; + +// Font information for Roboto 10pt +const font_info_t roboto_10ptFontInfo = +{ + 2, // Character height + '!', // Start character + '~', // End character + 2, // Width, in pixels, of space character + roboto_10ptDescriptors, // Character descriptor array + roboto_10ptBitmaps, // Character bitmap array +}; diff --git a/extras/fonts/font_roboto_8.c b/extras/fonts/font_roboto_8.c new file mode 100644 index 0000000..f3ad025 --- /dev/null +++ b/extras/fonts/font_roboto_8.c @@ -0,0 +1,1341 @@ +// +// Font data for Roboto 8pt +// +#include "fonts.h" + +// Character bitmaps for Roboto 8pt +const uint8_t roboto_8ptBitmaps[] = +{ + // @0 '!' (1 pixels wide) + 0x00, // + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x00, // + 0x00, // + 0x80, // # + 0x00, // + 0x00, // + + // @11 '"' (2 pixels wide) + 0x00, // + 0xC0, // ## + 0xC0, // ## + 0x40, // # + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @22 '#' (6 pixels wide) + 0x00, // + 0x04, // # + 0x20, // # + 0x7C, // ##### + 0x28, // # # + 0x28, // # # + 0xFC, // ###### + 0x40, // # + 0x50, // # # + 0x00, // + 0x00, // + + // @33 '$' (5 pixels wide) + 0x20, // # + 0x70, // ### + 0x98, // # ## + 0x80, // # + 0xC0, // ## + 0x30, // ## + 0x08, // # + 0x98, // # ## + 0x70, // ### + 0x20, // # + 0x00, // + + // @44 '%' (7 pixels wide) + 0x00, // + 0xC0, // ## + 0x28, // # # + 0x28, // # # + 0xD0, // ## # + 0x2C, // # ## + 0x32, // ## # + 0x52, // # # # + 0x0C, // ## + 0x00, // + 0x00, // + + // @55 '&' (6 pixels wide) + 0x00, // + 0x30, // ## + 0x48, // # # + 0x58, // # ## + 0x20, // # + 0x54, // # # # + 0x8C, // # ## + 0xCC, // ## ## + 0x7C, // ##### + 0x00, // + 0x00, // + + // @66 ''' (1 pixels wide) + 0x00, // + 0x80, // # + 0x80, // # + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @77 '(' (3 pixels wide) + 0x40, // # + 0x40, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x40, // # + 0x20, // # + + // @88 ')' (3 pixels wide) + 0x80, // # + 0x40, // # + 0x40, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x40, // # + 0x40, // # + 0x80, // # + + // @99 '*' (3 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x40, // # + 0xE0, // ### + 0xC0, // ## + 0x80, // # + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @110 '+' (6 pixels wide) + 0x00, // + 0x00, // + 0x10, // # + 0x10, // # + 0xFC, // ###### + 0x10, // # + 0x10, // # + 0x10, // # + 0x00, // + 0x00, // + 0x00, // + + // @121 ',' (2 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x40, // # + 0x40, // # + 0x80, // # + 0x00, // + + // @132 '-' (3 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0xE0, // ### + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @143 '.' (1 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x80, // # + 0x00, // + 0x00, // + + // @154 '/' (4 pixels wide) + 0x00, // + 0x10, // # + 0x10, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x40, // # + 0x40, // # + 0x80, // # + 0x80, // # + 0x00, // + + // @165 '0' (5 pixels wide) + 0x00, // + 0x70, // ### + 0x90, // # # + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x90, // # # + 0x70, // ### + 0x00, // + 0x00, // + + // @176 '1' (3 pixels wide) + 0x00, // + 0xE0, // ### + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x00, // + 0x00, // + + // @187 '2' (5 pixels wide) + 0x00, // + 0x70, // ### + 0x90, // # # + 0x10, // # + 0x10, // # + 0x20, // # + 0x40, // # + 0xC0, // ## + 0xF8, // ##### + 0x00, // + 0x00, // + + // @198 '3' (5 pixels wide) + 0x00, // + 0x70, // ### + 0x90, // # # + 0x10, // # + 0x70, // ### + 0x10, // # + 0x08, // # + 0x90, // # # + 0x70, // ### + 0x00, // + 0x00, // + + // @209 '4' (6 pixels wide) + 0x00, // + 0x18, // ## + 0x18, // ## + 0x28, // # # + 0x28, // # # + 0x48, // # # + 0xFC, // ###### + 0x08, // # + 0x08, // # + 0x00, // + 0x00, // + + // @220 '5' (5 pixels wide) + 0x00, // + 0xF0, // #### + 0x80, // # + 0x80, // # + 0xF0, // #### + 0x18, // ## + 0x08, // # + 0x90, // # # + 0x70, // ### + 0x00, // + 0x00, // + + // @231 '6' (5 pixels wide) + 0x00, // + 0x70, // ### + 0x80, // # + 0x80, // # + 0xF0, // #### + 0x98, // # ## + 0x88, // # # + 0x98, // # ## + 0x70, // ### + 0x00, // + 0x00, // + + // @242 '7' (5 pixels wide) + 0x00, // + 0xF8, // ##### + 0x10, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x40, // # + 0x40, // # + 0x40, // # + 0x00, // + 0x00, // + + // @253 '8' (5 pixels wide) + 0x00, // + 0xF0, // #### + 0x90, // # # + 0x90, // # # + 0xF0, // #### + 0x90, // # # + 0x88, // # # + 0x98, // # ## + 0xF0, // #### + 0x00, // + 0x00, // + + // @264 '9' (4 pixels wide) + 0x00, // + 0xE0, // ### + 0x90, // # # + 0x90, // # # + 0x90, // # # + 0xF0, // #### + 0x10, // # + 0x10, // # + 0xE0, // ### + 0x00, // + 0x00, // + + // @275 ':' (1 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x80, // # + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x80, // # + 0x00, // + 0x00, // + + // @286 ';' (2 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x40, // # + 0x00, // + 0x00, // + 0x00, // + 0x40, // # + 0x40, // # + 0x80, // # + 0x00, // + + // @297 '<' (4 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x30, // ## + 0xC0, // ## + 0xC0, // ## + 0x30, // ## + 0x00, // + 0x00, // + 0x00, // + + // @308 '=' (4 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0xF0, // #### + 0x00, // + 0xF0, // #### + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @319 '>' (4 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0xC0, // ## + 0x30, // ## + 0x30, // ## + 0xC0, // ## + 0x00, // + 0x00, // + 0x00, // + + // @330 '?' (5 pixels wide) + 0x00, // + 0x70, // ### + 0x88, // # # + 0x08, // # + 0x10, // # + 0x30, // ## + 0x20, // # + 0x00, // + 0x20, // # + 0x00, // + 0x00, // + + // @341 '@' (8 pixels wide) + 0x00, // + 0x3C, // #### + 0x42, // # # + 0x89, // # # # + 0xB4, // # ## # + 0x24, // # # + 0x24, // # # + 0x25, // # # # + 0xBE, // # ##### + 0x40, // # + 0x3C, // #### + + // @352 'A' (7 pixels wide) + 0x00, // + 0x10, // # + 0x10, // # + 0x28, // # # + 0x28, // # # + 0x6C, // ## ## + 0x7C, // ##### + 0x44, // # # + 0x86, // # ## + 0x00, // + 0x00, // + + // @363 'B' (6 pixels wide) + 0x00, // + 0xF0, // #### + 0x88, // # # + 0x88, // # # + 0xF0, // #### + 0x88, // # # + 0x84, // # # + 0x88, // # # + 0xF8, // ##### + 0x00, // + 0x00, // + + // @374 'C' (6 pixels wide) + 0x00, // + 0x70, // ### + 0x88, // # # + 0x8C, // # ## + 0x80, // # + 0x80, // # + 0x8C, // # ## + 0x88, // # # + 0x70, // ### + 0x00, // + 0x00, // + + // @385 'D' (6 pixels wide) + 0x00, // + 0xF0, // #### + 0x88, // # # + 0x84, // # # + 0x84, // # # + 0x84, // # # + 0x84, // # # + 0x88, // # # + 0xF0, // #### + 0x00, // + 0x00, // + + // @396 'E' (5 pixels wide) + 0x00, // + 0xF8, // ##### + 0x80, // # + 0x80, // # + 0xF0, // #### + 0x80, // # + 0x80, // # + 0x80, // # + 0xF8, // ##### + 0x00, // + 0x00, // + + // @407 'F' (5 pixels wide) + 0x00, // + 0xF8, // ##### + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x00, // + 0x00, // + + // @418 'G' (6 pixels wide) + 0x00, // + 0x78, // #### + 0x88, // # # + 0x80, // # + 0x80, // # + 0x9C, // # ### + 0x8C, // # ## + 0x8C, // # ## + 0x78, // #### + 0x00, // + 0x00, // + + // @429 'H' (6 pixels wide) + 0x00, // + 0x84, // # # + 0x84, // # # + 0x84, // # # + 0x84, // # # + 0xFC, // ###### + 0x84, // # # + 0x84, // # # + 0x84, // # # + 0x00, // + 0x00, // + + // @440 'I' (1 pixels wide) + 0x00, // + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x00, // + 0x00, // + + // @451 'J' (5 pixels wide) + 0x00, // + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0xC8, // ## # + 0x70, // ### + 0x00, // + 0x00, // + + // @462 'K' (5 pixels wide) + 0x00, // + 0x88, // # # + 0x90, // # # + 0xB0, // # ## + 0xE0, // ### + 0xA0, // # # + 0x90, // # # + 0x98, // # ## + 0x88, // # # + 0x00, // + 0x00, // + + // @473 'L' (5 pixels wide) + 0x00, // + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0xF8, // ##### + 0x00, // + 0x00, // + + // @484 'M' (8 pixels wide) + 0x00, // + 0x83, // # ## + 0xC3, // ## ## + 0xC5, // ## # # + 0xA5, // # # # # + 0xA5, // # # # # + 0xA9, // # # # # + 0x99, // # ## # + 0x91, // # # # + 0x00, // + 0x00, // + + // @495 'N' (6 pixels wide) + 0x00, // + 0x84, // # # + 0xC4, // ## # + 0xE4, // ### # + 0xA4, // # # # + 0x94, // # # # + 0x94, // # # # + 0x8C, // # ## + 0x8C, // # ## + 0x00, // + 0x00, // + + // @506 'O' (6 pixels wide) + 0x00, // + 0x70, // ### + 0x88, // # # + 0x84, // # # + 0x84, // # # + 0x84, // # # + 0x84, // # # + 0x88, // # # + 0x70, // ### + 0x00, // + 0x00, // + + // @517 'P' (6 pixels wide) + 0x00, // + 0xF8, // ##### + 0x88, // # # + 0x8C, // # ## + 0x88, // # # + 0xF0, // #### + 0x80, // # + 0x80, // # + 0x80, // # + 0x00, // + 0x00, // + + // @528 'Q' (6 pixels wide) + 0x00, // + 0x70, // ### + 0x88, // # # + 0x84, // # # + 0x84, // # # + 0x84, // # # + 0x84, // # # + 0x88, // # # + 0x7C, // ##### + 0x04, // # + 0x00, // + + // @539 'R' (5 pixels wide) + 0x00, // + 0xF0, // #### + 0x88, // # # + 0x88, // # # + 0x98, // # ## + 0xF8, // ##### + 0x88, // # # + 0x88, // # # + 0x88, // # # + 0x00, // + 0x00, // + + // @550 'S' (5 pixels wide) + 0x00, // + 0x70, // ### + 0x88, // # # + 0x80, // # + 0xE0, // ### + 0x18, // ## + 0x08, // # + 0x88, // # # + 0x70, // ### + 0x00, // + 0x00, // + + // @561 'T' (6 pixels wide) + 0x00, // + 0xFC, // ###### + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x00, // + 0x00, // + + // @572 'U' (6 pixels wide) + 0x00, // + 0x84, // # # + 0x84, // # # + 0x84, // # # + 0x84, // # # + 0x84, // # # + 0x84, // # # + 0x88, // # # + 0x78, // #### + 0x00, // + 0x00, // + + // @583 'V' (7 pixels wide) + 0x00, // + 0x82, // # # + 0x44, // # # + 0x44, // # # + 0x4C, // # ## + 0x28, // # # + 0x28, // # # + 0x20, // # + 0x10, // # + 0x00, // + 0x00, // + + // @594 'W' (9 pixels wide) + 0x00, 0x00, // + 0x88, 0x80, // # # # + 0x4C, 0x80, // # ## # + 0x4C, 0x80, // # ## # + 0x55, 0x00, // # # # # + 0x55, 0x00, // # # # # + 0x73, 0x00, // ### ## + 0x23, 0x00, // # ## + 0x23, 0x00, // # ## + 0x00, 0x00, // + 0x00, 0x00, // + + // @616 'X' (5 pixels wide) + 0x00, // + 0x88, // # # + 0xD8, // ## ## + 0x50, // # # + 0x20, // # + 0x20, // # + 0x50, // # # + 0xD8, // ## ## + 0x88, // # # + 0x00, // + 0x00, // + + // @627 'Y' (6 pixels wide) + 0x00, // + 0xC4, // ## # + 0x44, // # # + 0x28, // # # + 0x28, // # # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x00, // + 0x00, // + + // @638 'Z' (5 pixels wide) + 0x00, // + 0xF8, // ##### + 0x10, // # + 0x10, // # + 0x20, // # + 0x40, // # + 0x40, // # + 0x80, // # + 0xF8, // ##### + 0x00, // + 0x00, // + + // @649 '[' (2 pixels wide) + 0xC0, // ## + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0xC0, // ## + + // @660 '\' (4 pixels wide) + 0x00, // + 0x80, // # + 0x40, // # + 0x40, // # + 0x20, // # + 0x20, // # + 0x20, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x00, // + + // @671 ']' (2 pixels wide) + 0xC0, // ## + 0x40, // # + 0x40, // # + 0x40, // # + 0x40, // # + 0x40, // # + 0x40, // # + 0x40, // # + 0x40, // # + 0x40, // # + 0xC0, // ## + + // @682 '^' (3 pixels wide) + 0x00, // + 0x40, // # + 0xC0, // ## + 0xA0, // # # + 0xA0, // # # + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @693 '_' (5 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0xF8, // ##### + 0x00, // + + // @704 '`' (2 pixels wide) + 0x00, // + 0x80, // # + 0x40, // # + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @715 'a' (4 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x70, // ### + 0x90, // # # + 0x30, // ## + 0x90, // # # + 0x90, // # # + 0xF0, // #### + 0x00, // + 0x00, // + + // @726 'b' (5 pixels wide) + 0x00, // + 0x80, // # + 0x80, // # + 0xF0, // #### + 0x90, // # # + 0x88, // # # + 0x88, // # # + 0x98, // # ## + 0xF0, // #### + 0x00, // + 0x00, // + + // @737 'c' (4 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x70, // ### + 0x90, // # # + 0x80, // # + 0x80, // # + 0x90, // # # + 0x70, // ### + 0x00, // + 0x00, // + + // @748 'd' (4 pixels wide) + 0x00, // + 0x10, // # + 0x10, // # + 0xF0, // #### + 0x90, // # # + 0x90, // # # + 0x90, // # # + 0x90, // # # + 0xE0, // ### + 0x00, // + 0x00, // + + // @759 'e' (4 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x70, // ### + 0x90, // # # + 0xF0, // #### + 0x80, // # + 0x80, // # + 0x70, // ### + 0x00, // + 0x00, // + + // @770 'f' (4 pixels wide) + 0x00, // + 0x30, // ## + 0x40, // # + 0xE0, // ### + 0x40, // # + 0x40, // # + 0x40, // # + 0x40, // # + 0x40, // # + 0x00, // + 0x00, // + + // @781 'g' (5 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0xE8, // ### # + 0x98, // # ## + 0x98, // # ## + 0x98, // # ## + 0x98, // # ## + 0xF8, // ##### + 0x10, // # + 0xF0, // #### + + // @792 'h' (5 pixels wide) + 0x00, // + 0x80, // # + 0x80, // # + 0xF0, // #### + 0x90, // # # + 0x98, // # ## + 0x98, // # ## + 0x98, // # ## + 0x98, // # ## + 0x00, // + 0x00, // + + // @803 'i' (1 pixels wide) + 0x00, // + 0x80, // # + 0x00, // + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x00, // + 0x00, // + + // @814 'j' (2 pixels wide) + 0x00, // + 0x40, // # + 0x00, // + 0x40, // # + 0x40, // # + 0x40, // # + 0x40, // # + 0x40, // # + 0x40, // # + 0x40, // # + 0xC0, // ## + + // @825 'k' (4 pixels wide) + 0x00, // + 0x80, // # + 0x80, // # + 0x90, // # # + 0xA0, // # # + 0xC0, // ## + 0xA0, // # # + 0xA0, // # # + 0x90, // # # + 0x00, // + 0x00, // + + // @836 'l' (1 pixels wide) + 0x00, // + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x00, // + 0x00, // + + // @847 'm' (8 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0xF6, // #### ## + 0x99, // # ## # + 0x91, // # # # + 0x91, // # # # + 0x91, // # # # + 0x91, // # # # + 0x00, // + 0x00, // + + // @858 'n' (4 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0xF0, // #### + 0x90, // # # + 0x90, // # # + 0x90, // # # + 0x90, // # # + 0x90, // # # + 0x00, // + 0x00, // + + // @869 'o' (5 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x70, // ### + 0x90, // # # + 0x88, // # # + 0x88, // # # + 0x90, // # # + 0x70, // ### + 0x00, // + 0x00, // + + // @880 'p' (5 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0xF0, // #### + 0x90, // # # + 0x88, // # # + 0x88, // # # + 0x98, // # ## + 0xF0, // #### + 0x80, // # + 0x80, // # + + // @891 'q' (4 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0xF0, // #### + 0x90, // # # + 0x90, // # # + 0x90, // # # + 0x90, // # # + 0xF0, // #### + 0x10, // # + 0x10, // # + + // @902 'r' (3 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0xE0, // ### + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x00, // + 0x00, // + + // @913 's' (4 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0xE0, // ### + 0x90, // # # + 0xC0, // ## + 0x30, // ## + 0x90, // # # + 0xF0, // #### + 0x00, // + 0x00, // + + // @924 't' (3 pixels wide) + 0x00, // + 0x40, // # + 0x40, // # + 0xE0, // ### + 0x40, // # + 0x40, // # + 0x40, // # + 0x40, // # + 0x60, // ## + 0x00, // + 0x00, // + + // @935 'u' (4 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x90, // # # + 0x90, // # # + 0x90, // # # + 0x90, // # # + 0x90, // # # + 0xF0, // #### + 0x00, // + 0x00, // + + // @946 'v' (5 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x88, // # # + 0x48, // # # + 0x50, // # # + 0x10, // # + 0x30, // ## + 0x20, // # + 0x00, // + 0x00, // + + // @957 'w' (8 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x89, // # # # + 0x59, // # ## # + 0x5A, // # ## # + 0x56, // # # ## + 0x66, // ## ## + 0x26, // # ## + 0x00, // + 0x00, // + + // @968 'x' (4 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x90, // # # + 0xA0, // # # + 0x60, // ## + 0x60, // ## + 0xA0, // # # + 0x90, // # # + 0x00, // + 0x00, // + + // @979 'y' (5 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x88, // # # + 0x48, // # # + 0x50, // # # + 0x70, // ### + 0x30, // ## + 0x20, // # + 0x20, // # + 0x40, // # + + // @990 'z' (5 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x78, // #### + 0x10, // # + 0x30, // ## + 0x20, // # + 0x40, // # + 0xF8, // ##### + 0x00, // + 0x00, // + + // @1001 '{' (3 pixels wide) + 0x00, // + 0x20, // # + 0x60, // ## + 0x60, // ## + 0x40, // # + 0xC0, // ## + 0x40, // # + 0x60, // ## + 0x60, // ## + 0x20, // # + 0x00, // + + // @1012 '|' (1 pixels wide) + 0x00, // + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x80, // # + 0x00, // + + // @1023 '}' (3 pixels wide) + 0x80, // # + 0x40, // # + 0x40, // # + 0x40, // # + 0x40, // # + 0x20, // # + 0x40, // # + 0x40, // # + 0x40, // # + 0x40, // # + 0x80, // # + + // @1034 '~' (6 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0xE4, // ### # + 0x18, // ## + 0x00, // + 0x00, // + 0x00, // + 0x00, // +}; + +// Character descriptors for Roboto 8pt +// { [Char width in bits], [Offset into roboto_8ptCharBitmaps in bytes] } +const font_char_desc_t roboto_8ptDescriptors[] = +{ + {1, 0}, // ! + {2, 11}, // " + {6, 22}, // # + {5, 33}, // $ + {7, 44}, // % + {6, 55}, // & + {1, 66}, // ' + {3, 77}, // ( + {3, 88}, // ) + {3, 99}, // * + {6, 110}, // + + {2, 121}, // , + {3, 132}, // - + {1, 143}, // . + {4, 154}, // / + {5, 165}, // 0 + {3, 176}, // 1 + {5, 187}, // 2 + {5, 198}, // 3 + {6, 209}, // 4 + {5, 220}, // 5 + {5, 231}, // 6 + {5, 242}, // 7 + {5, 253}, // 8 + {4, 264}, // 9 + {1, 275}, // : + {2, 286}, // ; + {4, 297}, // < + {4, 308}, // = + {4, 319}, // > + {5, 330}, // ? + {8, 341}, // @ + {7, 352}, // A + {6, 363}, // B + {6, 374}, // C + {6, 385}, // D + {5, 396}, // E + {5, 407}, // F + {6, 418}, // G + {6, 429}, // H + {1, 440}, // I + {5, 451}, // J + {5, 462}, // K + {5, 473}, // L + {8, 484}, // M + {6, 495}, // N + {6, 506}, // O + {6, 517}, // P + {6, 528}, // Q + {5, 539}, // R + {5, 550}, // S + {6, 561}, // T + {6, 572}, // U + {7, 583}, // V + {9, 594}, // W + {5, 616}, // X + {6, 627}, // Y + {5, 638}, // Z + {2, 649}, // [ + {4, 660}, /* \ */ + {2, 671}, // ] + {3, 682}, // ^ + {5, 693}, // _ + {2, 704}, // ` + {4, 715}, // a + {5, 726}, // b + {4, 737}, // c + {4, 748}, // d + {4, 759}, // e + {4, 770}, // f + {5, 781}, // g + {5, 792}, // h + {1, 803}, // i + {2, 814}, // j + {4, 825}, // k + {1, 836}, // l + {8, 847}, // m + {4, 858}, // n + {5, 869}, // o + {5, 880}, // p + {4, 891}, // q + {3, 902}, // r + {4, 913}, // s + {3, 924}, // t + {4, 935}, // u + {5, 946}, // v + {8, 957}, // w + {4, 968}, // x + {5, 979}, // y + {5, 990}, // z + {3, 1001}, // { + {1, 1012}, // | + {3, 1023}, // } + {6, 1034}, // ~ +}; + +// Font information for Roboto 8pt +const font_info_t roboto_8ptFontInfo = +{ + 2, // Character height + '!', // Start character + '~', // End character + 2, // Width, in pixels, of space character + roboto_8ptDescriptors, // Character descriptor array + roboto_8ptBitmaps, // Character bitmap array +}; diff --git a/extras/fonts/fonts.c b/extras/fonts/fonts.c new file mode 100644 index 0000000..472590a --- /dev/null +++ b/extras/fonts/fonts.c @@ -0,0 +1,18 @@ +/* + * oled_fonts.c + * + * Created on: 8 dec. 2016 + * Author: zaltora + */ +#include "fonts.h" + +extern const font_info_t glcd_5x7_font_info; +extern const font_info_t roboto_8ptFontInfo; +extern const font_info_t roboto_10ptFontInfo; + +const font_info_t* fonts[NUM_FONTS] = +{ + &glcd_5x7_font_info, + &roboto_8ptFontInfo, + &roboto_10ptFontInfo, +}; diff --git a/extras/fonts/fonts.h b/extras/fonts/fonts.h new file mode 100644 index 0000000..e275785 --- /dev/null +++ b/extras/fonts/fonts.h @@ -0,0 +1,38 @@ +/* + * fonts.h + * + * Created on: 8 dec. 2016 + * Author: zaltora + */ + +#ifndef FONTS_H +#define FONTS_H + +#include +#include "config.h" + +/** + * Character descriptor + */ +typedef struct _font_char_desc +{ + uint8_t width; //Character width in pixel + uint16_t offset; //Offset of this character in bitmap +} font_char_desc_t; + +/** + * Font information + */ +typedef struct _font_info +{ + uint8_t height; //Character height in pixel, all characters have same height + uint8_t c; //Simulation of "C" width in TrueType term, the space between adjacent characters + char char_start; //First character + char char_end; //Last character + const font_char_desc_t* char_descriptors; //descriptor for each character + const uint8_t *bitmap; //Character bitmap +} font_info_t; + +extern const font_info_t* fonts[NUM_FONTS]; //Built-in fonts + +#endif // _FONTS__H_ diff --git a/extras/ssd1306/ssd1306.c b/extras/ssd1306/ssd1306.c index 06370a8..e2661c2 100644 --- a/extras/ssd1306/ssd1306.c +++ b/extras/ssd1306/ssd1306.c @@ -19,6 +19,7 @@ #include #include #include +#include #define SPI_BUS 1 @@ -68,6 +69,11 @@ #define debug(fmt, ...) #endif +#define abs(x) ((x)<0 ? -(x) : (x)) +#define swap(x, y) do { typeof(x) temp##x##y = x; x = y; y = temp##x##y; } while (0) + +const font_info_t* font ; // save font selection + /* Issue a command to SSD1306 device * I2C proto format: * |S|Slave Address|W|ACK|0x00|Command|Ack|P| @@ -403,4 +409,586 @@ int ssd1306_load_xbm(const ssd1306_t *dev, uint8_t *xbm, uint8_t *fb) return ssd1306_load_frame_buffer(dev, fb); } +int ssd1306_draw_pixel(const ssd1306_t *dev, uint8_t *fb, int8_t x, int8_t y, ssd1306_color_t color) +{ + uint16_t index; + if ((x >= dev->width) || (x < 0) || (y >= dev->height) || (y < 0)) + return -EINVAL; + + index = x + (y / 8) * dev->width; + switch (color) + { + case OLED_COLOR_WHITE: + fb[index] |= (1 << (y & 7)); + break; + case OLED_COLOR_BLACK: + fb[index] &= ~(1 << (y & 7)); + break; + case OLED_COLOR_INVERT: + fb[index] ^= (1 << (y & 7)); + break; + default: + break; + } + return 0 ; +} + +int ssd1306_draw_hline(const ssd1306_t *dev, uint8_t *fb, int8_t x, int8_t y, uint8_t w, ssd1306_color_t color) +{ + uint16_t index; + uint8_t mask, t; + + // boundary check + if ((x >= dev->width) || (x < 0) || (y >= dev->height) || (y < 0)) + return -EINVAL; + if (w == 0) + return -EINVAL; + if (x + w > dev->width) + w = dev->width - x; + + t = w; + index = x + (y / 8) * dev->width; + mask = 1 << (y & 7); + switch (color) + { + case OLED_COLOR_WHITE: + while (t--) + { + fb[index] |= mask; + ++index; + } + break; + case OLED_COLOR_BLACK: + mask = ~mask; + while (t--) + { + fb[index] &= mask; + ++index; + } + break; + case OLED_COLOR_INVERT: + while (t--) + { + fb[index] ^= mask; + ++index; + } + break; + default: + break; + } + return 0 ; +} + +int ssd1306_draw_vline(const ssd1306_t *dev, uint8_t *fb, int8_t x, int8_t y, uint8_t h, ssd1306_color_t color) +{ + uint16_t index; + uint8_t mask, mod, t; + + // boundary check + if ((x >= dev->width) || (x < 0) || (y >= dev->height) || (y < 0)) + return -EINVAL; + if (h == 0) + return -EINVAL; + if (y + h > dev->height) + h = dev->height - y; + + t = h; + index = x + (y / 8) * dev->width; + mod = y & 7; + if (mod) // partial line that does not fit into byte at top + { + // Magic from Adafruit + mod = 8 - mod; + static const uint8_t premask[8] = { 0x00, 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE }; + mask = premask[mod]; + if (t < mod) + mask &= (0xFF >> (mod - t)); + switch (color) + { + case OLED_COLOR_WHITE: + fb[index] |= mask; + break; + case OLED_COLOR_BLACK: + fb[index] &= ~mask; + break; + case OLED_COLOR_INVERT: + fb[index] ^= mask; + break; + default: + break; + } + + if (t < mod) + return 0; + t -= mod; + index += dev->width; + } + if (t >= 8) // byte aligned line at middle + { + switch (color) + { + case OLED_COLOR_WHITE: + do + { + fb[index] = 0xff; + index += dev->width; + t -= 8; + } while (t >= 8); + break; + case OLED_COLOR_BLACK: + do + { + fb[index] = 0x00; + index += dev->width; + t -= 8; + } while (t >= 8); + break; + case OLED_COLOR_INVERT: + do + { + fb[index] = ~fb[index]; + index += dev->width; + t -= 8; + } while (t >= 8); + break; + default: + break; + } + } + if (t) // // partial line at bottom + { + mod = t & 7; + static const uint8_t postmask[8] = {0x00, 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F }; + mask = postmask[mod]; + switch (color) + { + case OLED_COLOR_WHITE: + fb[index] |= mask; + break; + case OLED_COLOR_BLACK: + fb[index] &= ~mask; + break; + case OLED_COLOR_INVERT: + fb[index] ^= mask; + break; + default: + break; + } + + + } + return 0; +} + +int ssd1306_draw_rectangle(const ssd1306_t *dev, uint8_t *fb, int8_t x, int8_t y, uint8_t w, uint8_t h, ssd1306_color_t color) +{ + int err = 0; + if ((err = ssd1306_draw_hline(dev, fb, x, y, w, color))) + return err; + if ((err = ssd1306_draw_hline(dev, fb, x, y + h - 1, w, color))) + return err; + if ((err = ssd1306_draw_vline(dev, fb, x, y, h, color))) + return err; + return ssd1306_draw_vline(dev, fb, x + w - 1, y, h, color); + +} + + +int ssd1306_fill_rectangle(const ssd1306_t *dev, uint8_t *fb, int8_t x, int8_t y, uint8_t w, uint8_t h, ssd1306_color_t color) +{ + // Can be optimized? + uint8_t i; + int err = 0; + for (i = x; i < x + w; ++i) + if ((err = ssd1306_draw_vline(dev, fb, i, y, h, color))) + return err; + return 0 ; +} + +int ssd1306_draw_circle(const ssd1306_t *dev, uint8_t *fb, int8_t x0, int8_t y0, uint8_t r, ssd1306_color_t color) +{ + // Refer to http://en.wikipedia.org/wiki/Midpoint_circle_algorithm for the algorithm + + int8_t x = r; + int8_t y = 1; + int16_t radius_err = 1 - x; + int err = 0; + + if (r == 0) + return -EINVAL; + + if ((err = ssd1306_draw_pixel(dev, fb, x0 - r, y0, color))) + return err; + if ((err = ssd1306_draw_pixel(dev, fb, x0 + r, y0, color))) + return err; + if ((err = ssd1306_draw_pixel(dev, fb, x0, y0 - r, color))) + return err; + if ((err = ssd1306_draw_pixel(dev, fb, x0, y0 + r, color))) + return err; + + while (x >= y) + { + if ((err = ssd1306_draw_pixel(dev, fb, x0 + x, y0 + y, color))) + return err; + if ((err = ssd1306_draw_pixel(dev, fb, x0 - x, y0 + y, color))) + return err; + if ((err = ssd1306_draw_pixel(dev, fb, x0 + x, y0 - y, color))) + return err; + if ((err = ssd1306_draw_pixel(dev, fb, x0 - x, y0 - y, color))) + return err; + if (x != y) + { + /* Otherwise the 4 drawings below are the same as above, causing + * problem when color is INVERT + */ + if ((err = ssd1306_draw_pixel(dev, fb, x0 + y, y0 + x, color))) + return err; + if ((err = ssd1306_draw_pixel(dev, fb, x0 - y, y0 + x, color))) + return err; + if ((err = ssd1306_draw_pixel(dev, fb, x0 + y, y0 - x, color))) + return err; + if ((err = ssd1306_draw_pixel(dev, fb, x0 - y, y0 - x, color))) + return err; + } + ++y; + if (radius_err < 0) + { + radius_err += 2 * y + 1; + } + else + { + --x; + radius_err += 2 * (y - x + 1); + } + + } + return 0 ; +} + +int ssd1306_fill_circle(const ssd1306_t *dev, uint8_t *fb, int8_t x0, int8_t y0, uint8_t r, ssd1306_color_t color) +{ + int8_t x = 1; + int8_t y = r; + int16_t radius_err = 1 - y; + int8_t x1; + int err = 0; + + if (r == 0) + return -EINVAL; + + if ((err = ssd1306_draw_vline(dev, fb, x0, y0 - r, 2 * r + 1, color))) // Center vertical line + return err; + while (y >= x) + { + if ((err = ssd1306_draw_vline(dev, fb, x0 - x, y0 - y, 2 * y + 1, color))) + return err; + if ((err = ssd1306_draw_vline(dev, fb, x0 + x, y0 - y, 2 * y + 1, color))) + return err; + if (color != OLED_COLOR_INVERT) + { + if ((err = ssd1306_draw_vline(dev, fb, x0 - y, y0 - x, 2 * x + 1, color))) + return err; + if ((err = ssd1306_draw_vline(dev, fb, x0 + y, y0 - x, 2 * x + 1, color))) + return err; + } + ++x; + if (radius_err < 0) + { + radius_err += 2 * x + 1; + } + else + { + --y; + radius_err += 2 * (x - y + 1); + } + } + + if (color == OLED_COLOR_INVERT) + { + x1 = x; // Save where we stopped + + y = 1; + x = r; + radius_err = 1 - x; + if ((err = ssd1306_draw_hline(dev, fb, x0 + x1, y0, r - x1 + 1, color))) + return err; + if ((err = ssd1306_draw_hline(dev, fb, x0 - r, y0, r - x1 + 1, color))) + return err; + while (x >= y) + { + if ((err = ssd1306_draw_hline(dev, fb, x0 + x1, y0 - y, x - x1 + 1, color))) + return err; + if ((err = ssd1306_draw_hline(dev, fb, x0 + x1, y0 + y, x - x1 + 1, color))) + return err; + if ((err = ssd1306_draw_hline(dev, fb, x0 - x, y0 - y, x - x1 + 1, color))) + return err; + if ((err = ssd1306_draw_hline(dev, fb, x0 - x, y0 + y, x - x1 + 1, color))) + return err; + ++y; + if (radius_err < 0) + { + radius_err += 2 * y + 1; + } + else + { + --x; + radius_err += 2 * (y - x + 1); + } + } + } + return 0 ; +} + +int ssd1306_draw_line(const ssd1306_t *dev, uint8_t *fb, int16_t x0, int16_t y0, int16_t x1, int16_t y1, ssd1306_color_t color) { + + if ((x0 >= dev->width) || (x0 < 0) || (y0 >= dev->height) || (y0 < 0)) + return -EINVAL; + if ((x1 >= dev->width) || (x1 < 0) || (y1 >= dev->height) || (y1 < 0)) + return -EINVAL; + + int err ; + int16_t steep = abs(y1 - y0) > abs(x1 - x0); + if (steep) { + swap(x0, y0); + swap(x1, y1); + } + + if (x0 > x1) { + swap(x0, x1); + swap(y0, y1); + } + + int16_t dx, dy; + dx = x1 - x0; + dy = abs(y1 - y0); + + int16_t errx = dx / 2; + int16_t ystep; + + if (y0 < y1) { + ystep = 1; + } else { + ystep = -1; + } + + for (; x0<=x1; x0++) { + if (steep) { + if ((err = ssd1306_draw_pixel(dev, fb, y0, x0, color))) + return err; + } else { + if ((err = ssd1306_draw_pixel(dev, fb, x0, y0, color))) + return err; + } + errx -= dy; + if (errx < 0) { + y0 += ystep; + errx += dx; + } + } + return 0; +} + +int ssd1306_draw_triangle(const ssd1306_t *dev, uint8_t *fb, int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, ssd1306_color_t color) { + int err ; + if ((err = ssd1306_draw_line(dev, fb, x0, y0, x1, y1, color))) + return err; + if ((err = ssd1306_draw_line(dev, fb, x1, y1, x2, y2, color))) + return err; + return ssd1306_draw_line(dev, fb, x2, y2, x0, y0, color); +} + +int ssd1306_fill_triangle(const ssd1306_t *dev, uint8_t *fb, int16_t x0, int16_t y0,int16_t x1, int16_t y1, int16_t x2, int16_t y2, ssd1306_color_t color) { + + int16_t a, b, y, last; + int err ; + + // Sort coordinates by Y order (y2 >= y1 >= y0) + if (y0 > y1) { + swap(y0, y1); swap(x0, x1); + } + if (y1 > y2) { + swap(y2, y1); swap(x2, x1); + } + if (y0 > y1) { + swap(y0, y1); swap(x0, x1); + } + + if(y0 == y2) { // Handle awkward all-on-same-line case as its own thing + a = b = x0; + if(x1 < a) a = x1; + else if(x1 > b) b = x1; + if(x2 < a) a = x2; + else if(x2 > b) b = x2; + if ((err = ssd1306_draw_hline(dev, fb, a, y0, b-a+1, color))) + return err; + return 0; + } + + int16_t + dx01 = x1 - x0, + dy01 = y1 - y0, + dx02 = x2 - x0, + dy02 = y2 - y0, + dx12 = x2 - x1, + dy12 = y2 - y1, + sa = 0, + sb = 0; + + // For upper part of triangle, find scanline crossings for segments + // 0-1 and 0-2. If y1=y2 (flat-bottomed triangle), the scanline y1 + // is included here (and second loop will be skipped, avoiding a /0 + // error there), otherwise scanline y1 is skipped here and handled + // in the second loop...which also avoids a /0 error here if y0=y1 + // (flat-topped triangle). + if(y1 == y2) last = y1; // Include y1 scanline + else last = y1-1; // Skip it + + for(y=y0; y<=last; y++) { + a = x0 + sa / dy01; + b = x0 + sb / dy02; + sa += dx01; + sb += dx02; + /* longhand: + a = x0 + (x1 - x0) * (y - y0) / (y1 - y0); + b = x0 + (x2 - x0) * (y - y0) / (y2 - y0); + */ + if(a > b) swap(a,b); + if ((err = ssd1306_draw_hline(dev, fb, a, y, b-a+1, color))) + return err; + } + + // For lower part of triangle, find scanline crossings for segments + // 0-2 and 1-2. This loop is skipped if y1=y2. + sa = dx12 * (y - y1); + sb = dx02 * (y - y0); + for(; y<=y2; y++) { + a = x1 + sa / dy12; + b = x0 + sb / dy02; + sa += dx12; + sb += dx02; + /* longhand: + a = x1 + (x2 - x1) * (y - y1) / (y2 - y1); + b = x0 + (x2 - x0) * (y - y0) / (y2 - y0); + */ + if(a > b) swap(a,b); + if ((err = ssd1306_draw_hline(dev, fb, a, y, b-a+1, color))) + return err; + } + return 0 ; +} + +int ssd1306_select_font(uint8_t idx) +{ + if (idx < NUM_FONTS) + font = fonts[idx]; + else + return -EINVAL; + return 0 ; +} + +uint8_t ssd1306_draw_char(const ssd1306_t *dev, uint8_t *fb, uint8_t x, uint8_t y, char c, ssd1306_color_t foreground, ssd1306_color_t background) +{ + uint8_t i, j; + const uint8_t *bitmap; + uint8_t line = 0 ; + + if (font == NULL) + return 0; + + // we always have space in the font set + if ((c < font->char_start) || (c > font->char_end)) + c = ' '; + c = c - font->char_start; // c now become index to tables + bitmap = font->bitmap + font->char_descriptors[(unsigned char)c].offset; + for (j = 0; j < font->height; ++j) + { + for (i = 0; i < font->char_descriptors[(unsigned char)c].width; ++i) + { + if (i % 8 == 0) + { + line = bitmap[(font->char_descriptors[(unsigned char)c].width + 7) / 8 * j + i / 8]; // line data + } + if (line & 0x80) + { + ssd1306_draw_pixel(dev, fb, x + i, y + j, foreground); + } + else + { + switch (background) + { + case OLED_COLOR_TRANSPARENT: + // Not drawing for transparent background + break; + case OLED_COLOR_WHITE: + case OLED_COLOR_BLACK: + ssd1306_draw_pixel(dev, fb, x + i, y + j, background); + break; + case OLED_COLOR_INVERT: + // I don't know why I need invert background + break; + } + } + line = line << 1; + } + } + return (font->char_descriptors[(unsigned char)c].width); +} + +uint8_t ssd1306_draw_string(const ssd1306_t *dev, uint8_t *fb, uint8_t x, uint8_t y, char *str, ssd1306_color_t foreground, ssd1306_color_t background) +{ + uint8_t t = x; + + if (font == NULL) + return 0; + if (str == NULL) + return 0; + + while (*str) + { + x += ssd1306_draw_char(dev, fb, x, y, *str, foreground, background); + ++str; + if (*str) + x += font->c; + + } + return (x - t); +} + +uint8_t ssd1306_get_font_height() +{ + if (font == NULL) + return 0; + return (font->height); +} + + +uint8_t ssd1306_get_font_c() +{ + if (font == NULL) + return 0; + return (font->c); +} + +uint8_t ssd1306_measure_string(char *str) +{ + uint8_t w = 0; + char c; + + if (font == NULL) + return 0; + + while (*str) + { + c = *str; + // we always have space in the font set + if ((c < font->char_start) || (c > font->char_end)) + c = ' '; + c = c - font->char_start; // c now become index to tables + w += font->char_descriptors[(unsigned char)c].width; + ++str; + if (*str) + w += font->c; + } + return w; +} diff --git a/extras/ssd1306/ssd1306.h b/extras/ssd1306/ssd1306.h index b4309f9..fed1491 100644 --- a/extras/ssd1306/ssd1306.h +++ b/extras/ssd1306/ssd1306.h @@ -63,6 +63,16 @@ typedef enum SSD1306_ADDR_MODE_PAGE } ssd1306_mem_addr_mode_t; +/** + * Drawing color + */ +typedef enum +{ + OLED_COLOR_TRANSPARENT = -1, //!< Transparent (not drawing) + OLED_COLOR_BLACK = 0, //!< Black (pixel off) + OLED_COLOR_WHITE = 1, //!< White (or blue, yellow, pixel on) + OLED_COLOR_INVERT = 2, //!< Invert pixel (XOR) +} ssd1306_color_t; /** * Issue a single command on SSD1306. * @param dev Pointer to device descriptor @@ -275,6 +285,186 @@ int ssd1306_set_deseltct_lvl(const ssd1306_t *dev, uint8_t lvl); */ int ssd1306_set_whole_display_lighting(const ssd1306_t *dev, bool light); +/** + * Draw one pixel + * @param dev Pointer to device descriptor + * @param buf Pointer to framebuffer. Framebuffer size = width * height / 8 + * @param x X coordinate + * @param y Y coordinate + * @param color Color of the pixel + * @return Non-zero if error occured + */ +int ssd1306_draw_pixel(const ssd1306_t *dev, uint8_t *fb, int8_t x, int8_t y, ssd1306_color_t color); + +/** + * Draw a horizontal line + * @param dev Pointer to device descriptor + * @param buf Pointer to framebuffer. Framebuffer size = width * height / 8 + * @param x X coordinate or starting (left) point + * @param y Y coordinate or starting (left) point + * @param w Line width + * @param color Color of the line + * @return Non-zero if error occured + */ +int ssd1306_draw_hline(const ssd1306_t *dev, uint8_t *fb, int8_t x, int8_t y, uint8_t w, ssd1306_color_t color); + +/** + * Draw a vertical line + * @param dev Pointer to device descriptor + * @param buf Pointer to framebuffer. Framebuffer size = width * height / 8 + * @param x X coordinate or starting (top) point + * @param y Y coordinate or starting (top) point + * @param h Line height + * @param color Color of the line + * @return Non-zero if error occured + */ +int ssd1306_draw_vline(const ssd1306_t *dev, uint8_t *fb, int8_t x, int8_t y, uint8_t h, ssd1306_color_t color); + +/** + * Draw a line + * @param dev Pointer to device descriptor + * @param buf Pointer to framebuffer. Framebuffer size = width * height / 8 + * @param x0 First x point coordinate + * @param y0 First y point coordinate + * @param x1 Second x point coordinate + * @param y1 Second y point coordinate + * @param color Color of the line + * @return Non-zero if error occured + */ +int ssd1306_draw_line(const ssd1306_t *dev, uint8_t *fb, int16_t x0, int16_t y0, int16_t x1, int16_t y1, ssd1306_color_t color); + +/** + * Draw a rectangle + * @param dev Pointer to device descriptor + * @param buf Pointer to framebuffer. Framebuffer size = width * height / 8 + * @param x X coordinate or starting (top left) point + * @param y Y coordinate or starting (top left) point + * @param w Rectangle width + * @param h Rectangle height + * @param color Color of the rectangle border + * @return Non-zero if error occured + */ +int ssd1306_draw_rectangle(const ssd1306_t *dev, uint8_t *fb, int8_t x, int8_t y, uint8_t w, uint8_t h, ssd1306_color_t color); + +/** + * Draw a filled rectangle + * @param dev Pointer to device descriptor + * @param buf Pointer to framebuffer. Framebuffer size = width * height / 8 + * @param x X coordinate or starting (top left) point + * @param y Y coordinate or starting (top left) point + * @param w Rectangle width + * @param h Rectangle height + * @param color Color of the rectangle + * @return Non-zero if error occured + */ +int ssd1306_fill_rectangle(const ssd1306_t *dev, uint8_t *fb, int8_t x, int8_t y, uint8_t w, uint8_t h, ssd1306_color_t color); + +/** + * Draw a circle + * @param dev Pointer to device descriptor + * @param buf Pointer to framebuffer. Framebuffer size = width * height / 8 + * @param x0 X coordinate or center + * @param y0 Y coordinate or center + * @param r Radius + * @param color Color of the circle border + * @return Non-zero if error occured + */ +int ssd1306_draw_circle(const ssd1306_t *dev, uint8_t *fb, int8_t x0, int8_t y0, uint8_t r, ssd1306_color_t color); + +/** + * Draw a filled circle + * @param dev Pointer to device descriptor + * @param buf Pointer to framebuffer. Framebuffer size = width * height / 8 + * @param x0 X coordinate or center + * @param y0 Y coordinate or center + * @param r Radius + * @param color Color of the circle + * @return Non-zero if error occured + */ +int ssd1306_fill_circle(const ssd1306_t *dev, uint8_t *fb, int8_t x0, int8_t y0, uint8_t r, ssd1306_color_t color); + +/** + * Draw a triangle + * @param dev Pointer to device descriptor + * @param buf Pointer to framebuffer. Framebuffer size = width * height / 8 + * @param x0 First x point coordinate + * @param y0 First y point coordinate + * @param x1 Second x point coordinate + * @param y1 Second y point coordinate + * @param x2 third x point coordinate + * @param y2 third y point coordinate + * @param color Color of the triangle border + * @return Non-zero if error occured + */ +int ssd1306_draw_triangle(const ssd1306_t *dev, uint8_t *fb, int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, ssd1306_color_t color); + +/** + * Draw a filled triangle + * @param dev Pointer to device descriptor + * @param buf Pointer to framebuffer. Framebuffer size = width * height / 8 + * @param x0 First x point coordinate + * @param y0 First y point coordinate + * @param x1 Second x point coordinate + * @param y1 Second y point coordinate + * @param x2 third x point coordinate + * @param y2 third y point coordinate + * @param color Color of the triangle + * @return Non-zero if error occured + */ +int ssd1306_fill_triangle(const ssd1306_t *dev, uint8_t *fb, int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, ssd1306_color_t color); + +/** + * Select the font + * @param idx id value of the font + * @return Non-zero if error occured + */ +int ssd1306_select_font(uint8_t idx); + +/** + * Get the height of current selected font + * @return Height of the font (in pixels) or 0 if none font selected + */ +uint8_t ssd1306_get_font_height(); + +/** + * Get the "C" value (space between adjacent characters) of current selected font + * @return "C" value + */ +uint8_t ssd1306_get_font_c(); + +/** + * Draw one character using currently selected font + * @param dev Pointer to device descriptor + * @param buf Pointer to framebuffer. Framebuffer size = width * height / 8 + * @param x X position of character (top-left corner) + * @param y Y position of character (top-left corner) + * @param c The character to draw + * @param foreground Character color + * @param background Background color + * @return Width of the character + */ +uint8_t ssd1306_draw_char(const ssd1306_t *dev, uint8_t *fb, uint8_t x, uint8_t y, char c, ssd1306_color_t foreground, ssd1306_color_t background); + +/** + * Draw one character using currently selected font + * @param dev Pointer to device descriptor + * @param buf Pointer to framebuffer. Framebuffer size = width * height / 8 + * @param x X position of character (top-left corner) + * @param y Y position of character (top-left corner) + * @param str The string to draw + * @param foreground Character color + * @param background Background color + * @return Width of the string (out-of-display pixels also included) + */ +uint8_t ssd1306_draw_string(const ssd1306_t *dev, uint8_t *fb, uint8_t x, uint8_t y, char *str, ssd1306_color_t foreground, ssd1306_color_t background); + +/** + * Measure width of string with current selected font + * @param str String to measure + * @return Width of the string + */ +uint8_t ssd1306_measure_string(char *str); + #ifdef __cplusplus extern "C" }