当前位置: 首页 > news >正文

元太电磁膜SUDE-10S19MI-01X驱动适配

屏规格书:
在这里插入图片描述

dts配置:
首先要确保CONFIG_I2C_HID宏打开,i2c-hid-core.c 文件才能编译进去代码。规格书vendor product 分别为0x2d1f 和0x0165 来区别,不至于影响到整体的hid其他设备。

   +  i2c-hid-dev@10 {+  compatible = "hid-over-i2c";+	reg = <0x10>;+	hid-descr-addr = <0x0001>;+	interrupt-parent = <&gpio0>;+	interrupts = <6 0x0>;+	post-power-on-delay-ms = <70>;+	vdd = "vdd-supply";+	status ="okay";+ };

hid-input.c 文件里面根据实际情况,是否实际需要x,y坐标是否需要反,或x , 或y 反,或x,y都反。
hidinput_configure_usage函数。这里面x,y需要对调,而且x,还需要最大变最小,最小变最大逻辑 20320-value

static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_field *field,struct hid_usage *usage)
{+if((device->vendor==0x2d1f)&&(device->product==0x0123))+{+       if(b==20320)+       {+       	b=15240;+       }+      else if(b==15240){+          b= 20320;+       }+}if (field->application == HID_GD_GAMEPAD || field->application == HID_GD_JOYSTICK)input_set_abs_params(input, usage->code, a, b, (b - a) >> 8, (b - a) >> 4);else	input_set_abs_params(input, usage->code, a, b, 0, 0);(!test_bit(usage->code, input->key)) == value)input_event(input, EV_MSC, MSC_SCAN, usage->hid);input_event(input, usage->type, usage->code, value);//input_event(input, usage->type, usage->code, value);+ if((hid->vendor==0x2d1f)&&(hid->product==0x0123))+ {+	    if(usage->code == ABS_X)+	     input_event(input, usage->type, ABS_Y, value);+      else if(usage->code == ABS_Y)+	     input_event(input, usage->type, ABS_X, 20320-value);+	    else+	       input_event(input, usage->type, usage->code, value);+  }+  else+ {+     input_event(input, usage->type, usage->code, value);+ }if ((field->flags & HID_MAIN_ITEM_RELATIVE) &&usage->type == EV_KEY && value) {}

frameworks/base/data/keyboards/Vendor_2d1f_Product_0165.idc 添加此文件

# Copyright (C) 2010 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.#
# Emulator keyboard configuration file #1.
#
#touch.orientationAware touch x ytouch.deviceType = touchScreen
touch.orientationAware = 1keyboard.layout = qwerty
keyboard.characterMap = qwerty
keyboard.orientationAware = 1
keyboard.builtIn = 1cursor.mode = navigation
cursor.orientationAware = 1

屏规格书

http://www.lryc.cn/news/415258.html

相关文章:

  • C#数据类型 全局变量 类型转换方法(汇总)
  • HCIP重修总笔记(中)
  • 图片搜索网站,有大量高清图片,避免版权纠纷
  • 设计学习笔记8:在设计模式中,状态模式和策略模式有什么区别,它们各自适用于什么场景?
  • Android 10.0 系统默认蓝牙打开状态栏显示蓝牙图标功能实现
  • 在git中如何忽略.vscode目录?
  • 分布式系统
  • 【Material-UI】Autocomplete 组件中的事件处理(Events)详解
  • 【51单片机仿真】基于51单片机设计的钟表定时闹钟系统仿真源码设计文档演示视频——完整资料下载
  • 《刚刚问世》系列初窥篇-Java+Playwright自动化测试-7-元素基础定位方式-下篇 (详细教程)
  • [Day 44] 區塊鏈與人工智能的聯動應用:理論、技術與實踐
  • 【Redis】 Redis 列表指令指南
  • 设计测试用例的具体方法
  • GPT-4o mini(假设模型)概览
  • 抽象代数精解【9】
  • 熟悉简单测试面经
  • IoTDB 入门教程 实战篇④——C#示例(开源)
  • STL-vector容器
  • python字符串与变量名互相转换,字典,list操作
  • 企业及园区电力能源管理系统方案
  • 5.3 需求分析
  • 【C++】list介绍以及模拟实现(超级详细)
  • 从艺术创作到作物生长,农业AI迎来“GPT“时刻
  • 前端使用 Konva 实现可视化设计器(19)- 连接线 - 直线、折线
  • C#:通用方法总结—第15集
  • LoadRunner12 添加事务并添加检查点
  • python中的文件
  • Powerdesigner连接mysql数据库,逆向工程生成ER图 (保姆级教程:下载->连接->配置)看这一篇就够了
  • 商家转账到零钱分销返佣申请方案及驳回处理办法
  • 荟萃科技:国外问卷调查有没有实时更新的题库?