我看例程里有直接写入图片的函数,比如ipa_config((uint32_t)&gImage_image1);,这样的话是不是操作gImage_image1对应的数据就能实现对屏幕指定位置的修改?这种情况可以找一些其它单片机的例程,把对应的函数移植过来。
屏拿下来,看看后面的丝印就行了,如果拆不下来,就看init的初始化寄存器,对比一下就知道了。还有就查一下这块开发板的资料就可以了,示例代码应该可以查得到的。
引用: littleshrimp 发表于 2022-9-26 20:21 我看例程里有直接写入图片的函数,比如ipa_config((uint32_t)&gImage_image1);,这样的话是不是操作gImag ...
我将Logo图片数据进行了分析,并试图在图片外围加个方框,初步取得了成功,下图为加了左右竖线及部分横线,因为验证成功了就没有继续修改数据让方框闭合起来。
经过初步分析图像数据,这个Logo图片是320*162点阵像素,每个像素数据为2字节。
如果要采取这个方案显示的话,需要建立一个显示缓存为320*480*2=307200字节,即300k的flash,况且目前还不清楚如何设定图像的起点以及宽、高,所以困难比较大。如果能够找到更简捷的方法,应该会容易一些。
引用: lugl4313820 发表于 2022-9-26 22:57 屏拿下来,看看后面的丝印就行了,如果拆不下来,就看init的初始化寄存器,对比一下就知道了。还有就查一下 ...
屏幕背面没有驱动芯片的丝印信息:
右上角芯片的丝印信息如下,不象是驱动芯片:
从厂家官网搜索到的资料有限,百度也找不到更多的资料。我找到的仅有三个版本的资料:
最新的版本TLI范例中LCD有4个型号,我对应的是第2个V1.2:
从代码中我看不出驱动芯片的相关信息:
void lcd_power_on1(void)
{
lcd_command_write(0xC0); //power control1 command电源控制1命令/w/
lcd_data_write(0x0A); //P-Gamma level伽马水平//4.1875v
lcd_data_write(0x0A); //N-Gamma level
lcd_command_write(0xC1); //BT & VC Setting//power contrl2 command/w/
lcd_data_write(0x41);
lcd_data_write(0x07); //VCI1 = 2.5V
lcd_command_write(0xC2); //DC1.DC0 Setting//power control3 for normal mode
lcd_data_write(0x33);
lcd_command_write(0xC5); //VCOM control
lcd_data_write(0x00); //NV memory is not programmed NV存储器未编程
lcd_data_write(0x42); //VCM Setting
lcd_data_write(0x80); //VCM Register Enable
lcd_command_write(0xB0); //interface mode control //Polarity Setting 接口模式控制//极性设置
lcd_data_write(0x02);
lcd_command_write(0xB1); //frame rate control for normal mode 正常模式的帧速率控制
lcd_data_write(0xB0); //Frame Rate Setting//70 frame per second//no division for internal clocks 帧速率设置//每秒70帧//内部时钟无分割
lcd_data_write(0x11); //17 clocks per line period for idle mode at cpu interface CPU接口的空闲模式每行周期17个时钟
lcd_command_write(0xB4); //dispaly inversion control 显示反转控制
lcd_data_write(0x00); // disable Z-inversion , column inversion 禁用Z反转、列反转
lcd_command_write(0xB6); //display function control// RM.DM Setting 显示功能控制//RM。DM设置
lcd_data_write(0x70); //0xF0
lcd_data_write(0x02); //direction of gate scan: G1->G480 one by one, source scan: S1->S960, scan cycle if interval scan in non-display area
//门扫描方向:G1->G480逐个,源扫描:S1->S960,非显示区间隔扫描时扫描周期
lcd_data_write(0x3B); //number of lines to drive LCD: 8*(0x3C) = 480 驱动LCD的行数:8*(0x3C)=480
lcd_command_write(0xB7); //Entry Mode 进入模式
lcd_data_write(0x07); //disable low voltage detection, normal display 禁用低压检测,正常显示,
lcd_command_write(0xF0); //Enter ENG , must be set before gamma setting 输入ENG,必须在gamma设置之前设置
lcd_data_write(0x36);
lcd_data_write(0xA5);
lcd_data_write(0xD3);
lcd_command_write(0xE5); //Open gamma function , must be set before gamma setting打开伽马函数,必须在伽马设置之前设置
lcd_data_write(0x80);
lcd_command_write(0xE5); //Page 1
lcd_data_write(0x01);
lcd_command_write(0XB3); //WEMODE=0(Page 1) , pixels over window setting will be ignored.//frame rate control in partial mode/full colors
//WEMODE=0(第1页),窗口设置上方的像素将被忽略//部分模式/全色的帧速率控制
lcd_data_write(0x00);
lcd_command_write(0xE5); //Page 0
lcd_data_write(0x00);
lcd_command_write(0xF0); //Exit ENG , must be set before gamma setting 退出ENG,必须在gamma设置之前设置
lcd_data_write(0x36);
lcd_data_write(0xA5);
lcd_data_write(0x53);
lcd_command_write(0xE0); //Gamma setting
//y fine adjustment register for positive polarity y正极微调寄存器
lcd_data_write(0x00);
lcd_data_write(0x35);
lcd_data_write(0x33);
//y gradient adjustment register for positive polarity 正极性y梯度调整寄存器
lcd_data_write(0x00);
//y amplitude adjustment register for positive polarity 正极性的y振幅调整寄存器
lcd_data_write(0x00);
lcd_data_write(0x00);
//y fine adjustment register for negative polarity y负极性微调寄存器
lcd_data_write(0x00);
lcd_data_write(0x35);
lcd_data_write(0x33);
//y gradient adjustment register for negative polarity 负极性y梯度调整寄存器
lcd_data_write(0x00);
//y amplitude adjustment register for negative polarity 负极性的y振幅调整寄存器
lcd_data_write(0x00);
lcd_data_write(0x00);
lcd_command_write(0x36); //memory data access control 存储器数据访问控制
lcd_data_write(0x48);
lcd_command_write(0x3A); //interface pixel format setting 界面像素格式设置
lcd_data_write(0x55); //16-bits
lcd_command_write(0x11); //Exit sleep mode
lcd_command_write(0x29); //Display on
delay(10);
}
引用: hujj 发表于 2022-9-27 10:52 屏幕背面没有驱动芯片的丝印信息: 右上角芯片的丝印信息如下,不象是驱动芯片: ...
MCU屏,好象是在时序上做处理的。
引用: hujj 发表于 2022-9-27 11:02 开发板上也找不到LCD的驱动芯片:
RGB屏是不是只直接输出信号就可以驱动了,不用跟屏交互。
static void tli_config(void)
{
tli_parameter_struct tli_init_struct;
tli_layer_parameter_struct tli_layer_init_struct;
rcu_periph_clock_enable(RCU_TLI);
tli_gpio_config();
rcu_pll_input_output_clock_range_config(IDX_PLL2, RCU_PLL2RNG_1M_2M, RCU_PLL2VCO_150M_420M);
/* configure the PLL2 clock: CK_PLL2P/CK_PLL2Q/CK_PLL2R = HXTAL_VALUE / 25 * 150 / 3 */
if(ERROR == rcu_pll2_config(25, 150, 3, 3, 3)) {
while(1) {
}
}
rcu_pll_clock_output_enable(RCU_PLL2R);
rcu_tli_clock_div_config(RCU_PLL2R_DIV8);
rcu_osci_on(RCU_PLL2_CK);
if(ERROR == rcu_osci_stab_wait(RCU_PLL2_CK)) {
while(1) {
}
}
/* configure TLI parameter struct */
tli_init_struct.signalpolarity_hs = TLI_HSYN_ACTLIVE_LOW; //水平同步极性
tli_init_struct.signalpolarity_vs = TLI_VSYN_ACTLIVE_LOW; //垂直同步极性
tli_init_struct.signalpolarity_de = TLI_DE_ACTLIVE_LOW; //数据使能极性
tli_init_struct.signalpolarity_pixelck = TLI_PIXEL_CLOCK_TLI; //像素时钟极性
/* LCD display timing configuration */
tli_init_struct.synpsz_hpsz = HORIZONTAL_SYNCHRONOUS_PULSE - 1; //水平同步
tli_init_struct.synpsz_vpsz = VERTICAL_SYNCHRONOUS_PULSE - 1; //垂直同步宽度
tli_init_struct.backpsz_hbpsz = HORIZONTAL_SYNCHRONOUS_PULSE + HORIZONTAL_BACK_PORCH - 1; //水平同步后沿宽度
tli_init_struct.backpsz_vbpsz = VERTICAL_SYNCHRONOUS_PULSE + VERTICAL_BACK_PORCH - 1; //垂直同步后沿高度
tli_init_struct.activesz_hasz = HORIZONTAL_SYNCHRONOUS_PULSE + HORIZONTAL_BACK_PORCH + ACTIVE_WIDTH - 1; //有效宽度
tli_init_struct.activesz_vasz = VERTICAL_SYNCHRONOUS_PULSE + VERTICAL_BACK_PORCH + ACTIVE_HEIGHT - 1; //有效高度
tli_init_struct.totalsz_htsz = HORIZONTAL_SYNCHRONOUS_PULSE + HORIZONTAL_BACK_PORCH + ACTIVE_WIDTH + //总宽度
HORIZONTAL_FRONT_PORCH - 1;
tli_init_struct.totalsz_vtsz = VERTICAL_SYNCHRONOUS_PULSE + VERTICAL_BACK_PORCH + ACTIVE_HEIGHT + //总高度
VERTICAL_FRONT_PORCH - 1;
/* configure LCD background R,G,B values */
tli_init_struct.backcolor_red = 0xFF; //背景设为白色
tli_init_struct.backcolor_green = 0xFF;
tli_init_struct.backcolor_blue = 0xFF;
tli_init(&tli_init_struct);
/* TLI layer configuration 层初始化配置 */
tli_layer_init_struct.layer_window_leftpos = 80 + HORIZONTAL_SYNCHRONOUS_PULSE +
HORIZONTAL_BACK_PORCH + 2;
tli_layer_init_struct.layer_window_rightpos = (80 + 320 + HORIZONTAL_SYNCHRONOUS_PULSE +
HORIZONTAL_BACK_PORCH - 1);
tli_layer_init_struct.layer_window_toppos = 150 + VERTICAL_SYNCHRONOUS_PULSE + VERTICAL_BACK_PORCH;
tli_layer_init_struct.layer_window_bottompos = (150 + 100 + VERTICAL_SYNCHRONOUS_PULSE +
VERTICAL_BACK_PORCH - 1);
tli_layer_init_struct.layer_ppf = LAYER_PPF_RGB565;
tli_layer_init_struct.layer_sa = 0xFF; //层透明度 255 为完全不透明
tli_layer_init_struct.layer_default_blue = 0xFF;
tli_layer_init_struct.layer_default_green = 0xFF;
tli_layer_init_struct.layer_default_red = 0xFF;
tli_layer_init_struct.layer_default_alpha = 0x0; //该层显示范围外的颜色
tli_layer_init_struct.layer_acf1 = LAYER_ACF1_PASA; //层混模式 归一化的像素alpha 乘以归一化的恒定 alpha
tli_layer_init_struct.layer_acf2 = LAYER_ACF2_PASA; //归一化gImage_logo的像素alhpa,
tli_layer_init_struct.layer_frame_bufaddr = (uint32_t)&gImage_logo;; //缓存地址
tli_layer_init_struct.layer_frame_line_length = ((320 * 2) + 3); //行长度 这个值为一行的字节数+3
tli_layer_init_struct.layer_frame_buf_stride_offset = (320 * 2); //步幅偏移,定义了从某行起始处到下一行起始处之间的字节数
tli_layer_init_struct.layer_frame_total_line_number = 100; //总行数 定义了一帧行数
tli_layer_init(LAYER0, &tli_layer_init_struct);
}
我看到屏的驱动就是这样子的东西: