資源簡介
包含R61509V.c和.h兩個文件

代碼片段和文件信息
#include?“type_def.h“
#include?“SD.h“
#include?“FAT32.h“
#include?“R61905V.h“
#include?“gui.h“
#include?“ASCII(8x16).h“
#include?“ASCII(12x24).h“
//#include?“ASCII(16x32).h“
//#include?“ASCII(20x40).h“
extern?PART_INFO_type?xdata?FAT32_info;
extern?ITEM_INFO_type?xdata?HZK16;
extern?ITEM_INFO_type?xdata?HZK24;
//extern?ITEM_INFO_type?xdata?HZK32;
//extern?ITEM_INFO_type?xdata?HZK40;
//全角字符各字號對應的字符寬度和字模總字節數
u8?code?full_char[2][5]=
{
{81624?32?40} ???//字模寬度
{83272128200} ???//字??傋止潝?br/>};
//半角字符各字號對應的字符寬度、高度和字節總數
u8?code?half_char[2][5]=
{
{4?81216?20} //字模寬度
{8162436?40} //字模高度
//{8164864128} //字??傋止潝?br/>};?
/*******************************************************************************
*?函?數?名:??lcd_paint
*?功????能:??液晶全屏刷屏
*?入口參數:??color刷屏顏色
*?出口參數:??無
*?返?回?值:??無
*******************************************************************************/
void?lcd_paint(u16?color)
{
u8?xy;
lcd_set_window(00239319);
????for(y=160;y>0;y--) ?//液晶總有像素320*240
{
for?(x=240;x>0;x--)
??? {
?????????lcd_write_dat(color); ?
?lcd_write_dat(color);
????}
}
}
/*******************************************************************************/
void?lcd_show_half_char(u16?xu16?yu8?sizeu16?f_coloru16?b_coloru8?pchar)
{
u8?datheightn8i*ppchar;
//size-=1;
pchar-=32;
height=half_char[1][size-1]; ??//取得相應字號的字符高度
lcd_set_window(?x??y??x+half_char[0][size-1]-1??y+half_char[1][size-1]-1?);//得出起點、終點坐標并調用活動窗口函數設置活動窗口
switch?(size-1)
{
case?0:break; //對應1號字,因未建立1號字符字模,故不可用
case?1:ppchar=ASCII_8x16[pchar];break;??//對應2號字,取得相應字號字模頭指針
case?2:ppchar=ASCII_12x24[pchar];break;?//對應3號字,取得相應字號字模頭指針
//case?3:ppchar=ASCII_16x32[pchar];break;?//對應4號字,取得相應字號字模頭指針
//case?4:ppchar=ASCII_20x40[pchar];break;?//對應5號字,取得相應字號字模頭指針
default:return;
}
for(;height>0;height--) ??
{
for(n8=(half_char[0][size-1]>>3);n8>0;n8--) //根據相應字號的字模寬度得出寫8點像素數據的次數
{
dat=*(ppchar++); ?//取得ASCII碼字模數據
for(i=8;i>0;i--) ?//循環8次寫入8點像素
{
if(dat&0x80)
{
lcd_write_dat(f_color);
}
else?
{
lcd_write_dat(b_color);
}
dat<<=1; //移位1準備寫入一下點像素
}
}
if(?half_char[0][size-1]&0x07?) ??//根據字號得出是否存在有無效位的字節
{
dat=*(ppchar++); ??//取得字模數據
for(i=4;i>0;i--) ??//有效像素是4點,寫入4點,丟棄4點
{
if(dat&0x80)
{
lcd_write_dat(f_color);
}
else?
{
lcd_write_dat(b_color);
}
dat<<=1;
}
}
}
}
/*******************************************************************************/
/*
void?lcd_show_half_str(u16?xu16?yu8?sizeu8?*stru16?color)
{
//size-=1;
while(?(*str)!=‘\0‘?) ?//判斷是否到達字符串末尾
{
lcd_show_half_char(xysize*strcolor);???
x+=half_char[0][size-1]; ??
str++; ???
}
}*/
/*******************************************************************************/
/*
void?lcd_show_
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????4782??2013-06-27?09:05??R61905V.c
?????文件????????968??2013-06-28?16:17??gui.h
?????文件????????344??2013-06-27?10:27??R61905V.h
?????文件???????9398??2013-06-28?16:17??gui.c
-----------?---------??----------?-----??----
????????????????15492????????????????????4
- 上一篇:智能車電機驅動模塊
- 下一篇:HIWIN 線性馬達說明書
評論
共有 條評論