[求助] msp430f149控制TFT彩屏显示,但是不太明白,求助攻

王一天   2015-5-26 21:10 楼主
TFT彩屏初始化程序,看不懂,求解释
顺便问一句谁有TFT彩屏驱动(ST7735R )的中文资料


void TftInit(void)
{
   REPort&=~RE;
   DelayMs(100);
   REPort|=RE;
   DelayMs(100);
//------------------------------------------------------------------//  
//-------------------Software Reset---------------------------------//
//------------------------------------------------------------------//
  TftWriteCom(0x11);//Sleep exit
  DelayMs(120);

//ST7735R Frame Rate  帧速率设置
  TftWriteCom(0xB1);    //正常模式全色彩
  TftWriteData(0x01); TftWriteData(0x2C); TftWriteData(0x2D);
  TftWriteCom(0xB2);    //在待机模式
  TftWriteData(0x01); TftWriteData(0x2C); TftWriteData(0x2D);
  TftWriteCom(0xB3);    //在部分模式全彩
  TftWriteData(0x01); TftWriteData(0x2C); TftWriteData(0x2D);
  TftWriteData(0x01); TftWriteData(0x2C); TftWriteData(0x2D);
  TftWriteCom(0xB4);    //Column inversion  显示逆控制
  TftWriteData(0x07);

//ST7735R Power Sequence
  TftWriteCom(0xC0);    //功率控制1
  TftWriteData(0xA2); TftWriteData(0x02); TftWriteData(0x84);
  TftWriteCom(0xC1); TftWriteData(0xC5);    //功率控制2
  TftWriteCom(0xC2);    //功率控制3 (正常模式/全彩)
  TftWriteData(0x0A); TftWriteData(0x00);
  TftWriteCom(0xC3);    //控制功率4在空闲模式
  TftWriteData(0x8A); TftWriteData(0x2A);
  TftWriteCom(0xC4);    //功率控制5在部分模式/全彩
  TftWriteData(0x8A); TftWriteData(0xEE);  
  TftWriteCom(0xC5);    //VCOM 控制11
  TftWriteData(0x0E);  
  TftWriteCom(0x36);    //MX, MY, RGB mode
  TftWriteData(0xC8);

//ST7735R Gamma Sequence +伽码校正特性设置
  TftWriteCom(0xE0);
  TftWriteData(0x0F); TftWriteData(0x1A);
  TftWriteData(0x0F); TftWriteData(0x18);
  TftWriteData(0x2F); TftWriteData(0x28);
  TftWriteData(0x20); TftWriteData(0x22);
  TftWriteData(0x1F); TftWriteData(0x1B);
  TftWriteData(0x23); TftWriteData(0x37); TftWriteData(0x00);
  TftWriteData(0x07);
  TftWriteData(0x02); TftWriteData(0x10);
  TftWriteCom(0xE1);    //-伽码校正特性设置
  TftWriteData(0x0F); TftWriteData(0x1B);
  TftWriteData(0x0F); TftWriteData(0x17);
  TftWriteData(0x33); TftWriteData(0x2C);
  TftWriteData(0x29); TftWriteData(0x2E);
  TftWriteData(0x30); TftWriteData(0x30);
  TftWriteData(0x39); TftWriteData(0x3F);
  TftWriteData(0x00); TftWriteData(0x07);
  TftWriteData(0x03); TftWriteData(0x10);  
  TftWriteCom(0x2A);    //列地址设置
  TftWriteData(0x00);TftWriteData(0x00);
  TftWriteData(0x00);TftWriteData(0x7F);
  TftWriteCom(0x2B);    //行地址设置
  TftWriteData(0x00);TftWriteData(0x00);
  TftWriteData(0x00);TftWriteData(0x9F);
  TftWriteCom(0xF0);    //Enable test command  使能测试命令
  TftWriteData(0x01);
  TftWriteCom(0xF6);    //Disable ram power save mode
  TftWriteData(0x00);
  TftWriteCom(0x3A);    //65k mode 接口像素格式
  TftWriteData(0x05);   //18-bit/pixel
  TftWriteCom(0x29);    //Display on
}



回复评论 (1)

个人觉得初始化函数没必要都明白,
点赞  2015-5-27 09:27
电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 京公网安备 11010802033920号
    写回复