Functions allowing modification of config options of GPIO lines requested from user-space.
More...
|
int | gpiod_line_set_config (struct gpiod_line *line, int direction, int flags, int value) GPIOD_API |
| Update the configuration of a single GPIO line. More...
|
|
int | gpiod_line_set_config_bulk (struct gpiod_line_bulk *bulk, int direction, int flags, const int *values) GPIOD_API |
| Update the configuration of a set of GPIO lines. More...
|
|
int | gpiod_line_set_flags (struct gpiod_line *line, int flags) GPIOD_API |
| Update the configuration flags of a single GPIO line. More...
|
|
int | gpiod_line_set_flags_bulk (struct gpiod_line_bulk *bulk, int flags) GPIOD_API |
| Update the configuration flags of a set of GPIO lines. More...
|
|
int | gpiod_line_set_direction_input (struct gpiod_line *line) GPIOD_API |
| Set the direction of a single GPIO line to input. More...
|
|
int | gpiod_line_set_direction_input_bulk (struct gpiod_line_bulk *bulk) GPIOD_API |
| Set the direction of a set of GPIO lines to input. More...
|
|
int | gpiod_line_set_direction_output (struct gpiod_line *line, int value) GPIOD_API |
| Set the direction of a single GPIO line to output. More...
|
|
int | gpiod_line_set_direction_output_bulk (struct gpiod_line_bulk *bulk, const int *values) GPIOD_API |
| Set the direction of a set of GPIO lines to output. More...
|
|
Functions allowing modification of config options of GPIO lines requested from user-space.
◆ gpiod_line_set_config()
int gpiod_line_set_config |
( |
struct gpiod_line * |
line, |
|
|
int |
direction, |
|
|
int |
flags, |
|
|
int |
value |
|
) |
| |
Update the configuration of a single GPIO line.
- Parameters
-
line | GPIO line object. |
direction | Updated direction which may be one of GPIOD_LINE_REQUEST_DIRECTION_AS_IS, GPIOD_LINE_REQUEST_DIRECTION_INPUT, or GPIOD_LINE_REQUEST_DIRECTION_OUTPUT. |
flags | Replacement flags. |
value | The new output value for the line when direction is GPIOD_LINE_REQUEST_DIRECTION_OUTPUT. |
- Returns
- 0 is the operation succeeds. In case of an error this routine returns -1 and sets the last error number.
◆ gpiod_line_set_config_bulk()
int gpiod_line_set_config_bulk |
( |
struct gpiod_line_bulk * |
bulk, |
|
|
int |
direction, |
|
|
int |
flags, |
|
|
const int * |
values |
|
) |
| |
Update the configuration of a set of GPIO lines.
- Parameters
-
bulk | Set of GPIO lines. |
direction | Updated direction which may be one of GPIOD_LINE_REQUEST_DIRECTION_AS_IS, GPIOD_LINE_REQUEST_DIRECTION_INPUT, or GPIOD_LINE_REQUEST_DIRECTION_OUTPUT. |
flags | Replacement flags. |
values | An array holding line_bulk->num_lines new logical values for lines when direction is GPIOD_LINE_REQUEST_DIRECTION_OUTPUT. 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.
◆ gpiod_line_set_direction_input()
int gpiod_line_set_direction_input |
( |
struct gpiod_line * |
line | ) |
|
Set the direction of a single GPIO line to input.
- Parameters
-
- Returns
- 0 is the operation succeeds. In case of an error this routine returns -1 and sets the last error number.
◆ gpiod_line_set_direction_input_bulk()
Set the direction of a set of GPIO lines to input.
- Parameters
-
- 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.
◆ gpiod_line_set_direction_output()
int gpiod_line_set_direction_output |
( |
struct gpiod_line * |
line, |
|
|
int |
value |
|
) |
| |
Set the direction of a single GPIO line to output.
- Parameters
-
line | GPIO line object. |
value | The logical value output on the line. |
- Returns
- 0 is the operation succeeds. In case of an error this routine returns -1 and sets the last error number.
◆ gpiod_line_set_direction_output_bulk()
int gpiod_line_set_direction_output_bulk |
( |
struct gpiod_line_bulk * |
bulk, |
|
|
const int * |
values |
|
) |
| |
Set the direction of a set of GPIO lines to output.
- Parameters
-
bulk | Set of GPIO lines. |
values | An array holding line_bulk->num_lines new logical 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.
References GPIOD_LINE_EVENT_FALLING_EDGE, and GPIOD_LINE_EVENT_RISING_EDGE.
◆ gpiod_line_set_flags()
int gpiod_line_set_flags |
( |
struct gpiod_line * |
line, |
|
|
int |
flags |
|
) |
| |
Update the configuration flags of a single GPIO line.
- Parameters
-
line | GPIO line object. |
flags | Replacement flags. |
- Returns
- 0 is the operation succeeds. In case of an error this routine returns -1 and sets the last error number.
◆ gpiod_line_set_flags_bulk()
Update the configuration flags of a set of GPIO lines.
- Parameters
-
bulk | Set of GPIO lines. |
flags | Replacement flags. |
- 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.