答:gpiod_get_index()本质上和gpio_request()是一个功能,是申请gpio的,只是它是从device tree去查找, 因此看到第二个参数”con_id”是字符串类型,也就是gpio的名字。 例如在显示驱动看到的去查找名字为”enable”的gpio panel-simple.c: panel->enable_gpio = devm_gpiod_get_optional(dev,"enable",0); ...
`devm_gpiod_get_optional()` 函数用于在设备模型资源管理框架内,可选地获取一个 GPIO 描述符。它的函数定义如下: c struct gpio_desc *devm_gpiod_get_optional(struct device *dev, const char *con_id, enum gpiod_flags flags); 要使用这个函数,首先需要包含相应的头文件: c include. `#include ` ...
priv->ulpi_reset = devm_gpiod_get_optional(dev->parent, "reset", GPIOD_ACTIVE_LOW); /* property is optional, don't return error! */ if (priv->ulpi_reset) { /* Toggle ulpi to reset the phy. */ rc = dm_gpio_set_value(priv->ulpi_reset, 1); ...
2——GPIO子系统重要概念 descriptor-based legacy 说明 获得GPIO gpiod_get gpio_request gpiod_get_index gpiod_get_array gpio_request_array devm_gpiod_get...devm_gpiod_get_index devm_gpiod_get_array 设置方向 gpiod_direction_input gpio_direction_input gpiod_direction_output...gpiod_set_value...
*devm_fwnode_get_index_gpiod_from_child(struct device *dev, return desc; } -EXPORT_SYMBOL(devm_fwnode_get_index_gpiod_from_child); +EXPORT_SYMBOL(devm_fwnode_gpiod_get_index); /** * devm_gpiod_get_index_optional - Resource-managed gpiod_get_index_optional() ...
可以看到devm_gpiod_get_optional只是对gpiod_get_index的包装而已,并且index为0。index参数后面会提。 函数参数: structgpio_desc *__must_check devm_gpiod_get_index(structdevice *dev,constchar*con_id, unsignedintidx,enumgpiod_flags flags); ...
2019-12-20 19:43 −1.get请求在二级目录下的views.py文件中写入 声明全局变量 c = "pp" d = "123" def indexa(request): if request.method == "GET": name = request.GET.get("name") pwd =... 后羿的百宝箱 0 318 STM32 GPIO口的配置和应用 ...
descriptor-based legacy 说明获得GPIO gpiod_get gpio_request gpiod_get_index gpiod_get_array gpio_request_array devm_gpiod_get...devm_gpiod_get_index devm_gpiod_get_array 设置方向 gpiod_direction_input gpio_direction_input gpiod_direction_output...gpiod_set_value gpio_set_value 释放GPIO ...
可以看到devm_gpiod_get_optional只是对gpiod_get_index的包装而已,并且index为0。index参数后面会提。 函数参数: structgpio_desc *__must_check devm_gpiod_get_index(structdevice *dev,constchar*con_id, unsignedintidx,enumgpiod_flags flags); ...