?? dsplcd.c
字號(hào):
#include "DSP28_Deceive.h"
#define uchar unsigned char
#define uint unsigned int
const uchar time_num = 10; //有十個(gè)顯示的數(shù)0到9
const uchat time_data = 6; // 時(shí)間顯示個(gè)數(shù),時(shí),分,秒
const uchar time_line = 16;
const uchar time_row = 1;
const uint start_row = 50;
const uchar start_line= 50;
const uchar white = 0xFE;
const uchar blue = 0x02;
const uchar yellow = 0xFA;
const uchar time_buf[time_data] = {1,2,3,4,0,0}
const uchar times[time_num][time_line*time_row]={
/*-- 文字: 0 --*/
/*-- 宋體12; 此字體下對(duì)應(yīng)的點(diǎn)陣為:寬x高=8x16 --*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xBC,0x65,0xED,0x00,0xBC,0x65,0xED,0x00},
/*-- 文字: 1 --*/
/*-- 宋體12; 此字體下對(duì)應(yīng)的點(diǎn)陣為:寬x高=8x16 --*/
{0x00,0x00,0x00,0x10,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00},
/*-- 文字: 2 --*/
/*-- 宋體12; 此字體下對(duì)應(yīng)的點(diǎn)陣為:寬x高=8x16 --*/
{0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x04,0x04,0x08,0x10,0x20,0x42,0x7E,0x00,0x00},
/*-- 文字: 3 --*/
/*-- 宋體12; 此字體下對(duì)應(yīng)的點(diǎn)陣為:寬x高=8x16 --*/
{0x00,0x00,0x00,0x3C,0x42,0x42,0x04,0x18,0x04,0x02,0x02,0x42,0x44,0x38,0x00,0x00},
/*-- 文字: 4 --*/
/*-- 宋體12; 此字體下對(duì)應(yīng)的點(diǎn)陣為:寬x高=8x16 --*/
{0x00,0x00,0x00,0x04,0x0C,0x14,0x24,0x24,0x44,0x44,0x7E,0x04,0x04,0x1E,0x00,0x00},
/*-- 文字: 5 --*/
/*-- 宋體12; 此字體下對(duì)應(yīng)的點(diǎn)陣為:寬x高=8x16 --*/
{0x00,0x00,0x00,0x7E,0x40,0x40,0x40,0x58,0x64,0x02,0x02,0x42,0x44,0x38,0x00,0x00},
/*-- 文字: 6 --*/
/*-- 宋體12; 此字體下對(duì)應(yīng)的點(diǎn)陣為:寬x高=8x16 --*/
{0x00,0x00,0x00,0x1C,0x24,0x40,0x40,0x58,0x64,0x42,0x42,0x42,0x24,0x18,0x00,0x00},
/*-- 文字: 7 --*/
/*-- 宋體12; 此字體下對(duì)應(yīng)的點(diǎn)陣為:寬x高=8x16 --*/
{0x00,0x00,0x00,0x7E,0x44,0x44,0x08,0x08,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00},
/*-- 文字: 8 --*/
/*-- 宋體12; 此字體下對(duì)應(yīng)的點(diǎn)陣為:寬x高=8x16 --*/
{0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x24,0x18,0x24,0x42,0x42,0x42,0x3C,0x00,0x00},
/*-- 文字: 9 --*/
/*-- 宋體12; 此字體下對(duì)應(yīng)的點(diǎn)陣為:寬x高=8x16 --*/
{0x00,0x00,0x00,0x18,0x24,0x42,0x42,0x42,0x26,0x1A,0x02,0x02,0x24,0x38,0x00,0x00},
};
const baseData time_all[time_data] = {
{blue,white,start_row,start_line,time_row,time_line,&time_buf[time_data-1]},
{blue,white,start_row+time_row,start_line,time_row,time_line,&time_buf[time_data-2]},
{blue,white,start_row+2*time_row,start_line,time_row,time_line,&time_buf[time_data-3]},
{blue,white,start_row+3*time_row,start_line,time_row,time_line,&time_buf[time_data-4]},
{blue,white,start_row+4*time_row,start_line,time_row,time_line,&time_buf[time_data-5]},
{blue,white,start_row+5*time_row,start_line,time_row,time_line,&time_buf[time_data-6]},
};
void time_display(baseData *point)
{
uchar i = 0;
uchar x_clum = 0;
uchar y_line = 0;
uchar *p = ×[*(point->point_time)][0];
time_clear(point);
for(i = 0;i<time_data;++i,++point)
{
CMD_CS();
*CMD = 0X04;
DAT_CS();
*DAT = point->background_color;
CMD_CS();
*CMD = 0X02;
DAT_CS();
*DAT = point->foreground_color;
CMD_CS();
*CMD = 0x01;
for(y_line = 0;y_line < point->lengh;++y_line)
{
X_ADDR_CS();
*X_ADDR = (point->x_cdinate/256);
*X_ADDR = (point->x_cdinate%256);
Y_ADDR_CS();
*Y_ADDR = point->y_cdinate + y_line;
for(x_clum = 0;x_clum < point->wide;++x_clum,++p)
{
DAT_CS();
*DAT = *p;
}
}
}
}
void time_clear(baseData *point_clear)
{
uchar x_clum = 0;
uchar y_line = 0;
CMD_CS();
*CMD = 0X04;
DAT_CS();
*DAT = point_clear->background_color;
CMD_CS();
*CMD = 0x00;
for(y_line = 0;y_line < time_line;++y_line)
{
X_ADDR_CS();
*X_ADDR = (point_clear->x_cdinate/256);
*X_ADDR = (point_clear->x_cdinate%256);
Y_ADDR_CS();
*Y_ADDR = point_clear->y_cdinate;
DAT_CS();
for(x_clum = 0;x_clum < time_row;++x_clum)
{
*DAT = white;
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -