libgpiod
|
Functions | |
void | gpiod_line_request_release (struct gpiod_line_request *request) |
Release the requested lines and free all associated resources. | |
const char * | gpiod_line_request_get_chip_name (struct gpiod_line_request *request) |
Get the name of the chip this request was made on. | |
size_t | gpiod_line_request_get_num_requested_lines (struct gpiod_line_request *request) |
Get the number of lines in the request. | |
size_t | gpiod_line_request_get_requested_offsets (struct gpiod_line_request *request, unsigned int *offsets, size_t max_offsets) |
Get the offsets of the lines in the request. | |
enum gpiod_line_value | gpiod_line_request_get_value (struct gpiod_line_request *request, unsigned int offset) |
Get the value of a single requested line. | |
int | gpiod_line_request_get_values_subset (struct gpiod_line_request *request, size_t num_values, const unsigned int *offsets, enum gpiod_line_value *values) |
Get the values of a subset of requested lines. | |
int | gpiod_line_request_get_values (struct gpiod_line_request *request, enum gpiod_line_value *values) |
Get the values of all requested lines. | |
int | gpiod_line_request_set_value (struct gpiod_line_request *request, unsigned int offset, enum gpiod_line_value value) |
Set the value of a single requested line. | |
int | gpiod_line_request_set_values_subset (struct gpiod_line_request *request, size_t num_values, const unsigned int *offsets, const enum gpiod_line_value *values) |
Set the values of a subset of requested lines. | |
int | gpiod_line_request_set_values (struct gpiod_line_request *request, const enum gpiod_line_value *values) |
Set the values of all lines associated with a request. | |
int | gpiod_line_request_reconfigure_lines (struct gpiod_line_request *request, struct gpiod_line_config *config) |
Update the configuration of lines associated with a line request. | |
int | gpiod_line_request_get_fd (struct gpiod_line_request *request) |
Get the file descriptor associated with a line request. | |
int | gpiod_line_request_wait_edge_events (struct gpiod_line_request *request, int64_t timeout_ns) |
Wait for edge events on any of the requested lines. | |
int | gpiod_line_request_read_edge_events (struct gpiod_line_request *request, struct gpiod_edge_event_buffer *buffer, size_t max_events) |
Read a number of edge events from a line request. | |
Functions allowing interactions with requested lines.
const char * gpiod_line_request_get_chip_name | ( | struct gpiod_line_request * | request | ) |
Get the name of the chip this request was made on.
request | Line request object. |
int gpiod_line_request_get_fd | ( | struct gpiod_line_request * | request | ) |
Get the file descriptor associated with a line request.
request | GPIO line request. |
size_t gpiod_line_request_get_num_requested_lines | ( | struct gpiod_line_request * | request | ) |
Get the number of lines in the request.
request | Line request object. |
size_t gpiod_line_request_get_requested_offsets | ( | struct gpiod_line_request * | request, |
unsigned int * | offsets, | ||
size_t | max_offsets ) |
Get the offsets of the lines in the request.
request | Line request object. |
offsets | Array to store offsets. |
max_offsets | Number of offsets that can be stored in the offsets array. |
If max_offsets is lower than the number of lines actually requested (this value can be retrieved using gpiod_line_request_get_num_requested_lines), then only up to max_lines offsets will be stored in offsets.
enum gpiod_line_value gpiod_line_request_get_value | ( | struct gpiod_line_request * | request, |
unsigned int | offset ) |
Get the value of a single requested line.
request | Line request object. |
offset | The offset of the line of which the value should be read. |
int gpiod_line_request_get_values | ( | struct gpiod_line_request * | request, |
enum gpiod_line_value * | values ) |
Get the values of all requested lines.
request | GPIO line request. |
values | Array in which the values will be stored. Must be sized to hold the number of lines filled by gpiod_line_request_get_num_requested_lines. Each value is associated with the line identified by the corresponding entry in the offset array filled by gpiod_line_request_get_requested_offsets. |
int gpiod_line_request_get_values_subset | ( | struct gpiod_line_request * | request, |
size_t | num_values, | ||
const unsigned int * | offsets, | ||
enum gpiod_line_value * | values ) |
Get the values of a subset of requested lines.
request | GPIO line request. |
num_values | Number of lines for which to read values. |
offsets | Array of offsets identifying the subset of requested lines from which to read values. |
values | Array in which the values will be stored. Must be sized to hold num_values entries. Each value is associated with the line identified by the corresponding entry in offsets . |
int gpiod_line_request_read_edge_events | ( | struct gpiod_line_request * | request, |
struct gpiod_edge_event_buffer * | buffer, | ||
size_t | max_events ) |
Read a number of edge events from a line request.
request | GPIO line request. |
buffer | Edge event buffer, sized to hold at least max_events . |
max_events | Maximum number of events to read. |
int gpiod_line_request_reconfigure_lines | ( | struct gpiod_line_request * | request, |
struct gpiod_line_config * | config ) |
Update the configuration of lines associated with a line request.
request | GPIO line request. |
config | New line config to apply. |
void gpiod_line_request_release | ( | struct gpiod_line_request * | request | ) |
Release the requested lines and free all associated resources.
request | Line request object to release. |
int gpiod_line_request_set_value | ( | struct gpiod_line_request * | request, |
unsigned int | offset, | ||
enum gpiod_line_value | value ) |
Set the value of a single requested line.
request | Line request object. |
offset | The offset of the line for which the value should be set. |
value | Value to set. |
int gpiod_line_request_set_values | ( | struct gpiod_line_request * | request, |
const enum gpiod_line_value * | values ) |
Set the values of all lines associated with a request.
request | GPIO line request. |
values | Array containing the values to set. Must be sized to contain the number of lines filled by gpiod_line_request_get_num_requested_lines. Each value is associated with the line identified by the corresponding entry in the offset array filled by gpiod_line_request_get_requested_offsets. |
int gpiod_line_request_set_values_subset | ( | struct gpiod_line_request * | request, |
size_t | num_values, | ||
const unsigned int * | offsets, | ||
const enum gpiod_line_value * | values ) |
Set the values of a subset of requested lines.
request | GPIO line request. |
num_values | Number of lines for which to set values. |
offsets | Array of offsets, containing the number of entries specified by num_values , identifying the requested lines for which to set values. |
values | Array of values to set, containing the number of entries specified by num_values . Each value is associated with the line identified by the corresponding entry in offsets . |
int gpiod_line_request_wait_edge_events | ( | struct gpiod_line_request * | request, |
int64_t | timeout_ns ) |
Wait for edge events on any of the requested lines.
request | GPIO line request. |
timeout_ns | Wait time limit in nanoseconds. If set to 0, the function returns immediately. If set to a negative number, the function blocks indefinitely until an event becomes available. |
Lines must have edge detection set for edge events to be emitted. By default edge detection is disabled.