信息发布→ 登录 注册 退出

DRV_01_Input子系统框架详解

发布时间:2025-06-27

点击量:

资料下载

无法通过浏览器直接访问Coding上的资源,必须使用Git工具进行下载:

代码语言:JavaScript 运行次数:0

运行 复制 ```javascript git clone https://e.coding.net/weidongshan/linux/doc_and_source_for_drivers.git ```

观看视频,了解百问网驱动大全。

Input子系统框架详解的参考资料:

Linux 5.x内核文档:Documentation\input\input-programming.rst 和 Documentation\input\event-codes.rst Linux 4.x内核文档:Documentation\input\input-programming.txt 和 Documentation\input\event-codes.txt

  1. 回顾字符设备驱动程序编写

如何编写字符设备驱动程序?

  • 确定主设备号
  • 创建file_operations结构体,并填充drv_open/drv_read/drv_ioctl等函数
  • 注册file_operations结构体,调用register_chrdev(major, &fops, name)
  • 在入口函数中调用register_chrdev
  • 在出口函数中调用unregister_chrdev
  • 使用辅助函数帮助系统自动创建设备节点,调用class_create和device_create
  1. Input子系统框架

  1. Input子系统内部实现

3.1 重要结构体

左边的input_dev表示输入设备

右边的input_handler表示“处理程序”

匹配之后使用input_handle保存两者之间的联系

设备获取、上报数据:input_event

3.2 注册流程演示,请观看视频。

3.3 读取一个数据的流程演示

标签:# 设备驱动程序  # http  # clip  # currentColor  # evenodd  # rule  # 进行下载  # 资料下载  # 参考资料  # 文档  # linux  # https  # input  # Event  # 结构体  # JavaScript  # 工具  # 浏览器  # git  
在线客服
服务热线

服务热线

4008888355

微信咨询
二维码
返回顶部
×二维码

截屏,微信识别二维码

打开微信

微信号已复制,请打开微信添加咨询详情!