libgpiod  1.6.2
Functions
Setting line configuration

Functions allowing modification of config options of GPIO lines requested from user-space. More...

Collaboration diagram for Setting line configuration:

Functions

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...
 

Detailed Description

Functions allowing modification of config options of GPIO lines requested from user-space.

Function Documentation

◆ 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
lineGPIO line object.
directionUpdated direction which may be one of GPIOD_LINE_REQUEST_DIRECTION_AS_IS, GPIOD_LINE_REQUEST_DIRECTION_INPUT, or GPIOD_LINE_REQUEST_DIRECTION_OUTPUT.
flagsReplacement flags.
valueThe 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
bulkSet of GPIO lines.
directionUpdated direction which may be one of GPIOD_LINE_REQUEST_DIRECTION_AS_IS, GPIOD_LINE_REQUEST_DIRECTION_INPUT, or GPIOD_LINE_REQUEST_DIRECTION_OUTPUT.
flagsReplacement flags.
valuesAn 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
lineGPIO line object.
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()

int gpiod_line_set_direction_input_bulk ( struct gpiod_line_bulk bulk)

Set the direction of a set of GPIO lines to input.

Parameters
bulkSet of GPIO 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_output()

int gpiod_line_set_direction_output ( struct gpiod_line *  line,
int  value 
)

Set the direction of a single GPIO line to output.

Parameters
lineGPIO line object.
valueThe 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
bulkSet of GPIO lines.
valuesAn 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
lineGPIO line object.
flagsReplacement 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()

int gpiod_line_set_flags_bulk ( struct gpiod_line_bulk bulk,
int  flags 
)

Update the configuration flags of a set of GPIO lines.

Parameters
bulkSet of GPIO lines.
flagsReplacement 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.