【GD32F427开发板试用】5. SPI驱动TFTLCD屏幕

news2024/11/15 12:29:54

本篇文章来自极术社区与兆易创新组织的GD32F427开发板评测活动,更多开发板试用活动请关注极术社区网站。作者:hehung

之前发帖

【GD32F427开发板试用】1. 串口实现scanf输入控制LED
【GD32F427开发板试用】2. RT-Thread标准版移植
【GD32F427开发板试用】3. 硬件IIC0驱动OLED显示中文
【GD32F427开发板试用】4. ADC采集摇杆模块移动量

前言

本文实现了使用GD32FF427V-START板子的SPI1驱动TFTLCD,LCD是2.2寸的ILI9341屏,不带触摸功能,这块屏幕是我从n年前参加兆易创新比赛获得的奖品GD32E230C-EVAL开发板上薅下来的,这块板子已经吃灰多年,没有派上什么用处,这次想起来还有这么一块板子,遂将LCD屏幕取下来,使用GD32F427V驱动试一下。
遗憾的是这块屏幕一直有一条蓝色的竖线,可能是放的时间太久了,电路有了断点。
本文实现功能如下:

  1. 基于RT-Thread Studio开发,基于RT-Thread OS;
  2. 使用SPI1驱动;
  3. 完成英文字符显示。

LCD屏资料

我手头并没有这块LCD屏幕的资料,遂到GD官网找了一番,还是没有,然后在万能的淘宝上才找到了资料。
资料网址:2.2inch SPI Module ILI9341 SKU: MSP2202

这个网址介绍的很详细,本文不做赘述。
下图是产品参数:

下图是引脚连接,引脚布局很重要,后面都需要连接到单片机上使用:

线路连接

知道了LCD的引脚布局,接下来就是与单片机连接了,这块LCD是SPI驱动的,所以我们需要选择一路SPI作为我们的驱动总线,本文选择了SPI1。
SPI硬件连接如下图,复用关系为AF5。

线路连接如下:

GD32F427V-STARTTFTLCD Pin
3.3VVCC
GNDGND
PB0CS
PB1RESET
PB12DC/RS
PB15SDI/MOSI
PB13SCK
3.3VLED
PB14SDO/MISO

软件实现

软件也是在GD32E230C-EVAL板子提供的源码基础上修改而来的,适配了我定义的这几个引脚,,该驱动程序不止适用于该LCD,也适用于其他的ILI9341驱动芯片的屏幕。

驱动代码由三个文件组成:
app_tftlcd_drv.c;
app_tftlcd_drv.h;
app_tftlcd_font.h。

app_tftlcd_drv.c

该文件主要实现了spi1以及使用到的其他IO口的初始化以及LCD屏幕的驱动代码。

/*
 * @hehung
 * 2022-12-11
 * 转载请注明出处
 */
#include "app_tftlcd_drv.h"
#include "app_tftlcd_font.h"
#include <rtthread.h>
#include "gd32f4xx.h"

#define H_VIEW

#ifdef H_VIEW
    #define X_MAX_PIXEL         320
    #define Y_MAX_PIXEL         240
#else
    #define X_MAX_PIXEL         240
    #define Y_MAX_PIXEL         320
#endif

static uint8_t spi_write_byte(uint32_t spi_periph,uint8_t byte);
static void spi1_init(void);
static void lcd_write_index(uint8_t index);
static void lcd_write_data(uint8_t data);

static void lcd_write_data_16bit(uint8_t datah,uint8_t datal);
static void lcd_reset(void);


/*!
    \brief      write an unsigned 8-bit bytes
    \param[in]  spi_periph: SPIx(x=0,1,2)
    \param[in]  byte: write byte
    \param[out] none
    \retval     none
*/
static uint8_t spi_write_byte(uint32_t spi_periph,uint8_t byte)
{
//    SPI_CTL1(spi_periph) |= SPI_CTL1_BYTEN;
    while(RESET == (SPI_STAT(spi_periph)&SPI_FLAG_TBE));
    SPI_DATA(spi_periph) = byte;

    while(RESET == (SPI_STAT(spi_periph)&SPI_FLAG_RBNE));
    return(SPI_DATA(spi_periph));
} 

/*!
    \brief      init SPI1
    \param[in]  none
    \param[out] none
    \retval     none
*/
static void spi1_init(void)
{
    spi_parameter_struct spi_init_struct;

    /* enable the gpio clock */
    rcu_periph_clock_enable(RCU_GPIOB);
    rcu_periph_clock_enable(RCU_SPI1);

    /* GPIOB config, PB13(SPI1_SCK), PB14(SPI1_MISO), PB15(LCD_SPI1_MOSI) */
    gpio_af_set(GPIOB, GPIO_AF_5, GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15);
    gpio_mode_set(GPIOB, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15);
    gpio_output_options_set(GPIOB, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15);

    /* GPIOB config */
    gpio_mode_set(GPIOB, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_12);
    gpio_output_options_set(GPIOB, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_12);

    /* SPI1 parameter config */
    spi_init_struct.trans_mode           = SPI_TRANSMODE_FULLDUPLEX;
    spi_init_struct.device_mode          = SPI_MASTER;
    spi_init_struct.frame_size           = SPI_FRAMESIZE_8BIT;
    spi_init_struct.clock_polarity_phase = SPI_CK_PL_HIGH_PH_2EDGE;
    spi_init_struct.nss                  = SPI_NSS_SOFT;
    spi_init_struct.prescale             = SPI_PSC_32;
    spi_init_struct.endian               = SPI_ENDIAN_MSB;
    spi_init(SPI1, &spi_init_struct);

    /* set crc polynomial */
    spi_enable(SPI1);
}

/*!
    \brief      write the register address
    \param[in]  index: register address
    \param[out] none
    \retval     none
*/
static void lcd_write_index(uint8_t index)
{
    LCD_RS_CLR;
    spi_write_byte(SPI1,index);
}

/*!
    \brief      write the register data
    \param[in]  data: register data
    \param[out] none
    \retval     none
*/
static void lcd_write_data(uint8_t data)
{
    LCD_RS_SET;
    spi_write_byte(SPI1,data);
}

/*!
    \brief      write the register data(an unsigned 16-bit data)
    \param[in]  datah: register data high 8bit
    \param[in]  datal: register data low 8bit
    \param[out] none
    \retval     none
*/
static void lcd_write_data_16bit(uint8_t datah,uint8_t datal)
{
    lcd_write_data(datah);
    lcd_write_data(datal);
}

/*!
    \brief      lcd reset
    \param[in]  none
    \param[out] none
    \retval     none
*/
static void lcd_reset(void)
{
    LCD_RST_CLR;

    rt_thread_mdelay(100);

    LCD_RST_SET;

    rt_thread_mdelay(50);
}


/*!
    \brief      lcd init
    \param[in]  none
    \param[out] none
    \retval     none
*/
void lcd_init(void)
{
    spi1_init();

    LCD_CS_CLR;
    lcd_reset();

    /* write the register address 0xCB*/
    lcd_write_index(0xCB);
    lcd_write_data(0x39);
    lcd_write_data(0x2C);
    lcd_write_data(0x00);
    lcd_write_data(0x34);
    lcd_write_data(0x02);

    /* write the register address 0xCF*/
    lcd_write_index(0xCF);
    lcd_write_data(0x00);
    lcd_write_data(0XC1);
    lcd_write_data(0X30);

    /* write the register address 0xE8*/
    lcd_write_index(0xE8);
    lcd_write_data(0x85);
    lcd_write_data(0x00);
    lcd_write_data(0x78);

    /* write the register address 0xEA*/
    lcd_write_index(0xEA);
    lcd_write_data(0x00);
    lcd_write_data(0x00);

    /* write the register address 0xED*/
    lcd_write_index(0xED);
    lcd_write_data(0x64);
    lcd_write_data(0x03);
    lcd_write_data(0X12);
    lcd_write_data(0X81);

    /* write the register address 0xF7*/
    lcd_write_index(0xF7);
    lcd_write_data(0x20);

    /* power control VRH[5:0] */
    lcd_write_index(0xC0);
    lcd_write_data(0x23);

    /* power control SAP[2:0];BT[3:0] */
    lcd_write_index(0xC1);
    lcd_write_data(0x10);

    /* vcm control */
    lcd_write_index(0xC5);
    lcd_write_data(0x3e);
    lcd_write_data(0x28); 

    /* vcm control2 */
    lcd_write_index(0xC7);
    lcd_write_data(0x86);

    lcd_write_index(0x36);
#ifdef H_VIEW
    lcd_write_data(0xE8);
#else
    lcd_write_data(0x48); 
#endif
    /* write the register address 0x3A*/
    lcd_write_index(0x3A);
    lcd_write_data(0x55);

    /* write the register address 0xB1*/
    lcd_write_index(0xB1);
    lcd_write_data(0x00);
    lcd_write_data(0x18);

    /* display function control */
    lcd_write_index(0xB6);
    lcd_write_data(0x08); 
    lcd_write_data(0x82);
    lcd_write_data(0x27);  

    /* 3gamma function disable */
    lcd_write_index(0xF2);
    lcd_write_data(0x00); 

    /* gamma curve selected  */
    lcd_write_index(0x26);
    lcd_write_data(0x01); 

    /* set gamma  */
    lcd_write_index(0xE0);
    lcd_write_data(0x0F);
    lcd_write_data(0x31);
    lcd_write_data(0x2B);
    lcd_write_data(0x0C);
    lcd_write_data(0x0E);
    lcd_write_data(0x08);
    lcd_write_data(0x4E);
    lcd_write_data(0xF1);
    lcd_write_data(0x37);
    lcd_write_data(0x07);
    lcd_write_data(0x10);
    lcd_write_data(0x03);
    lcd_write_data(0x0E);
    lcd_write_data(0x09);
    lcd_write_data(0x00);

    /* set gamma  */
    lcd_write_index(0XE1);
    lcd_write_data(0x00);
    lcd_write_data(0x0E);
    lcd_write_data(0x14);
    lcd_write_data(0x03);
    lcd_write_data(0x11);
    lcd_write_data(0x07);
    lcd_write_data(0x31);
    lcd_write_data(0xC1);
    lcd_write_data(0x48);
    lcd_write_data(0x08);
    lcd_write_data(0x0F);
    lcd_write_data(0x0C);
    lcd_write_data(0x31);
    lcd_write_data(0x36);
    lcd_write_data(0x0F);

    /* exit sleep */
    lcd_write_index(0x11);
    rt_thread_mdelay(120);

    /* display on */
    lcd_write_index(0x29);
    lcd_write_index(0x2c);

    LCD_CS_SET;
}

/*!
    \brief      set lcd display region
    \param[in]  x_start: the x position of the start point
    \param[in]  y_start: the y position of the start point
    \param[in]  x_end: the x position of the end point
    \param[in]  y_end: the y position of the end point
    \param[out] none
    \retval     none
*/
void lcd_set_region(uint16_t x_start,uint16_t y_start,uint16_t x_end,uint16_t y_end)
{
    LCD_CS_CLR;

    /* write the register address 0x2A*/
    lcd_write_index(0x2A);
    lcd_write_data_16bit(x_start >> 8,x_start);
    lcd_write_data_16bit(x_end >> 8,x_end);

    /* write the register address 0x2B*/
    lcd_write_index(0x2B);
    lcd_write_data_16bit(y_start >> 8,y_start);
    lcd_write_data_16bit(y_end >> 8,y_end);

    /* write the register address 0x2C*/
    lcd_write_index(0x2C);
    LCD_CS_SET;
}

/*!
    \brief      set the start display point of lcd
    \param[in]  x: the x position of the start point
    \param[in]  y: the y position of the start point
    \param[out] none
    \retval     none
*/
void lcd_set_xy(uint16_t x,uint16_t y)
{
    /* write the register address 0x2A*/
    lcd_write_index(0x2A);
    lcd_write_data_16bit(x >> 8,x);

    /* write the register address 0x2B*/
    lcd_write_index(0x2B);
    lcd_write_data_16bit(y >> 8,y);

    /* write the register address 0x2C*/
    lcd_write_index(0x2C);
}

/*!
    \brief      draw a point on the lcd
    \param[in]  x: the x position of the point 
    \param[in]  y: the y position of the point 
    \param[in]  data: write the register data
    \param[out] none
    \retval     none
*/
void lcd_draw_point(uint16_t x,uint16_t y,uint16_t data)
{
    lcd_set_xy(x,y);
    lcd_write_data(data >> 8);
    lcd_write_data(data);
}

/*!
    \brief      clear the lcd
    \param[in]  color: lcd display color 
    \param[out] none
    \retval     none
*/
void lcd_clear(uint16_t color)
{
    unsigned int i,m;
    /* set lcd display region */
    lcd_set_region(0,0,X_MAX_PIXEL - 1,Y_MAX_PIXEL - 1);
    LCD_RS_SET;

    LCD_CS_CLR;
    for(i = 0;i < Y_MAX_PIXEL;i ++){
        for(m = 0;m < X_MAX_PIXEL;m ++){
            spi_write_byte(SPI1,color >> 8);
            spi_write_byte(SPI1,color);
        }
    }
    LCD_CS_SET;
}

/*!
    \brief      bgr to rgb format conversion
    \param[in]  c: bgr color value
    \param[out] none
    \retval     rgb color value
*/
uint16_t lcd_bgr2rgb(uint16_t c)
{
    uint16_t r,g,b,rgb;
    b = (c >> 0) & 0x1f;
    g = (c >> 5) & 0x3f;
    r = (c >> 11) & 0x1f;
    rgb = (b << 11) + (g << 5) + (r << 0);
    return(rgb);
}

/*!
    \brief      gui circle
    \param[in]  x: the x position of the start point 
    \param[in]  y: the y position of the start point
    \param[in]  r: the radius of circle
    \param[in]  fc: display color of font
    \param[out] none
    \retval     none
*/
void lcd_circle_draw(uint16_t x,uint16_t y,uint16_t r,uint16_t fc)
{
    unsigned short a,b;
    int c;
    a = 0;
    b = r;
    c = 3 - 2 * r;
    LCD_CS_CLR;

    while(a < b){
        /* draw points on the lcd */
        lcd_draw_point(x + a,y + b,fc);
        lcd_draw_point(x - a,y + b,fc);
        lcd_draw_point(x + a,y - b,fc);
        lcd_draw_point(x - a,y - b,fc);
        lcd_draw_point(x + b,y + a,fc);
        lcd_draw_point(x - b,y + a,fc);
        lcd_draw_point(x + b,y - a,fc);
        lcd_draw_point(x - b,y - a,fc);

        if(c < 0)
            c = c + 4 * a + 6;
        else{ 
            c = c + 4 * (a - b) + 10;
            b -= 1; 
        } 
        a += 1;
    } 
    if(a == b){
        /* draw points on the lcd */
        lcd_draw_point(x + a,y + b,fc);
        lcd_draw_point(x + a,y + b,fc);
        lcd_draw_point(x + a,y - b,fc);
        lcd_draw_point(x - a,y - b,fc);
        lcd_draw_point(x + b,y + a,fc);
        lcd_draw_point(x - b,y + a,fc);
        lcd_draw_point(x + b,y - a,fc);
        lcd_draw_point(x - b,y - a,fc);
    } 
    LCD_CS_SET;
}

/*!
    \brief      gui draw line
    \param[in]  x0: the x position of the start point
    \param[in]  y0: the y position of the start point
    \param[in]  x1: the x position of the end point
    \param[in]  y1: the y position of the end point
    \param[in]  color: lcd display color
    \param[out] none
    \retval     none
*/
void lcd_line_draw(uint16_t x0,uint16_t y0,uint16_t x1,uint16_t y1,uint16_t color)
{
    /* - difference in x's
       - difference in y's
       - dx,dy * 2
       - amount in pixel space to move during drawing
       - amount in pixel space to move during drawing
       - the discriminant i.e. error i.e. decision variable
       - used for looping */
    int dx,dy,dx2,dy2,x_inc,y_inc,error,index;

    LCD_CS_CLR;

    lcd_set_xy(x0,y0);
    /* calculate x distance */
    dx = x1 - x0;
    /* calculate y distance */
    dy = y1 - y0;

    if(dx >= 0){
        x_inc = 1;
    }else{
        x_inc = -1;
        dx = -dx;
    } 

    if(dy >= 0){
        y_inc = 1;
    }else{
        y_inc = -1;
        dy    = -dy; 
    } 

    dx2 = dx << 1;
    dy2 = dy << 1;

    if(dx > dy){
        /* initialize error */
        error = dy2 - dx;
        /* draw the line */
        for(index = 0;index <= dx;index ++){
            lcd_draw_point(x0,y0,color);
            /* test if error has overflowed */
            if(0 <= error){
                error -= dx2;
                /* move to next line */
                y0 += y_inc;
             }
            /* adjust the error term */
            error += dy2;
            /* move to the next pixel */
            x0 += x_inc;
         }
    }else{
        /* initialize error term */
        error = dx2 - dy;
        /* draw the linedraw the line*/
        for(index = 0;index <= dy;index ++){
            /* set the pixel */
            lcd_draw_point(x0,y0,color);

            /* test if error overflowed */
            if(0 <= error){
                error -= dy2;
                /* move to next line */
                x0 += x_inc;
            }
            /* adjust the error term */
            error += dx2;

            /* move to the next pixel */
            y0 += y_inc;
        }
    }
    LCD_CS_SET;
}

/*!
    \brief      gui box
    \param[in]  x: the x position of the start point
    \param[in]  y: the y position of the start point
    \param[in]  w: the width of the box
    \param[in]  h: the high of the box
    \param[in]  bc: display background color
    \param[out] none
    \retval     none
*/
void lcd_rect_draw(uint16_t x,uint16_t y,uint16_t w,uint16_t h,uint16_t line_color)
{
    LCD_CS_CLR;

    /* gui draw line*/
    lcd_line_draw(x,y,x + w,y,line_color);
    lcd_line_draw(x + w,y,x + w,y + h,line_color);
    lcd_line_draw(x,y + h,x + w,y + h,line_color);
    lcd_line_draw(x,y,x,y + h,line_color);

    LCD_CS_SET;
}

/*!
    \brief      lcd box
    \param[in]  x: the x position of the start point
    \param[in]  y: the y position of the start point
    \param[in]  w: the width of the box
    \param[in]  h: the high of the box
    \param[in]  bc: display background color
    \param[out] none
    \retval     none
*/
void lcd_box(uint16_t x,uint16_t y,uint16_t w,uint16_t h,uint16_t bc)
{
    LCD_CS_CLR;

    /* gui draw line*/
    lcd_line_draw(x,y,x + w,y,0xEF7D);
    lcd_line_draw(x + w - 1,y + 1,x + w-1,y + 1 + h,0x2965);
    lcd_line_draw(x,y + h,x + w,y + h,0x2965);
    lcd_line_draw(x,y,x,y + h,0xEF7D);
    lcd_line_draw(x + 1,y + 1,x + 1 + w - 2,y + 1 + h - 2,bc);

    LCD_CS_SET;
}

/*!
    \brief      lcd box2
    \param[in]  x: the x position of the start point
    \param[in]  y: the y position of the start point
    \param[in]  w: the width of the box
    \param[in]  h: the high of the box
    \param[in]  mode: display color combination mode 
    \param[out] none
    \retval     none
*/
void lcd_box2(uint16_t x,uint16_t y,uint16_t w,uint16_t h, uint8_t mode)
{
    LCD_CS_CLR;

    /* gui box2 display mode0 */
    if(0 == mode){
        lcd_line_draw(x,y,x + w,y,0xEF7D);
        lcd_line_draw(x + w - 1,y + 1,x + w - 1,y + 1 + h,0x2965);
        lcd_line_draw(x,y + h,x + w,y + h,0x2965);
        lcd_line_draw(x,y,x,y + h,0xEF7D);
    }
    /* gui box2 display mode1 */
    if(1 == mode){
        lcd_line_draw(x,y,x + w,y,0x2965);
        lcd_line_draw(x + w - 1,y + 1,x + w - 1,y + 1 + h,0xEF7D);
        lcd_line_draw(x,y + h,x + w,y + h,0xEF7D);
        lcd_line_draw(x,y,x,y + h,0x2965);
    }
    /* gui box2 display mode2 */
    if(2 == mode){
        lcd_line_draw(x,y,x + w,y,0xffff);
        lcd_line_draw(x + w - 1,y + 1,x + w - 1,y + 1 + h,0xffff);
        lcd_line_draw(x,y + h,x + w,y + h,0xffff);
        lcd_line_draw(x,y,x,y + h,0xffff);
    }
    LCD_CS_SET;
}

/*!
    \brief      gui rect
    \param[in]  x1: the x position of the start point
    \param[in]  y1: the y position of the start point
    \param[in]  x2: the x position of the end point
    \param[in]  y2: the y position of the end point
    \param[in]  fc: display color of font
    \param[out] none
    \retval     none
*/
void lcd_rect_color_draw(uint16_t x1,uint16_t y1,uint16_t x2,uint16_t y2,uint16_t fc)
{
    int ix,iy;
    LCD_CS_CLR;
    for(ix = x1;ix < x2;ix ++){
        for(iy = y1;iy < y2;iy ++)
            /* set the pixel */
            lcd_draw_point(ix,iy,fc);
    }

    LCD_CS_SET;
}

/*!
    \brief      display button down
    \param[in]  x1: the x position of the start point
    \param[in]  y1: the y position of the start point
    \param[in]  x2: the x position of the end point
    \param[in]  y2: the y position of the end point
    \param[out] none
    \retval     none
*/
void display_button_down(uint16_t x1,uint16_t y1,uint16_t x2,uint16_t y2)
{
    LCD_CS_CLR;

    /* gui draw line with gray color*/
    lcd_line_draw(x1,y1,x2,y1,GRAY2);
    lcd_line_draw(x1 + 1,y1 + 1,x2,y1 + 1,GRAY1);
    lcd_line_draw(x1,y1,x1,y2,GRAY2);
    lcd_line_draw(x1 + 1,y1 + 1,x1 + 1,y2,GRAY1);

    /* gui draw line with white color*/
    lcd_line_draw(x1,y2,x2,y2,WHITE);
    lcd_line_draw(x2,y1,x2,y2,WHITE);
    LCD_CS_SET;
}

/*!
    \brief      display button up
    \param[in]  x1: the x position of the start point
    \param[in]  y1: the y position of the start point
    \param[in]  x2: the x position of the end point
    \param[in]  y2: the y position of the end point
    \param[out] none
    \retval     none
*/
void display_button_up(uint16_t x1,uint16_t y1,uint16_t x2,uint16_t y2)
{
    LCD_CS_CLR;

    /* gui draw line with white color*/
    lcd_line_draw(x1,y1,x2,y1,WHITE);
    lcd_line_draw(x1,y1,x1,y2,WHITE);

    /* gui draw line with gray color*/
    lcd_line_draw(x1 + 1,y2 - 1,x2,y2 - 1,GRAY1);
    lcd_line_draw(x1,y2,x2,y2,GRAY2);
    lcd_line_draw(x2 - 1,y1 + 1,x2 - 1,y2,GRAY1);
    lcd_line_draw(x2,y1,x2,y2,GRAY2);
    LCD_CS_SET;
}

/*!
    \brief      gui draw font to gbk16
    \param[in]  x: the x position of the start point
    \param[in]  y: the y position of the start point
    \param[in]  fc: display color of font
    \param[in]  bc: display background color
    \param[in]  *s: display char
    \param[out] none
    \retval     none
*/
void lcd_draw_font_gbk16(uint16_t x,uint16_t y,uint16_t fc,uint16_t bc,char *s)
{
    unsigned char i,j;
    unsigned short k,x0;
    x0 = x;

    LCD_CS_CLR;
    while(*s){
        /* ASCII character table from 32 to 128 */
        if(((uint8_t)(*s)) < 128){
            k = *s;
            if(13 == k){
                x = x0;
                y += 16;
            }else{
                if(k > 32)
                    k -= 32;
                else 
                    k = 0;
                for(i = 0;i < 16;i ++)
                    for(j = 0;j < 8;j ++){
                        if(asc16[k * 16 + i] & (0x80 >> j))
                            /* draw a point on the lcd */
                            lcd_draw_point(x + j,y + i,fc);
                        else{
                            if(fc != bc)
                                /* draw a point on the lcd */
                                lcd_draw_point(x + j,y + i,bc);
                        }
                    }
                x += 8;
            }
            s ++;
        }else{
            for(k = 0;k < hz16_num;k ++){
                if((hz16[k].Index[0] == *(s)) && (hz16[k].Index[1] == *(s + 1))){ 
                    for(i = 0;i < 16;i ++){
                        for(j = 0; j < 8; j ++){
                            if(hz16[k].Msk[i * 2] & (0x80 >> j))
                                /* draw a point on the lcd */
                                lcd_draw_point(x + j,y + i,fc);
                            else{
                                if(fc != bc)
                                    /* draw a point on the lcd */
                                    lcd_draw_point(x + j,y + i,bc);
                            }
                        }
                        for(j = 0;j < 8;j ++){
                            if(hz16[k].Msk[i * 2 + 1] & (0x80 >> j))
                                /* draw a point on the lcd */
                                lcd_draw_point(x + j + 8,y + i,fc);
                            else{
                                if(fc != bc)
                                    /* draw a point on the lcd */
                                    lcd_draw_point(x + j + 8,y + i,bc);
                            }
                        }
                    }
                }
            }
            s += 2;
            x += 16;
        }
    }
    LCD_CS_SET;
}

/*!
    \brief      gui draw font to gbk24
    \param[in]  x: the x position of the start point
    \param[in]  y: the y position of the start point
    \param[in]  fc: display color of font
    \param[in]  bc: display background color
    \param[in]  *s: display char
    \param[out] none
    \retval     none
*/
void lcd_draw_font_gbk24(uint16_t x,uint16_t y,uint16_t fc,uint16_t bc,char *s)
{
    unsigned char i,j;
    unsigned short k;

    LCD_CS_CLR;
    while(*s){
        /* ASCII character table from 32 to 128 */
        if(((uint8_t)(*s)) < 0x80){
            k = *s;
            if(k > 32)
                k -= 32;
            else
                k = 0;

            for(i = 0;i < 16;i ++)
                for(j = 0;j < 8;j ++){
                    if(asc16[k * 16 + i] & (0x80 >> j))
                        /* draw a point on the lcd */
                        lcd_draw_point(x + j,y + i,fc);
                    else{
                        if(fc != bc)
                            /* draw a point on the lcd */
                            lcd_draw_point(x + j,y + i,bc);
                    }
                }
            s ++;
            x += 8;
        }else{
            for(k = 0;k < hz24_num;k ++){
                if((hz24[k].Index[0] == *(s)) && (hz24[k].Index[1] == *(s + 1))){ 
                    for(i = 0;i < 24;i ++){
                        for(j = 0;j < 8;j ++){
                            if(hz24[k].Msk[i * 3] & (0x80 >> j))
                                /* draw a point on the lcd */
                                lcd_draw_point(x + j,y + i,fc);
                            else{
                                if(fc != bc)
                                    /* draw a point on the lcd */
                                    lcd_draw_point(x + j,y + i,bc);
                            }
                        }
                        for(j = 0;j < 8;j ++){
                            if(hz24[k].Msk[i * 3 + 1] & (0x80 >> j))
                                /* draw a point on the lcd */
                                lcd_draw_point(x + j + 8,y + i,fc);
                            else{
                                if(fc != bc)
                                /* draw a point on the lcd */
                                lcd_draw_point(x + j + 8,y + i,bc);
                            }
                        }
                        for(j = 0;j < 8;j ++){
                            if(hz24[k].Msk[i * 3 + 2] & (0x80 >> j))
                                /* draw a point on the lcd */
                                lcd_draw_point(x + j + 16,y + i,fc);
                            else{
                                if(fc != bc)
                                    /* draw a point on the lcd */
                                    lcd_draw_point(x + j + 16,y + i,bc);
                            }
                        }
                    }
                }
            }
        s += 2;
        x += 24;
        }
    }
    LCD_CS_SET;
}

/*!
    \brief      gui draw font to num32
    \param[in]  x: the x position of the start point
    \param[in]  y: the y position of the start point
    \param[in]  fc: display color of font
    \param[in]  bc: display background color
    \param[in]  num: display num
    \param[out] none
    \retval     none
*/
void lcd_draw_font_num32(uint16_t x,uint16_t y,uint16_t fc,uint16_t bc,uint16_t num)
{
    unsigned char i,j,k,c;

    LCD_CS_CLR;
    for(i = 0;i < 32;i ++){
        for(j = 0;j < 4;j++){
            c = *(sz32 + num * 32 * 4 + i * 4 + j);
            for(k = 0;k < 8;k ++){
                if(c & (0x80 >> k))
                    /* draw a point on the lcd */
                    lcd_draw_point(x + j * 8 + k,y + i,fc);
                else{
                    if(fc != bc)
                        /* draw a point on the lcd */
                        lcd_draw_point(x + j * 8 + k,y + i,bc);
                }
            }
        }
    }
    LCD_CS_SET;
}

app_tftlcd_drv.h

该文件体用app_tftlcd_drv.c实现的函数的头文件以及一些驱动总需要使用到的宏定义。

/*
 * @hehung
 * 2022-12-11
 * 转载请注明出处
 */
#ifndef APP_TFTLCD_DRV_H
#define APP_TFTLCD_DRV_H

#include "stdint.h"

/* Colors */
#define RED             0xf800
#define GREEN           0x07e0
#define BLUE            0x001f
#define WHITE           0xffff
#define BLACK           0x0000
#define YELLOW          0xFFE0

/* GRAYs */
#define GRAY0           0xEF7D
#define GRAY1           0x8410
#define GRAY2           0x4208

/* PB0 tft cs */
#define LCD_CS_SET      ((uint32_t)(GPIO_BOP(GPIOB) = GPIO_PIN_0))
#define LCD_CS_CLR      ((uint32_t)(GPIO_BC(GPIOB) = GPIO_PIN_0))

/* PB12 tft rs/dc */
#define LCD_RS_SET      ((uint32_t)(GPIO_BOP(GPIOB) = GPIO_PIN_12))
#define LCD_RS_CLR      ((uint32_t)(GPIO_BC(GPIOB) = GPIO_PIN_12))

/* PB1 tft rst */
#define LCD_RST_SET     ((uint32_t)(GPIO_BOP(GPIOB) = GPIO_PIN_1))
#define LCD_RST_CLR     ((uint32_t)(GPIO_BC(GPIOB) = GPIO_PIN_1))

/* lcd init */
void lcd_init(void);
/* clear the lcd */
void lcd_clear(uint16_t color);
/* set the start display point of lcd */
void lcd_set_xy(uint16_t x,uint16_t y);
/* draw a point on the lcd */
void lcd_draw_point(uint16_t x,uint16_t y,uint16_t data);

/* bgr to rgb format conversion */
uint16_t lcd_bgr2rgb(uint16_t c);
/* draw a circle on the lcd */
void lcd_circle_draw(uint16_t x,uint16_t y,uint16_t r,uint16_t fc);
/* draw a line on the LCD */
void lcd_line_draw(uint16_t x0,uint16_t y0,uint16_t x1,uint16_t y1,uint16_t color);
/* LCD rectangle draw */
void lcd_rect_draw(uint16_t x,uint16_t y,uint16_t w,uint16_t h,uint16_t line_color);
/* LCD box */
void lcd_box(uint16_t x,uint16_t y,uint16_t w,uint16_t h,uint16_t bc);
/* LCD box2 */
void lcd_box2(uint16_t x,uint16_t y,uint16_t w,uint16_t h,uint8_t mode);
/* draw a rectangle with color on the lcd */
void lcd_rect_color_draw(uint16_t x1,uint16_t y1,uint16_t x2,uint16_t y2,uint16_t fc);
/* display button down */
void display_button_down(uint16_t x1,uint16_t y1,uint16_t x2,uint16_t y2);
/* display button up */
void display_button_up(uint16_t x1,uint16_t y1,uint16_t x2,uint16_t y2);
/* draw gbk16 font on the LCD */
void lcd_draw_font_gbk16(uint16_t x,uint16_t y,uint16_t fc,uint16_t bc,char *s);
/* draw gbk24 font on the LCD */
void lcd_draw_font_gbk24(uint16_t x,uint16_t y,uint16_t fc,uint16_t bc,char *s);
/* draw num32 font on the LCD */
void lcd_draw_font_num32(uint16_t x,uint16_t y,uint16_t fc,uint16_t bc,uint16_t num);

void lcd_region_set(uint16_t StartX, uint16_t StartY, uint16_t EndX, uint16_t EndY);


#endif /* APP_TFTLCD_DRV_H */

app_tftlcd_font.h

该文件主要是字库,该LCD没有自带字库,需要我们自己做,该文件已经做好了英文字库,中文字库字符是24X24的,字库制作方式在本文前面提到的网址中有描述,如果需要,可以自行下载相应的软件制作,本文不做赘述。
用例中提供了16预计24像素大小的字体,如下:

/*
 * @hehung
 * 2022-12-11
 * 转载请注明出处
 */
#ifndef APP_TFTLCD_FONT_H
#define APP_TFTLCD_FONT_H

#define USE_ONCHIP_FLASH_FONT 1

const unsigned char asc16[] =
{
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* " " */
    0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x10,0x10,0x00,0x00, /* "!" */
    0x00,0x00,0x6C,0x6C,0x24,0x24,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* """ */
    0x00,0x24,0x24,0x24,0x24,0xFE,0x48,0x48,0x48,0x48,0xFC,0x90,0x90,0x90,0x90,0x00, /* "#" */
    0x00,0x10,0x3C,0x54,0x92,0x90,0x50,0x38,0x14,0x12,0x12,0x92,0x54,0x78,0x10,0x00, /* "$" */
    0x00,0x00,0x22,0x5C,0x94,0xA8,0x48,0x10,0x10,0x24,0x2A,0x52,0x54,0x88,0x00,0x00, /* "%" */
    0x00,0x00,0x30,0x48,0x48,0x50,0x20,0x6E,0x54,0x94,0x8C,0x88,0x8A,0x74,0x00,0x00, /* "&" */
    0x00,0x00,0x30,0x30,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* "'" */
    0x00,0x04,0x08,0x10,0x10,0x20,0x20,0x20,0x20,0x20,0x20,0x10,0x10,0x08,0x04,0x00, /* "(" */
    0x00,0x80,0x40,0x20,0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x20,0x40,0x80,0x00, /* ")" */
    0x00,0x00,0x00,0x00,0x10,0x54,0x38,0x10,0x38,0x54,0x10,0x00,0x00,0x00,0x00,0x00, /* "*" */
    0x00,0x00,0x00,0x10,0x10,0x10,0x10,0xFE,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00, /* "+" */
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x20,0x00, /* "," */
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* "-" */
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x00,0x00, /* "." */
    0x00,0x00,0x04,0x04,0x08,0x08,0x10,0x10,0x20,0x20,0x40,0x40,0x80,0x80,0x00,0x00, /* "/" */
    0x00,0x00,0x38,0x44,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x44,0x38,0x00,0x00, /* "0" */
    0x00,0x00,0x10,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00, /* "1" */
    0x00,0x00,0x38,0x44,0x82,0x82,0x04,0x08,0x10,0x20,0x40,0x82,0x84,0xFC,0x00,0x00, /* "2" */
    0x00,0x00,0x38,0x44,0x82,0x02,0x04,0x38,0x04,0x02,0x02,0x82,0x44,0x38,0x00,0x00, /* "3" */
    0x00,0x00,0x04,0x0C,0x14,0x14,0x24,0x24,0x44,0x44,0xFE,0x04,0x04,0x0E,0x00,0x00, /* "4" */
    0x00,0x00,0xFC,0x80,0x80,0x80,0xB8,0xC4,0x82,0x02,0x02,0x82,0x84,0x78,0x00,0x00, /* "5" */
    0x00,0x00,0x3C,0x42,0x82,0x80,0xB8,0xC4,0x82,0x82,0x82,0x82,0x44,0x38,0x00,0x00, /* "6" */
    0x00,0x00,0x7E,0x42,0x82,0x04,0x04,0x08,0x08,0x08,0x10,0x10,0x10,0x10,0x00,0x00, /* "7" */
    0x00,0x00,0x38,0x44,0x82,0x82,0x44,0x38,0x44,0x82,0x82,0x82,0x44,0x38,0x00,0x00, /* "8" */
    0x00,0x00,0x38,0x44,0x82,0x82,0x82,0x82,0x46,0x3A,0x02,0x82,0x44,0x38,0x00,0x00, /* "9" */
    0x00,0x00,0x00,0x00,0x10,0x10,0x00,0x00,0x00,0x00,0x10,0x10,0x00,0x00,0x00,0x00, /* ":" */
    0x00,0x00,0x00,0x00,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x20,0x00,0x00, /* ";" */
    0x00,0x00,0x00,0x00,0x06,0x18,0x60,0x80,0x60,0x18,0x06,0x00,0x00,0x00,0x00,0x00, /* "<" */
    0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00, /* "=" */
    0x00,0x00,0x00,0x00,0xC0,0x30,0x0C,0x02,0x0C,0x30,0xC0,0x00,0x00,0x00,0x00,0x00, /* ">" */
    0x00,0x38,0x44,0x82,0x82,0x02,0x04,0x08,0x10,0x10,0x10,0x00,0x10,0x10,0x00,0x00, /* "?" */
    0x00,0x00,0x38,0x44,0x82,0x9A,0xAA,0xAA,0xAA,0xAA,0xAA,0x96,0x80,0x42,0x3C,0x00, /* "@" */
    0x00,0x00,0x10,0x10,0x10,0x28,0x28,0x28,0x44,0x44,0x7C,0x44,0x44,0xEE,0x00,0x00, /* "A" */
    0x00,0x00,0xFC,0x42,0x42,0x42,0x42,0x7C,0x42,0x42,0x42,0x42,0x42,0xFC,0x00,0x00, /* "B" */
    0x00,0x00,0x3C,0x44,0x82,0x80,0x80,0x80,0x80,0x80,0x82,0x82,0x44,0x38,0x00,0x00, /* "C" */
    0x00,0x00,0xF8,0x44,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x44,0xF8,0x00,0x00, /* "D" */
    0x00,0x00,0xFC,0x44,0x42,0x40,0x44,0x7C,0x44,0x40,0x40,0x42,0x44,0xFC,0x00,0x00, /* "E" */
    0x00,0x00,0xFC,0x44,0x42,0x40,0x44,0x7C,0x44,0x40,0x40,0x40,0x40,0xF0,0x00,0x00, /* "F" */
    0x00,0x00,0x34,0x4C,0x82,0x80,0x80,0x80,0x8E,0x84,0x84,0x84,0x4C,0x34,0x00,0x00, /* "G" */
    0x00,0x00,0xEE,0x44,0x44,0x44,0x44,0x7C,0x44,0x44,0x44,0x44,0x44,0xEE,0x00,0x00, /* "H" */
    0x00,0x00,0x7C,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00, /* "I" */
    0x00,0x00,0x3E,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x88,0x88,0x70,0x00,0x00, /* "J" */
    0x00,0x00,0xEE,0x44,0x48,0x48,0x50,0x60,0x50,0x48,0x48,0x44,0x44,0xEE,0x00,0x00, /* "K" */
    0x00,0x00,0xE0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x42,0x44,0xFC,0x00,0x00, /* "L" */
    0x00,0x00,0xC6,0x44,0x6C,0x6C,0x6C,0x54,0x54,0x54,0x44,0x44,0x44,0xEE,0x00,0x00, /* "M" */
    0x00,0x00,0xCE,0x44,0x64,0x64,0x64,0x54,0x54,0x4C,0x4C,0x4C,0x44,0xE4,0x00,0x00, /* "N" */
    0x00,0x00,0x38,0x44,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x44,0x38,0x00,0x00, /* "O" */
    0x00,0x00,0xF8,0x44,0x42,0x42,0x42,0x44,0x78,0x40,0x40,0x40,0x40,0xE0,0x00,0x00, /* "P" */
    0x00,0x00,0x38,0x44,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0xBA,0x44,0x3C,0x02,0x00, /* "Q" */
    0x00,0x00,0xF0,0x48,0x44,0x44,0x44,0x48,0x70,0x48,0x44,0x44,0x44,0xE6,0x00,0x00, /* "R" */
    0x00,0x00,0x3C,0x44,0x82,0x80,0x40,0x30,0x0C,0x02,0x02,0x82,0x44,0x78,0x00,0x00, /* "S" */
    0x00,0x00,0x7C,0x54,0x92,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00, /* "T" */
    0x00,0x00,0xEE,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x38,0x00,0x00, /* "U" */
    0x00,0x00,0xEE,0x44,0x44,0x44,0x44,0x28,0x28,0x28,0x28,0x10,0x10,0x10,0x00,0x00, /* "V" */
    0x00,0x00,0xEE,0x44,0x54,0x54,0x54,0x54,0x54,0x54,0x28,0x28,0x28,0x28,0x00,0x00, /* "W" */
    0x00,0x00,0xEE,0x44,0x44,0x28,0x28,0x10,0x10,0x28,0x28,0x44,0x44,0xEE,0x00,0x00, /* "X" */
    0x00,0x00,0xEE,0x44,0x44,0x28,0x28,0x28,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00, /* "Y" */
    0x00,0x00,0x7E,0x44,0x84,0x08,0x08,0x10,0x20,0x20,0x40,0x82,0x84,0xFC,0x00,0x00, /* "Z" */
    0x00,0x1C,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x1C,0x00, /* "[" */
    0x00,0x00,0xEE,0x44,0x54,0x54,0xFE,0x54,0x54,0x54,0x28,0x28,0x28,0x28,0x00,0x00, /* "\" */
    0x00,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x70,0x00, /* "]" */
    0x00,0x30,0x48,0x84,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* "^" */
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00, /* "_" */
    0x00,0x40,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* "`" */
    0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x84,0x04,0x7C,0x84,0x84,0x8C,0x76,0x00,0x00, /* "a" */
    0x00,0x00,0xC0,0x40,0x40,0x40,0x58,0x64,0x42,0x42,0x42,0x42,0x64,0x58,0x00,0x00, /* "b" */
    0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x44,0x80,0x80,0x80,0x80,0x44,0x38,0x00,0x00, /* "c" */
    0x00,0x00,0x0C,0x04,0x04,0x04,0x34,0x4C,0x84,0x84,0x84,0x84,0x4C,0x36,0x00,0x00, /* "d" */
    0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x84,0x84,0xFC,0x80,0x80,0x84,0x78,0x00,0x00, /* "e" */
    0x00,0x00,0x18,0x24,0x20,0x20,0xF8,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x00,0x00, /* "f" */
    0x00,0x00,0x00,0x00,0x00,0x00,0x3A,0x44,0x44,0x78,0x80,0x7C,0x82,0x82,0x7C,0x00, /* "g" */
    0x00,0x00,0xC0,0x40,0x40,0x40,0x58,0x64,0x44,0x44,0x44,0x44,0x44,0xEE,0x00,0x00, /* "h" */
    0x00,0x00,0x10,0x10,0x00,0x00,0x30,0x10,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00, /* "i" */
    0x00,0x00,0x10,0x10,0x00,0x00,0x30,0x10,0x10,0x10,0x10,0x10,0x10,0x90,0x60,0x00, /* "j" */
    0x00,0x00,0xC0,0x40,0x40,0x40,0x5C,0x48,0x50,0x60,0x50,0x48,0x44,0xEE,0x00,0x00, /* "k" */
    0x00,0x00,0x30,0x10,0x10,0x10,0x10,0x11,0x10,0x10,0x10,0x10,0x10,0x39,0x00,0x00, /* "l" */
    0x00,0x00,0x00,0x00,0x00,0x00,0xAC,0xD2,0x92,0x92,0x92,0x92,0x92,0xD6,0x00,0x00, /* "m" */
    0x00,0x00,0x00,0x00,0x00,0x00,0x58,0xE4,0x44,0x44,0x44,0x44,0x44,0xEE,0x00,0x00, /* "n" */
    0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x44,0x82,0x82,0x82,0x82,0x44,0x38,0x00,0x00, /* "o" */
    0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0x64,0x42,0x42,0x42,0x64,0x58,0x40,0xE0,0x00, /* "p" */
    0x00,0x00,0x00,0x00,0x00,0x00,0x36,0x4C,0x84,0x84,0x84,0x4C,0x34,0x04,0x0E,0x00, /* "q" */
    0x00,0x00,0x00,0x00,0x00,0x00,0x6C,0x30,0x20,0x20,0x20,0x20,0x20,0x70,0x00,0x00, /* "r" */
    0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x88,0x84,0x60,0x18,0x84,0x44,0x78,0x00,0x00, /* "s" */
    0x00,0x00,0x00,0x20,0x20,0x20,0xF8,0x20,0x20,0x20,0x20,0x20,0x24,0x18,0x00,0x00, /* "t" */
    0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0x42,0x42,0x42,0x42,0x42,0x46,0x3A,0x00,0x00, /* "u" */
    0x00,0x00,0x00,0x00,0x00,0x00,0xEE,0x44,0x44,0x28,0x28,0x28,0x10,0x10,0x00,0x00, /* "v" */
    0x00,0x00,0x00,0x00,0x00,0x00,0xEE,0x44,0x44,0x54,0x54,0x28,0x28,0x28,0x00,0x00, /* "w" */
    0x00,0x00,0x00,0x00,0x00,0x00,0xEE,0x44,0x28,0x10,0x10,0x28,0x44,0xEE,0x00,0x00, /* "x" */
    0x00,0x00,0x00,0x00,0x00,0x00,0xEE,0x44,0x44,0x28,0x28,0x10,0x10,0xA0,0xC0,0x00, /* "y" */
    0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x44,0x88,0x10,0x20,0x42,0x84,0xFC,0x00,0x00, /* "z" */
    0x00,0x0C,0x10,0x10,0x10,0x10,0x10,0x60,0x10,0x10,0x10,0x10,0x10,0x10,0x0C,0x00, /* "{" */
    0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00, /* "|" */
    0x00,0xC0,0x20,0x20,0x20,0x20,0x20,0x18,0x20,0x20,0x20,0x20,0x20,0x20,0xC0,0x00, /* "}" */
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x72,0x8C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* "~" */
};

/* Digital tube font */
const unsigned char sz32[]={
    /* "0" */
    0x00,0x00,0x00,0x00,0x00,0x1F,0xE0,0x00,0x00,0x3F,0xF0,0x00,0x00,0x3F,0xF0,0x00,0x00,0x1F,0xE0,0x00,0x01,0x80,0x06,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x03,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x01,0x80,0x06,0x00,0x00,0x1F,0xE0,0x00,0x00,0x3F,0xF0,0x00,0x00,0x3F,0xF0,0x00,0x00,0x1F,0xE0,0x00,
    /* "1" */
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x01,0x80,0x00,0x00,0x03,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x03,0x80,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,
    /* "2" */
    0x00,0x00,0x00,0x00,0x00,0x1F,0xE0,0x00,0x00,0x3F,0xF0,0x00,0x00,0xFF,0xF0,0x00,0x01,0xFF,0xE0,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x1F,0xE3,0x00,0x00,0x7F,0xF8,0x00,0x00,0x7F,0xF8,0x00,0x00,0x1F,0xE0,0x00,0x03,0x00,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x1F,0xF0,0x00,0x00,0x3F,0xF8,0x00,0x00,0x3F,0xFC,0x00,0x00,0x1F,0xFE,0x00,
    /* "3" */
    0x00,0x00,0x00,0x00,0x03,0xFF,0x80,0x00,0x01,0xFF,0xC0,0x00,0x00,0xFF,0xC0,0x00,0x00,0x7F,0x80,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x7F,0x8C,0x00,0x01,0xFF,0xE0,0x00,0x01,0xFF,0xF0,0x00,0x00,0x7F,0x80,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x18,0x00,0x00,0x7F,0x80,0x00,0x00,0xFF,0xC0,0x00,0x01,0xFF,0xC0,0x00,0x03,0xFF,0x80,0x00,
    /* "4" */
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x01,0x00,0x03,0x00,0x03,0x00,0x03,0x80,0x07,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0x1F,0xE3,0x00,0x00,0x7F,0xF8,0x00,0x00,0x7F,0xFC,0x00,0x00,0x1F,0xE0,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,
    /* "5" */
    0x00,0x00,0x00,0x00,0x00,0x1F,0xFC,0x00,0x00,0x3F,0xF8,0x00,0x00,0x3F,0xF0,0x00,0x00,0x1F,0xE0,0x00,0x01,0x80,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0x1F,0xE0,0x00,0x00,0x7F,0xF8,0x00,0x00,0x7F,0xF8,0x00,0x00,0x1F,0xE0,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x06,0x00,0x00,0x3F,0xE0,0x00,0x00,0x7F,0xF0,0x00,0x00,0xFF,0xF0,0x00,0x01,0xFF,0xE0,0x00,
    /* "6" */
    0x00,0x00,0x00,0x00,0x00,0x1F,0xFC,0x00,0x00,0x3F,0xF8,0x00,0x00,0x3F,0xF0,0x00,0x00,0x1F,0xE0,0x00,0x01,0x80,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0x1F,0xE0,0x00,0x00,0x7F,0xF8,0x00,0x00,0x7F,0xFC,0x00,0x00,0x1F,0xE0,0x00,0x03,0x00,0x03,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x01,0x80,0x06,0x00,0x00,0x1F,0xE0,0x00,0x00,0x3F,0xF0,0x00,0x00,0x3F,0xF0,0x00,0x00,0x1F,0xE0,0x00,
    /* "7" */
    0x00,0x00,0x00,0x00,0x07,0xFF,0xE0,0x00,0x03,0xFF,0xC0,0x00,0x01,0xFF,0x88,0x00,0x00,0xFF,0x18,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,
    /* "8" */
    0x00,0x00,0x00,0x00,0x00,0x1F,0xE0,0x00,0x00,0x3F,0xF0,0x00,0x00,0x3F,0xF0,0x00,0x00,0x1F,0xE0,0x00,0x01,0x80,0x06,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0x1F,0xE3,0x00,0x00,0x7F,0xF8,0x00,0x00,0x7F,0xFC,0x00,0x00,0x1F,0xE0,0x00,0x03,0x00,0x03,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x01,0x80,0x06,0x00,0x00,0x1F,0xE0,0x00,0x00,0x3F,0xF0,0x00,0x00,0x3F,0xF0,0x00,0x00,0x1F,0xE0,0x00,
    /* "9" */
    0x00,0x00,0x00,0x00,0x00,0x1F,0xE0,0x00,0x00,0x3F,0xF0,0x00,0x00,0x3F,0xF0,0x00,0x00,0x1F,0xE0,0x00,0x01,0x80,0x06,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0x1F,0xE3,0x00,0x00,0x7F,0xF8,0x00,0x00,0x7F,0xFC,0x00,0x00,0x1F,0xE0,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x06,0x00,0x00,0x1F,0xE0,0x00,0x00,0x3F,0xF0,0x00,0x00,0x7F,0xF0,0x00,0x00,0xFF,0xE0,0x00,
    /* "." */
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    /* ":" */
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    /* "%" */
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xC0,0x06,0x00,0x0F,0xE0,0x06,0x00,0x00,0x00,0x0C,0x00,0x30,0x18,0x18,0x00,0x30,0x18,0x18,0x00,0x30,0x18,0x30,0x00,0x30,0x18,0x30,0x00,0x30,0x18,0x60,0x00,0x30,0x08,0xC0,0x00,0x07,0xC0,0xC0,0x00,0x0F,0xE0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xE0,0x00,0x06,0x07,0xC0,0x00,0x06,0x30,0x18,0x00,0x0C,0x30,0x18,0x00,0x0C,0x30,0x18,0x00,0x18,0x30,0x18,0x00,0x30,0x30,0x18,0x00,0x30,0x30,0x18,0x00,0x60,0x00,0x00,0x00,0xC0,0x0F,0xE0,0x00,0xC0,0x07,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    /* "℃" */
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0xE0,0x00,0x08,0x87,0xFC,0x00,0x08,0x8E,0x03,0x00,0x08,0x98,0x01,0x80,0x07,0x18,0x00,0x80,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x18,0x01,0x00,0x00,0x0C,0x03,0x00,0x00,0x07,0xFC,0x00,0x00,0x01,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    /* "-" */
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xF0,0x00,0x00,0x7F,0xF0,0x00,0x00,0x7F,0xE0,0x00,0x00,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};

struct typFNT_GB162
{
    unsigned char Index[3];
    char Msk[32];
};

#define hz16_num   100

const struct typFNT_GB162 hz16[] = {
    "显",0x00,0x00,0x1F,0xF0,0x10,0x10,0x10,0x10,0x1F,0xF0,0x10,0x10,0x10,0x10,0x1F,0xF0,0x04,0x40,0x44,0x44,0x24,0x44,0x14,0x48,0x14,0x50,0x04,0x40,0xFF,0xFE,0x00,0x00,
    "示",0x00,0x00,0x3F,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFE,0x01,0x00,0x01,0x00,0x11,0x10,0x11,0x08,0x21,0x04,0x41,0x02,0x81,0x02,0x05,0x00,0x02,0x00,
    "测",0x00,0x04,0x27,0xC4,0x14,0x44,0x14,0x54,0x85,0x54,0x45,0x54,0x45,0x54,0x15,0x54,0x15,0x54,0x25,0x54,0xE5,0x54,0x21,0x04,0x22,0x84,0x22,0x44,0x24,0x14,0x08,0x08,
    "试",0x00,0x28,0x20,0x24,0x10,0x24,0x10,0x20,0x07,0xFE,0x00,0x20,0xF0,0x20,0x17,0xE0,0x11,0x20,0x11,0x10,0x11,0x10,0x15,0x10,0x19,0xCA,0x17,0x0A,0x02,0x06,0x00,0x02,
};

struct typFNT_GB242
{
    unsigned char Index[3];
    char Msk[72];
};

#define hz24_num   100

/* Song typeface Bold Small 2 font */
const struct typFNT_GB242 hz24[] = 
{
    "显",0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0x00,0x0F,0x03,0xC0,0x0C,0x00,0x40,0x1F,0xF8,0x60,0x18,0x00,0x60,0x08,0x00,0x40,0x0E,0x01,0xC0,0x07,0xFF,0x00,0x00,0x00,0x00,0x01,0x84,0x00,0x01,0x84,0x00,0x19,0x87,0x80,0x0F,0x8C,0xE0,0x07,0x8C,0x20,0x00,0xCC,0x00,0x03,0xFF,0xE0,0x1F,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    "示",0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x00,0x1F,0xFF,0xC0,0x00,0x7F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xC0,0x3F,0xFF,0xE0,0x00,0x30,0x00,0x00,0x30,0x00,0x00,0x30,0x00,0x06,0x13,0x00,0x0C,0x13,0xC0,0x0C,0x18,0xF0,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    "测",0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x39,0xFC,0x30,0x1F,0xCC,0x30,0x07,0x06,0xB0,0x0F,0x06,0xF0,0x19,0x07,0xB0,0x31,0x37,0xB0,0x31,0x36,0xF0,0x1F,0x27,0xF0,0x01,0x67,0xF0,0x01,0xE5,0xF0,0x01,0xE1,0xF0,0x00,0x41,0xF0,0x0C,0xF8,0xB0,0x3C,0xD8,0x30,0x00,0x8C,0x30,0x00,0x80,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    "试",0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x03,0x60,0x0C,0x03,0x70,0x0C,0x03,0x30,0x00,0x3F,0xE0,0x00,0x3F,0x80,0x08,0x01,0x00,0x3C,0x01,0x80,0x04,0x7F,0x80,0x04,0x7D,0x80,0x0C,0x00,0x80,0x0C,0x10,0xC0,0x0C,0x10,0xC0,0x0C,0x18,0x40,0x0C,0x1C,0x60,0x0F,0x7E,0x60,0x06,0x70,0x30,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};

#endif /* APP_TFTLCD_FONT_H */

主函数

int main(void)
{
    /* Initialize lcd */
    lcd_init();

    lcd_clear(BLUE);
    lcd_draw_font_gbk24(20, 40, WHITE, BLUE, "GD32F427V-START");
    lcd_draw_font_gbk24(20, 80, WHITE, BLUE, "  aijishu.com");
    lcd_draw_font_gbk24(20, 120, WHITE, BLUE, " Spi TFT LCD tsst");
    lcd_draw_font_gbk24(20, 160, WHITE, BLUE, "     -- hehung");

    while (1)
    {
        rt_thread_mdelay(100);
    }

    return RT_EOK;
}

实现效果

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-D1FszsK5-1676273723209)(https://pic2.zhimg.com/80/v2-0dcd9abb064a0020e487e8009e1317c5_1440w.webp)]

我发现我把Spi TFT LCD test 写成了tsst,不要在意这些细节,哈哈哈

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/343128.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

IB学习者的培养目标有哪些?

IB课程强调要培养年轻人的探究精神&#xff0c;在富有渊博知识的同时&#xff0c;更要勤于思考&#xff0c;敢于思考&#xff0c;尊重和理解跨文化的差异&#xff0c;坚持原则维护公平&#xff0c;让这个世界充满爱与和平&#xff0c;让这个世界变得更加美好。上一次我们为大家…

编译原理—翻译方案、属性栈代码

系列文章戳这里&#x1f447; 什么是上下文无关文法、最左推导和最右推导如何判断二义文法及消除文法二义性何时需要消除左递归什么是句柄、什么是自上而下、自下而上分析什么是LL(1)、LR(0)、LR(1)文法、LR分析表LR(0)、SLR(1)、LR(1)、LALR(1)文法之间的关系编译原理第三章习…

JavaSE学习day5_01 方法(也叫函数)

在学习方法之前&#xff0c;我们扩展一点关于数组的知识&#xff0c;就是数组的内存图;先看一张图&#xff1a; 可知一个程序在内存中运行时&#xff0c;内存是划分为几个区的&#xff0c;方法在栈区&#xff0c;看到new这个单词&#xff0c;在创建对象的时候会在内存中开辟一块…

如何做好多项目全生命周期的资源调配,提升资源利用效率?【橙子】

随着产品研发中心各团队承接的研发项目数量和规模日趋增加&#xff0c;人均产值和利润目标逐步提升&#xff0c;人均承接的项目数量也逐渐增加&#xff0c;目前缺乏合理的研发资源管理方案&#xff0c;存在多项目研发过程中资源冲突及部分项目研发人员忙闲不均等现象&#xff0…

微电影行业痛点解决方案

在当下新媒体时代&#xff0c;微电影作为“微文化”的载体&#xff0c;具有“微”的特点&#xff0c;经过短短数年的快速发展&#xff0c;并获得了受众广泛的关注和喜爱&#xff0c;对人们的休闲娱乐方式也产生较大的影响。但在迅猛发展的同时也存在一些行业痛点&#xff0c;诸…

第十一天栈与队列

20. 有效的括号力扣题目链接(opens new window)给定一个只包括 (&#xff0c;)&#xff0c;{&#xff0c;}&#xff0c;[&#xff0c;] 的字符串&#xff0c;判断字符串是否有效。有效字符串需满足&#xff1a;左括号必须用相同类型的右括号闭合。左括号必须以正确的顺序闭合。…

【GPLT 三阶题目集】L3-013 非常弹的球

刚上高一的森森为了学好物理&#xff0c;买了一个“非常弹”的球。虽然说是非常弹的球&#xff0c;其实也就是一般的弹力球而已。森森玩了一会儿弹力球后突然想到&#xff0c;假如他在地上用力弹球&#xff0c;球最远能弹到多远去呢&#xff1f;他不太会&#xff0c;你能帮他解…

Liunx--线程池的实现--0208 09

1. 线程池的了解 预先申请线程。线程池维护着多个线程&#xff0c;等待着监督管理者分配可并发执行的任务&#xff0c;这避免了在处理短时间任务时创建与销毁线程的代价。 2.线程池框架 2.1 线程的封装 首先我们需要写线程的构造函数&#xff0c;他的编号是什么&#xff0c;…

NXP iMX8平台上使用imx-gpu-sdk开发

By Toradex胡珊逢Apalis iMX8 计算机模块采用了 NXP 的 i.MX 8 QuadMax 处理器。该处理器具有两个 Vivante GC7000/XSVX 单元&#xff0c;能够支持 OpenCL、OpenVX、OpenGL ES 。本文将介绍如何使用 NXP 提供的 imx-gpu-sdk 编译能够在 Apalis iMX8 运行的 OpenCL 和 OpenCV 应…

Java_Maven:2. maven 构建 SSM 工程

目录 ​​​​​​​ 1 需求 2 准备数据库 3 创建一个 maven 工程 4 知识点准备 4.1 依赖传递 4.2 依赖冲突的解决 4.2.1 依赖调解原则 4.2.2 排除依赖 4.2.3 锁定版本 5 定义 pom.xml 6 Dao 层 6.1 pojo 模型类 6.2 dao 层代码 6.3 配置文件 6.4 单元测试 7 …

软件测试面试准备——(一)Selenium(1)基础问题及自动化测试

滴滴面试&#xff1a;1. 自己负责哪部分功能&#xff1f;农餐对接系统分为了两大子系统&#xff0c;一个是个人订餐系统&#xff0c;二是餐馆、个人与农产品供应商进行农产品交易系统。我主要负责组织测试人员对该系统进行测试。我们测试分为两个阶段&#xff1a;一、功能测试阶…

Http发展历史

1 缘起 有一次&#xff0c;听到有人在议论招聘面试的人员&#xff0c; 谈及应聘人员的知识深度&#xff0c;说&#xff1a;问了一些关于Http的问题&#xff0c;如Http相关结构、网络结构等&#xff0c; 然后又说&#xff0c;问没问相关原理、来源&#xff1f; 我也是有些困惑了…

Spring Boot开发实战——echarts图标填充数据

echarts模块的导入 先看看成品吧&#xff01; 有的图标的数据用了一些计算框架不是直接查数据库所以有点慢。 ok&#xff01;&#x1f603; 上正文&#xff0c;接上节Spring boot项目开发实战——&#xff08;LayUI实现前后端数据交换与定义方法渲染数据&#xff09;讲解了一般…

百度版本gactgpt即将来临,gpt人工智能机器横空出世

百度版本gactgpt即将来临&#xff0c;gpt人工智能机器横空出世&#xff0c;“一言”为定&#xff01;百度版ChatGPT确认&#xff01;李彦宏OKR曝光&#xff0c;率先应用于收索业务 gactCBT 大获&#xff0c;当下极有可能成为人工智能的 iPhone 时刻。为了在这场人工智能竞赛中…

Redis面试知识

概述 Redis 是速度非常快的非关系型(NoSQL)内存键值数据库,可以存储键和五种不同类型的值之间的映射。 键的类型只能为字符串,值支持五种数据类型:字符串、列表、集合、散列表、有序集合。 Redis 支持很多特性,例如将内存中的数据持久化到硬盘中,使用复制来扩展读性能…

解决workman部署到Linux环境无法启动和连接的问题(结合TP6框架)

0、检查Linux是否满足workman的环境要求 curl -Ss www.workerman.net | php看要求的环境是否都是ok。 如果出现&#xff1a; workman Call to undefined function stream_socket_server()解决方案&#xff1a;去PHP的配置文件查找disabled_function&#xff0c;去掉stream_s…

SAP NetWeaver版本和SAP Kernel版本的确定

SAP NetWeaver&#xff08;SAP NW&#xff09;描述了用于“业务启用”的所有软件和服务。SAP业务套件&#xff08;如ERP中央组件&#xff08;ECC&#xff09;或供应商关系管理&#xff08;SRM&#xff09;&#xff09;包含该特定业务解决方案的软件组件。 以下是SAP NetWeaver…

el-table+selet+pagination回显触发selection-change事件,打印的数组出现数据重复问题

目录 一、应用场景 二、问题描述 三、原因分析* 四、解决办法 一、应用场景 1】vue项目 2】el-conversation组件 3】使用el-table组件 4】使用type"select"属性 5】使用selection-change事件 6】使用toggleRowSelection方法 7】混合使用el-pagination组件 二…

《论文阅读》Towards Emotional Support Dialog Systems

《论文阅读》Towards Emotional Support Dialog Systems 前言简介思路出发点相关知识区别EC、ER和ESCEmotional Support Conversation任务定义ESC框架数据集总结前言 你是否也对于理解论文存在困惑? 你是否也像我之前搜索论文解读,得到只是中文翻译的解读后感到失望? 小白…

页表与线程学习

线程 线程(TCB)是进程(PCB)的基本单位。 linux认为没有进程&#xff0c;没有线程在概念上的区分&#xff0c;只有一个叫做执行流。这句话指明了都是PCB。 Linux的线程是用进程(PCB)模拟的. 这样做的好处 不用在单独设计TCB。不用维护TCB和PCB之间的关系。不用单独编写任何调度…