LCD_WRITE_CMD(0x01); // SW reset vTaskDelay(120 / portTICK_PERIOD_MS); // Interface Mode Control LCD_WRITE_CMD(0xF7); LCD_WRITE_DATA(0xA9); LCD_WRITE_DATA(0x51); LCD_WRITE_DATA(0x2C); LCD_WRITE_DATA(0x82); // D7 stream, loose LCD_WRITE_CMD(0XC0); //Power Control 1 LCD_WRITE_DATA(0x18); //Vreg1out LCD_WRITE_DATA(0x16); //Verg2out LCD_WRITE_CMD(0xC1); //Power Control 2 LCD_WRITE_DATA(0x41); //VGH,VGL LCD_WRITE_CMD(0xC5); //Power Control 3 LCD_WRITE_DATA(0x00); LCD_WRITE_DATA(0x22); //Vcom LCD_WRITE_DATA(0x85); // LCD_WRITE_CMD(0xB1); //Frame rate // LCD_WRITE_DATA(0xA0); //60Hz LCD_WRITE_CMD(0xB0); LCD_WRITE_DATA(0x00); // LCD_WRITE_DATA(0xB0); LCD_WRITE_CMD(0xA1); LCD_WRITE_DATA(0xB0); LCD_WRITE_CMD(0xB4); //Display Inversion Control LCD_WRITE_DATA(0x02); //2-dot LCD_WRITE_CMD(0XB6); //RGB/MCU Interface Control LCD_WRITE_DATA(0x02); //02 MCU LCD_WRITE_DATA(0x42); //Source,Gate scan dieection LCD_WRITE_CMD(0XE9); // Set Image Function LCD_WRITE_DATA(0x00); //disable 24 bit data input // PGAMCTRL(Positive Gamma Control) LCD_WRITE_CMD(0xE0); LCD_WRITE_DATA(0x00); LCD_WRITE_DATA(0x04); LCD_WRITE_DATA(0x0E); LCD_WRITE_DATA(0x08); LCD_WRITE_DATA(0x17); LCD_WRITE_DATA(0x0A); LCD_WRITE_DATA(0x40); LCD_WRITE_DATA(0x79); LCD_WRITE_DATA(0x4D); LCD_WRITE_DATA(0x07); LCD_WRITE_DATA(0x0E); LCD_WRITE_DATA(0x0A); LCD_WRITE_DATA(0x1A); LCD_WRITE_DATA(0x1D); LCD_WRITE_DATA(0x0F); // NGAMCTRL (Negative Gamma Correction) LCD_WRITE_CMD(0xE1); LCD_WRITE_DATA(0x00); LCD_WRITE_DATA(0x1B); LCD_WRITE_DATA(0x1F); LCD_WRITE_DATA(0x02); LCD_WRITE_DATA(0x10); LCD_WRITE_DATA(0x05); LCD_WRITE_DATA(0x32); LCD_WRITE_DATA(0x34); LCD_WRITE_DATA(0x43); LCD_WRITE_DATA(0x02); LCD_WRITE_DATA(0x0A); LCD_WRITE_DATA(0x09); LCD_WRITE_DATA(0x33); LCD_WRITE_DATA(0x37); LCD_WRITE_DATA(0x0F); LCD_WRITE_CMD(0x35); LCD_WRITE_DATA(0x00); LCD_WRITE_CMD(0x36); //Memory Access LCD_WRITE_DATA(0x48); LCD_WRITE_CMD(0x3A); //Interface Pixel Format LCD_WRITE_DATA(0x55); //16bit // LCD_WRITE_CMD(0x21); //Display inversion on // # Sleep OUT LCD_WRITE_CMD(0x11); vTaskDelay(120 / portTICK_PERIOD_MS); // Display ON LCD_WRITE_CMD(0x29);
时间: 2024-04-11 17:30:51 浏览: 167
Ubuntu下Lcd和触摸屏模拟器_/dev/Ubuntu_LCD_surface9ju_VTSLcd_Ubuntu模拟lcd_
5星 · 资源好评率100%
你提供的代码片段看起来是在进行LCD屏幕的初始化配置。根据你的代码,你使用的是一个16位的RGB接口,并且通过配置寄存器来设置LCD的参数。
在RGB/MCU Interface Control寄存器中,你将第一个字节设置为0x02,表示选择MCU接口。第二个字节设置为0x42,表示选择源和扫描方向。
在Interface Pixel Format寄存器中,你将数据设置为0x55,表示选择16位的像素格式。
其他的代码段包括设置电源控制、Gamma校正、显示模式等。
如果你的LCD屏幕颜色显示不正确,可以尝试以下几点:
1. 检查物理连接:确保LCD屏幕正确连接到你的设备,并且连接线没有损坏或者接触不良。
2. 检查驱动程序:确认你使用的驱动程序是正确的,并且没有错误配置引起颜色显示问题。
3. 调整参数:根据你的实际情况,尝试调整一些参数,比如RGB顺序、像素格式等,以便正确显示颜色。
如果以上方法都没有解决问题,建议查阅LCD屏幕的相关文档或者联系供应商的技术支持获取进一步的帮助。他们可能能够提供更具体的解决方案。
阅读全文