// Copyright 2021 IOsetting // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include "st7567.h" #include /* Absolute value */ #define ABS(x) ((x) > 0 ? (x) : -(x)) /* ST7567 data buffer */ __BIT ST7567_colorInverted = RESET; uint8_t ST7567_currentX = 0; uint8_t ST7567_currentY = 0; static __XDATA uint8_t ST7567_Buffer_all[ST7567_WIDTH * ST7567_PAGES]; void ST7567_WriteData(uint8_t dat) { ST7567_CS = 0; SPI_TxRx(dat); ST7567_CS = 1; } void ST7567_WriteSameData(uint8_t dat, uint32_t size) { ST7567_CS = 0; do { SPI_TxRx(dat); } while (--size); ST7567_CS = 1; } void ST7567_WriteCommand(uint8_t command) { ST7567_DC = 0; ST7567_WriteData(command); ST7567_DC = 1; } static void ST7567_Transmit(const uint8_t *pDat, uint32_t size) { ST7567_CS = 0; do { SPI_TxRx(*pDat++); } while (--size); ST7567_CS = 1; } void ST7567_Reset(void) { ST7567_RES = 0; SYS_Delay(5); ST7567_RES = 1; } void ST7567_Init(void) { ST7567_Reset(); ST7567_SetBackLightState(HAL_State_ON); ST7567_WriteCommand(ST7567_RESET); // adjust contrast ST7567_WriteCommand(ST7567_SET_EV); ST7567_WriteCommand(ST7567_SET_EV_MASK & 0x20); // adjust regular voltage. LCD may fail to display if it is set too low. ST7567_WriteCommand(ST7567_REGULATION_RATIO | ST7567_REGULATION_RATIO_5_0); ST7567_WriteCommand(ST7567_BIAS_1_9); ST7567_WriteCommand(ST7567_X_ORIENT); ST7567_WriteCommand(ST7567_Y_ORIENT); ST7567_WriteCommand(ST7567_INVERSE_DISPLAY_OFF); // Start from line 0 ST7567_WriteCommand(ST7567_SET_START_LINE | (0x00 & ST7567_SET_START_LINE_MASK)); // Start from page 0 ST7567_WriteCommand(ST7567_SET_PAGE_ADDRESS | (0x00 & ST7567_SET_PAGE_ADDRESS_MASK)); // Start from column 0 ST7567_WriteCommand(ST7567_SET_COLUMN_ADDRESS_MSB | (0x00 & ST7567_SET_COLUMN_ADDRESS_MSB_MASK)); ST7567_WriteCommand(ST7567_SET_COLUMN_ADDRESS_LSB | (0x00 & ST7567_SET_COLUMN_ADDRESS_LSB_MASK)); // power control, LCD may fail to display if it is not properly set. // recommend to set them all ST7567_WriteCommand(ST7567_POWER_CONTROL |ST7567_POWER_CONTROL_VB |ST7567_POWER_CONTROL_VR |ST7567_POWER_CONTROL_VF); ST7567_WriteCommand(ST7567_DISPLAY_ON); ST7567_WriteCommand(ST7567_ALL_PIXEL_NORMAL); } void ST7567_SetPowerSaveMode(HAL_State_t state) { #if (ST7567_MODEL == ST7567_MODEL_ST7565) if (state == HAL_State_ON) ST7567_WriteCommand(ST7567_MODE_SLEEP); else ST7567_WriteCommand(ST7567_MODE_NORMAL); #else if (state == HAL_State_ON) { ST7567_WriteCommand(ST7567_DISPLAY_OFF); ST7567_WriteCommand(ST7567_ALL_PIXEL_ON); } else { ST7567_WriteCommand(ST7567_ALL_PIXEL_NORMAL); ST7567_WriteCommand(ST7567_DISPLAY_ON); } #endif } void ST7567_SetBackLightState(HAL_State_t state) { ST7567_BL = (state == HAL_State_ON)? SET : RESET; } void ST7567_SetContrast(uint8_t val) { ST7567_WriteCommand(ST7567_SET_EV); ST7567_WriteCommand(ST7567_SET_EV_MASK & val); } void ST7567_UpdateScreen(void) { uint8_t i = 0, *pt = ST7567_Buffer_all; for (i = 0; i < ST7567_PAGES; i++) { ST7567_WriteCommand(ST7567_SET_PAGE_ADDRESS|(i & ST7567_SET_PAGE_ADDRESS_MASK)); ST7567_WriteCommand(ST7567_SET_COLUMN_ADDRESS_MSB|(0 >> 4)); ST7567_WriteCommand(ST7567_SET_COLUMN_ADDRESS_LSB|(0 & 0x0F)); ST7567_Transmit(pt + (ST7567_WIDTH * i), ST7567_WIDTH); } } void ST7567_ToggleInvert(void) { /* Toggle invert */ ST7567_colorInverted = !ST7567_colorInverted; if (ST7567_colorInverted) { ST7567_WriteCommand(ST7567_INVERSE_DISPLAY_ON); } else { ST7567_WriteCommand(ST7567_INVERSE_DISPLAY_OFF); } } void ST7567_Fill(uint8_t color) { /* Set memory */ memset((uint8_t *)ST7567_Buffer_all, (color == ST7567_COLOR_BACK) ? 0x00 : 0xFF, sizeof(ST7567_Buffer_all)); } void ST7567_DrawPixel(uint8_t x, uint8_t y, uint8_t color) { uint8_t page, column; if (x >= ST7567_WIDTH || y >= ST7567_HEIGHT) { /* Error */ return; } if (color == ST7567_COLOR_FRONT) { ST7567_Buffer_all[x + (y / 8) * ST7567_WIDTH] |= 1 << (y % 8); } else { ST7567_Buffer_all[x + (y / 8) * ST7567_WIDTH] &= ~(1 << (y % 8)); } } void ST7567_GotoXY(uint16_t x, uint16_t y) { /* Set write pointers */ ST7567_currentX = x; ST7567_currentY = y; } char ST7567_Putc(char ch, FontDef_t* font, uint8_t color) { uint32_t i, b, j, k; for (i = 0; i < font->height; i++) { for (j = 0; j < font->bytes; j++) { b = font->dat[((ch - 32) * font->height + i) * font->bytes + j]; if (font->order == 0) { for (k = 0; k < 8 && k < font->width - j * 8; k++) { if ((b << k) & 0x80) { ST7567_DrawPixel(ST7567_currentX + (j * 8) + k, (ST7567_currentY + i), (uint8_t) color); } else { ST7567_DrawPixel(ST7567_currentX + (j * 8) + k, (ST7567_currentY + i), (uint8_t) !color); } } } else { for (k = 0; k < 8 && k < font->width - j * 8; k++) { if (b & (0x0001 << k)) { ST7567_DrawPixel(ST7567_currentX + (j * 8) + k, (ST7567_currentY + i), (uint8_t) color); } else { ST7567_DrawPixel(ST7567_currentX + (j * 8) + k, (ST7567_currentY + i), (uint8_t) !color); } } } } } /* Increase pointer */ ST7567_currentX += font->width + 1; /* Return character written */ return ch; } char ST7567_Puts(char* str, FontDef_t* Font, uint8_t color) { /* Write characters */ while (*str) { /* Write character by character */ if (ST7567_Putc(*str, Font, color) != *str) { /* Return error */ return *str; } /* Increase string pointer */ str++; } /* Everything OK, zero should be returned */ return *str; } void ST7567_DrawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint8_t c) { int16_t dx, dy, sx, sy, err, e2, i, tmp; /* Check for overflow */ if (x0 >= ST7567_WIDTH) { x0 = ST7567_WIDTH - 1; } if (x1 >= ST7567_WIDTH) { x1 = ST7567_WIDTH - 1; } if (y0 >= ST7567_HEIGHT) { y0 = ST7567_HEIGHT - 1; } if (y1 >= ST7567_HEIGHT) { y1 = ST7567_HEIGHT - 1; } dx = (x0 < x1) ? (x1 - x0) : (x0 - x1); dy = (y0 < y1) ? (y1 - y0) : (y0 - y1); sx = (x0 < x1) ? 1 : -1; sy = (y0 < y1) ? 1 : -1; err = ((dx > dy) ? dx : -dy) / 2; if (dx == 0) { if (y1 < y0) { tmp = y1; y1 = y0; y0 = tmp; } if (x1 < x0) { tmp = x1; x1 = x0; x0 = tmp; } /* Vertical line */ for (i = y0; i <= y1; i++) { ST7567_DrawPixel(x0, i, c); } /* Return from function */ return; } if (dy == 0) { if (y1 < y0) { tmp = y1; y1 = y0; y0 = tmp; } if (x1 < x0) { tmp = x1; x1 = x0; x0 = tmp; } /* Horizontal line */ for (i = x0; i <= x1; i++) { ST7567_DrawPixel(i, y0, c); } /* Return from function */ return; } while (1) { ST7567_DrawPixel(x0, y0, c); if (x0 == x1 && y0 == y1) { break; } e2 = err; if (e2 > -dx) { err -= dy; x0 += sx; } if (e2 < dy) { err += dx; y0 += sy; } } } static __CODE uint8_t Font3x5 [] = { 0x00, 0x00, 0x00, 0x00, 0x00, // SP 0x02, 0x02, 0x02, 0x00, 0x02, // ! 0x05, 0x05, 0x00, 0x00, 0x00, // " 0x05, 0x07, 0x05, 0x07, 0x05, // # 0x06, 0x03, 0x06, 0x03, 0x02, // $ 0x01, 0x04, 0x02, 0x01, 0x04, // % 0x03, 0x03, 0x07, 0x05, 0x06, // & 0x02, 0x02, 0x00, 0x00, 0x00, // ' 0x04, 0x02, 0x02, 0x02, 0x04, // ( 0x01, 0x02, 0x02, 0x02, 0x01, // ) 0x05, 0x02, 0x05, 0x00, 0x00, // * 0x00, 0x02, 0x07, 0x02, 0x00, // + 0x00, 0x00, 0x00, 0x02, 0x01, // , 0x00, 0x00, 0x07, 0x00, 0x00, // - 0x00, 0x00, 0x00, 0x00, 0x02, // . 0x00, 0x04, 0x02, 0x01, 0x00, // / 0x07, 0x05, 0x05, 0x05, 0x07, // 0 0x02, 0x03, 0x02, 0x02, 0x07, // 1 0x07, 0x04, 0x07, 0x01, 0x07, // 2 0x07, 0x04, 0x06, 0x04, 0x07, // 3 0x05, 0x05, 0x07, 0x04, 0x04, // 4 0x07, 0x01, 0x07, 0x04, 0x07, // 5 0x07, 0x01, 0x07, 0x05, 0x07, // 6 0x07, 0x04, 0x04, 0x04, 0x04, // 7 0x07, 0x05, 0x07, 0x05, 0x07, // 8 0x07, 0x05, 0x07, 0x04, 0x07, // 9 0x00, 0x02, 0x00, 0x02, 0x00, // : 0x00, 0x02, 0x00, 0x02, 0x01, // ; 0x04, 0x02, 0x01, 0x02, 0x04, // < 0x00, 0x07, 0x00, 0x07, 0x00, // = 0x01, 0x02, 0x04, 0x02, 0x01, // > 0x07, 0x04, 0x02, 0x00, 0x02, // ? 0x02, 0x05, 0x07, 0x01, 0x06, // @ 0x02, 0x05, 0x07, 0x05, 0x05, // A 0x03, 0x05, 0x03, 0x05, 0x03, // B 0x06, 0x01, 0x01, 0x01, 0x06, // C 0x03, 0x05, 0x05, 0x05, 0x03, // D 0x07, 0x01, 0x07, 0x01, 0x07, // E 0x07, 0x01, 0x07, 0x01, 0x01, // F 0x06, 0x01, 0x07, 0x05, 0x06, // G 0x05, 0x05, 0x07, 0x05, 0x05, // H 0x07, 0x02, 0x02, 0x02, 0x07, // I 0x04, 0x04, 0x04, 0x05, 0x02, // J 0x05, 0x05, 0x03, 0x05, 0x05, // K 0x01, 0x01, 0x01, 0x01, 0x07, // L 0x05, 0x07, 0x07, 0x05, 0x05, // M 0x05, 0x07, 0x07, 0x07, 0x05, // N 0x02, 0x05, 0x05, 0x05, 0x02, // O 0x03, 0x05, 0x03, 0x01, 0x01, // P 0x02, 0x05, 0x05, 0x05, 0x06, // Q 0x03, 0x05, 0x07, 0x03, 0x05, // R 0x06, 0x01, 0x02, 0x04, 0x03, // S 0x07, 0x02, 0x02, 0x02, 0x02, // T 0x05, 0x05, 0x05, 0x05, 0x02, // U 0x05, 0x05, 0x05, 0x02, 0x02, // V 0x05, 0x05, 0x07, 0x07, 0x05, // W 0x05, 0x05, 0x02, 0x05, 0x05, // X 0x05, 0x05, 0x02, 0x02, 0x02, // Y 0x07, 0x04, 0x02, 0x01, 0x07, // Z 0x03, 0x01, 0x01, 0x01, 0x03, // [ 0x00, 0x01, 0x02, 0x04, 0x00, /* \ */ 0x06, 0x04, 0x04, 0x04, 0x06, // ] 0x02, 0x05, 0x00, 0x00, 0x00, // ^ 0x00, 0x00, 0x00, 0x00, 0x07, // _ 0x01, 0x02, 0x00, 0x00, 0x00, // ` 0x00, 0x03, 0x06, 0x05, 0x07, // a 0x01, 0x03, 0x05, 0x05, 0x03, // b 0x00, 0x06, 0x01, 0x01, 0x06, // c 0x04, 0x06, 0x05, 0x05, 0x06, // d 0x00, 0x06, 0x05, 0x03, 0x06, // e 0x04, 0x02, 0x07, 0x02, 0x02, // f 0x06, 0x05, 0x07, 0x04, 0x02, // g 0x01, 0x03, 0x05, 0x05, 0x05, // h 0x02, 0x00, 0x02, 0x02, 0x02, // i 0x04, 0x00, 0x04, 0x04, 0x03, // j 0x01, 0x05, 0x03, 0x03, 0x05, // k 0x03, 0x02, 0x02, 0x02, 0x07, // l 0x00, 0x07, 0x07, 0x07, 0x05, // m 0x00, 0x03, 0x05, 0x05, 0x05, // n 0x00, 0x02, 0x05, 0x05, 0x02, // o 0x00, 0x03, 0x05, 0x03, 0x01, // p 0x00, 0x06, 0x05, 0x06, 0x04, // q 0x00, 0x06, 0x01, 0x01, 0x01, // r 0x00, 0x06, 0x03, 0x06, 0x03, // s 0x02, 0x07, 0x02, 0x02, 0x06, // t 0x00, 0x05, 0x05, 0x05, 0x06, // u 0x00, 0x05, 0x05, 0x05, 0x02, // v 0x00, 0x05, 0x07, 0x07, 0x07, // w 0x00, 0x05, 0x02, 0x02, 0x05, // x 0x00, 0x05, 0x06, 0x04, 0x06, // y 0x00, 0x07, 0x06, 0x03, 0x07, // z 0x06, 0x02, 0x01, 0x02, 0x06, // { 0x02, 0x02, 0x02, 0x02, 0x02, // | 0x03, 0x02, 0x04, 0x02, 0x03, // } 0x00, 0x06, 0x03, 0x00, 0x00, // ~ 0x07, 0x07, 0x07, 0x07, 0x07, // DEL }; static __CODE uint8_t Font5x7 [] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 0x04, 0x04, 0x04, 0x04, 0x00, 0x04, 0x00, // ! 0x0a, 0x0a, 0x0a, 0x00, 0x00, 0x00, 0x00, // " 0x0a, 0x0a, 0x1f, 0x0a, 0x1f, 0x0a, 0x0a, // # 0x04, 0x1e, 0x05, 0x0e, 0x14, 0x0f, 0x04, // $ 0x00, 0x19, 0x1a, 0x04, 0x0b, 0x13, 0x00, // % 0x06, 0x09, 0x05, 0x02, 0x15, 0x09, 0x16, // & 0x06, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, // ' 0x08, 0x04, 0x02, 0x02, 0x02, 0x04, 0x08, // ( 0x02, 0x04, 0x08, 0x08, 0x08, 0x04, 0x02, // ) 0x00, 0x04, 0x15, 0x0e, 0x15, 0x04, 0x00, // * 0x00, 0x04, 0x04, 0x1f, 0x04, 0x04, 0x00, // + 0x00, 0x00, 0x00, 0x00, 0x0c, 0x08, 0x04, // , 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, // - 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, // . 0x00, 0x10, 0x08, 0x04, 0x02, 0x01, 0x00, // / 0x0e, 0x11, 0x19, 0x15, 0x13, 0x11, 0x0e, // 0 0x04, 0x06, 0x04, 0x04, 0x04, 0x04, 0x0e, // 1 0x0e, 0x11, 0x10, 0x08, 0x04, 0x02, 0x1f, // 2 0x1f, 0x08, 0x04, 0x08, 0x10, 0x11, 0x0e, // 3 0x08, 0x0c, 0x0a, 0x09, 0x1f, 0x08, 0x08, // 4 0x1f, 0x01, 0x0f, 0x10, 0x10, 0x11, 0x0e, // 5 0x0c, 0x02, 0x01, 0x0f, 0x11, 0x11, 0x0e, // 6 0x1f, 0x10, 0x08, 0x04, 0x02, 0x02, 0x02, // 7 0x0e, 0x11, 0x11, 0x0e, 0x11, 0x11, 0x0e, // 8 0x0e, 0x11, 0x11, 0x1e, 0x10, 0x08, 0x06, // 9 0x00, 0x06, 0x06, 0x00, 0x06, 0x06, 0x00, // : 0x00, 0x06, 0x06, 0x00, 0x06, 0x04, 0x02, // ; 0x08, 0x04, 0x02, 0x01, 0x02, 0x04, 0x08, // < 0x00, 0x00, 0x1f, 0x00, 0x1f, 0x00, 0x00, // = 0x02, 0x04, 0x08, 0x10, 0x08, 0x04, 0x02, // > 0x0e, 0x11, 0x10, 0x08, 0x04, 0x00, 0x04, // ? 0x0e, 0x11, 0x10, 0x16, 0x1d, 0x11, 0x0e, // @ 0x0e, 0x11, 0x11, 0x11, 0x1f, 0x11, 0x11, // A 0x0f, 0x11, 0x11, 0x0f, 0x11, 0x11, 0x0f, // B 0x0e, 0x11, 0x01, 0x01, 0x01, 0x11, 0x0e, // C 0x07, 0x09, 0x11, 0x11, 0x11, 0x09, 0x07, // D 0x1f, 0x01, 0x01, 0x0f, 0x01, 0x01, 0x1f, // E 0x1f, 0x01, 0x01, 0x0f, 0x01, 0x01, 0x01, // F 0x0e, 0x11, 0x01, 0x1d, 0x11, 0x11, 0x1e, // G 0x11, 0x11, 0x11, 0x1f, 0x11, 0x11, 0x11, // H 0x0e, 0x04, 0x04, 0x04, 0x04, 0x04, 0x0e, // I 0x1c, 0x08, 0x08, 0x08, 0x08, 0x09, 0x06, // J 0x11, 0x09, 0x05, 0x03, 0x05, 0x09, 0x11, // K 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x1f, // L 0x11, 0x1b, 0x15, 0x15, 0x11, 0x11, 0x11, // M 0x11, 0x11, 0x13, 0x15, 0x19, 0x11, 0x11, // N 0x0e, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e, // O 0x0f, 0x11, 0x11, 0x0f, 0x01, 0x01, 0x01, // P 0x0e, 0x11, 0x11, 0x11, 0x15, 0x09, 0x16, // Q 0x0f, 0x11, 0x11, 0x0f, 0x05, 0x09, 0x11, // R 0x1e, 0x01, 0x01, 0x0e, 0x10, 0x10, 0x0f, // S 0x1f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, // T 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e, // U 0x11, 0x11, 0x11, 0x11, 0x11, 0x0a, 0x04, // V 0x11, 0x11, 0x11, 0x15, 0x15, 0x15, 0x0a, // W 0x11, 0x11, 0x0a, 0x04, 0x0a, 0x11, 0x11, // X 0x11, 0x11, 0x11, 0x0a, 0x04, 0x04, 0x04, // Y 0x1f, 0x10, 0x08, 0x04, 0x02, 0x01, 0x1f, // Z 0x0e, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0e, // [ 0x15, 0x0a, 0x15, 0x0a, 0x15, 0x0a, 0x15, /* \ */ 0x0e, 0x08, 0x08, 0x08, 0x08, 0x08, 0x0e, // ] 0x04, 0x0a, 0x11, 0x00, 0x00, 0x00, 0x00, // ^ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, // _ 0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, // ` 0x00, 0x00, 0x0e, 0x10, 0x1e, 0x11, 0x1e, // a 0x01, 0x01, 0x0d, 0x13, 0x11, 0x11, 0x0f, // b 0x00, 0x00, 0x0e, 0x01, 0x01, 0x11, 0x0e, // c 0x10, 0x10, 0x16, 0x19, 0x11, 0x11, 0x1e, // d 0x00, 0x00, 0x0e, 0x11, 0x1f, 0x01, 0x0e, // e 0x0c, 0x12, 0x02, 0x07, 0x02, 0x02, 0x02, // f 0x00, 0x1e, 0x11, 0x11, 0x1e, 0x10, 0x0e, // g 0x01, 0x01, 0x0d, 0x13, 0x11, 0x11, 0x11, // h 0x04, 0x00, 0x06, 0x04, 0x04, 0x04, 0x0e, // i 0x08, 0x00, 0x0c, 0x08, 0x08, 0x09, 0x06, // j 0x01, 0x01, 0x09, 0x05, 0x03, 0x05, 0x09, // k 0x06, 0x04, 0x04, 0x04, 0x04, 0x04, 0x0e, // l 0x00, 0x00, 0x0b, 0x15, 0x15, 0x11, 0x11, // m 0x00, 0x00, 0x0d, 0x13, 0x11, 0x11, 0x11, // n 0x00, 0x00, 0x0e, 0x11, 0x11, 0x11, 0x0e, // o 0x00, 0x00, 0x0f, 0x11, 0x0f, 0x01, 0x01, // p 0x00, 0x00, 0x16, 0x19, 0x1e, 0x10, 0x10, // q 0x00, 0x00, 0x0d, 0x13, 0x01, 0x01, 0x01, // r 0x00, 0x00, 0x0e, 0x01, 0x0e, 0x10, 0x0f, // s 0x02, 0x02, 0x07, 0x02, 0x02, 0x12, 0x0c, // t 0x00, 0x00, 0x11, 0x11, 0x11, 0x19, 0x16, // u 0x00, 0x00, 0x11, 0x11, 0x11, 0x0a, 0x04, // v 0x00, 0x00, 0x11, 0x11, 0x15, 0x15, 0x0a, // w 0x00, 0x00, 0x11, 0x0a, 0x04, 0x0a, 0x11, // x 0x00, 0x00, 0x11, 0x11, 0x1e, 0x10, 0x0e, // y 0x00, 0x00, 0x1f, 0x08, 0x04, 0x02, 0x1f, // z 0x08, 0x04, 0x04, 0x02, 0x04, 0x04, 0x08, // { 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, // | 0x02, 0x04, 0x04, 0x08, 0x04, 0x04, 0x02, // } 0x00, 0x00, 0x02, 0x15, 0x08, 0x00, 0x00, // ~ 0x00, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x00, // }; __CODE FontDef_t Font_3x5 = {3, 5, 1, 1, Font3x5}; __CODE FontDef_t Font_5x7 = {5, 7, 1, 1, Font5x7};