高级会员

- 积分
- 506
- 金钱
- 506
- 注册时间
- 2012-10-8
- 在线时间
- 0 小时
|
发表于 2012-11-19 19:13:58
|
显示全部楼层
1. 原子兄的板子我没有用过,给你两个例子吧,一个是RA8875的,
下载地址在这个帖子的97楼,里面有下载
http://www.openedv.com/posts/list/8903.htm
2. 还有个是ili9341
/*
*********************************************************************************************************
* 函 数 名: LCD9341_DrawHLine
* 功能说明: 画水平线 用UCGUI的接口函数
* 形 参: X,Y的坐标和颜色
* 返 回 值: 无
*********************************************************************************************************
*/
void LCD9341_DrawHLine(uint16_t _usX1 , uint16_t _usY1 , uint16_t _usX2 , uint16_t _usColor)
{
uint16_t i;
#if 1
LCD9341_SetDispWin(_usX1, _usY1, _usX2,_usY1);
for (i = 0; i <_usX2-_usX1+1; i++)
{
ILI9341_RAM = _usColor;
}
#else
for (i = _usX1; i <=_usX2; i++)
{
LCD9341_SetPoint(i, _usY1, _usColor);
}
#endif
}
/*
*********************************************************************************************************
* 函 数 名: LCD9341_DrawVLine
* 功能说明: 画垂直平线 用UCGUI的接口函数
* 形 参: X,Y的坐标和颜色
* 返 回 值: 无
*********************************************************************************************************
*/
void LCD9341_DrawVLine(uint16_t _usX1 , uint16_t _usY1 , uint16_t _usY2 , uint16_t _usColor)
{
uint16_t i;
#if 1
LCD9341_SetDispWin(_usX1, _usY1,_usX1,_usY2);
for (i = 0; i <_usY2-_usY1+1; i++)
{
ILI9341_RAM = _usColor;
}
#else
for (i = _usY1; i <=_usY2; i++)
{
LCD9341_SetPoint(_usX1, i, _usColor);
}
#endif
}
/*
*********************************************************************************************************
* 函 数 名: LCD9341_DrawVLine
* 功能说明: 画矩形填充 用UCGUI的接口函数
* 形 参: X,Y的坐标和颜色
* 返 回 值: 无
*********************************************************************************************************
*/
void LCD9341_FillRect(uint16_t _usX1 , uint16_t _usY1 , uint16_t _usX2 , uint16_t _usY2 , uint16_t _usColor)
{
uint32_t n, temp;
LCD9341_SetDispWin(_usX1, _usY1,_usX2,_usY2);
temp = (u32)(_usX2-_usX1+1)*(_usY2 -_usY1+1);
for(n=0; n<temp; n++)
{
ILI9341_RAM =_usColor;
}
}
void DrawBitLine16BPP(int x, int y, U16 const*p, int xsize)
{
LCD_PIXELINDEX Index;
if ((GUI_Context.DrawMode & LCD_DRAWMODE_TRANS)==0)
{
#if 0
for (;xsize > 0; xsize--,x++,p++)
{
LCD9341_SetPoint(x, y, *p);
}
#else
LCD9341_SetDispWin(x, y,x+xsize-1, y);
for (;xsize > 0; xsize--,p++)
{
ILI9341_RAM = *p;
}
#endif
}
else
{ /* Handle transparent bitmap */
for (; xsize > 0; xsize--, x++, p++)
{
Index = *p;
if (Index)
{
LCD9341_SetPoint(x+0, y, Index);
}
}
}
}
看完这几个应该你就明白了
|
|