屏的分辨率是320*320,但是用set_position函数去定义起始和结束地址时x的最大值就成了480,也就是我定义set_position(0,0,320,320)时只显示满屏的 一半,而定义set_position(0,0,480,320)时才显示全屏
void DCS_Packet_trans(void)
{
Write_Command(0xB7);
Write_Data(0x43);
Write_Data(0x02);
Write_Command(0xBC);
Write_Data(0x20);
Write_Data(0xb8);
Write_Command(0xBD);
Write_Data(0x0b);
Write_Data(0x00);
Write_Command(0x2C);
}
void GP_COMMAD_PA(unsigned int PA)
{
Write_Command(0xBC);
Write_Data(PA);
Write_Data(PA>>8);
Write_Command(0xBD);
Write_Data(0x00);
Write_Data(0x00);
Write_Command(0xBF);
}
void set_position(unsigned int stx,unsigned int sty,unsigned int endx,unsigned int endy)
{
Write_Command(0xB7);
Write_Data(0x02);
Write_Data(0x01);
GP_COMMAD_PA(5);
Write_Command(0xBF);
Write_Data(0x2A);
Write_Data(stx>>8);
Write_Data(stx&0xff);
Write_Data(endx>>8);
Write_Data(endx&0xff);
GP_COMMAD_PA(5);
Write_Command(0xBF);
Write_Data(0x2B);
Write_Data(sty>>8);
Write_Data(sty&0xff);
Write_Data(endy>>8);
Write_Data(endy&0xff);
Write_Command(0xB7);
Write_Data(0x42);
Write_Data(0x01);
Write_Command(0xBC);
Write_Data(0x01);
Write_Data(0x00);
Write_Command(0xBD);
Write_Data(0x00);
Write_Data(0x00);
Write_Command(0x36);
Write_Data(0x00);
DCS_Packet_trans();
Write_Command(0x2C);
}
|