- /**
- * 函数功能: 在 LCD 显示器上显示一个英文字符
- * 输入参数: usX:在特定扫描方向下字符的起始X坐标
- * usY :在特定扫描方向下该点的起始Y坐标
- * cChar :要显示的英文字符
- * usColor_Background :选择英文字符的背景色
- * usColor_Foreground :选择英文字符的前景色
- * font:字体选择
- * 可选值:FONT_16 :16号字体
- * FONT_24 :24号字体
- * 返 回 值: 无
- * 说 明:该函数必须与ascii.h内容对应使用
- */
- void LCD_DispChar_EN_Transparent(uint16_t usX,uint16_t usY,const char cChar,
- uint16_t usColor_Background,uint16_t usColor_Foreground,
- uint8_t transparent,USB_FONT_Typdef font)
- {
- uint8_t ucTemp, ucRelativePositon, ucPage, ucColumn;
- uint16_t i,j;
-
- /* 检查输入参数是否合法 */
- assert_param(IS_FONT(font));
-
- ucRelativePositon = cChar - ' ';
-
- if(font==USB_FONT_16)
- {
- for(j=0;j<16;++j)
- {
- for(i=0;i<8;++i)
- {
- LCD_SetCursor(usX+i,usY+j);
- bk_color[8*j+i]=LCD_Read_PixelData();
- }
- }
- LCD_OpenWindow(usX,usY,8,16);
- LCD_WRITE_CMD(0x2C);
-
- for(i=0,ucPage=0;ucPage<16;ucPage++)
- {
- ucTemp=ucAscii_1608[ucRelativePositon][ucPage];
- for(ucColumn=0;ucColumn<8;ucColumn++)
- {
- if(ucTemp&0x01)
- LCD_WRITE_DATA(usColor_Foreground);
- else if(transparent)
- LCD_WRITE_DATA(bk_color[i]);
- else
- LCD_WRITE_DATA(usColor_Background);
- ++i;
- ucTemp >>= 1;
- }
- }
- }
- else
- {
- for(j=0;j<24;++j)
- {
- for(i=0;i<12;++i)
- {
- LCD_SetCursor(usX+i,usY+j);
- bk_color[12*j+i]=LCD_Read_PixelData();
- }
- }
- LCD_OpenWindow(usX,usY,12,24);
- LCD_WRITE_CMD(0x2C);
-
- for(i=0,ucPage=0;ucPage<48;ucPage++)
- {
- ucTemp=ucAscii_2412[ucRelativePositon][ucPage];
- for(ucColumn=0;ucColumn<8;ucColumn++)
- {
- if(ucTemp&0x01)
- LCD_WRITE_DATA(usColor_Foreground);
- else if(transparent)
- LCD_WRITE_DATA(bk_color[i]);
- else
- LCD_WRITE_DATA(usColor_Background);
- ++i;
- ucTemp >>= 1;
- }
- ucPage++;
- ucTemp=ucAscii_2412[ucRelativePositon][ucPage];
- /* 只显示前面4个位,与前面8位总共12位 */
- for(ucColumn=0;ucColumn<4;ucColumn++)
- {
- if(ucTemp&0x01)
- LCD_WRITE_DATA(usColor_Foreground);
- else if(transparent)
- LCD_WRITE_DATA(bk_color[i]);
- else
- LCD_WRITE_DATA(usColor_Background);
- ++i;
- ucTemp >>= 1;
- }
- }
- }
- }
- /**
- * 函数功能: 在 LCD 显示器上显示英文字符串
- * 输入参数: usX:在特定扫描方向下字符的起始X坐标
- * usY :在特定扫描方向下该点的起始Y坐标
- * pStr :要显示的英文字符串的首地址
- * usColor_Background :选择英文字符的背景色
- * usColor_Foreground :选择英文字符的前景色
- * font:字体选择
- * 可选值:FONT_16 :16号字体
- * FONT_24 :24号字体
- * 返 回 值: 无
- * 说 明:该函数必须与ascii.h内容对应使用
- */
- void LCD_DispString_EN_Transparent(uint16_t usX,uint16_t usY,const char * pstr,
- uint16_t usColor_Background, uint16_t usColor_Foreground,
- uint8_t transparent,USB_FONT_Typdef font)
- {
- /* 检查输入参数是否合法 */
- assert_param(IS_FONT(font));
-
- while(*pstr != '\0')
- {
- if(font==USB_FONT_16)
- {
- if((usX+8)>LCD_DEFAULT_WIDTH)
- {
- usX = 0;
- usY += 16;
- }
- if((usY+16)>LCD_DEFAULT_HEIGTH)
- {
- usX=0;
- usY=0;
- }
- LCD_DispChar_EN_Transparent(usX,usY,*pstr,usColor_Background,usColor_Foreground,transparent,USB_FONT_16);
- pstr++;
- usX+=8;
- }
- else
- {
- if((usX+12)>LCD_DEFAULT_WIDTH)
- {
- usX=0;
- usY+=24;
- }
- if((usY+24)>LCD_DEFAULT_HEIGTH)
- {
- usX=0;
- usY=0;
- }
- LCD_DispChar_EN_Transparent(usX,usY,*pstr,usColor_Background,usColor_Foreground,transparent,USB_FONT_24);
- pstr++;
- usX+=12;
- }
- }
- }
- /**
- * 函数功能: 在 LCD 显示器上显示一个中文
- * 输入参数: usX:在特定扫描方向下字符的起始X坐标
- * usY :在特定扫描方向下该点的起始Y坐标
- * pstr: 汉字字符低字节码
- * usColor_Background :选择英文字符的背景色
- * usColor_Foreground :选择英文字符的前景色
- * font:字体选择
- * 可选值:FONT_16 :16号字体
- * FONT_24 :24号字体
- * 返 回 值: 无
- * 说 明:无
- */
- void LCD_Disp_CH_Transparent(uint16_t usX,uint16_t usY,const uint8_t *pstr,
- uint16_t usColor_Background, uint16_t usColor_Foreground,
- uint8_t transparent,USB_FONT_Typdef font)
- {
- uint8_t ucTemp, ucPage, ucColumn;
- uint8_t gbk_buffer[72];
- uint16_t i,j;
-
- /* 检查输入参数是否合法 */
- assert_param(IS_FONT(font));
-
- if(font==USB_FONT_16)
- {
- for(j=0;j<16;++j)
- {
- for(i=0;i<16;++i)
- {
- LCD_SetCursor(usX+i,usY+j);
- bk_color[16*j+i]=LCD_Read_PixelData();
- }
- }
-
- LCD_OpenWindow(usX,usY,16,16);
- LCD_WRITE_CMD(0x2C);
- #if USB_SPIFLASH_CH==1
- GetGBKCode_SPIFLASH(gbk_buffer,pstr,USB_FONT_16);
- #else
- GetGBKCode_SD(gbk_buffer,pstr,FONT_16);
- #endif
- for(i=0,ucPage=0;ucPage<32;ucPage++)
- {
- ucTemp=gbk_buffer[ucPage];
- for(ucColumn=0;ucColumn<8;ucColumn++)
- {
- if(ucTemp&0x01)
- LCD_WRITE_DATA(usColor_Foreground);
- else if(transparent)
- LCD_WRITE_DATA(bk_color[i]);
- else
- LCD_WRITE_DATA(usColor_Background);
- ++i;
- ucTemp >>= 1;
- }
- }
- }
- else
- {
- for(j=0;j<24;++j)
- {
- for(i=0;i<24;++i)
- {
- LCD_SetCursor(usX+i,usY+j);
- bk_color[24*j+i]=LCD_Read_PixelData();
- }
- }
-
- LCD_OpenWindow(usX,usY,24,24);
- LCD_WRITE_CMD(0x2C);
- #if USB_SPIFLASH_CH==1
- GetGBKCode_SPIFLASH(gbk_buffer,pstr,USB_FONT_24);
- #else
- GetGBKCode_SD(gbk_buffer,pstr,FONT_24);
- #endif
-
- for(i=0,ucPage=0;ucPage<72;ucPage++)
- {
- ucTemp=gbk_buffer[ucPage];
- for(ucColumn=0;ucColumn<8;ucColumn++)
- {
- if(ucTemp&0x01)
- LCD_WRITE_DATA(usColor_Foreground);
- else if(transparent)
- LCD_WRITE_DATA(bk_color[i]);
- else
- LCD_WRITE_DATA(usColor_Background);
- ++i;
- ucTemp >>= 1;
- }
- }
- }
- }
- /**
- * 函数功能: 在 LCD 显示器上显示一串中文
- * 输入参数: usX:在特定扫描方向下字符的起始X坐标
- * usY :在特定扫描方向下该点的起始Y坐标
- * pstr: 汉字字符低字节码
- * usColor_Background :选择英文字符的背景色
- * usColor_Foreground :选择英文字符的前景色
- * font:字体选择
- * 可选值:FONT_16 :16号字体
- * FONT_24 :24号字体
- * 返 回 值: 无
- * 说 明:无
- */
- void LCD_DispString_CH_Transparent(uint16_t usX,uint16_t usY,const uint8_t *pstr,
- uint16_t usColor_Background, uint16_t usColor_Foreground,
- uint8_t transparent,USB_FONT_Typdef font)
- {
- /* 检查输入参数是否合法 */
- assert_param(IS_FONT(font));
-
- while(*pstr != '\0')
- {
- if(font==USB_FONT_16)
- {
- if((usX+16)>LCD_DEFAULT_WIDTH)
- {
- usX = 0;
- usY += 16;
- }
- if((usY+16)>LCD_DEFAULT_HEIGTH)
- {
- usX=0;
- usY=0;
- }
- LCD_Disp_CH_Transparent(usX,usY,pstr,usColor_Background,usColor_Foreground,transparent,USB_FONT_16);
- pstr+=2;
- usX+=16;
- }
- else
- {
- if((usX+24)>LCD_DEFAULT_WIDTH)
- {
- usX = 0;
- usY += 24;
- }
- if((usY+24)>LCD_DEFAULT_HEIGTH)
- {
- usX=0;
- usY=0;
- }
- LCD_Disp_CH_Transparent(usX,usY,pstr,usColor_Background,usColor_Foreground,transparent,USB_FONT_24);
- pstr+=2;
- usX+=24;
- }
- }
- }
- /**
- * 函数功能: 在 LCD 显示器上显示一串中英文
- * 输入参数: usX:在特定扫描方向下字符的起始X坐标
- * usY :在特定扫描方向下该点的起始Y坐标
- * pstr: 汉字字符低字节码
- * usColor_Background :选择英文字符的背景色
- * usColor_Foreground :选择英文字符的前景色
- * font:字体选择
- * 可选值:FONT_16 :16号字体
- * FONT_24 :24号字体
- * 返 回 值: 无
- * 说 明:无
- */
- void LCD_DispString_EN_CH_Transparent(uint16_t usX,uint16_t usY,const uint8_t *pstr,
- uint16_t usColor_Background, uint16_t usColor_Foreground,
- uint8_t transparent,USB_FONT_Typdef font)
- {
- /* 检查输入参数是否合法 */
- assert_param(IS_FONT(font));
-
- while(*pstr != '\0')
- {
- if(*pstr<=0x7f)
- {
- if(font==USB_FONT_16)
- {
- if((usX+8)>LCD_DEFAULT_WIDTH)
- {
- usX = 0;
- usY += 16;
- }
- if((usY+16)>LCD_DEFAULT_HEIGTH)
- {
- usX=0;
- usY=0;
- }
- LCD_DispChar_EN_Transparent(usX,usY,*pstr,usColor_Background,usColor_Foreground,transparent,USB_FONT_16);
- pstr++;
- usX+=8;
- }
- else
- {
- if((usX+12)>LCD_DEFAULT_WIDTH)
- {
- usX=0;
- usY+=24;
- }
- if((usY+24)>LCD_DEFAULT_HEIGTH)
- {
- usX=0;
- usY=0;
- }
- LCD_DispChar_EN_Transparent(usX,usY,*pstr,usColor_Background,usColor_Foreground,transparent,USB_FONT_24);
- pstr++;
- usX+=12;
- }
- }
- else
- {
- if(font==USB_FONT_16)
- {
- if((usX+16)>LCD_DEFAULT_WIDTH)
- {
- usX = 0;
- usY += 16;
- }
- if((usY+16)>LCD_DEFAULT_HEIGTH)
- {
- usX=0;
- usY=0;
- }
- LCD_Disp_CH_Transparent(usX,usY,pstr,usColor_Background,usColor_Foreground,transparent,USB_FONT_16);
- pstr+=2;
- usX+=16;
- }
- else
- {
- if((usX+24)>LCD_DEFAULT_WIDTH)
- {
- usX = 0;
- usY += 24;
- }
- if((usY+24)>LCD_DEFAULT_HEIGTH)
- {
- usX=0;
- usY=0;
- }
- LCD_Disp_CH_Transparent(usX,usY,pstr,usColor_Background,usColor_Foreground,transparent,USB_FONT_24);
- pstr+=2;
- usX+=24;
- }
- }
- }
- }