From 52bfc4f2aab3d35a9171cb1b5f7409abe98646cc Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Sun, 24 Sep 2017 22:06:31 +0200 Subject: [PATCH] core: add gpiod_line_bulk_get_line() Add a getter function for retrieving line handles from bulk objects. Signed-off-by: Bartosz Golaszewski --- include/gpiod.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/gpiod.h b/include/gpiod.h index fb173be..6946a33 100644 --- a/include/gpiod.h +++ b/include/gpiod.h @@ -373,6 +373,18 @@ static inline void gpiod_line_bulk_add(struct gpiod_line_bulk *bulk, bulk->lines[bulk->num_lines++] = line; } +/** + * @brief Retrieve the line handle from a line bulk object at given offset. + * @param bulk Line bulk object. + * @param offset Line offset. + * @return Line handle at given offset. + */ +static inline struct gpiod_line * +gpiod_line_bulk_get_line(struct gpiod_line_bulk *bulk, unsigned int offset) +{ + return bulk->lines[offset]; +} + /** * @brief Read the GPIO line offset. * @param line GPIO line object. -- 2.30.2