touch_screen
1. 手动分配与设置 struct input_dev * 变量
struct input_dev *inputDev;
inputDev = input_allocate_device(); // 分配
inputDev->name = "xxx_inputDev"; // 设置input device名字
__set_bit(EV_ABS, inputdev->evbit); // 设置事件类型
input_set_abs_params(inputdev, ABS_MT_POSITION_X, 0, 480, 0, 0);//设置x轴事件码, x轴范围0~480
input_set_abs_params(inputdev, ABS_MT_POSITION_Y, 0, 272, 0, 0);//设置y轴事件码, y轴范围0~272
input_mt_init_slots(inputdev, MAX_SUPPORT_POINTS, 0); // 初始化触摸点个数 MAX_SUPPORT_POINTS2. 注册 input device
input_register_device(inputDev); // 注册3. 向linux系统上报事件
4. 注销与释放 input device
5. 应用层测试
Last updated