Convenience data structures and helper functions for storing and operating on multiple lines at once.
More...
Convenience data structures and helper functions for storing and operating on multiple lines at once.
◆ gpiod_line_bulk_foreach_line
#define gpiod_line_bulk_foreach_line |
( |
|
bulk, |
|
|
|
line, |
|
|
|
lineptr |
|
) |
| |
Value: for ((lineptr) = (bulk)->lines, (line) = *(lineptr); \
(lineptr) <= (bulk)->lines + ((bulk)->num_lines - 1); \
(lineptr)++, (line) = *(lineptr))
Iterate over all line handles held by a line bulk object.
- Parameters
-
bulk | Line bulk object. |
line | GPIO line handle. On each iteration, the subsequent line handle is assigned to this pointer. |
lineptr | Pointer to a GPIO line handle used to store the loop state. |
Definition at line 788 of file gpiod.h.
◆ gpiod_line_bulk_foreach_line_off
#define gpiod_line_bulk_foreach_line_off |
( |
|
bulk, |
|
|
|
line, |
|
|
|
offset |
|
) |
| |
Value: for ((offset) = 0, (line) = (bulk)->lines[0]; \
(offset) < (bulk)->num_lines; \
(offset)++, (line) = (bulk)->lines[(offset)])
Iterate over all line handles held by a line bulk object (integer counter variant).
- Parameters
-
bulk | Line bulk object. |
line | GPIO line handle. On each iteration, the subsequent line handle is assigned to this pointer. |
offset | An integer variable used to store the loop state. |
This is a variant of gpiod_line_bulk_foreach_line which uses an integer variable (either signed or unsigned) to store the loop state. This offset variable is guaranteed to correspond to the offset of the current line in the bulk->lines array.
Definition at line 806 of file gpiod.h.
◆ GPIOD_LINE_BULK_INITIALIZER
#define GPIOD_LINE_BULK_INITIALIZER { { NULL }, 0 } |
Static initializer for GPIO bulk objects.
This macro simply sets the internally held number of lines to 0.
Definition at line 734 of file gpiod.h.
◆ gpiod_line_bulk_add()
static void gpiod_line_bulk_add |
( |
struct gpiod_line_bulk * |
bulk, |
|
|
struct gpiod_line * |
line |
|
) |
| |
|
inlinestatic |
◆ gpiod_line_bulk_get_line()
static struct gpiod_line* gpiod_line_bulk_get_line |
( |
struct gpiod_line_bulk * |
bulk, |
|
|
unsigned int |
offset |
|
) |
| |
|
inlinestatic |
Retrieve the line handle from a line bulk object at given offset.
- Parameters
-
bulk | Line bulk object. |
offset | Line offset. |
- Returns
- Line handle at given offset.
Definition at line 765 of file gpiod.h.
References gpiod_line_bulk::lines.
◆ gpiod_line_bulk_init()
Initialize a GPIO bulk object.
- Parameters
-
This routine simply sets the internally held number of lines to 0.
Definition at line 742 of file gpiod.h.
References gpiod_line_bulk::num_lines.
◆ gpiod_line_bulk_num_lines()
static unsigned int gpiod_line_bulk_num_lines |
( |
struct gpiod_line_bulk * |
bulk | ) |
|
|
inlinestatic |
Retrieve the number of GPIO lines held by this line bulk object.
- Parameters
-
- Returns
- Number of lines held by this line bulk.
Definition at line 776 of file gpiod.h.
References gpiod_line_bulk::num_lines.