* 则为 gpiod_get_index(dev, con_id, 1, flags); */structgpio_desc *__must_checkgpiod_get(structdevice *dev,constchar*con_id,enumgpiod_flags flags){returngpiod_get_index(dev, con_id,0, flags); }structgpio_desc *__must_checkgpiod_get_index(structdevice *dev,constchar*con_id,un...
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_direc...
可以看到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); 重点关注第二个和第三个参数。 gpiod_get_index()到底用来...
gpiod_get gpiod_get_array gpiod_get_array_optiona gpiod_get_direction gpiod_get_index gpiod_get_index_optiona gpiod_get_optional gpiod_get_raw_value gpiod_get_raw_value_can gpiod_get_value gpiod_get_value_canslee gpiod_is_active_low gpiod_put gpiod_put_array gpiod_set_array_...
struct gpio_desc *gpiod_get(struct device *dev, const char *con_id,enum gpiod_flags flags)struct gpio_desc *gpiod_get_index(struct device *dev,const char *con_id, unsigned int idx,enum gpiod_flags flags) 或者也可以使用如下两个函数获取可用设备: ...
blue = gpiod_get_index(dev, "led", 2, GPIOD_OUT_HIGH); power = gpiod_get(dev, "power", GPIOD_OUT_HIGH); 1. 2. 3. 4. 5. 1.3.2 旧的gpio函数举例 如果需要使用gpio_函数,需要知道引脚号,引脚号的计算: 每个注册的GPIO Controller会确定它的"base number",那么这个控制器里的第n号引脚...
4、 desc_to_gpio devm_get_gpiod_from_chi devm_gpiod_getdevm_gpiod_get_array devm_gpiod_get_array_op devm_gpiod_get_index devm_gpiod_get_index_opdevm_gpiod_get_optionaldevm_gpiod_putdevm_gpiod_put_arrayfwnode_get_named_gpiodgpio_to_descgpiod_cansleepgpiod_countgpiod_direction_inpu...
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_...
我的问题出现在获取GPIO描述符阶段;文档说要使用gpiod_get_index(),该函数调用的是struct device而不是struct acpi_device。我试图通过传递struct acpi_device::dev成员来实现这一点,但是尽管这样做后我没有收到任何错误消息,但是当我将GPIO引脚设置为活动时,似乎什么也没有发生,所以我认为它不起作用。
unsigned int index mnumep'iio-d_flse£flags) 使用如下函数同时获取多个设备: struct g3io_ds5us geiod_g«t_a「「av(st「Mct device"dev, c0list char *cDr_idj enum gpiod」lags fl$eG 该函数返回一个 struct gniO-dwscy{unsigned int ndescs;struct gpio—desc*clest[ ...