讨论广场 问答详情
以hdf移植触摸驱动遇到的问题
sharkfox 2024-10-15 13:36:14
239 评论 分享

设备:迅为itop-rk3568

系统:Openharmony4.1Release

问题:屏幕显示为横屏,1280x800,在修改了input_config.hcs里引脚等配置以后,触摸有反应,但是坐标不对。看了下串口信息,好像分辨率这块没有读出来,需要修改哪里?

[    3.275302] [I/device_node] launch devnode hdf_touch_gt911_service
[    3.275341] [I/HDF_INPUT_DRV] HdfGoodixChipInit: enter
[    3.275481] [I/HDF_LOG_TAG] ChipMatchCheck: boardNode's father name = touch0, chipNode's grandpa name = touch0
[    3.408300] [E/HDF_LOG_TAG] SetTiming: enable = 0
[    3.451970] [E/HDF_LOG_TAG] InputI2cWrite: i2c write err
[    3.452018] [E/HDF_LOG_TAG] SetResetStatus: InputI2cWrite failed, ret = -1
[    3.452045] [E/HDF_LOG_TAG] SetTiming: SetResetStatus failed
[    3.558619] [E/HDF_LOG_TAG] InputI2cRead: i2c read err
[    3.558664] [E/HDF_INPUT_DRV] ChipDetect: read chip version failed
[    3.558692] [I/HDF_LOG_TAG] ChipDriverInit: reset chip 19 time
[    3.558740] [E/HDF_LOG_TAG] SetTiming: enable = 1
[    3.819857] [I/HDF_INPUT_DRV] ChipDetect:IC FW version is 4192
[    3.819900] [I/HDF_INPUT_DRV] ChipDetect:TOUCH IC is GT911
[    3.819938] [I/HDF_INPUT_DRV] Product_ID: 9271_1060, x_sol = 1920, y_sol = 1200
[    3.820871] [I/HDF_LOG_TAG] Clock ticks for an esd cycle: 600
[    3.820911] [I/HDF_LOG_TAG] Esd protector started!
[    3.820947] [I/HDF_LOG_TAG] ChipDriverInit: chipDetect succ, ret = 0
[    3.820973] [I/HDF_LOG_TAG] ChipDriverInit: do not update firmware
[    3.821895] [I/gpio_core] GpioIrqRecordCreate: gpio(101) thread started!
[    3.822103] [I/linux_gpio_adapter] LinuxGpioSetIrq: gona request normal irq:123(101)!
[    3.822103]
[    3.822299] [I/HDF_LOG_TAG] RegisterInputDevice: enter
[    3.822340] [I/HDF_LOG_TAG] RegisterInputDevice: enter devName=main_touch, devType=0
[    3.822372] [I/HDF_LOG_TAG] CreateDeviceNode: create node succ, devId is 1
[    3.823110] [E/HDF_LOG_TAG] HotPlugNotify: send event failed
[    3.823155] [I/HDF_LOG_TAG] RegisterInputDevice: exit succ, devCount is 1
[    3.823188] [I/HDF_INPUT_DRV] HdfGoodixChipInit: exit succ, chipName = gt911
[    3.823668] [I/device_node] launch devnode
[    3.823700] [I/HDF_LOG_TAG] HdfHIDDriverInit: Hid Driver Init
[    3.823725] [I/HDF_LOG_TAG] LoadCachedHid: start
[    3.823750] [I/HDF_LOG_TAG] RegisterInputDevice: enter
[    3.823777] [I/HDF_LOG_TAG] RegisterInputDevice: enter devName=hid-powerkey, devType=1
[    3.823804] [I/HDF_LOG_TAG] CreateDeviceNode: prepare to register hdf device
[    3.823866] [I/device_node] launch devnode
[    3.823892] [I/HDF_LOG_TAG] HdfHIDDriverInit: Hid Driver Init
[    3.823916] [I/HDF_LOG_TAG] LoadCachedHid: start
[    3.823940] [W/HDF_LOG_TAG] LoadCachedHid: no need repeat load cache
[    3.824676] [I/osal_cdev] add cdev hdf_input_event2 success

 

239 评论 分享
写回答
全部评论(7)
[ 3.819938] [I/HDF_INPUT_DRV] Product_ID: 9271_1060, x_sol = 1920, y_sol = 1200
这行日志显示分辨率1920x1200与实际不符,你在input_config.hcs有配置吗?
2024-10-15 14:53:03
2024-10-29 22:10:41
引用:“int32_t resX = device->driver->boardCfg->attr.resolutionX; int32_t resY = device->driver->boardCfg->attr.resolutionY; frame->fingers[i].x = resX - ((buf[GT_POINT_SIZE * i + GT_X_L”
问题已解决,报错原因定位及代码分析已在最新提问帖中回复
2024-10-29 22:10:41
2024-10-16 08:48:05
引用:“这样子的”
int32_t resX = device->driver->boardCfg->attr.resolutionX; int32_t resY = device->driver->boardCfg->attr.resolutionY; frame->fingers[i].x = resX - ((buf[GT_POINT_SIZE * i + GT_X_LOW] &amp; ONE_BYTE_MASK) | ((buf[GT_POINT_SIZE * i + GT_X_HIGH] &amp; ONE_BYTE_MASK) << ONE_BYTE_OFFSET)); frame->fingers[i].y = resY - ((buf[GT_POINT_SIZE * i + GT_Y_LOW] &amp; ONE_BYTE_MASK) | ((buf[GT_POINT_SIZE * i + GT_Y_HIGH] &amp; ONE_BYTE_MASK) << ONE_BYTE_OFFSET)); if (frame->fingers[i].y < GT_Y_OFFSET_A) { frame->fingers[i].y += CORRECTION_VALUE_A; } else if (frame->fingers[i].y < GT_Y_OFFSET_B) { frame->fingers[i].y += CORRECTION_VALUE_B; } else if (frame->fingers[i].y < GT_Y_OFFSET_C) { frame->fingers[i].y += CORRECTION_VALUE_C; } HDF_LOGE("x_sol = %d, y_sol = %d",frame->fingers[i].x,frame->fingers[i].y);
2024-10-16 08:48:05
2024-10-16 08:46:32
引用:“竖屏显示,而且分辨率也不对”
这样子的
2024-10-16 08:46:32
2024-10-16 08:38:35
引用:“获取的坐标具体是怎样的?是按照竖屏显示的还是就是不准确?先确认下是方向错了还是分辨率没获取到,分辨率没获取到要具体分析下代码流程”
竖屏显示,而且分辨率也不对
2024-10-16 08:38:35
2024-10-15 15:40:27
引用:“配置了 solutionX = 1280; solutionY = 800; ”
获取的坐标具体是怎样的?是按照竖屏显示的还是就是不准确?先确认下是方向错了还是分辨率没获取到,分辨率没获取到要具体分析下代码流程
2024-10-15 15:40:27
2024-10-15 14:57:11
配置了 solutionX = 1280; solutionY = 800;
2024-10-15 14:57:11