在 gpio-keyc的基础上改写的旋转按钮 ec11的驱动,已经经过了测试。可自定义左旋和右旋的键值。如果按键值输入是第三个引脚,也支持按键操作 补存的头文件: gpio_ec11.h #ifndef _GPIO_EC11_H #define _GPIO_EC11_H struct device; struct gpio_desc; /** * struct gpio_ec11_button - configuration parameters * @leftcode: ec11 left direction input event code (KEY_*, SW_*) * @rightcode: ec11 right direction input event code (KEY_*, SW_*) * @gpio: %-1 if this key does not support gpio * @gpio: %-1 if this key does not support gpio * @active_low: %true indicates that button is considered * depressed when gpio is low * @desc: label that will be attached to button's gpio * @type: input event type (%EV_KEY, %EV_SW, %EV_ABS) * @wakeup: configure the button as a wake-up source * @debounce_interval: debounce ticks interval in msecs * @can_disable: %true indicates that userspace is allowed to * disable button via sysfs * @value: axis value for %EV_ABS * @irq: Irq number in case of interrupt keys * @gpiod: GPIO descriptor */ struct gpio_ec11_button { unsigned int code; unsigned int leftcode; /*记录左旋键值*/ unsigned int rightcode; /*记录右旋键值*/ int gpio; /*旋转编码器A引脚的gpio号*/ int subgpio; /*旋转编码器B引脚的gpio号*/ int active_low; const char *desc; unsigned int type; int wakeup; int debounce_interval; bool can_disable; int value; unsigned int irq; unsigned int irq_flags; struct gpio_desc *gpiod; }; /** * struct gpio_ec11_platform_data - platform data for gpio_ec11 driver * @buttons: pointer to array of &gpio;_keys_button structures * describing buttons attached to the device * @nbuttons: number of elements in @buttons array * @poll_interval: polling interval in msecs - for polling driver only * @rep: enable input subsystem auto repeat * @enable: platform hook for enabling the device * @disable: platform hook for disabling the device * @name: input device name */ struct gpio_ec11_platform_data { struct gpio_ec11_button *buttons; int nbuttons; unsigned int poll_interval; unsigned int rep:1; int (*enable)(struct device *dev); void (*disable)(struct device *dev); const char *name; }; #endif
2022-07-05 22:52:12 27KB linux驱 ec11
1
嵌入式Linux应用程序开发详解,从对linux操作系统的上手熟悉到linux应用程序开发。目录如下:第1 章 Linux 快速入门 第2 章 Linux 基础命令 第3 章 Linux 下的C 编程基础 第4 章 嵌入式系统基础 第5 章 嵌入式Linux开发环境的搭建 第6 章 文件IO编程 第7 章 进程控制开发 第8 章 进程间通信 第9章(多线程编程) 第10章(嵌入式Linux网络编程) 第11章(嵌入式Linux设备驱动开发) 第12章(Qt图形编程)
2021-04-02 12:10:44 10.85MB linux驱 linux网 linux应
1
此程序为全志H3的GPIO内核驱动程序驱动部分
2021-03-08 09:20:29 3KB linux驱
1
包含 ap6212源码驱动,wifi,蓝牙驱动移植指导文档。以及个人移植遇到的问题和解决办法。
2019-12-21 19:24:22 5.31MB AP6212 linux驱
1