Private
Public Access
2
0

gpio: chardev: Add helper to retrieve gpiochip and line offset by line name

This makes the retrieval robust against chips being reordered during
boot. The results can be used to fill out mraa_pin_t while initializing
a board.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Jan Kiszka
2021-01-18 07:11:20 +01:00
committed by Tom Ingleby
parent fdab66958e
commit 56a11363de
2 changed files with 46 additions and 0 deletions

View File

@@ -49,6 +49,8 @@ mraa_boolean_t mraa_is_gpio_line_open_source(mraa_gpiod_line_info *linfo);
int mraa_get_number_of_gpio_chips();
int mraa_get_chip_infos(mraa_gpiod_chip_info*** cinfos);
int mraa_find_gpio_line_by_name(const char *name, unsigned *chip_number, unsigned *line_number);
/* Multiple gpio support. */
typedef struct _gpio_group* mraa_gpiod_group_t;