增加 gpiod_get_optional.
Signed-off-by: rick.chan <chenyang@autoai.com>
This commit is contained in:
parent
136da28c52
commit
d293a39910
|
@ -101,7 +101,39 @@ flags:optional GPIO initialization flags。
|
|||
|
||||
This is equivalent to gpiod_get_index(), except that when no GPIO with the specified index was assigned to the requested function it will return NULL。
|
||||
|
||||
## 4. gpiod_direction_output 函数
|
||||
## 4. gpiod_get_optional 函数
|
||||
|
||||
**头文件:**
|
||||
|
||||
```cpp
|
||||
#include <linux/gpio/consumer.h>
|
||||
```
|
||||
|
||||
**函数原型:**
|
||||
|
||||
```cpp
|
||||
static inline struct gpio_desc *__must_check
|
||||
gpiod_get_optional(struct device *dev, const char *con_id,
|
||||
enum gpiod_flags flags);
|
||||
```
|
||||
|
||||
**说明:**
|
||||
|
||||
Obtain an optional GPIO for a given GPIO function. This is equivalent to gpiod_get(), except that when no GPIO was assigned to the requested function it will return NULL. This is convenient for drivers that need to handle optional GPIOs.
|
||||
|
||||
**参数:**
|
||||
|
||||
dev:GPIO consumer, can be NULL for system-global GPIOs
|
||||
|
||||
con_id:function within the GPIO consumer
|
||||
|
||||
flags:optional GPIO initialization flags
|
||||
|
||||
**返回值:**
|
||||
|
||||
Equivalent to gpiod_get(), except that when no GPIO was assigned to the requested function it will return NULL.
|
||||
|
||||
## 5. gpiod_direction_output 函数
|
||||
|
||||
**头文件:**
|
||||
|
||||
|
@ -129,7 +161,7 @@ value:initial output value of the GPIO。
|
|||
|
||||
Return 0 in case of success, else an error code。
|
||||
|
||||
## 5. gpiod_direction_input 函数
|
||||
## 6. gpiod_direction_input 函数
|
||||
|
||||
**头文件:**
|
||||
|
||||
|
@ -155,7 +187,7 @@ desc:GPIO to set to input。
|
|||
|
||||
Return 0 in case of success, else an error code。
|
||||
|
||||
## 6. gpiod_set_value_cansleep 函数
|
||||
## 7. gpiod_set_value_cansleep 函数
|
||||
|
||||
**头文件:**
|
||||
|
||||
|
|
Loading…
Reference in New Issue