本文主要是介绍高通SDM450+android9.0读显示屏ID,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1.读屏厂OTP时写入DA寄存器的值
1) 确定驱动IC厂家指定的读取ID的命令
static char id_cmd[] = {0xDA, 0x00, 0x06, 0xA0};
static struct mipi_dsi_cmd sc600_800p_id_command =
{sizeof(id_cmd), id_cmd, 0x00};
#define ILI9881C_0D_800P_VIDEO_SIGNATURE 0x005A //读出来ID和厂家写入的ID值来比较
2) 让读ID的结构体指针指向上面的读ID指令
pinfo->mipi.panel_read_cmd = &sc600_800p_id_command;
pinfo->mipi.signature = ILI9881C_0D_800P_VIDEO_SIGNATURE;
3) mdss_dsi_read_panel_signature()从LCM读出ID并比较
// panel_read_cmds指向读ID的命令结构体sc600_800p_id_command
ret = mdss_dsi_cmds_tx(mipi, mipi->panel_read_cmds, 1, 0);
if (ret)
goto exit_read_signature;
//实际都回来的*lp是4个字节,比如0x27005a21
result = mdss_dsi_cmds_rx(mipi, &lp, 1, 1);
if (!result)
goto exit_read_signature;
data = ntohl(*lp);
data = data >> 8;//取高8位
data = data & 0xffff;//取读出来的2个字节,比如时0x005a
if (data != panel_signature)
ret = 1;
2.读驱动IC的ID
打印的信息如下:
[1300] mdss_dsi_read_panel_signature()--->*rp=0x98983500,ID4[00]=0x98,device_id=0x980000
[1330] mdss_dsi_read_panel_signature()--->*rp=0x81813500,ID4[01]=0x81,device_id=0x988100
[1350] mdss_dsi_read_panel_signature()--->*rp=0x1c1c3500,ID4[02]=0x1c,device_id=0x98811c
这篇关于高通SDM450+android9.0读显示屏ID的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!