调试key LCD rs485都正常运行,修复了bug,但是DMA接收的问题没有解决
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
* 显示屏: 160x160像素
|
||||
* 段地址: SEG112~SEG271
|
||||
* 外部MPU晶振: 20MHz
|
||||
* 切记不要在中断中操作屏幕,不然会打断屏幕的时许造成不可预测的问题!!!!!!!!!!!!!!!
|
||||
******************************************************************************/
|
||||
|
||||
#include "160160D.h"
|
||||
@@ -1144,10 +1145,14 @@ void Fault_Disp(void)
|
||||
|
||||
|
||||
/**
|
||||
* @brief 显示按键运行状态指示
|
||||
* @brief 显示按键运行状态指示,屏幕的左上方显示3个点
|
||||
* @param Flag 状态标志:非0=显示运行指示,0=清除指示
|
||||
* @note 在屏幕左上角(坐标0,0)显示按键运行状态
|
||||
* 显示3个像素点表示运行状态
|
||||
* *
|
||||
* *
|
||||
*
|
||||
* *
|
||||
* @retval 无
|
||||
*/
|
||||
void KeyRun_Disp(uint32_t Flag)
|
||||
@@ -1171,9 +1176,16 @@ void KeyRun_Disp(uint32_t Flag)
|
||||
/**
|
||||
* @brief 全屏显示图像数据
|
||||
* @param ptr 图像数据指针(160x160像素,每像素2位,共3200字节)
|
||||
* @note 将图像数据按4K色模式(2位/像素)写入整个屏幕
|
||||
* 图像数据格式:每字节包含4个像素点(bit7-6, bit5-4, bit3-2, bit1-0)
|
||||
* 每行160像素 = 40字节,共160行
|
||||
* @note 将图像数据按4K色模式 写入整个屏幕
|
||||
* 图像数据格式:每字节包含8个像素点
|
||||
* 写入数据:| D7 D6 D5 D4 | D3 D2 D1 D0 |
|
||||
* └ 第一个像素 ┘ └ 第二个像素 ┘
|
||||
* 写入数据:| D7 D6 D5 D4 | D3 D2 D1 D0 |
|
||||
* └ 第三个像素 ┘ └ 第四个像素 ┘
|
||||
* 写入数据:| D7 D6 D5 D4 | D3 D2 D1 D0 |
|
||||
* └ 第五个像素 ┘ └ 第六个像素 ┘
|
||||
* 写入数据:| D7 D6 D5 D4 | D3 D2 D1 D0 |
|
||||
* └ 第七个像素 ┘ └ 第八个像素 ┘
|
||||
* @retval 无
|
||||
*/
|
||||
void ScreenPrintf(uint8_t* ptr)
|
||||
@@ -1184,17 +1196,17 @@ void ScreenPrintf(uint8_t* ptr)
|
||||
|
||||
SetAddress(0, 0); /* 设置起始地址为屏幕左上角 */
|
||||
|
||||
/* 循环显示160行 */
|
||||
/* 循环显示 160 行 */
|
||||
for(i = 0; i < 160; i++)
|
||||
{
|
||||
/* 每行20个字节(每字节4个像素点,共80个像素点,但实际显示需要更多) */
|
||||
/* 每行20个字节(每字节 8 个像素点,共 160 个像素点) */
|
||||
for(j = 0; j < 20; j++)
|
||||
{
|
||||
/* 将每字节的4个2位像素值转换为显示数据 */
|
||||
WriteData(disp_point[(ptr[i*20 + j] >> 6) & 0x03]); /* bit7-6 */
|
||||
WriteData(disp_point[(ptr[i*20 + j] >> 4) & 0x03]); /* bit5-4 */
|
||||
WriteData(disp_point[(ptr[i*20 + j] >> 2) & 0x03]); /* bit3-2 */
|
||||
WriteData(disp_point[(ptr[i*20 + j] >> 0) & 0x03]); /* bit1-0 */
|
||||
/* 将每字节的 4 个 2 位像素值转换为显示数据 */
|
||||
WriteData(disp_point[(ptr[i*20 + j] >> 6) & 0x03]); /* bit0-1 */
|
||||
WriteData(disp_point[(ptr[i*20 + j] >> 4) & 0x03]); /* bit2-3 */
|
||||
WriteData(disp_point[(ptr[i*20 + j] >> 2) & 0x03]); /* bit4-5 */
|
||||
WriteData(disp_point[(ptr[i*20 + j] >> 0) & 0x03]); /* bit6-7 */
|
||||
}
|
||||
WriteData(0x00); /* 补全每行末尾的数据,使总点数能被3整除 */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user