libgpiod
1.4.1
|
Data Structures | |
struct | gpiod_line_event |
Structure holding event info. More... | |
Enumerations | |
enum | { GPIOD_LINE_EVENT_RISING_EDGE = 1, GPIOD_LINE_EVENT_FALLING_EDGE } |
Event types. More... | |
Functions | |
int | gpiod_line_event_wait (struct gpiod_line *line, const struct timespec *timeout) GPIOD_API |
Wait for an event on a single line. More... | |
int | gpiod_line_event_wait_bulk (struct gpiod_line_bulk *bulk, const struct timespec *timeout, struct gpiod_line_bulk *event_bulk) GPIOD_API |
Wait for events on a set of lines. More... | |
int | gpiod_line_event_read (struct gpiod_line *line, struct gpiod_line_event *event) GPIOD_API |
Read the last event from the GPIO line. More... | |
int | gpiod_line_event_get_fd (struct gpiod_line *line) GPIOD_API |
Get the event file descriptor. More... | |
int | gpiod_line_event_read_fd (int fd, struct gpiod_line_event *event) GPIOD_API |
Read the last GPIO event directly from a file descriptor. More... | |
anonymous enum |
int gpiod_line_event_get_fd | ( | struct gpiod_line * | line | ) |
Get the event file descriptor.
line | GPIO line object. |
Users may want to poll the event file descriptor on their own. This routine allows to access it.
int gpiod_line_event_read | ( | struct gpiod_line * | line, |
struct gpiod_line_event * | event | ||
) |
Read the last event from the GPIO line.
line | GPIO line object. |
event | Buffer to which the event data will be copied. |
int gpiod_line_event_read_fd | ( | int | fd, |
struct gpiod_line_event * | event | ||
) |
Read the last GPIO event directly from a file descriptor.
fd | File descriptor. |
event | Buffer in which the event data will be stored. |
Users who directly poll the file descriptor for incoming events can also directly read the event data from it using this routine. This function translates the kernel representation of the event to the libgpiod format.
int gpiod_line_event_wait | ( | struct gpiod_line * | line, |
const struct timespec * | timeout | ||
) |
Wait for an event on a single line.
line | GPIO line object. |
timeout | Wait time limit. |
int gpiod_line_event_wait_bulk | ( | struct gpiod_line_bulk * | bulk, |
const struct timespec * | timeout, | ||
struct gpiod_line_bulk * | event_bulk | ||
) |
Wait for events on a set of lines.
bulk | Set of GPIO lines to monitor. |
timeout | Wait time limit. |
event_bulk | Bulk object in which to store the line handles on which events occurred. Can be NULL. |