Screen works

However, what it displays is not great.
master
Ronald 1 year ago
parent 7319d96bd2
commit ba4ac4d9b2

1
.gitignore vendored

@ -3,3 +3,4 @@ compile_commands.json
config.ini
Todo.md
.cache
.ccls-cache

@ -3,6 +3,8 @@ project(GlucoseMonitor C)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
add_executable(glucose_monitor src/main.c libs/log.c/src/log.c)
# Find the pkg-config package
find_package(PkgConfig REQUIRED)
@ -15,9 +17,6 @@ pkg_check_modules(LIBCURL REQUIRED libcurl)
# Use pkg-config to find inih
pkg_check_modules(INIH REQUIRED inih)
# Add the executable
add_executable(glucose_monitor src/main.c libs/log.c/src/log.c)
# Link against the cJSON library
target_link_libraries(glucose_monitor PRIVATE ${LIBCURL_LIBRARIES} ${CJSON_LIBRARIES} ${INIH_LIBRARIES})
@ -31,3 +30,39 @@ target_include_directories(
${INIH_INCLUDE_DIRS}
)
if(ENABLE_SSD1305_DISPLAY)
target_compile_definitions(glucose_monitor PRIVATE ENABLE_SSD1305_DISPLAY)
target_sources(
glucose_monitor
PRIVATE
libs/waveshare-ssd1305/OLED/ssd1305.c
libs/waveshare-ssd1305/Config/DEV_Config.h
)
include_directories(
libs/waveshare-ssd1305/OLED/
libs/waveshare-ssd1305/Config/
)
set(SSD1305_WAVESHARE_LIB_SRC libs/waveshare-ssd1305/OLED/ssd1305.c)
add_library(SSD1305_WAVESHARE_LIB STATIC ${SSD1305_WAVESHARE_LIB_SRC})
target_compile_definitions(SSD1305_WAVESHARE_LIB PRIVATE USE_DEV_LIB)
target_compile_definitions(SSD1305_WAVESHARE_LIB PRIVATE USE_SPI)
set(CONFIG_WAVESHARE_LIB_SRC libs/waveshare-ssd1305/Config/DEV_Config.c)
add_library(CONFIG_WAVESHARE_LIB STATIC ${CONFIG_WAVESHARE_LIB_SRC})
target_compile_definitions(CONFIG_WAVESHARE_LIB PRIVATE USE_DEV_LIB)
target_compile_definitions(CONFIG_WAVESHARE_LIB PRIVATE USE_SPI)
target_link_libraries(glucose_monitor PRIVATE m SSD1305_WAVESHARE_LIB CONFIG_WAVESHARE_LIB)
find_library(LGPIO_LIBRARY lgpio)
if(LGPIO_LIBRARY)
message(STATUS "Found lgpio library at: ${LGPIO_LIBRARY}")
target_link_libraries(glucose_monitor PRIVATE lgpio)
link_directories(${LGPIO_INCLUDE_DIR})
else()
message(ERROR "lgpio library not found")
endif()
endif()

@ -0,0 +1,271 @@
/*****************************************************************************
* | File : DEV_Config.c
* | Author : Waveshare team
* | Function : Hardware underlying interface
* | Info :
*----------------
* | This version: V2.0
* | Date : 2020-06-17
* | Info : Basic version
*
******************************************************************************/
#include "DEV_Config.h"
#include <unistd.h>
uint32_t fd;
#if USE_DEV_LIB
int GPIO_Handle;
int SPI_Handle;
int I2C_Handle;
#endif
/*****************************************
GPIO
*****************************************/
void DEV_Digital_Write(UWORD Pin, UBYTE Value)
{
#ifdef USE_BCM2835_LIB
bcm2835_gpio_write(Pin, Value);
#elif USE_WIRINGPI_LIB
digitalWrite(Pin, Value);
#elif USE_DEV_LIB
lgGpioWrite(GPIO_Handle, Pin, Value);
#endif
}
UBYTE DEV_Digital_Read(UWORD Pin)
{
UBYTE Read_value = 0;
#ifdef USE_BCM2835_LIB
Read_value = bcm2835_gpio_lev(Pin);
#elif USE_WIRINGPI_LIB
Read_value = digitalRead(Pin);
#elif USE_DEV_LIB
Read_value = lgGpioRead(GPIO_Handle,Pin);
#endif
return Read_value;
}
void DEV_GPIO_Mode(UWORD Pin, UWORD Mode)
{
#ifdef USE_BCM2835_LIB
if(Mode == 0 || Mode == BCM2835_GPIO_FSEL_INPT){
bcm2835_gpio_fsel(Pin, BCM2835_GPIO_FSEL_INPT);
}else {
bcm2835_gpio_fsel(Pin, BCM2835_GPIO_FSEL_OUTP);
}
#elif USE_WIRINGPI_LIB
if(Mode == 0 || Mode == INPUT){
pinMode(Pin, INPUT);
pullUpDnControl(Pin, PUD_UP);
}else{
pinMode(Pin, OUTPUT);
// printf (" %d OUT \r\n",Pin);
}
#elif USE_DEV_LIB
if(Mode == 0 || Mode == LG_SET_INPUT){
lgGpioClaimInput(GPIO_Handle,LFLAGS,Pin);
// printf("IN Pin = %d\r\n",Pin);
}else{
lgGpioClaimOutput(GPIO_Handle, LFLAGS, Pin, LG_LOW);
// printf("OUT Pin = %d\r\n",Pin);
}
#endif
}
/**
* delay x ms
**/
void DEV_Delay_ms(UDOUBLE xms)
{
#ifdef USE_BCM2835_LIB
bcm2835_delay(xms);
#elif USE_WIRINGPI_LIB
delay(xms);
#elif USE_DEV_LIB
lguSleep(xms/1000.0);
#endif
}
static void DEV_GPIO_Init(void)
{
DEV_GPIO_Mode(OLED_RST, 1);
DEV_GPIO_Mode(OLED_DC, 1);
}
/******************************************************************************
function: Module Initialize, the library and initialize the pins, SPI protocol
parameter:
Info:
******************************************************************************/
UBYTE DEV_ModuleInit(void)
{
#ifdef USE_BCM2835_LIB
if(!bcm2835_init()) {
printf("bcm2835 init failed !!! \r\n");
return 1;
} else {
printf("bcm2835 init success !!! \r\n");
}
DEV_GPIO_Init();
#if USE_SPI
printf("USE_SPI\r\n");
bcm2835_spi_begin(); //Start spi interface, set spi pin for the reuse function
bcm2835_spi_setBitOrder(BCM2835_SPI_BIT_ORDER_MSBFIRST); //High first transmission
bcm2835_spi_setDataMode(BCM2835_SPI_MODE3); //spi mode 3
bcm2835_spi_setClockDivider(BCM2835_SPI_CLOCK_DIVIDER_32); //Frequency
bcm2835_spi_chipSelect(BCM2835_SPI_CS0); //set CE0
bcm2835_spi_setChipSelectPolarity(BCM2835_SPI_CS0, LOW); //enable cs0
#elif USE_IIC
OLED_DC_0;
OLED_CS_0;
printf("USE_IIC\r\n");
bcm2835_i2c_begin();
bcm2835_i2c_setSlaveAddress(0x3c);
/**********************************************************/
#endif
#elif USE_WIRINGPI_LIB
//if(wiringPiSetup() < 0) {//use wiringpi Pin number table
if(wiringPiSetupGpio() < 0) { //use BCM2835 Pin number table
printf("set wiringPi lib failed !!! \r\n");
return 1;
} else {
printf("set wiringPi lib success !!! \r\n");
}
DEV_GPIO_Init();
#if USE_SPI
printf("USE_SPI\r\n");
//wiringPiSPISetup(0,9000000);
wiringPiSPISetupMode(0, 9000000, 3);
#elif USE_IIC
OLED_DC_0;
OLED_CS_0;
printf("USE_IIC\r\n");
fd = wiringPiI2CSetup(0x3c);
#endif
#elif USE_DEV_LIB
char buffer[NUM_MAXBUF];
FILE *fp1;
fp1 = popen("cat /proc/cpuinfo | grep 'Raspberry Pi 5'", "r");
if (fp1 == NULL) {
printf("It is not possible to determine the model of the Raspberry PI\n");
return -1;
}
if(fgets(buffer, sizeof(buffer), fp1) != NULL)
{
GPIO_Handle = lgGpiochipOpen(4);
if (GPIO_Handle < 0)
{
printf( "gpiochip4 Export Failed\n");
return -1;
}
}
else
{
GPIO_Handle = lgGpiochipOpen(0);
if (GPIO_Handle < 0)
{
printf( "gpiochip0 Export Failed\n");
return -1;
}
}
DEV_GPIO_Init();
#if USE_SPI
printf("USE_SPI\r\n");
SPI_Handle = lgSpiOpen(0, 0, 10000000, 0);
#elif USE_IIC
printf("USE_IIC\r\n");
// OLED_DC_0;
// OLED_CS_0;
I2C_Handle = lgI2cOpen(1, 0x3c, 0);
#endif
#endif
return 0;
}
void DEV_SPI_WriteByte(uint8_t Value)
{
#ifdef USE_BCM2835_LIB
bcm2835_spi_transfer(Value);
#elif USE_WIRINGPI_LIB
wiringPiSPIDataRW(0,&Value,1);
#elif USE_DEV_LIB
// printf("write data is %d\r\n", Value);
lgSpiWrite(SPI_Handle,(char*)&Value, 1);
#endif
}
void DEV_SPI_Write_nByte(uint8_t *pData, uint32_t Len)
{
#ifdef USE_BCM2835_LIB
char rData[Len];
bcm2835_spi_transfernb(pData,rData,Len);
#elif USE_WIRINGPI_LIB
wiringPiSPIDataRW(0, pData, Len);
#elif USE_DEV_LIB
lgSpiWrite(SPI_Handle,(char*) pData, Len);
#endif
}
void I2C_Write_Byte(uint8_t value, uint8_t Cmd)
{
#ifdef USE_BCM2835_LIB
char wbuf[2]={Cmd, value};
bcm2835_i2c_write(wbuf, 2);
#elif USE_WIRINGPI_LIB
int ref;
//wiringPiI2CWrite(fd,Cmd);
ref = wiringPiI2CWriteReg8(fd, (int)Cmd, (int)value);
while(ref != 0) {
ref = wiringPiI2CWriteReg8 (fd, (int)Cmd, (int)value);
if(ref == 0)
break;
}
#elif USE_DEV_LIB
lgI2cWriteI2CBlockData(I2C_Handle,Cmd,(char *)&value,1);
#endif
}
/******************************************************************************
function: Module exits, closes SPI and BCM2835 library
parameter:
Info:
******************************************************************************/
void DEV_ModuleExit(void)
{
#ifdef USE_BCM2835_LIB
bcm2835_spi_end();
bcm2835_i2c_end();
bcm2835_close();
#elif USE_WIRINGPI_LIB
OLED_CS_0;
OLED_RST_1;
OLED_DC_0;
#elif USE_DEV_LIB
#endif
}

@ -0,0 +1,74 @@
#ifndef _DEV_CONFIG_H_
#define _DEV_CONFIG_H_
/***********************************************************************************************************************
------------------------------------------------------------------------
|\\\ ///|
|\\\ Hardware interface ///|
------------------------------------------------------------------------
***********************************************************************************************************************/
#include "Debug.h"
#ifdef USE_BCM2835_LIB
#include <bcm2835.h>
#elif USE_WIRINGPI_LIB
#include <wiringPi.h>
#include <wiringPiSPI.h>
#include <wiringPiI2C.h>
#elif USE_DEV_LIB
#include <lgpio.h>
#define LFLAGS 0
#define NUM_MAXBUF 4
#endif
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <unistd.h>
#define USE_SPI 1
#define USE_IIC 0
#define IIC_CMD 0X00
#define IIC_RAM 0X40
/**
* data
**/
#define UBYTE uint8_t
#define UWORD uint16_t
#define UDOUBLE uint32_t
//OLED Define
#define OLED_CS 8
#define OLED_RST 25
#define OLED_DC 24
#define OLED_CS_0 DEV_Digital_Write(OLED_CS,0)
#define OLED_CS_1 DEV_Digital_Write(OLED_CS,1)
#define OLED_RST_0 DEV_Digital_Write(OLED_RST,0)
#define OLED_RST_1 DEV_Digital_Write(OLED_RST,1)
#define OLED_DC_0 DEV_Digital_Write(OLED_DC,0)
#define OLED_DC_1 DEV_Digital_Write(OLED_DC,1)
#define LOCAL_DEV_ModuleInit DEV_ModuleInit
/*------------------------------------------------------------------------------------------------------*/
UBYTE DEV_ModuleInit(void);
void DEV_ModuleExit(void);
void DEV_GPIO_Mode(UWORD Pin, UWORD Mode);
void DEV_Digital_Write(UWORD Pin, UBYTE Value);
UBYTE DEV_Digital_Read(UWORD Pin);
void DEV_Delay_ms(UDOUBLE xms);
void I2C_Write_Byte(uint8_t value, uint8_t Cmd);
void DEV_SPI_WriteByte(UBYTE Value);
void DEV_SPI_Write_nByte(uint8_t *pData, uint32_t Len);
#endif

@ -0,0 +1,46 @@
/*****************************************************************************
* | File : Debug.h
* | Author : Waveshare team
* | Function : debug with printf
* | Info :
* Image scanning
* Please use progressive scanning to generate images or fonts
*----------------
* | This version: V2.0
* | Date : 2020-06-17
* | Info :
* 1.USE_DEBUG -> DEBUG, If you need to see the debug information,
* clear the execution: make DEBUG=-DDEBUG
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documnetation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
******************************************************************************/
#ifndef __DEBUG_H
#define __DEBUG_H
#include <stdio.h>
#if DEBUG
#define Debug(__info,...) printf("Debug: " __info,##__VA_ARGS__)
#else
#define Debug(__info,...)
#endif
#endif

@ -0,0 +1,225 @@
/*****************************************************************************
* | File : ssd1305.c
* | Author : Waveshare team
* | Function : 2.23inch OLED HAT Drive function
* | Info :
*----------------
* | This version: V1.0
* | Date : 2023-12-20
* | Info :
* -----------------------------------------------------------------------------
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documnetation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
******************************************************************************/
#include "ssd1305.h"
unsigned char buffer[WIDTH * HEIGHT / 8];
void command(uint8_t cmd){
#if USE_SPI
OLED_DC_0;
// OLED_CS_0;
DEV_SPI_WriteByte(cmd);
// OLED_CS_1;
#elif USE_IIC
I2C_Write_Byte(cmd,IIC_CMD);
#endif
}
void data(uint8_t Data)
{
#if USE_SPI
OLED_DC_1;
DEV_SPI_WriteByte(Data);
#elif USE_IIC
I2C_Write_Byte(Data,IIC_RAM);
#endif
}
void SSD1305_begin()
{
OLED_RST_1;
DEV_Delay_ms(100);
OLED_RST_0;
DEV_Delay_ms(100);
OLED_RST_1;
DEV_Delay_ms(100);
command(0xAE);//--turn off oled panel
command(0x04);//--Set Lower Column Start Address for Page Addressing Mode
command(0x10);//--Set Higher Column Start Address for Page Addressing Mode
command(0x40);//---Set Display Start Line
command(0x81);//---Set Contrast Control for BANK0
command(0x80);//--Contrast control register is set
command(0xA1);//--Set Segment Re-map
command(0xA6);//--Set Normal/Inverse Display
command(0xA8);//--Set Multiplex Ratio
command(0x1F);
command(0xC8);//--Set COM Output Scan Direction
command(0xD3);//--Set Display Offset
command(0x00);
command(0xD5);//--Set Display Clock Divide Ratio/ Oscillator Frequency
command(0xF0);
command(0xD8);//--Set Area Color Mode ON/OFF & Low Power Display Mode
command(0x05);
command(0xD9);//--Set pre-charge period
command(0xC2);
command(0xDA);//--Set COM Pins Hardware Configuration
command(0x12);
command(0xDB);//--Set VCOMH Deselect Level
command(0x3C);//--Set VCOM Deselect Level
command(0xAF);//--Normal Brightness Display ON
}
void SSD1305_clear()
{
int i;
for(i = 0;i<sizeof(buffer);i++)
{
buffer[i] = 0;
}
}
void SSD1305_pixel(int x,int y,char color)
{
if(x > WIDTH || y > HEIGHT)return ;
if(color)
buffer[x+(y/8)*WIDTH] |= 1<<(y%8);
else
buffer[x+(y/8)*WIDTH] &= ~(1<<(y%8));
}
void SSD1305_char1616(unsigned char x,unsigned char y,unsigned char chChar)
{
unsigned char i, j;
unsigned char chTemp = 0, y0 = y, chMode = 0;
for (i = 0; i < 32; i ++) {
chTemp = Font1612[chChar - 0x30][i];
for (j = 0; j < 8; j ++) {
chMode = chTemp & 0x80? 1 : 0;
SSD1305_pixel(x, y, chMode);
chTemp <<= 1;
y ++;
if ((y - y0) == 16) {
y = y0;
x ++;
break;
}
}
}
}
void SSD1305_char3216(unsigned char x,unsigned char y,unsigned char chChar)
{
unsigned char i, j;
unsigned char chTemp = 0, y0 = y, chMode = 0;
for (i = 0; i < 64; i ++) {
chTemp = Font3216[chChar - 0x30][i];
for (j = 0; j < 8; j ++) {
chMode = chTemp & 0x80? 1 : 0;
SSD1305_pixel(x, y, chMode);
chTemp <<= 1;
y ++;
if ((y - y0) == 32) {
y = y0;
x ++;
break;
}
}
}
}
void SSD1305_char(unsigned char x,unsigned char y,char acsii,char size,char mode)
{
unsigned char i,j,y0=y;
char temp;
unsigned char ch = acsii - ' ';
for(i = 0;i<size;i++)
{
if(size == 12)
{
if(mode)temp=Font1206[ch][i];
else temp = ~Font1206[ch][i];
}
else
{
if(mode)temp=Font1608[ch][i];
else temp = ~Font1608[ch][i];
}
for(j =0;j<8;j++)
{
if(temp & 0x80) SSD1305_pixel(x,y,1);
else SSD1305_pixel(x,y,0);
temp <<=1;
y++;
if((y-y0)==size)
{
y = y0;
x ++;
break;
}
}
}
}
void SSD1305_string(unsigned char x,unsigned char y, const char *pString,
unsigned char Size,unsigned char Mode)
{
while (*pString != '\0') {
if (x > (WIDTH - Size / 2)) {
x = 0;
y += Size;
if (y > (HEIGHT - Size)) {
y = x = 0;
}
}
SSD1305_char(x, y, *pString, Size, Mode);
x += Size / 2;
pString ++;
}
}
void SSD1305_bitmap(unsigned char x,unsigned char y,const unsigned char *pBmp,
unsigned char chWidth,unsigned char chHeight)
{
unsigned char i, j, byteWidth = (chWidth + 7)/8;
for(j = 0; j < chHeight; j++){
for(i = 0;i <chWidth;i ++){
if(*(pBmp + j*byteWidth+i/8) & (128 >> (i & 7))){
SSD1305_pixel(x + i, y + j, 1);
}
}
}
}
void SSD1305_display()
{
UWORD page, column;
for (page = 0; page < (HEIGHT / 8); page++) {
/* set page address */
command(0xB0 + page);
/* set low column address */
command(0x04);
/* set high column address */
command(0x10);
/* write data */
for(column=0; column< WIDTH; column++) {
data(buffer[page * WIDTH + column]);
}
}
}

@ -0,0 +1,432 @@
/*****************************************************************************
* | File : ssd1305.h
* | Author : Waveshare team
* | Function : 2.23inch OLED HAT Drive function
* | Info :
*----------------
* | This version: V1.0
* | Date : 2023-12-20
* | Info :
* -----------------------------------------------------------------------------
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documnetation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
******************************************************************************/
#ifndef _SSD1305_H_
#define _SSD1305_H_
#include "DEV_Config.h"
#define VCCSTATE SSD1305_SWITCHCAPVCC
#define WIDTH 128
#define HEIGHT 32
#define NUM_PAGE 8
void SSD1305_begin();
void SSD1305_display();
void SSD1305_clear();
void SSD1305_pixel(int x,int y,char color);
void SSD1305_bitmap(unsigned char x,unsigned char y,const unsigned char *pBmp,
unsigned char chWidth,unsigned char chHeight);
void SSD1305_string(unsigned char x,unsigned char y, const char *pString,
unsigned char Size,unsigned char Mode);
void SSD1305_char1616(unsigned char x,unsigned char y,unsigned char chChar);
void SSD1305_char3216(unsigned char x,unsigned char y,unsigned char chChar);
static const unsigned char waveshare_en[384]=
{
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X7F,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X7F,0XFF,0X80,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X7F,0XFF,0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X7F,0XFF,0XF0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X7F,0XFD,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X7F,0XF9,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X7F,0XF1,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X63,0X39,0X9C,0X60,0X83,0X3F,0XCC,0X0D,0XFF,0X9F,0XF4,0X04,0XFF,0X1F,0XF7,0XFE,
0X63,0X31,0X1C,0X60,0X83,0X7F,0XCC,0X0D,0XFF,0XBF,0XE4,0X04,0XFF,0X9F,0XF7,0XFE,
0X70,0X13,0X0E,0X60,0X83,0X60,0X66,0X19,0X80,0X30,0X04,0X04,0X81,0X90,0X16,0X00,
0X70,0X03,0X0E,0X60,0X83,0X40,0X66,0X19,0XFF,0X1F,0XE7,0XFC,0X80,0X90,0X17,0XF8,
0X70,0X06,0X06,0X60,0X83,0X7F,0XE3,0X31,0XFF,0X07,0XF7,0XFC,0XFF,0X9F,0XF7,0XF8,
0X38,0X80,0X66,0X60,0X83,0X7F,0XE1,0X31,0X80,0X00,0X34,0X04,0XFF,0X9F,0XF6,0X00,
0X38,0XC8,0X66,0X60,0X83,0X40,0X61,0XE1,0X80,0X00,0X34,0X04,0X80,0X93,0X06,0X00,
0X38,0XCC,0XC6,0X70,0X87,0X40,0X60,0XE1,0X80,0X00,0X74,0X04,0X80,0X91,0XC6,0X00,
0X3F,0XFF,0X8E,0X3F,0XFE,0X40,0X60,0XC1,0XFF,0XBF,0XE4,0X04,0X80,0X90,0XE7,0XFE,
0X1F,0XFF,0X8E,0X0F,0XF8,0X40,0X60,0X01,0XFF,0XBF,0X84,0X04,0X80,0X90,0X3F,0XFE,
0X0F,0XFF,0X9E,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X07,0XFF,0XBE,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X03,0XFF,0XFE,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X01,0XFF,0XFE,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X1F,0XFE,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
};
static const unsigned char waveshare_ch[448]=
{
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X1F,0XFF,0XF0,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X1F,0XFF,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X1F,0XFF,0XFF,0X01,0XC6,0X1C,0X00,0X00,0X00,0X01,0XC0,0X00,
0X00,0X00,0X1F,0XFF,0XDF,0X81,0XB6,0XDC,0X3F,0XFF,0XF8,0XFF,0XFF,0XC3,0XFF,0XFF,
0X1F,0XFF,0X9F,0X83,0XB6,0XDF,0X3F,0XFF,0XF8,0XFF,0XFF,0XC3,0XFF,0XFF,0X1F,0XFF,
0X1F,0XC7,0XB6,0XFF,0X00,0X38,0X00,0XFF,0XFF,0XC3,0XFF,0XFF,0X1F,0XFF,0X1F,0XE7,
0X36,0XFF,0X3F,0XFF,0XF8,0XC1,0XC0,0XC0,0X00,0X1E,0X10,0XC7,0X19,0XE7,0X37,0XE0,
0X3F,0XFF,0XF8,0XC1,0XC0,0XC0,0X00,0X3C,0X18,0XC6,0X38,0XF1,0XFF,0XC7,0X38,0X38,
0X38,0XC1,0XC0,0XC0,0X00,0X78,0X18,0XC6,0X30,0XF1,0XBF,0XF6,0X3B,0X39,0XF8,0XC1,
0XC0,0XC0,0X7F,0XF8,0X18,0X02,0X70,0X73,0X80,0X3E,0X3B,0XFB,0XB8,0XFF,0XFF,0XC0,
0X7F,0XF0,0X1C,0X00,0X20,0X77,0XBF,0X9E,0X38,0X38,0X38,0XFF,0XFF,0XC0,0X7F,0XE0,
0X1C,0X10,0X22,0X37,0XBF,0X9E,0X38,0XFB,0X38,0XFF,0XFF,0XC0,0X00,0XE0,0X1C,0X10,
0X42,0X33,0X80,0X1E,0X3B,0XFB,0XF8,0XC1,0XC0,0XC0,0X00,0XE0,0X1E,0X30,0XC6,0X33,
0XBF,0X9C,0X00,0X00,0X00,0XC1,0XC0,0XC7,0XFF,0XFF,0X1E,0X39,0X86,0X33,0XBF,0X9C,
0X1F,0XFF,0XF8,0XC1,0XC0,0XC7,0XFF,0XFF,0X1E,0X39,0XCE,0X73,0XBF,0X8C,0X1F,0XFF,
0XF8,0XC1,0XC1,0XC7,0XFF,0XFF,0X0F,0XFF,0XF8,0X73,0XB9,0X9C,0X00,0X00,0X38,0XFF,
0XFF,0XC0,0X00,0XE0,0X0F,0XFF,0XF8,0X73,0XB9,0X9E,0X00,0X00,0X38,0XFF,0XFF,0XC0,
0X00,0XE0,0X07,0XFF,0XF8,0XF3,0XB9,0X9E,0X1F,0XFF,0XF8,0XFF,0XFF,0X80,0X00,0XE0,
0X03,0XFF,0XF9,0XF3,0XB9,0X9E,0X1F,0XFF,0XF8,0X01,0XC0,0X00,0X00,0XE0,0X03,0XFF,
0XFB,0XF3,0XB9,0XBE,0X00,0X00,0X38,0X01,0XC0,0X03,0XFF,0XE0,0X01,0XFF,0XFF,0XF3,
0XF9,0XFF,0X1F,0XFF,0XF8,0X01,0XFF,0XC3,0XFF,0XE0,0X00,0X7F,0XFF,0XF3,0XF9,0XF7,
0X1F,0XFF,0XF8,0X00,0XFF,0XC3,0XFF,0XE0,0X00,0X1F,0XFF,0XF3,0X80,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
};
static const unsigned char Font1206[95][12] = {
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*" ",0*/
{0x00,0x00,0x00,0x00,0x3F,0x40,0x00,0x00,0x00,0x00,0x00,0x00},/*"!",1*/
{0x00,0x00,0x30,0x00,0x40,0x00,0x30,0x00,0x40,0x00,0x00,0x00},/*""",2*/
{0x09,0x00,0x0B,0xC0,0x3D,0x00,0x0B,0xC0,0x3D,0x00,0x09,0x00},/*"#",3*/
{0x18,0xC0,0x24,0x40,0x7F,0xE0,0x22,0x40,0x31,0x80,0x00,0x00},/*"$",4*/
{0x18,0x00,0x24,0xC0,0x1B,0x00,0x0D,0x80,0x32,0x40,0x01,0x80},/*"%",5*/
{0x03,0x80,0x1C,0x40,0x27,0x40,0x1C,0x80,0x07,0x40,0x00,0x40},/*"&",6*/
{0x10,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"'",7*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x80,0x20,0x40,0x40,0x20},/*"(",8*/
{0x00,0x00,0x40,0x20,0x20,0x40,0x1F,0x80,0x00,0x00,0x00,0x00},/*")",9*/
{0x09,0x00,0x06,0x00,0x1F,0x80,0x06,0x00,0x09,0x00,0x00,0x00},/*"*",10*/
{0x04,0x00,0x04,0x00,0x3F,0x80,0x04,0x00,0x04,0x00,0x00,0x00},/*"+",11*/
{0x00,0x10,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*",",12*/
{0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x00,0x00},/*"-",13*/
{0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*".",14*/
{0x00,0x20,0x01,0xC0,0x06,0x00,0x38,0x00,0x40,0x00,0x00,0x00},/*"/",15*/
{0x1F,0x80,0x20,0x40,0x20,0x40,0x20,0x40,0x1F,0x80,0x00,0x00},/*"0",16*/
{0x00,0x00,0x10,0x40,0x3F,0xC0,0x00,0x40,0x00,0x00,0x00,0x00},/*"1",17*/
{0x18,0xC0,0x21,0x40,0x22,0x40,0x24,0x40,0x18,0x40,0x00,0x00},/*"2",18*/
{0x10,0x80,0x20,0x40,0x24,0x40,0x24,0x40,0x1B,0x80,0x00,0x00},/*"3",19*/
{0x02,0x00,0x0D,0x00,0x11,0x00,0x3F,0xC0,0x01,0x40,0x00,0x00},/*"4",20*/
{0x3C,0x80,0x24,0x40,0x24,0x40,0x24,0x40,0x23,0x80,0x00,0x00},/*"5",21*/
{0x1F,0x80,0x24,0x40,0x24,0x40,0x34,0x40,0x03,0x80,0x00,0x00},/*"6",22*/
{0x30,0x00,0x20,0x00,0x27,0xC0,0x38,0x00,0x20,0x00,0x00,0x00},/*"7",23*/
{0x1B,0x80,0x24,0x40,0x24,0x40,0x24,0x40,0x1B,0x80,0x00,0x00},/*"8",24*/
{0x1C,0x00,0x22,0xC0,0x22,0x40,0x22,0x40,0x1F,0x80,0x00,0x00},/*"9",25*/
{0x00,0x00,0x00,0x00,0x08,0x40,0x00,0x00,0x00,0x00,0x00,0x00},/*":",26*/
{0x00,0x00,0x00,0x00,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00},/*";",27*/
{0x00,0x00,0x04,0x00,0x0A,0x00,0x11,0x00,0x20,0x80,0x40,0x40},/*"<",28*/
{0x09,0x00,0x09,0x00,0x09,0x00,0x09,0x00,0x09,0x00,0x00,0x00},/*"=",29*/
{0x00,0x00,0x40,0x40,0x20,0x80,0x11,0x00,0x0A,0x00,0x04,0x00},/*">",30*/
{0x18,0x00,0x20,0x00,0x23,0x40,0x24,0x00,0x18,0x00,0x00,0x00},/*"?",31*/
{0x1F,0x80,0x20,0x40,0x27,0x40,0x29,0x40,0x1F,0x40,0x00,0x00},/*"@",32*/
{0x00,0x40,0x07,0xC0,0x39,0x00,0x0F,0x00,0x01,0xC0,0x00,0x40},/*"A",33*/
{0x20,0x40,0x3F,0xC0,0x24,0x40,0x24,0x40,0x1B,0x80,0x00,0x00},/*"B",34*/
{0x1F,0x80,0x20,0x40,0x20,0x40,0x20,0x40,0x30,0x80,0x00,0x00},/*"C",35*/
{0x20,0x40,0x3F,0xC0,0x20,0x40,0x20,0x40,0x1F,0x80,0x00,0x00},/*"D",36*/
{0x20,0x40,0x3F,0xC0,0x24,0x40,0x2E,0x40,0x30,0xC0,0x00,0x00},/*"E",37*/
{0x20,0x40,0x3F,0xC0,0x24,0x40,0x2E,0x00,0x30,0x00,0x00,0x00},/*"F",38*/
{0x0F,0x00,0x10,0x80,0x20,0x40,0x22,0x40,0x33,0x80,0x02,0x00},/*"G",39*/
{0x20,0x40,0x3F,0xC0,0x04,0x00,0x04,0x00,0x3F,0xC0,0x20,0x40},/*"H",40*/
{0x20,0x40,0x20,0x40,0x3F,0xC0,0x20,0x40,0x20,0x40,0x00,0x00},/*"I",41*/
{0x00,0x60,0x20,0x20,0x20,0x20,0x3F,0xC0,0x20,0x00,0x20,0x00},/*"J",42*/
{0x20,0x40,0x3F,0xC0,0x24,0x40,0x0B,0x00,0x30,0xC0,0x20,0x40},/*"K",43*/
{0x20,0x40,0x3F,0xC0,0x20,0x40,0x00,0x40,0x00,0x40,0x00,0xC0},/*"L",44*/
{0x3F,0xC0,0x3C,0x00,0x03,0xC0,0x3C,0x00,0x3F,0xC0,0x00,0x00},/*"M",45*/
{0x20,0x40,0x3F,0xC0,0x0C,0x40,0x23,0x00,0x3F,0xC0,0x20,0x00},/*"N",46*/
{0x1F,0x80,0x20,0x40,0x20,0x40,0x20,0x40,0x1F,0x80,0x00,0x00},/*"O",47*/
{0x20,0x40,0x3F,0xC0,0x24,0x40,0x24,0x00,0x18,0x00,0x00,0x00},/*"P",48*/
{0x1F,0x80,0x21,0x40,0x21,0x40,0x20,0xE0,0x1F,0xA0,0x00,0x00},/*"Q",49*/
{0x20,0x40,0x3F,0xC0,0x24,0x40,0x26,0x00,0x19,0xC0,0x00,0x40},/*"R",50*/
{0x18,0xC0,0x24,0x40,0x24,0x40,0x22,0x40,0x31,0x80,0x00,0x00},/*"S",51*/
{0x30,0x00,0x20,0x40,0x3F,0xC0,0x20,0x40,0x30,0x00,0x00,0x00},/*"T",52*/
{0x20,0x00,0x3F,0x80,0x00,0x40,0x00,0x40,0x3F,0x80,0x20,0x00},/*"U",53*/
{0x20,0x00,0x3E,0x00,0x01,0xC0,0x07,0x00,0x38,0x00,0x20,0x00},/*"V",54*/
{0x38,0x00,0x07,0xC0,0x3C,0x00,0x07,0xC0,0x38,0x00,0x00,0x00},/*"W",55*/
{0x20,0x40,0x39,0xC0,0x06,0x00,0x39,0xC0,0x20,0x40,0x00,0x00},/*"X",56*/
{0x20,0x00,0x38,0x40,0x07,0xC0,0x38,0x40,0x20,0x00,0x00,0x00},/*"Y",57*/
{0x30,0x40,0x21,0xC0,0x26,0x40,0x38,0x40,0x20,0xC0,0x00,0x00},/*"Z",58*/
{0x00,0x00,0x00,0x00,0x7F,0xE0,0x40,0x20,0x40,0x20,0x00,0x00},/*"[",59*/
{0x00,0x00,0x70,0x00,0x0C,0x00,0x03,0x80,0x00,0x40,0x00,0x00},/*"\",60*/
{0x00,0x00,0x40,0x20,0x40,0x20,0x7F,0xE0,0x00,0x00,0x00,0x00},/*"]",61*/
{0x00,0x00,0x20,0x00,0x40,0x00,0x20,0x00,0x00,0x00,0x00,0x00},/*"^",62*/
{0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10},/*"_",63*/
{0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"`",64*/
{0x00,0x00,0x02,0x80,0x05,0x40,0x05,0x40,0x03,0xC0,0x00,0x40},/*"a",65*/
{0x20,0x00,0x3F,0xC0,0x04,0x40,0x04,0x40,0x03,0x80,0x00,0x00},/*"b",66*/
{0x00,0x00,0x03,0x80,0x04,0x40,0x04,0x40,0x06,0x40,0x00,0x00},/*"c",67*/
{0x00,0x00,0x03,0x80,0x04,0x40,0x24,0x40,0x3F,0xC0,0x00,0x40},/*"d",68*/
{0x00,0x00,0x03,0x80,0x05,0x40,0x05,0x40,0x03,0x40,0x00,0x00},/*"e",69*/
{0x00,0x00,0x04,0x40,0x1F,0xC0,0x24,0x40,0x24,0x40,0x20,0x00},/*"f",70*/
{0x00,0x00,0x02,0xE0,0x05,0x50,0x05,0x50,0x06,0x50,0x04,0x20},/*"g",71*/
{0x20,0x40,0x3F,0xC0,0x04,0x40,0x04,0x00,0x03,0xC0,0x00,0x40},/*"h",72*/
{0x00,0x00,0x04,0x40,0x27,0xC0,0x00,0x40,0x00,0x00,0x00,0x00},/*"i",73*/
{0x00,0x10,0x00,0x10,0x04,0x10,0x27,0xE0,0x00,0x00,0x00,0x00},/*"j",74*/
{0x20,0x40,0x3F,0xC0,0x01,0x40,0x07,0x00,0x04,0xC0,0x04,0x40},/*"k",75*/
{0x20,0x40,0x20,0x40,0x3F,0xC0,0x00,0x40,0x00,0x40,0x00,0x00},/*"l",76*/
{0x07,0xC0,0x04,0x00,0x07,0xC0,0x04,0x00,0x03,0xC0,0x00,0x00},/*"m",77*/
{0x04,0x40,0x07,0xC0,0x04,0x40,0x04,0x00,0x03,0xC0,0x00,0x40},/*"n",78*/
{0x00,0x00,0x03,0x80,0x04,0x40,0x04,0x40,0x03,0x80,0x00,0x00},/*"o",79*/
{0x04,0x10,0x07,0xF0,0x04,0x50,0x04,0x40,0x03,0x80,0x00,0x00},/*"p",80*/
{0x00,0x00,0x03,0x80,0x04,0x40,0x04,0x50,0x07,0xF0,0x00,0x10},/*"q",81*/
{0x04,0x40,0x07,0xC0,0x02,0x40,0x04,0x00,0x04,0x00,0x00,0x00},/*"r",82*/
{0x00,0x00,0x06,0x40,0x05,0x40,0x05,0x40,0x04,0xC0,0x00,0x00},/*"s",83*/
{0x00,0x00,0x04,0x00,0x1F,0x80,0x04,0x40,0x00,0x40,0x00,0x00},/*"t",84*/
{0x04,0x00,0x07,0x80,0x00,0x40,0x04,0x40,0x07,0xC0,0x00,0x40},/*"u",85*/
{0x04,0x00,0x07,0x00,0x04,0xC0,0x01,0x80,0x06,0x00,0x04,0x00},/*"v",86*/
{0x06,0x00,0x01,0xC0,0x07,0x00,0x01,0xC0,0x06,0x00,0x00,0x00},/*"w",87*/
{0x04,0x40,0x06,0xC0,0x01,0x00,0x06,0xC0,0x04,0x40,0x00,0x00},/*"x",88*/
{0x04,0x10,0x07,0x10,0x04,0xE0,0x01,0x80,0x06,0x00,0x04,0x00},/*"y",89*/
{0x00,0x00,0x04,0x40,0x05,0xC0,0x06,0x40,0x04,0x40,0x00,0x00},/*"z",90*/
{0x00,0x00,0x00,0x00,0x04,0x00,0x7B,0xE0,0x40,0x20,0x00,0x00},/*"{",91*/
{0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xF0,0x00,0x00,0x00,0x00},/*"|",92*/
{0x00,0x00,0x40,0x20,0x7B,0xE0,0x04,0x00,0x00,0x00,0x00,0x00},/*"}",93*/
{0x40,0x00,0x80,0x00,0x40,0x00,0x20,0x00,0x20,0x00,0x40,0x00},/*"~",94*/
};
static const unsigned char Font1608[95][16] = {
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*" ",0*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xCC,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00},/*"!",1*/
{0x00,0x00,0x08,0x00,0x30,0x00,0x60,0x00,0x08,0x00,0x30,0x00,0x60,0x00,0x00,0x00},/*""",2*/
{0x02,0x20,0x03,0xFC,0x1E,0x20,0x02,0x20,0x03,0xFC,0x1E,0x20,0x02,0x20,0x00,0x00},/*"#",3*/
{0x00,0x00,0x0E,0x18,0x11,0x04,0x3F,0xFF,0x10,0x84,0x0C,0x78,0x00,0x00,0x00,0x00},/*"$",4*/
{0x0F,0x00,0x10,0x84,0x0F,0x38,0x00,0xC0,0x07,0x78,0x18,0x84,0x00,0x78,0x00,0x00},/*"%",5*/
{0x00,0x78,0x0F,0x84,0x10,0xC4,0x11,0x24,0x0E,0x98,0x00,0xE4,0x00,0x84,0x00,0x08},/*"&",6*/
{0x08,0x00,0x68,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"'",7*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xE0,0x18,0x18,0x20,0x04,0x40,0x02,0x00,0x00},/*"(",8*/
{0x00,0x00,0x40,0x02,0x20,0x04,0x18,0x18,0x07,0xE0,0x00,0x00,0x00,0x00,0x00,0x00},/*")",9*/
{0x02,0x40,0x02,0x40,0x01,0x80,0x0F,0xF0,0x01,0x80,0x02,0x40,0x02,0x40,0x00,0x00},/*"*",10*/
{0x00,0x80,0x00,0x80,0x00,0x80,0x0F,0xF8,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x00},/*"+",11*/
{0x00,0x01,0x00,0x0D,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*",",12*/
{0x00,0x00,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80},/*"-",13*/
{0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*".",14*/
{0x00,0x00,0x00,0x06,0x00,0x18,0x00,0x60,0x01,0x80,0x06,0x00,0x18,0x00,0x20,0x00},/*"/",15*/
{0x00,0x00,0x07,0xF0,0x08,0x08,0x10,0x04,0x10,0x04,0x08,0x08,0x07,0xF0,0x00,0x00},/*"0",16*/
{0x00,0x00,0x08,0x04,0x08,0x04,0x1F,0xFC,0x00,0x04,0x00,0x04,0x00,0x00,0x00,0x00},/*"1",17*/
{0x00,0x00,0x0E,0x0C,0x10,0x14,0x10,0x24,0x10,0x44,0x11,0x84,0x0E,0x0C,0x00,0x00},/*"2",18*/
{0x00,0x00,0x0C,0x18,0x10,0x04,0x11,0x04,0x11,0x04,0x12,0x88,0x0C,0x70,0x00,0x00},/*"3",19*/
{0x00,0x00,0x00,0xE0,0x03,0x20,0x04,0x24,0x08,0x24,0x1F,0xFC,0x00,0x24,0x00,0x00},/*"4",20*/
{0x00,0x00,0x1F,0x98,0x10,0x84,0x11,0x04,0x11,0x04,0x10,0x88,0x10,0x70,0x00,0x00},/*"5",21*/
{0x00,0x00,0x07,0xF0,0x08,0x88,0x11,0x04,0x11,0x04,0x18,0x88,0x00,0x70,0x00,0x00},/*"6",22*/
{0x00,0x00,0x1C,0x00,0x10,0x00,0x10,0xFC,0x13,0x00,0x1C,0x00,0x10,0x00,0x00,0x00},/*"7",23*/
{0x00,0x00,0x0E,0x38,0x11,0x44,0x10,0x84,0x10,0x84,0x11,0x44,0x0E,0x38,0x00,0x00},/*"8",24*/
{0x00,0x00,0x07,0x00,0x08,0x8C,0x10,0x44,0x10,0x44,0x08,0x88,0x07,0xF0,0x00,0x00},/*"9",25*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x0C,0x03,0x0C,0x00,0x00,0x00,0x00,0x00,0x00},/*":",26*/
{0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*";",27*/
{0x00,0x00,0x00,0x80,0x01,0x40,0x02,0x20,0x04,0x10,0x08,0x08,0x10,0x04,0x00,0x00},/*"<",28*/
{0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,0x00,0x00},/*"=",29*/
{0x00,0x00,0x10,0x04,0x08,0x08,0x04,0x10,0x02,0x20,0x01,0x40,0x00,0x80,0x00,0x00},/*">",30*/
{0x00,0x00,0x0E,0x00,0x12,0x00,0x10,0x0C,0x10,0x6C,0x10,0x80,0x0F,0x00,0x00,0x00},/*"?",31*/
{0x03,0xE0,0x0C,0x18,0x13,0xE4,0x14,0x24,0x17,0xC4,0x08,0x28,0x07,0xD0,0x00,0x00},/*"@",32*/
{0x00,0x04,0x00,0x3C,0x03,0xC4,0x1C,0x40,0x07,0x40,0x00,0xE4,0x00,0x1C,0x00,0x04},/*"A",33*/
{0x10,0x04,0x1F,0xFC,0x11,0x04,0x11,0x04,0x11,0x04,0x0E,0x88,0x00,0x70,0x00,0x00},/*"B",34*/
{0x03,0xE0,0x0C,0x18,0x10,0x04,0x10,0x04,0x10,0x04,0x10,0x08,0x1C,0x10,0x00,0x00},/*"C",35*/
{0x10,0x04,0x1F,0xFC,0x10,0x04,0x10,0x04,0x10,0x04,0x08,0x08,0x07,0xF0,0x00,0x00},/*"D",36*/
{0x10,0x04,0x1F,0xFC,0x11,0x04,0x11,0x04,0x17,0xC4,0x10,0x04,0x08,0x18,0x00,0x00},/*"E",37*/
{0x10,0x04,0x1F,0xFC,0x11,0x04,0x11,0x00,0x17,0xC0,0x10,0x00,0x08,0x00,0x00,0x00},/*"F",38*/
{0x03,0xE0,0x0C,0x18,0x10,0x04,0x10,0x04,0x10,0x44,0x1C,0x78,0x00,0x40,0x00,0x00},/*"G",39*/
{0x10,0x04,0x1F,0xFC,0x10,0x84,0x00,0x80,0x00,0x80,0x10,0x84,0x1F,0xFC,0x10,0x04},/*"H",40*/
{0x00,0x00,0x10,0x04,0x10,0x04,0x1F,0xFC,0x10,0x04,0x10,0x04,0x00,0x00,0x00,0x00},/*"I",41*/
{0x00,0x03,0x00,0x01,0x10,0x01,0x10,0x01,0x1F,0xFE,0x10,0x00,0x10,0x00,0x00,0x00},/*"J",42*/
{0x10,0x04,0x1F,0xFC,0x11,0x04,0x03,0x80,0x14,0x64,0x18,0x1C,0x10,0x04,0x00,0x00},/*"K",43*/
{0x10,0x04,0x1F,0xFC,0x10,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x0C,0x00,0x00},/*"L",44*/
{0x10,0x04,0x1F,0xFC,0x1F,0x00,0x00,0xFC,0x1F,0x00,0x1F,0xFC,0x10,0x04,0x00,0x00},/*"M",45*/
{0x10,0x04,0x1F,0xFC,0x0C,0x04,0x03,0x00,0x00,0xE0,0x10,0x18,0x1F,0xFC,0x10,0x00},/*"N",46*/
{0x07,0xF0,0x08,0x08,0x10,0x04,0x10,0x04,0x10,0x04,0x08,0x08,0x07,0xF0,0x00,0x00},/*"O",47*/
{0x10,0x04,0x1F,0xFC,0x10,0x84,0x10,0x80,0x10,0x80,0x10,0x80,0x0F,0x00,0x00,0x00},/*"P",48*/
{0x07,0xF0,0x08,0x18,0x10,0x24,0x10,0x24,0x10,0x1C,0x08,0x0A,0x07,0xF2,0x00,0x00},/*"Q",49*/
{0x10,0x04,0x1F,0xFC,0x11,0x04,0x11,0x00,0x11,0xC0,0x11,0x30,0x0E,0x0C,0x00,0x04},/*"R",50*/
{0x00,0x00,0x0E,0x1C,0x11,0x04,0x10,0x84,0x10,0x84,0x10,0x44,0x1C,0x38,0x00,0x00},/*"S",51*/
{0x18,0x00,0x10,0x00,0x10,0x04,0x1F,0xFC,0x10,0x04,0x10,0x00,0x18,0x00,0x00,0x00},/*"T",52*/
{0x10,0x00,0x1F,0xF8,0x10,0x04,0x00,0x04,0x00,0x04,0x10,0x04,0x1F,0xF8,0x10,0x00},/*"U",53*/
{0x10,0x00,0x1E,0x00,0x11,0xE0,0x00,0x1C,0x00,0x70,0x13,0x80,0x1C,0x00,0x10,0x00},/*"V",54*/
{0x1F,0xC0,0x10,0x3C,0x00,0xE0,0x1F,0x00,0x00,0xE0,0x10,0x3C,0x1F,0xC0,0x00,0x00},/*"W",55*/
{0x10,0x04,0x18,0x0C,0x16,0x34,0x01,0xC0,0x01,0xC0,0x16,0x34,0x18,0x0C,0x10,0x04},/*"X",56*/
{0x10,0x00,0x1C,0x00,0x13,0x04,0x00,0xFC,0x13,0x04,0x1C,0x00,0x10,0x00,0x00,0x00},/*"Y",57*/
{0x08,0x04,0x10,0x1C,0x10,0x64,0x10,0x84,0x13,0x04,0x1C,0x04,0x10,0x18,0x00,0x00},/*"Z",58*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFE,0x40,0x02,0x40,0x02,0x40,0x02,0x00,0x00},/*"[",59*/
{0x00,0x00,0x30,0x00,0x0C,0x00,0x03,0x80,0x00,0x60,0x00,0x1C,0x00,0x03,0x00,0x00},/*"\",60*/
{0x00,0x00,0x40,0x02,0x40,0x02,0x40,0x02,0x7F,0xFE,0x00,0x00,0x00,0x00,0x00,0x00},/*"]",61*/
{0x00,0x00,0x00,0x00,0x20,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x20,0x00,0x00,0x00},/*"^",62*/
{0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01},/*"_",63*/
{0x00,0x00,0x40,0x00,0x40,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"`",64*/
{0x00,0x00,0x00,0x98,0x01,0x24,0x01,0x44,0x01,0x44,0x01,0x44,0x00,0xFC,0x00,0x04},/*"a",65*/
{0x10,0x00,0x1F,0xFC,0x00,0x88,0x01,0x04,0x01,0x04,0x00,0x88,0x00,0x70,0x00,0x00},/*"b",66*/
{0x00,0x00,0x00,0x70,0x00,0x88,0x01,0x04,0x01,0x04,0x01,0x04,0x00,0x88,0x00,0x00},/*"c",67*/
{0x00,0x00,0x00,0x70,0x00,0x88,0x01,0x04,0x01,0x04,0x11,0x08,0x1F,0xFC,0x00,0x04},/*"d",68*/
{0x00,0x00,0x00,0xF8,0x01,0x44,0x01,0x44,0x01,0x44,0x01,0x44,0x00,0xC8,0x00,0x00},/*"e",69*/
{0x00,0x00,0x01,0x04,0x01,0x04,0x0F,0xFC,0x11,0x04,0x11,0x04,0x11,0x00,0x18,0x00},/*"f",70*/
{0x00,0x00,0x00,0xD6,0x01,0x29,0x01,0x29,0x01,0x29,0x01,0xC9,0x01,0x06,0x00,0x00},/*"g",71*/
{0x10,0x04,0x1F,0xFC,0x00,0x84,0x01,0x00,0x01,0x00,0x01,0x04,0x00,0xFC,0x00,0x04},/*"h",72*/
{0x00,0x00,0x01,0x04,0x19,0x04,0x19,0xFC,0x00,0x04,0x00,0x04,0x00,0x00,0x00,0x00},/*"i",73*/
{0x00,0x00,0x00,0x03,0x00,0x01,0x01,0x01,0x19,0x01,0x19,0xFE,0x00,0x00,0x00,0x00},/*"j",74*/
{0x10,0x04,0x1F,0xFC,0x00,0x24,0x00,0x40,0x01,0xB4,0x01,0x0C,0x01,0x04,0x00,0x00},/*"k",75*/
{0x00,0x00,0x10,0x04,0x10,0x04,0x1F,0xFC,0x00,0x04,0x00,0x04,0x00,0x00,0x00,0x00},/*"l",76*/
{0x01,0x04,0x01,0xFC,0x01,0x04,0x01,0x00,0x01,0xFC,0x01,0x04,0x01,0x00,0x00,0xFC},/*"m",77*/
{0x01,0x04,0x01,0xFC,0x00,0x84,0x01,0x00,0x01,0x00,0x01,0x04,0x00,0xFC,0x00,0x04},/*"n",78*/
{0x00,0x00,0x00,0xF8,0x01,0x04,0x01,0x04,0x01,0x04,0x01,0x04,0x00,0xF8,0x00,0x00},/*"o",79*/
{0x01,0x01,0x01,0xFF,0x00,0x85,0x01,0x04,0x01,0x04,0x00,0x88,0x00,0x70,0x00,0x00},/*"p",80*/
{0x00,0x00,0x00,0x70,0x00,0x88,0x01,0x04,0x01,0x04,0x01,0x05,0x01,0xFF,0x00,0x01},/*"q",81*/
{0x01,0x04,0x01,0x04,0x01,0xFC,0x00,0x84,0x01,0x04,0x01,0x00,0x01,0x80,0x00,0x00},/*"r",82*/
{0x00,0x00,0x00,0xCC,0x01,0x24,0x01,0x24,0x01,0x24,0x01,0x24,0x01,0x98,0x00,0x00},/*"s",83*/
{0x00,0x00,0x01,0x00,0x01,0x00,0x07,0xF8,0x01,0x04,0x01,0x04,0x00,0x00,0x00,0x00},/*"t",84*/
{0x01,0x00,0x01,0xF8,0x00,0x04,0x00,0x04,0x00,0x04,0x01,0x08,0x01,0xFC,0x00,0x04},/*"u",85*/
{0x01,0x00,0x01,0x80,0x01,0x70,0x00,0x0C,0x00,0x10,0x01,0x60,0x01,0x80,0x01,0x00},/*"v",86*/
{0x01,0xF0,0x01,0x0C,0x00,0x30,0x01,0xC0,0x00,0x30,0x01,0x0C,0x01,0xF0,0x01,0x00},/*"w",87*/
{0x00,0x00,0x01,0x04,0x01,0x8C,0x00,0x74,0x01,0x70,0x01,0x8C,0x01,0x04,0x00,0x00},/*"x",88*/
{0x01,0x01,0x01,0x81,0x01,0x71,0x00,0x0E,0x00,0x18,0x01,0x60,0x01,0x80,0x01,0x00},/*"y",89*/
{0x00,0x00,0x01,0x84,0x01,0x0C,0x01,0x34,0x01,0x44,0x01,0x84,0x01,0x0C,0x00,0x00},/*"z",90*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x3E,0xFC,0x40,0x02,0x40,0x02},/*"{",91*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00},/*"|",92*/
{0x00,0x00,0x40,0x02,0x40,0x02,0x3E,0xFC,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"}",93*/
{0x00,0x00,0x60,0x00,0x80,0x00,0x80,0x00,0x40,0x00,0x40,0x00,0x20,0x00,0x20,0x00},/*"~",94*/
};
static const unsigned char Font1612[11][32] =
{
{0x00,0x00,0x3F,0xFC,0x3F,0xFC,0x30,0x0C,0x30,0x0C,0x30,0x0C,0x30,0x0C,0x30,0x0C,
0x30,0x0C,0x30,0x0C,0x30,0x0C,0x30,0x0C,0x30,0x0C,0x3F,0xFC,0x3F,0xFC,0x00,0x00},/*"0",0*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,
0x30,0x00,0x3F,0xFC,0x3F,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"1",1*/
{0x00,0x00,0x39,0xFC,0x39,0xFC,0x31,0x8C,0x31,0x8C,0x31,0x8C,0x31,0x8C,0x31,0x8C,
0x31,0x8C,0x31,0x8C,0x31,0x8C,0x31,0x8C,0x31,0x8C,0x3F,0x8C,0x3F,0x8C,0x00,0x00},/*"2",2*/
{0x00,0x00,0x38,0x1C,0x38,0x1C,0x31,0x8C,0x31,0x8C,0x31,0x8C,0x31,0x8C,0x31,0x8C,
0x31,0x8C,0x31,0x8C,0x31,0x8C,0x31,0x8C,0x31,0x8C,0x3F,0xFC,0x3F,0xFC,0x00,0x00},/*"3",3*/
{0x00,0x00,0x3F,0x80,0x3F,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,
0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x3F,0xFC,0x3F,0xFC,0x00,0x00},/*"4",4*/
{0x00,0x00,0x3F,0xBC,0x3F,0xBC,0x31,0x8C,0x31,0x8C,0x31,0x8C,0x31,0x8C,0x31,0x8C,
0x31,0x8C,0x31,0x8C,0x31,0x8C,0x31,0x8C,0x31,0x8C,0x31,0xFC,0x31,0xFC,0x00,0x00},/*"5",5*/
{0x00,0x00,0x3F,0x9C,0x3F,0x9C,0x31,0x8C,0x31,0x8C,0x31,0x8C,0x31,0x8C,0x31,0x8C,
0x31,0x8C,0x31,0x8C,0x31,0x8C,0x31,0x8C,0x31,0x8C,0x31,0xFC,0x31,0xFC,0x00,0x00},/*"6",6*/
{0x00,0x00,0x38,0x00,0x38,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,
0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x3F,0xFC,0x3F,0xFC,0x00,0x00},/*"7",7*/
{0x00,0x00,0x3F,0xFC,0x3F,0xFC,0x31,0x8C,0x31,0x8C,0x31,0x8C,0x31,0x8C,0x31,0x8C,
0x31,0x8C,0x31,0x8C,0x31,0x8C,0x31,0x8C,0x31,0x8C,0x3F,0xFC,0x3F,0xFC,0x00,0x00},/*"8",8*/
{0x00,0x00,0x3F,0x9C,0x3F,0x9C,0x31,0x8C,0x31,0x8C,0x31,0x8C,0x31,0x8C,0x31,0x8C,
0x31,0x8C,0x31,0x8C,0x31,0x8C,0x31,0x8C,0x31,0x8C,0x3F,0xFC,0x3F,0xFC,0x00,0x00},/*"9",9*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x30,
0x18,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*":",10*/
};
static const unsigned char Font3216[11][64] =
{
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xFF,0xFC,0x3F,0xFF,0xFF,0xFC, /*"0",0*/
0x30,0x00,0x00,0x0C,0x30,0x00,0x00,0x0C,0x30,0x00,0x00,0x0C,0x30,0x00,0x00,0x0C,
0x30,0x00,0x00,0x0C,0x30,0x00,0x00,0x0C,0x30,0x00,0x00,0x0C,0x30,0x00,0x00,0x0C,
0x3F,0xFF,0xFF,0xFC,0x3F,0xFF,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*"1",1*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
0x3F,0xFF,0xFF,0xFC,0x3F,0xFF,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x01,0xFF,0xFC,0x3C,0x01,0xFF,0xFC, /*"2",2*/
0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,
0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,
0x3F,0xFF,0x80,0x0C,0x3F,0xFF,0x80,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x3C,0x38,0x00,0x00,0x3C, /*"3",3*/
0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,
0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,
0x3F,0xFF,0xFF,0xFC,0x3F,0xFF,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0x80,0x00,0x3F,0xFF,0x80,0x00, /*"4",4*/
0x00,0x01,0x80,0x00,0x00,0x01,0x80,0x00,0x00,0x01,0x80,0x00,0x00,0x01,0x80,0x00,
0x00,0x01,0x80,0x00,0x00,0x01,0x80,0x00,0x00,0x01,0x80,0x00,0x00,0x01,0x80,0x00,
0x3F,0xFF,0xFF,0xFC,0x3F,0xFF,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0x80,0x3C,0x3F,0xFF,0x80,0x3C, /*"5",5*/
0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,
0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,
0x30,0x01,0xFF,0xFC,0x30,0x01,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xFF,0xFC,0x3F,0xFF,0xFF,0xFC, /*"6",6*/
0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,
0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,
0x3C,0x01,0xFF,0xFC,0x3C,0x01,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00, /*"7",7*/
0x30,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
0x30,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
0x3F,0xFF,0xFF,0xFC,0x3F,0xFF,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xFF,0xFC,0x3F,0xFF,0xFF,0xFC, /*"8",8*/
0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,
0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,
0x3F,0xFF,0xFF,0xFC,0x3F,0xFF,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0x80,0x3C,0x3F,0xFF,0x80,0x3C, /*"9",9*/
0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,
0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,0x30,0x01,0x80,0x0C,
0x3F,0xFF,0xFF,0xFC,0x3F,0xFF,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*":",10*/
0x00,0x00,0x00,0x00,0x0F,0xF0,0x0F,0xF0,0x0F,0xF0,0x0F,0xF0,0x0C,0x00,0x00,0x30,
0x0C,0x00,0x00,0x30,0x0F,0xF0,0x0F,0xF0,0x0F,0xF0,0x0F,0xF0,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}
};
static const unsigned char Bmp4016[96] = //SUN
{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xF1,0x81,0x8F,0xFC,0x3F,
0xF1,0x81,0x8F,0xFC,0x30,0x31,0x81,0x8C,0x0C,0x30,0x01,0x81,0x8C,0x0C,0x30,0x01,
0x81,0x8C,0x0C,0x3F,0xF1,0x81,0x8C,0x0C,0x3F,0xF1,0x81,0x8C,0x0C,0x00,0x31,0x81,
0x8C,0x0C,0x00,0x31,0x81,0x8C,0x0C,0x30,0x31,0x81,0x8C,0x0C,0x3F,0xF1,0xFF,0x8C,
0x0C,0x3F,0xF1,0xFF,0x8C,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
static const unsigned char Signal816[16] = //mobie signal
{
0xFE,0x02,0x92,0x0A,0x54,0x2A,0x38,0xAA,0x12,0xAA,0x12,0xAA,0x12,0xAA,0x12,0xAA
};
static const unsigned char Msg816[16] = //message
{
0x1F,0xF8,0x10,0x08,0x18,0x18,0x14,0x28,0x13,0xC8,0x10,0x08,0x10,0x08,0x1F,0xF8
};
static const unsigned char Bat816[16] = //batery
{
0x0F,0xFE,0x30,0x02,0x26,0xDA,0x26,0xDA,0x26,0xDA,0x26,0xDA,0x30,0x02,0x0F,0xFE
};
static const unsigned char Bluetooth88[8] = // bluetooth
{
0x18,0x54,0x32,0x1C,0x1C,0x32,0x54,0x18
};
static const unsigned char GPRS88[8] = //GPRS
{
0xC3,0x99,0x24,0x20,0x2C,0x24,0x99,0xC3
};
static const unsigned char Alarm88[8] = //alram
{
0xC3,0xBD,0x42,0x52,0x4E,0x42,0x3C,0xC3
};
#endif

@ -14,6 +14,11 @@
#include <ini.h>
#include "log.h"
#ifdef ENABLE_SSD1305_DISPLAY
#include "ssd1305.h"
#include "DEV_Config.h"
#endif
volatile int Received_Exit_Signal = 0;
volatile int Finished_Tidy_Up = 0;
@ -24,6 +29,13 @@ void handle_sigint(int signal)
Received_Exit_Signal = 1;
}
void handle_sigterm(int signal)
{
log_info("Received SIGTERM gracefully shutting down...");
Received_Exit_Signal = 1;
}
size_t write_chunk(void *data, size_t size, size_t nmemb, void *clientp)
{
size_t real_size;
@ -216,14 +228,6 @@ size_t get_auth_token(const char *email, const char *password, char *auth_token)
size_t get_patient_id(const char *token, char *patient_id)
{
CURL *curl;
curl = curl_easy_init();
if (curl == NULL) {
log_error("curl_easy_init failed");
return 0;
}
struct Request request;
request.endpoint = "https://api.libreview.io/llu/connections";
request.token = token;
@ -272,12 +276,11 @@ size_t get_patient_id(const char *token, char *patient_id)
return 0;
}
size_t patient_id_length = strlen(patient_id_object->valuestring);
strncpy(patient_id, patient_id_object->valuestring, patient_id_length);
sprintf(patient_id, "%s", patient_id_object->valuestring);
cJSON_Delete(json);
return patient_id_length;
return strlen(patient_id);
}
double get_glucose_units(const char *token, const char *patient_id)
@ -374,6 +377,8 @@ static int inih_ini_handler(void *user, const char *section, const char *name, c
configuration->log_level = LOG_ERROR;
else if (strcmp(value, "FATAL") == 0)
configuration->log_level = LOG_FATAL;
} else if (MATCH("GENERAL", "INTERVAL")) {
configuration->interval = atoi(value);
} else {
return 1; /* unknown section/name, error */
}
@ -393,7 +398,12 @@ int main(void)
sa.sa_handler = handle_sigint;
sa.sa_flags = 0; // No flags are set
if (sigaction(SIGINT, &sa, NULL) < 0) {
perror("Error installing signal handler");
log_fatal("error installing signal handler for SIGINT");
return EXIT_FAILURE;
}
sa.sa_handler = handle_sigterm;
if (sigaction(SIGTERM, &sa, NULL) < 0) {
log_fatal("error installing signal handler for SIGINT");
return EXIT_FAILURE;
}
@ -413,20 +423,29 @@ int main(void)
Configuration configuration;
configuration.log_level = LOG_TRACE;
bool found_config_file = false;
for (int i = 0; i < number_of_possible_config_file_locations; ++i) {
if (does_file_exist(possible_config_file_locations[i])) {
log_debug("found config file at %s", possible_config_file_locations[i]);
if (ini_parse(possible_config_file_locations[i], inih_ini_handler, &configuration) < 1) {
log_fatal("failed to load config file");
return EXIT_FAILURE;
} else
} else {
found_config_file = true;
break;
}
}
}
for (int i = 0; i < number_of_possible_config_file_locations; ++i)
free(possible_config_file_locations[i]);
if (!found_config_file) {
log_fatal("failed to find config file, ensure that a config file exists");
return EXIT_FAILURE;
}
log_set_level(configuration.log_level);
if (configuration.email == NULL || strcmp(configuration.email, "\"\"") == 0) {
@ -453,7 +472,19 @@ int main(void)
}
free(configuration.email);
free(configuration.password);
log_debug("token: %s\n", token);
log_debug("token: %s", token);
#ifdef ENABLE_SSD1305_DISPLAY
log_debug("Attempting to initialise DEV library");
if(LOCAL_DEV_ModuleInit() != 0) {
log_fatal("Failed to initialise DEV library");
return EXIT_FAILURE;
}
log_debug("initialised DEV library");
SSD1305_begin();
#endif
char patient_id[BUFFER_SIZE];
size_t patient_id_length;
@ -462,16 +493,20 @@ int main(void)
log_fatal("failed to get patient ID, exiting...");
return EXIT_FAILURE;
}
log_debug("patient ID: %s\n", patient_id);
log_debug("patient ID: %s", patient_id);
struct timespec ts = {1, 0}; // 5 seconds, 0 nanoseconds
struct timespec ts = {configuration.interval, 0}; // 5 seconds, 0 nanoseconds
time_t t;
char time_str[BUFFER_SIZE];
double glucose_units;
char display[BUFFER_SIZE];
while (!Received_Exit_Signal) {
printf("Received_Exit_Signal: %d\n", Received_Exit_Signal);
nanosleep(&ts, NULL);
#ifdef ENABLE_SSD1305_DISPLAY
SSD1305_clear();
#endif
time(&t);
strftime(time_str, BUFFER_SIZE, "%H:%M:%S %A %d %B %Y", localtime(&t));
@ -480,8 +515,23 @@ int main(void)
log_error("failed to get glucose units");
continue;
}
printf("Glucose units at %s are %lf\n", time_str, get_glucose_units(token, patient_id));
sprintf(display, "Glucose units at %s are %lf", time_str, glucose_units);
printf("%s\n", display);
#ifdef ENABLE_SSD1305_DISPLAY
log_debug("showing glucose units on display");
SSD1305_string(0, 52, display, 12, 0);
SSD1305_display();
#endif
}
#ifdef ENABLE_SSD1305_DISPLAY
DEV_ModuleExit();
#endif
curl_global_cleanup();
}

@ -21,9 +21,11 @@ typedef struct Configuration {
char *email;
char *password;
int log_level;
int interval;
} Configuration;
void handle_sigint(int signal);
void handle_sigterm(int signal);
size_t write_chunk(void *data, size_t size, size_t nmemb, void *userdata);
struct Response* post_request(const struct Request *request);
struct Response* get_request(const struct Request *request);

Loading…
Cancel
Save