struct gpio_desc转换成gpio编号 头文件 需要首先包含头文件 #include <linux/gpio/consumer.h> 1. 获取&释放 使用一下两个函数获取GPIO设备,多个设备时需要附带index参数。函数返回一个GPIO描述符,或一个错误编码,可以使用IS_ERR()进行检查: struct gpio_desc *gpiod_get(struct device *dev, const char *con...
反之亦然: int desc_to_gpio(const gpio_desc *desc) struct gpio_desc *gpio_to_desc(无符号gpio...