这个窗口设置函数怎么使用?大手具体指导下~谢谢!!!
/******************************问题1*********************************************
*函数名:LCD_SetDisplayWindow
*函数说明:设置LCD显示窗口
*输入参数:
* Xpos:X坐标
* Ypos Y坐标
* Height:窗口高度
* Width:窗口宽度
*返回值:无 50h和52h是起点,51h和53h是终点
**************************************************************************************/
void LCD_SetDisplayWindow(uint16_t Xpos, uint16_t Ypos, uint8_t Height, uint16_t Width)
{
if(Xpos >= Height) LCD_WriteReg(0x50, (Xpos - Height + 1));
else LCD_WriteReg(0x50, 0);
LCD_WriteReg(0x51, Xpos);
if(Ypos >= Width) LCD_WriteReg(0x52, (Ypos - Width + 1));
else LCD_WriteReg(0x52, 0);
LCD_WriteReg(0x53, Ypos);
LCD_SetCursor(Xpos, Ypos);
}
************************问题2**********************************
void **(uint16_t x,uint16_t y)
{
int i,j,k;
uint16_t color;
LCD_SetCursor(x,y);
for (i = 0; i < 50; i++) //高
{
for(j=0;j<100;j++) //宽
{
k = i*100+j; //50*100的区域
#if **_x
color = gImage_**[k*2];
//#else
// color = gImage_**[k*2+1]<<8;
#else
color = gImage_**[k*2] | (gImage_**[k*2+1]<<8);
#endif
LCD_WriteRAM_Prepare();
LCD_WriteRAM(color); //颜色代码 写显存,显存地址自动增加
}
y++;
LCD_SetCursor(x, y);
}
}
经过试验发现,color = gImage_**[k*2] | (gImage_**[k*2+1]<<8);(标准的,和我取模的**一样~),color = gImage_**[k*2];和color = gImage_**[k*2+1]<<8; 也有图像,只是颜色不一样~不知道怎么解释这个现象 |