libgpiod
1.6.2
|
Interface for requesting GPIO lines from userspace for both values and events. More...
Data Structures | |
struct | gpiod_line_request_config |
Structure holding configuration of a line request. More... | |
Enumerations | |
enum | { GPIOD_LINE_REQUEST_DIRECTION_AS_IS = 1, GPIOD_LINE_REQUEST_DIRECTION_INPUT, GPIOD_LINE_REQUEST_DIRECTION_OUTPUT, GPIOD_LINE_REQUEST_EVENT_FALLING_EDGE, GPIOD_LINE_REQUEST_EVENT_RISING_EDGE, GPIOD_LINE_REQUEST_EVENT_BOTH_EDGES } |
Available types of requests. More... | |
enum | { GPIOD_LINE_REQUEST_FLAG_OPEN_DRAIN = GPIOD_BIT(0), GPIOD_LINE_REQUEST_FLAG_OPEN_SOURCE = GPIOD_BIT(1), GPIOD_LINE_REQUEST_FLAG_ACTIVE_LOW = GPIOD_BIT(2), GPIOD_LINE_REQUEST_FLAG_BIAS_DISABLE = GPIOD_BIT(3), GPIOD_LINE_REQUEST_FLAG_BIAS_PULL_DOWN = GPIOD_BIT(4), GPIOD_LINE_REQUEST_FLAG_BIAS_PULL_UP = GPIOD_BIT(5) } |
Miscellaneous GPIO request flags. More... | |
Functions | |
int | gpiod_line_request (struct gpiod_line *line, const struct gpiod_line_request_config *config, int default_val) GPIOD_API |
Reserve a single line. More... | |
int | gpiod_line_request_input (struct gpiod_line *line, const char *consumer) GPIOD_API |
Reserve a single line, set the direction to input. More... | |
int | gpiod_line_request_output (struct gpiod_line *line, const char *consumer, int default_val) GPIOD_API |
Reserve a single line, set the direction to output. More... | |
int | gpiod_line_request_rising_edge_events (struct gpiod_line *line, const char *consumer) GPIOD_API |
Request rising edge event notifications on a single line. More... | |
int | gpiod_line_request_falling_edge_events (struct gpiod_line *line, const char *consumer) GPIOD_API |
Request falling edge event notifications on a single line. More... | |
int | gpiod_line_request_both_edges_events (struct gpiod_line *line, const char *consumer) GPIOD_API |
Request all event type notifications on a single line. More... | |
int | gpiod_line_request_input_flags (struct gpiod_line *line, const char *consumer, int flags) GPIOD_API |
Reserve a single line, set the direction to input. More... | |
int | gpiod_line_request_output_flags (struct gpiod_line *line, const char *consumer, int flags, int default_val) GPIOD_API |
Reserve a single line, set the direction to output. More... | |
int | gpiod_line_request_rising_edge_events_flags (struct gpiod_line *line, const char *consumer, int flags) GPIOD_API |
Request rising edge event notifications on a single line. More... | |
int | gpiod_line_request_falling_edge_events_flags (struct gpiod_line *line, const char *consumer, int flags) GPIOD_API |
Request falling edge event notifications on a single line. More... | |
int | gpiod_line_request_both_edges_events_flags (struct gpiod_line *line, const char *consumer, int flags) GPIOD_API |
Request all event type notifications on a single line. More... | |
int | gpiod_line_request_bulk (struct gpiod_line_bulk *bulk, const struct gpiod_line_request_config *config, const int *default_vals) GPIOD_API |
Reserve a set of GPIO lines. More... | |
int | gpiod_line_request_bulk_input (struct gpiod_line_bulk *bulk, const char *consumer) GPIOD_API |
Reserve a set of GPIO lines, set the direction to input. More... | |
int | gpiod_line_request_bulk_output (struct gpiod_line_bulk *bulk, const char *consumer, const int *default_vals) GPIOD_API |
Reserve a set of GPIO lines, set the direction to output. More... | |
int | gpiod_line_request_bulk_rising_edge_events (struct gpiod_line_bulk *bulk, const char *consumer) GPIOD_API |
Request rising edge event notifications on a set of lines. More... | |
int | gpiod_line_request_bulk_falling_edge_events (struct gpiod_line_bulk *bulk, const char *consumer) GPIOD_API |
Request falling edge event notifications on a set of lines. More... | |
int | gpiod_line_request_bulk_both_edges_events (struct gpiod_line_bulk *bulk, const char *consumer) GPIOD_API |
Request all event type notifications on a set of lines. More... | |
int | gpiod_line_request_bulk_input_flags (struct gpiod_line_bulk *bulk, const char *consumer, int flags) GPIOD_API |
Reserve a set of GPIO lines, set the direction to input. More... | |
int | gpiod_line_request_bulk_output_flags (struct gpiod_line_bulk *bulk, const char *consumer, int flags, const int *default_vals) GPIOD_API |
Reserve a set of GPIO lines, set the direction to output. More... | |
int | gpiod_line_request_bulk_rising_edge_events_flags (struct gpiod_line_bulk *bulk, const char *consumer, int flags) GPIOD_API |
Request rising edge event notifications on a set of lines. More... | |
int | gpiod_line_request_bulk_falling_edge_events_flags (struct gpiod_line_bulk *bulk, const char *consumer, int flags) GPIOD_API |
Request falling edge event notifications on a set of lines. More... | |
int | gpiod_line_request_bulk_both_edges_events_flags (struct gpiod_line_bulk *bulk, const char *consumer, int flags) GPIOD_API |
Request all event type notifications on a set of lines. More... | |
void | gpiod_line_release (struct gpiod_line *line) GPIOD_API |
Release a previously reserved line. More... | |
void | gpiod_line_release_bulk (struct gpiod_line_bulk *bulk) GPIOD_API |
Release a set of previously reserved lines. More... | |
bool | gpiod_line_is_requested (struct gpiod_line *line) GPIOD_API |
Check if the calling user has ownership of this line. More... | |
bool | gpiod_line_is_free (struct gpiod_line *line) GPIOD_API |
Check if the calling user has neither requested ownership of this line nor configured any event notifications. More... | |
Interface for requesting GPIO lines from userspace for both values and events.
anonymous enum |
Available types of requests.
anonymous enum |
Miscellaneous GPIO request flags.
bool gpiod_line_is_free | ( | struct gpiod_line * | line | ) |
Check if the calling user has neither requested ownership of this line nor configured any event notifications.
line | GPIO line object. |
bool gpiod_line_is_requested | ( | struct gpiod_line * | line | ) |
Check if the calling user has ownership of this line.
line | GPIO line object. |
void gpiod_line_release | ( | struct gpiod_line * | line | ) |
Release a previously reserved line.
line | GPIO line object. |
void gpiod_line_release_bulk | ( | struct gpiod_line_bulk * | bulk | ) |
Release a set of previously reserved lines.
bulk | Set of GPIO lines to release. |
If the lines were not previously requested together, the behavior is undefined.
int gpiod_line_request | ( | struct gpiod_line * | line, |
const struct gpiod_line_request_config * | config, | ||
int | default_val | ||
) |
Reserve a single line.
line | GPIO line object. |
config | Request options. |
default_val | Initial line value - only relevant if we're setting the direction to output. |
If this routine succeeds, the caller takes ownership of the GPIO line until it's released.
int gpiod_line_request_both_edges_events | ( | struct gpiod_line * | line, |
const char * | consumer | ||
) |
Request all event type notifications on a single line.
line | GPIO line object. |
consumer | Name of the consumer. |
int gpiod_line_request_both_edges_events_flags | ( | struct gpiod_line * | line, |
const char * | consumer, | ||
int | flags | ||
) |
Request all event type notifications on a single line.
line | GPIO line object. |
consumer | Name of the consumer. |
flags | Additional request flags. |
int gpiod_line_request_bulk | ( | struct gpiod_line_bulk * | bulk, |
const struct gpiod_line_request_config * | config, | ||
const int * | default_vals | ||
) |
Reserve a set of GPIO lines.
bulk | Set of GPIO lines to reserve. |
config | Request options. |
default_vals | Initial line values - only relevant if we're setting the direction to output. |
If this routine succeeds, the caller takes ownership of the GPIO lines until they're released. All the requested lines must be prodivided by the same gpiochip.
int gpiod_line_request_bulk_both_edges_events | ( | struct gpiod_line_bulk * | bulk, |
const char * | consumer | ||
) |
Request all event type notifications on a set of lines.
bulk | Set of GPIO lines to request. |
consumer | Name of the consumer. |
int gpiod_line_request_bulk_both_edges_events_flags | ( | struct gpiod_line_bulk * | bulk, |
const char * | consumer, | ||
int | flags | ||
) |
Request all event type notifications on a set of lines.
bulk | Set of GPIO lines to request. |
consumer | Name of the consumer. |
flags | Additional request flags. |
int gpiod_line_request_bulk_falling_edge_events | ( | struct gpiod_line_bulk * | bulk, |
const char * | consumer | ||
) |
Request falling edge event notifications on a set of lines.
bulk | Set of GPIO lines to request. |
consumer | Name of the consumer. |
int gpiod_line_request_bulk_falling_edge_events_flags | ( | struct gpiod_line_bulk * | bulk, |
const char * | consumer, | ||
int | flags | ||
) |
Request falling edge event notifications on a set of lines.
bulk | Set of GPIO lines to request. |
consumer | Name of the consumer. |
flags | Additional request flags. |
int gpiod_line_request_bulk_input | ( | struct gpiod_line_bulk * | bulk, |
const char * | consumer | ||
) |
Reserve a set of GPIO lines, set the direction to input.
bulk | Set of GPIO lines to reserve. |
consumer | Name of the consumer. |
int gpiod_line_request_bulk_input_flags | ( | struct gpiod_line_bulk * | bulk, |
const char * | consumer, | ||
int | flags | ||
) |
Reserve a set of GPIO lines, set the direction to input.
bulk | Set of GPIO lines to reserve. |
consumer | Name of the consumer. |
flags | Additional request flags. |
int gpiod_line_request_bulk_output | ( | struct gpiod_line_bulk * | bulk, |
const char * | consumer, | ||
const int * | default_vals | ||
) |
Reserve a set of GPIO lines, set the direction to output.
bulk | Set of GPIO lines to reserve. |
consumer | Name of the consumer. |
default_vals | Initial line values. |
int gpiod_line_request_bulk_output_flags | ( | struct gpiod_line_bulk * | bulk, |
const char * | consumer, | ||
int | flags, | ||
const int * | default_vals | ||
) |
Reserve a set of GPIO lines, set the direction to output.
bulk | Set of GPIO lines to reserve. |
consumer | Name of the consumer. |
flags | Additional request flags. |
default_vals | Initial line values. |
int gpiod_line_request_bulk_rising_edge_events | ( | struct gpiod_line_bulk * | bulk, |
const char * | consumer | ||
) |
Request rising edge event notifications on a set of lines.
bulk | Set of GPIO lines to request. |
consumer | Name of the consumer. |
int gpiod_line_request_bulk_rising_edge_events_flags | ( | struct gpiod_line_bulk * | bulk, |
const char * | consumer, | ||
int | flags | ||
) |
Request rising edge event notifications on a set of lines.
bulk | Set of GPIO lines to request. |
consumer | Name of the consumer. |
flags | Additional request flags. |
int gpiod_line_request_falling_edge_events | ( | struct gpiod_line * | line, |
const char * | consumer | ||
) |
Request falling edge event notifications on a single line.
line | GPIO line object. |
consumer | Name of the consumer. |
int gpiod_line_request_falling_edge_events_flags | ( | struct gpiod_line * | line, |
const char * | consumer, | ||
int | flags | ||
) |
Request falling edge event notifications on a single line.
line | GPIO line object. |
consumer | Name of the consumer. |
flags | Additional request flags. |
int gpiod_line_request_input | ( | struct gpiod_line * | line, |
const char * | consumer | ||
) |
Reserve a single line, set the direction to input.
line | GPIO line object. |
consumer | Name of the consumer. |
int gpiod_line_request_input_flags | ( | struct gpiod_line * | line, |
const char * | consumer, | ||
int | flags | ||
) |
Reserve a single line, set the direction to input.
line | GPIO line object. |
consumer | Name of the consumer. |
flags | Additional request flags. |
int gpiod_line_request_output | ( | struct gpiod_line * | line, |
const char * | consumer, | ||
int | default_val | ||
) |
Reserve a single line, set the direction to output.
line | GPIO line object. |
consumer | Name of the consumer. |
default_val | Initial line value. |
int gpiod_line_request_output_flags | ( | struct gpiod_line * | line, |
const char * | consumer, | ||
int | flags, | ||
int | default_val | ||
) |
Reserve a single line, set the direction to output.
line | GPIO line object. |
consumer | Name of the consumer. |
flags | Additional request flags. |
default_val | Initial line value. |
int gpiod_line_request_rising_edge_events | ( | struct gpiod_line * | line, |
const char * | consumer | ||
) |
Request rising edge event notifications on a single line.
line | GPIO line object. |
consumer | Name of the consumer. |
int gpiod_line_request_rising_edge_events_flags | ( | struct gpiod_line * | line, |
const char * | consumer, | ||
int | flags | ||
) |
Request rising edge event notifications on a single line.
line | GPIO line object. |
consumer | Name of the consumer. |
flags | Additional request flags. |