#include "HW_MCUIO.h"//#include "stm32f4xx_hal.h" #include "dot.h" #include "platform.h" #include "function.h" #include "base_core_user.h" #ifdef LCD_ON /* F4系列速度太快,需要加延时,读写才正常!!!*/ static void lcd_delay(unsigned short dy) { unsigned short i; for(i=0;i=0x61)&&(*pt<=0x7A) ) //小写 rt = &chardot[(*pt-0x61)*16]; else if( (*pt>=0x41)&&(*pt<=0x5A) ) //大写 rt = &chardot[((CHAR_41)+*pt-0x41)*16]; else if( (*pt>=0x30)&&(*pt<=0x39) ) //数字 rt = &chardot[((CHAR_30)+*pt-0x30)*16]; else if (*pt==0x20)//空格 rt = &chardot[(CHAR_20)*16]; else if (*pt==0x2D)//-中杠 rt = &chardot[(CHAR_2D)*16]; else if (*pt==0x5F)//_下杠 rt = &chardot[(CHAR_5F)*16]; else if (*pt==0x2E)//. rt = &chardot[(CHAR_2E)*16]; else if (*pt==0x3A)//: rt = &chardot[(CHAR_3A)*16]; else //出错时,显示空格(空白) rt = &chardot[(CHAR_20)*16]; return rt; } #define CHAR_16x8 1 #define CHAR_16x8_MIDLINE 2 #define CHIN_12x12 3 #define CHIN_16x16 4 /* * */ static unsigned char display_char_chinese(unsigned short x,unsigned short y, unsigned char char_type, const unsigned char *chr, unsigned char len, unsigned char reverse) { unsigned char i,j,*pt; switch(char_type){ case CHAR_16x8: for(j=0;;j++){ if( chr[j] ==0x00 )break; pt =get_string_table(chr+j); //写一个字符 lcd_set_cursor_position(x+j*8,y); for(i=0;i<8;i++) lcd_write_data( (reverse==0)?pt[i]:~pt[i] ); lcd_set_cursor_position(x+j*8,y+1); for(i=0;i<8;i++) lcd_write_data( (reverse==0)?pt[i+8]:~pt[i+8] ); }//for break; case CHAR_16x8_MIDLINE://特殊处理:下划线代替中划线 for(j=0;;j++){ if( chr[j] ==0x00 )break; pt =get_string_table(chr+j); //写一个字符 lcd_set_cursor_position(x+j*8,y); for(i=0;i<8;i++) lcd_write_data( (reverse==0)?pt[i]:~pt[i] ); lcd_set_cursor_position(x+j*8,y);//lcd_set_cursor_position(x+j*8,y+1); for(i=0;i<8;i++) lcd_write_data( (reverse==0)?pt[i+8]:~pt[i+8] ); }//for break; #if 0 case CHIN_12x12: for(j=0;j