|
![](static/image/common/ico_lz.png)
楼主 |
发表于 2012-1-4 17:57:13
|
显示全部楼层
****************************************************************************/
void ili9320_SetPoint(u16 x,u16 y,u16 point)
{
if ( (x>320)||(y>240) ) return;
ili9320_SetCursor(x,y);
ClrCs;
LCD_WriteCommand(0x0022);
LCD_WriteRAM(point);
SetCs;
}
/* 设置像素点 颜色,X,Y */
void rt_hw_lcd_set_pixel(const char* pixel, int x, int y)
{
if ( (x>320)||(y>240) ) return;
ili9320_SetCursor(x,y);
ClrCs;
LCD_WriteCommand(0x0022);
LCD_WriteRAM(*pixel);
SetCs;
}
/* 获取像素点颜色 */
void rt_hw_lcd_get_pixel(char* pixel, int x, int y)
{
u16 temp;
LCD_WriteReg(x,y);
ClrCs;
LCD_WriteCommand(0x0022);
temp = LCD_ReadRAM(); //dummy
temp = LCD_ReadRAM();
SetCs;
// p=ili9320_BGR2RGB(temp);
*(rt_uint16_t*)pixel = temp;
}
/* 画水平线 */
void rt_hw_lcd_draw_hline(const char* pixel, int x1, int x2, int y)
{
while (x1 < x2)
{
ili9320_SetCursor(x1,y);
ClrCs;
LCD_WriteCommand(0x0022);
LCD_WriteRAM(*pixel);
SetCs;
x1++;
}
}
/* 垂直线 */
void rt_hw_lcd_draw_vline(const char* pixel, int x, int y1, int y2)
{
while (y1 < y2)
{
ili9320_SetCursor(x,y1);
ClrCs;
LCD_WriteCommand(0x0022);
LCD_WriteRAM(*pixel);
SetCs;
y1++;
}
}
/* ?? */
void rt_hw_lcd_draw_blit_line(const char* pixels, int x, int y, rt_size_t size)
{
rt_uint16_t *ptr;
ptr = (rt_uint16_t*)pixels;
if ( (x>320)||(y>240) ) return;
ili9320_SetCursor(x,y);
ClrCs;
LCD_WriteCommand(0x0022);
while (size)
{
LCD_WriteRAM(*ptr ++);
size --;
}
SetCs;
} |
|