大佬些 帮忙解释一下这些函数的 意思,跪谢!,#include <absacc.h>
#include <intrins.h>
#include <stdio.h>
#include <string.h>
#define TP_enable 1
#include “ASCLL_CHAR.h”
#include “read_write_control.h”
#include “7789S_init.h”
//#include “TP.h”
#include “photo.h”
//#include “ID_error.h”
sbit KEY4=P1^4;
sbit KEY3=P1^5;
sbit KEY2=P1^6;// sfr CLK_DIV=0X97;
uchar one=0,two=0,three=0,four=0;//计算十六进制数组
//*********************************************************
void set_windows_x(uint x_strat_add,uint x_end_add)
{
write_comm(0x2A);
write_data(x_strat_add>>8);
write_data(x_strat_add&0xFF);
write_data(x_end_add>>8);
write_data(x_end_add&0xFF);
}
void set_windows_y(uint y_strat_add,uint y_end_add)
{
write_comm(0x2B);
write_data(y_strat_add>>8);
write_data(y_strat_add&0x00FF);
write_data(y_end_add>>8);
write_data(y_end_add&0x00FF);
}
//*****************************灰阶
void display_gray()
{uint gray=0;
unsigned char up,DOWN,x,i;
set_windows_x(0x0000,0x00eF); //set windows to 128
set_windows_y(0x0000,0x0013F); //set windows to 160
write_comm(0x2C);
CS1=0;
for(up=0;up<160;up++)//1.44 64
{ for(i=0;i<16;i++)
{for(x=0;x<15;x++)
{
// write_data(gray); //serial enable high 8bit
display_only(gray>>8,gray);
// display_sixten(gray);
}
gray+=0x1082;
}
gray=0;
}
/********************************************/
for(DOWN=0;DOWN<50;DOWN++)//1.44 21
{
for(x=0;x<120;x++)
{ // write_data(0xff); //serial enable high 8bit
display_sixten(0xFFFF);
//write_data(0xff),write_data(0xff);
}
for(x=0;x<120;x++)
{
//write_data(0); //serial enable high 8bit
display_sixten(0X0000);
//write_data(0x00),write_data(0x00);
}
}
for(DOWN=0;DOWN<60;DOWN++)//1.44 22
{
for(x=0;x<30;x++)
{
// write_data(0xff); //serial enable high 8bit
display_sixten(0xFFFF);
//write_data(0xFF),write_data(0xFF);
}
for(x=0;x<60;x++)
{ // write_data(0xEF); //serial enable high 8bit
display_sixten(0xEF7D);
}
for(x=0;x<30;x++)
{
display_sixten(0xFFFF);
//write_data(0xff),write_data(0xff);
}
for(x=0;x<30;x++)
{
display_sixten(0x0000);
//write_data(0x00),write_data(0x00);
}
for(x=0;x<60;x++)
{
display_sixten(0x1082);
//write_data(0x10),write_data(0x82);
}
for(x=0;x<30;x++)
{
display_sixten(0x0000);
//write_data(0x00),write_data(0x00);
}
}
for(DOWN=0;DOWN<50;DOWN++) //1.44 21
{
for(x=0;x<120;x++)
{
display_sixten(0xFFFF);
//write_data(0xff),write_data(0xff);
}
for(x=0;x<120;x++)
{
display_sixten(0x0000);
// write_data(0x00),write_data(0x00);
}
}
CS1=1;
}
void row_32gray()
{ uchar i;
uint gray=0,y;
write_comm(0x2c);
for(i=0;i<32;i++)
{ for(y=0;y<2400;y++)
display_sixten(gray);
gray+=0x0841;
}
gray=0;
}
//**************************************************//
void column_32gray()
{uint gray=0;
unsigned char up,x,i;
write_comm(0x2C);
for(up=0;up<160;up++)//1.44 64
{ for(i=0;i<30;i++)
{for(x=0;x<8;x++)
display_sixten(gray);
gray+=0x0841;
}
gray=0;
}
gray=0xffff;
for(up=0;up<160;up++)//1.44 64
{ for(i=0;i<30;i++)
{ for(x=0;x<8;x++)
display_sixten(gray);
gray-=0x0841;
}
gray=0xffff;
}
gray=0;
}
//***************************************************
void display_char() // .
{ uchar code display_error_char[]=”ID OK”;//字符串
uchar code display_ID[]=”ID: “;
uint char_number,r_char,j,k,x=0,y=0;
uchar control,count_char=0,l;
uchar read_ascii_char[16];
uchar table[13];
char_number=strlen(display_error_char); //计算char的个数
for(control=0;control<char_number;control++)
{ r_char=(unsigned int)(display_error_char[control])*16;//计算char的首地址
if(count_char==21)
{ y+=16;
x=0;
count_char=0;
}
for(j=0;j<16;j++) //8bit*16char
{
read_ascii_char[j]=ASCII[r_char+j];
}
set_windows_x(1+x,x+8);
set_windows_y(1+y,y+16);
write_comm(0x2c);
for(k=0;k<16;k++)
{ for(l=0;l<8;l++)
{
if(read_ascii_char[k]&(0x80>>l))
display_sixten(0x001F);
else
display_sixten(0x0000);
}
}
x+=8;
count_char++;
}
count_char=0;
x=0;y=0;
char_number=strlen(display_ID); //计算char的个数
for(control=0;control<char_number;control++)
{ r_char=(unsigned int)(display_ID[control])*16;//计算char的首地址
if(count_char==21)
{ y+=16;
x=0;
count_char=0;
}
for(j=0;j<16;j++) //8bit*16char
{
read_ascii_char[j]=ASCII[r_char+j];
}
set_windows_x(1+x,x+8);
set_windows_y(49+y,y+64);
write_comm(0x2c);
for(k=0;k<16;k++)
{ for(l=0;l<8;l++)
{
if(read_ascii_char[k]&(0x80>>l))
display_sixten(0x001F);
else
display_sixten(0x0000);
}
}
x+=8;
count_char++;
}
//**********************************************************
count_char=0;
x=0;y=0;
table[0]=’0′;
table[1]=’x’;
table[2]=asc_table[r_data[1]>>4];
table[3]=asc_table[r_data[1]&0x0f];
table[4]=’ ‘;
table[5]=’0′;
table[6]=’x’;
table[7]=asc_table[r_data[2]>>4];
table[8]=asc_table[r_data[2]&0x0F];
for(control=0;control<9;control++)
{ r_char=(unsigned int)(table[control])*16;//计算char的首地址
if(count_char==21)
{ y+=16;
x=0;
count_char=0;
}
for(j=0;j<16;j++) //8bit*16char
{
read_ascii_char[j]=ASCII[r_char+j];
}
set_windows_x(26+x,x+33);
set_windows_y(49+y,y+65);
write_comm(0x2c);
for(k=0;k<16;k++)
{ for(l=0;l<8;l++)
{
if(read_ascii_char[k]&(0x80>>l))
display_sixten(0xF800);
else
display_sixten(0x0000);
}
}
x+=8;
count_char++;
}
//*******************************************************//
count_char=0;
x=0;y=0;
table[9]=’0′;
table[10]=’x’;
table[11]=asc_table[r_data[3]>>4];
table[12]=asc_table[r_data[3]&0x0F];
for(control=9;control<13;control++)
{ r_char=(unsigned int)(table[control])*16;//计算char的首地址
if(count_char==21)
{ y+=16;
x=0;
count_char=0;
}
for(j=0;j<16;j++) //8bit*16char
{
read_ascii_char[j]=ASCII[r_char+j];
}
set_windows_x(26+x,x+33);
set_windows_y(66+y,y+82);
write_comm(0x2c);
for(k=0;k<16;k++)
{ for(l=0;l<8;l++)
{
if(read_ascii_char[k]&(0x80>>l))
display_sixten(0xF800);
else
display_sixten(0x0000);
}
}
x+=8;
count_char++;
}
count_char=0;
}
//***********************************************888
void display_photo()
{ uint j,k;
uint x,y,l=0,n=0;
set_windows_x(0,239); //set windows to 120
set_windows_y(0,319); //set windows to 160
write_comm(0xc6);
write_data(0x02);
write_comm(0x2C);
CS1=0;
for(y=0;y<80;y++)
{
for(x=0;x<120;x++)
{
display_only(0x00,0x00);
}
for(x=0;x<120;x++)
{
display_only(0x00,0x00);
}
}
for(y=0;y<160;y++)
{
for(x=0;x<120;x++)
{
display_only(photo1[y*240+l],photo1[y*240+l+1]);
l=l+2;
}
for(x=0;x<120;x++)
{
display_only(photo1[y*240+j],photo1[y*240+j+1]);
j=j+2;}
l=0;j=0;
}
for(y=0;y<80;y++)
{
for(x=0;x<120;x++)
{
display_only(0x00,0x00);
}
for(x=0;x<120;x++)
{
display_only(0x00,0x00);
}
}
CS1=1;
}
//void display_photo()
//{ uchar j,k;
// uint x,y,l=0,n=0;
// set_windows_x(0x0000,0x00eF); //set windows to 128
// set_windows_y(0x0000,0x0013F); //set windows to 160
// for(j=0;j<2;j++)
// { for(k=0;k<2;k++)
// {
// set_windows_x(0+l,l+119); //set windows to 120
// set_windows_y(0+n,n+159); //set windows to 160
// write_comm(0x2C);
// for(y=0;y<160;y++)
// for(x=0;x<240;x++)
// {
// display_only(photo1[y*240+x],photo1[y*240+x+1]);
// x++;}
// l+=120;
// }
// l=0;
// n+=160;
// }
// }
//************************************************************************
void display_bar_rgb()
{ uchar i;
uint colour,j=0;
uint *temp;
temp=colournum;
set_windows_x(0x0000,0x00eF); //set windows to 128
set_windows_y(0x0000,0x0013F); //set windows to 160
write_comm(0x2C);
for(j=0;j<106;j++)
for(i=0;i<240;i++)
{
display_only(0xf8,0x00);
}
for(j=0;j<106;j++)
for(i=0;i<240;i++)
{
display_only(0x07,0xe0);
}
for(j=0;j<108;j++)
for(i=0;i<240;i++)
{
display_only(0x00,0x1F);
}
}
void display_w()
{
uint i,k;
set_windows_x(0x0000,0x00eF); //set windows to 128
set_windows_y(0x0000,0x0013F); //set windows to 160
write_comm(0x2C);
for(i=0;i<320;i++)
{ for(k=0;k<240;i++)
display_sixten(0x2945); }
}
//*********************************
void display_temp(uchar vcom)
{ uint count1,read_char, x1, j,k;//l;//IC_modul;
uchar control;
uint l=0,n=0;
uchar read_ascii_char[16];
uchar table[4];
table[0]=’0′;
table[1]=’x’;
table[2]=asc_table[vcom>>4];
table[3]=asc_table[vcom&0x0f];
// start_y=2;
// set_start_x=5;
// count_x=8;
for(control=0;control<4;control++)
{
read_char=(unsigned int)(table[control])*16;
if(l==160)
{n+=16;
l=0;
}
for(j=0;j<16;j++) //8bit*16char
{
read_ascii_char[j]=ASCII[read_char+j];
}
set_windows_x(2+l,l+9);
set_windows_y(5+n,n+20);
write_comm(0x2c);
for(k=0;k<16;k++)
{
for(x1=0;x1<8;x1++)
{
if(read_ascii_char[k]&(0x80>>x1))
display_sixten(0xf800);
else
display_sixten(0x0000);
}
}
l+=8;
}
}
//**************888888888
void display_point(uint x,uint y,uint colour)
{
set_windows_x(x,x);
set_windows_y(y,y);
write_comm(0X2C);
display_sixten(colour);
DBL=0xff; DBH=0xff;
}
void display_WHITE()
{
uint i,k;
set_windows_x(0x0000,0x00eF); //set windows to 128
set_windows_y(0x0000,0x0013F); //set windows to 160
write_comm(0x2C);
for(i=0;i<240;i++)
display_only(0x29,0x45);
for(i=0;i<318;i++)//144 plaese set 126,177 plaese set 158
{
display_only(0x29,0x45);
for(k=0;k<238;k++)
display_only(0x29,0x45);
display_only(0x29,0x45);
}
for(i=0;i<240;i++)
display_only(0x29,0x45);
}
void display_r()
{
uint i,k;
set_windows_x(0x0000,0x00eF); //set windows to 128
set_windows_y(0x0000,0x0013F); //set windows to 160
write_comm(0x2C);
for(k=0;k<80;k++)
{ for(k=0;k<2;k++)
{ for(i=0;i<120;i++)
{
display_only(0xf8,0x00);
display_only(0xf8,0x00);
}
}
for(k=0;k<2;k++)
{ for(i=0;i<120;i++)
{display_only(0xf8,0x00);
display_only(0xf8,0x00);
}
}
}
}
void display_charNG() // .
{ uchar code display_error_char[]=”ID NG”;//字符串
uchar code display_ID[]=”ID: “;
uint char_number,r_char,j,k,x=0,y=0;
uchar control,count_char=0,l;
uchar read_ascii_char[16];
uchar table[13];
char_number=strlen(display_error_char); //计算char的个数
for(control=0;control<char_number;control++)
{ r_char=(unsigned int)(display_error_char[control])*16;//计算char的首地址
if(count_char==21)
{ y+=16;
x=0;
count_char=0;
}
for(j=0;j<16;j++) //8bit*16char
{
read_ascii_char[j]=ASCII[r_char+j];
}
set_windows_x(1+x,x+8);
set_windows_y(1+y,y+16);
write_comm(0x2c);
for(k=0;k<16;k++)
{ for(l=0;l<8;l++)
{
if(read_ascii_char[k]&(0x80>>l))
display_sixten(0x001F);
else
display_sixten(0x0000);
}
}
x+=8;
count_char++;
}
count_char=0;
x=0;y=0;
char_number=strlen(display_ID); //计算char的个数
for(control=0;control<char_number;control++)
{ r_char=(unsigned int)(display_ID[control])*16;//计算char的首地址
if(count_char==21)
{ y+=16;
x=0;
count_char=0;
}
for(j=0;j<16;j++) //8bit*16char
{
read_ascii_char[j]=ASCII[r_char+j];
}
set_windows_x(1+x,x+8);
set_windows_y(49+y,y+64);
write_comm(0x2c);
for(k=0;k<16;k++)
{ for(l=0;l<8;l++)
{
if(read_ascii_char[k]&(0x80>>l))
display_sixten(0x001F);
else
display_sixten(0x0000);
}
}
x+=8;
count_char++;
}
//**********************************************************
count_char=0;
x=0;y=0;
table[0]=’0′;
table[1]=’x’;
table[2]=asc_table[r_data[1]>>4];
table[3]=asc_table[r_data[1]&0x0f];
table[4]=’ ‘;
table[5]=’0′;
table[6]=’x’;
table[7]=asc_table[r_data[2]>>4];
table[8]=asc_table[r_data[2]&0x0F];
for(control=0;control<9;control++)
{ r_char=(unsigned int)(table[control])*16;//计算char的首地址
if(count_char==21)
{ y+=16;
x=0;
count_char=0;
}
for(j=0;j<16;j++) //8bit*16char
{
read_ascii_char[j]=ASCII[r_char+j];
}
set_windows_x(26+x,x+33);
set_windows_y(49+y,y+65);
write_comm(0x2c);
for(k=0;k<16;k++)
{ for(l=0;l<8;l++)
{
if(read_ascii_char[k]&(0x80>>l))
display_sixten(0xF800);
else
display_sixten(0x0000);
}
}
x+=8;
count_char++;
}
//*******************************************************//
count_char=0;
x=0;y=0;
table[9]=’0′;
table[10]=’x’;
table[11]=asc_table[r_data[3]>>4];
table[12]=asc_table[r_data[3]&0x0F];
for(control=9;control<13;control++)
{ r_char=(unsigned int)(table[control])*16;//计算char的首地址
if(count_char==21)
{ y+=16;
x=0;
count_char=0;
}
for(j=0;j<16;j++) //8bit*16char
{
read_ascii_char[j]=ASCII[r_char+j];
}
set_windows_x(26+x,x+33);
set_windows_y(66+y,y+82);
write_comm(0x2c);
for(k=0;k<16;k++)
{ for(l=0;l<8;l++)
{
if(read_ascii_char[k]&(0x80>>l))
display_sixten(0xF800);
else
display_sixten(0x0000);
}
}
x+=8;
count_char++;
}
count_char=0;
}
//***********************************************888
void display_f()
{
uint i,k;
set_windows_x(0x0000,0x00eF); //set windows to 128
set_windows_y(0x0000,0x0013F); //set windows to 160
write_comm(0x2C);
for(k=0;k<80;k++)
{ for(k=0;k<2;k++)
{ for(i=0;i<120;i++)
{
display_only(0xf8,0x1f);
display_only(0x07,0xe0);
}
}
for(k=0;k<2;k++)
{ for(i=0;i<120;i++)
{display_only(0x07,0xe0);
display_only(0xf8,0x1f);
}
}
}
}
//******************************//
void display(uint w)
{
uint i,k;
set_windows_x(0x0000,0x00eF); //set windows to 128
set_windows_y(0x0000,0x0013F); //set windows to 160
write_comm(0x2C);
for(k=0;k<320;k++)
{ for(i=0;i<240;i++)
{
display_sixten(w);
}
}
}
void Dispclostall(void)
{ uint COL=240,ROW=320;
unsigned int i,j;
set_windows_x(0,COL-1); //set windows to 128
set_windows_y(0,ROW-1); //set windows to 160
write_comm(0x2C);
for(i=0;i<ROW/5;i++)
{
for(j=0;j<COL;j++)
{ display_only(0x84,0x10);}
}
for(i=0;i<ROW/5;i++)
{
for(j=0;j<COL/3;j++)
{ display_only(0x84,0x10);}
for(j=0;j<(COL/3+COL%3);j++)
{ display_only(0x00,0x00);}
for(j=0;j<COL/3;j++)
{ display_only(0x84,0x10);}
}
for(i=0;i<(ROW/5+ROW%5);i++)
{
for(j=0;j<COL;j++)
{ display_only (0x84,0x10);}
}
for(i=0;i<ROW/5;i++)
{
for(j=0;j<COL/3;j++)
{ display_only(0x84,0x10);}
for(j=0;j<(COL/3+COL%3);j++)
{ display_only(0xFF,0xFF);}
for(j=0;j<COL/3;j++)
{ display_only(0x84,0x10);}
}
for(i=0;i<ROW/5;i++)
{
for(j=0;j<COL;j++)
{ display_only(0x84,0x10);}
}
}
void waitkey(void)
//{
// if( KEY4&1 )
// {delay(10);}
// else
// { while(!KEY4)
// {
// delay(100);
// }
// }
//}
{
if(KEY4)
{
delay(10);
while(KEY4)
{
if(~KEY4)
{
delay(10);
break;
}
else
{
delay(10);
}
}
}
}
//***********************************************
void main()
{ uchar vcom=0x10;
r_datum=1;
IC7789_CM_init();
read_ID(0x04,4);
delay(10);
if((r_data[0]==0X85)&(r_data[1]==0X85)&&(r_data[2]==0X52) )
{
// display_char();
// display_gray();
// display(0xFFFF);
// delay(800);waitkey();delay(800);
// display(0x0000);
// delay(800);waitkey();delay(800);
// display(0x52CD);
// delay(800);waitkey();delay(800);
// Dispclostall();
// display_char2();
// delay(300);waitkey();delay(300);
// delay(300);waitkey();
// display_black();
// delay(300);waitkey();
// display_gray();
// delay(300);waitkey();
// display_bar_rgb();
// delay(300);waitkey();delay(300);
// display_char();
// display_gray();
// delay(800);
// display(0xFFFF);
// delay(300);//waitkey();delay(300);
// display(0x0000);
// delay(300);
// display_char();
// delay(800);waitkey();delay(800);
// delay(2000);//waitkey();delay(300);
// display(0xff9912);
// delay(300);//waitkey();delay(300);
// display(0x2104);
// delay(300);
// display(0x4208);
// delay(300);
display_photo();
delay(800);waitkey();delay(800);
display_black();
}
// else
{
// display(0xF800);
// display_charNG();
}
// while(1);
}
,显示屏的驱动代码。明显不是技术问题而是你自己懒。这样的问题要么自己想办法