Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux kernel Linux内核中的gpiod_*与gpio_*方法_Linux Kernel_Device Driver_Device Tree - Fatal编程技术网

Linux kernel Linux内核中的gpiod_*与gpio_*方法

Linux kernel Linux内核中的gpiod_*与gpio_*方法,linux-kernel,device-driver,device-tree,Linux Kernel,Device Driver,Device Tree,Linux设备驱动程序编程中哪种GPIO API更可取?在什么条件下:GPIO\u set\u value()或gpiod\u set\u value() 一个以GPIO desc为对象,另一个以从设备树解析的GPIO为对象。对于所有新驱动程序,建议使用gpiod.*API。旧的gpio.*API现在被认为已弃用 从提交: gpiolib:导出基于描述符的GPIO接口 此修补程序导出gpiod.*API函数系列,这是一个更安全的方法 传统GPIO接口的替代方案。gpiod之间的差异 传统的gpi

Linux设备驱动程序编程中哪种GPIO API更可取?在什么条件下:
GPIO\u set\u value()
gpiod\u set\u value()


一个以GPIO desc为对象,另一个以从设备树解析的GPIO为对象。

对于所有新驱动程序,建议使用
gpiod.*
API。旧的
gpio.*
API现在被认为已弃用

从提交:

gpiolib:导出基于描述符的GPIO接口

此修补程序导出
gpiod.*
API函数系列,这是一个更安全的方法 传统GPIO接口的替代方案。gpiod之间的差异 传统的gpio API包括:

  • gpio处理整数,而gpiod处理不透明的处理程序 未经适当收购不得伪造或使用
  • gpiod get/set函数知道GPIO的活动低状态
  • gpio使用者现在应该包括
    以访问 新的接口,而芯片驱动程序将使用
传统的gpio API现在构建为gpiod之上的内联函数

有关新gpiod API的详细信息,请参阅下一个链接:

  • (以及提交添加的其余gpiod内核文档)