6.2 WY 简易显示函数
快速原型开发的简易显示
WY 简易显示函数
WY_DisplayChar 是一个简化的显示函数,适用于快速原型开发和调试。该函数将字模数据直接写入帧缓冲区,适合分辨率较低或对性能要求不高的场景。
wy_display.c
//点阵数据显示 - 数据高位在前 (字库文字的显示格式)
/**
* @brief 字符字体数据排置方式
*/
#define FONT_DATA_ARRAY_TYPE_W (0)
#define FONT_DATA_ARRAY_TYPE_Y (1)
/**
* @brief 字符 点阵数据显示
* @param pBits 字符数据的缓存
* @param x_y 坐标
* @param width 字符宽度
* @param high 字符高度
* @param ft_color 字体颜色
* @param bg_color 背景颜色
* @param _type 排置方式
*/
void fontDisplay_DZ(unsigned char *pBits, unsigned short x, unsigned short y, unsigned short width, unsigned short high,
unsigned short ft_color, unsigned short bg_color, unsigned char _type)
{
unsigned int i, j, k, cnt = 0;
unsigned char temp;
unsigned char multiple = 0;
unsigned short disp_x, disp_y = 0;
//竖置横排显示Y
if (FONT_DATA_ARRAY_TYPE_Y == _type) {
multiple = ((high + 7) >> 3);
for (i = 0; i < multiple; i++)
{
for (j = 0; j < width; j++)
{
temp = pBits[cnt++];
for (k = 0; k < 8; k++)
{
disp_x = (x + j);
disp_y = (y + k + (i * 8));
if ( ((temp >> k) & 0x01) == 0 ) //bg
else //font
}
}
}
}
//横置横排显示W
else if (FONT_DATA_ARRAY_TYPE_W == _type) {
multiple = ((width + 7) >> 3);
for (i = 0; i < high; i++)
{
for (j = 0; j < multiple; j++)
{
temp = pBits[cnt++];
for (k = 0; k < 8; k++)
{
disp_x = (x + k + (j * 8));
disp_y = (y + i);
if ( ((temp << k) & 0x80) == 0 ) //bg
else //font
}
}
}
}
}
/**
* @brief 测试验证 lcd 在任意坐标画点函数
*/
void test_lcd_draw_point(void)
}
}

