Functions allowing to read and set GPIO line values for single lines and in bulk.
More...
Functions allowing to read and set GPIO line values for single lines and in bulk.
◆ gpiod_line_get_value()
int gpiod_line_get_value |
( |
struct gpiod_line * |
line | ) |
|
Read current value of a single GPIO line.
- Parameters
-
- Returns
- 0 or 1 if the operation succeeds. On error this routine returns -1 and sets the last error number.
◆ gpiod_line_get_value_bulk()
int gpiod_line_get_value_bulk |
( |
struct gpiod_line_bulk * |
bulk, |
|
|
int * |
values |
|
) |
| |
Read current values of a set of GPIO lines.
- Parameters
-
bulk | Set of GPIO lines to reserve. |
values | An array big enough to hold line_bulk->num_lines values. |
- Returns
- 0 is the operation succeeds. In case of an error this routine returns -1 and sets the last error number.
If succeeds, this routine fills the values array with a set of values in the same order, the lines are added to line_bulk. If the lines were not previously requested together, the behavior is undefined.
◆ gpiod_line_set_value()
int gpiod_line_set_value |
( |
struct gpiod_line * |
line, |
|
|
int |
value |
|
) |
| |
Set the value of a single GPIO line.
- Parameters
-
line | GPIO line object. |
value | New value. |
- Returns
- 0 is the operation succeeds. In case of an error this routine returns -1 and sets the last error number.
◆ gpiod_line_set_value_bulk()
int gpiod_line_set_value_bulk |
( |
struct gpiod_line_bulk * |
bulk, |
|
|
const int * |
values |
|
) |
| |
Set the values of a set of GPIO lines.
- Parameters
-
bulk | Set of GPIO lines to reserve. |
values | An array holding line_bulk->num_lines new values for lines. A NULL pointer is interpreted as a logical low for all lines. |
- Returns
- 0 is the operation succeeds. In case of an error this routine returns -1 and sets the last error number.
If the lines were not previously requested together, the behavior is undefined.