devm_gpiod_put_array fwnode_get_named_gpiod gpio_to_desc gpiod_cansleep gpiod_count gpiod_direction_input gpiod_direction_output gpiod_direction_output_ gpiod_export gpiod_export_link gpiod_get gpiod_get_array gpiod_get_array_optiona gpiod_get_direction gpiod_get_index gpiod_get_index...
devm_gpiod_get_array;// 2.设置方向gpiod_direction_input; gpiod_direction_output;// 3.读值、写值gpiod_get_value; gpiod_set_value; // 4. 设为中断(如果必要)request_irq(gpiod_to_irq(gpio_desc)...);//将gpio转为对应的irq,然后注册该irq的中断handler // 5.释放GPIOgpiod_put; gpiod_...
fwnode_get_named_gpiod gpio_to_desc gpiod_cansleep gpiod_count gpiod_direction_input gpiod_direction_output gpiod_direction_output_ gpiod_export gpiod_export_link gpiod_get gpiod_get_array gpiod_get_array_optiona gpiod_get_direction gpiod_get_index gpiod_get_index_optiona gpiod_get_o...
desc_to_gpio devm_get_gpiod_from_chi devm_gpiod_get devm_gpiod_get_array devm_gpiod_get_array_op devm_gpiod_get_index devm_gpiod_get_index_op devm_gpiod_get_optional devm_gpiod_put devm_gpiod_put_array fwnode_get_named_gpiod gpio_to_desc gpiod_cansleep gpiod_count gpiod_direct...
devm_pinctrl_get_select_default(structdevice *dev);// 使用"default"状态的引脚pinctrl_get_select(structdevice *dev,constchar*name);// 根据name选择某种状态的引脚pinctrl_put(structpinctrl *p);// 不再使用, 退出时调用 GPIO子系统 要操作GPIO引脚,得先把所用到的引脚配置为GPIO功能,这需要通过Pinctrl子...
devm_pinctrl_get_select_default(struct device *dev); // 使用"default"状态的引脚 pinctrl_get_select(struct device *dev, const char *name); // 根据name选择某种状态的引脚 pinctrl_put(struct pinctrl *p); // 不再使用, 退出时调用 GPIO子系统 ...
https://www.kernel.org/doc/Documentation/gpio/consumer.txt #头文件 我们需要包含头文件 #include <linux/gpio/consumer.h> 看头文件里面包含的函数列表 desc_to_gpiodevm_get_gpiod_from_chidevm_gpiod_getdevm_gpiod_get_arraydevm_gpiod_get_array_opdevm_gpiod_get_indexdevm_gpiod_get_index_opdevm...
在gpio 子系统中,用 struct gpio_desc 来描述一个 gpio 引脚,gpiod_xxx() 都是围绕着 strcut gpio_desc 进行操作的。 完整的接口定义位于 linux/gpio/consumer.h,大约共有 70个 API。 常用API: 获得/释放 一个或者一组 gpio: [devm]_gpiod_get*() [devm]_gpiod_put*() 设置/查询 输入或者输出 gpi...
必须与pinctrl_get配对使用。 4.1.3 devm_pinctrl_get •函数原型:struct pinctrl *devm_pinctrl_get(struct device *dev) •作用:根据设备获取 pin 操作句柄,所有 pin 操作必须基于此 pinctrl 句柄,与 pinctrl_get功能完全一样,只是 devm_pinctrl_get 会将申请到的 pinctrl 句柄做记录,绑定到设备句柄信息中。
#旧的GPIO使用实例 DTS文件 驱动文件调用 # 新的GPIOD文档 #头文件 我们需要包含头文件 #include <linux/gpio/consumer.h> 看头文件里面包含的函数列表 desc_to_gpio devm_get_gpiod_from_chi devm_gpiod_get devm_gpiod_get_array devm_gpiod_get_array_op devm_gpiod_get_index devm_gpiod_get_index...