libgpiod
1.2
|
![]() |
Enumerations | |
enum | { GPIOD_LINE_DIRECTION_INPUT = 1, GPIOD_LINE_DIRECTION_OUTPUT } |
Possible direction settings. More... | |
enum | { GPIOD_LINE_ACTIVE_STATE_HIGH = 1, GPIOD_LINE_ACTIVE_STATE_LOW } |
Possible active state settings. More... | |
Functions | |
unsigned int | gpiod_line_offset (struct gpiod_line *line) GPIOD_API |
Read the GPIO line offset. More... | |
const char * | gpiod_line_name (struct gpiod_line *line) GPIOD_API |
Read the GPIO line name. More... | |
const char * | gpiod_line_consumer (struct gpiod_line *line) GPIOD_API |
Read the GPIO line consumer name. More... | |
int | gpiod_line_direction (struct gpiod_line *line) GPIOD_API |
Read the GPIO line direction setting. More... | |
int | gpiod_line_active_state (struct gpiod_line *line) GPIOD_API |
Read the GPIO line active state setting. More... | |
bool | gpiod_line_is_used (struct gpiod_line *line) GPIOD_API |
Check if the line is currently in use. More... | |
bool | gpiod_line_is_open_drain (struct gpiod_line *line) GPIOD_API |
Check if the line is an open-drain GPIO. More... | |
bool | gpiod_line_is_open_source (struct gpiod_line *line) GPIOD_API |
Check if the line is an open-source GPIO. More... | |
int | gpiod_line_update (struct gpiod_line *line) GPIOD_API |
Re-read the line info. More... | |
bool | gpiod_line_needs_update (struct gpiod_line *line) GPIOD_API |
Check if the line info needs to be updated. More... | |
anonymous enum |
anonymous enum |
int gpiod_line_active_state | ( | struct gpiod_line * | line | ) |
Read the GPIO line active state setting.
line | GPIO line object. |
const char* gpiod_line_consumer | ( | struct gpiod_line * | line | ) |
Read the GPIO line consumer name.
line | GPIO line object. |
int gpiod_line_direction | ( | struct gpiod_line * | line | ) |
Read the GPIO line direction setting.
line | GPIO line object. |
bool gpiod_line_is_open_drain | ( | struct gpiod_line * | line | ) |
Check if the line is an open-drain GPIO.
line | GPIO line object. |
bool gpiod_line_is_open_source | ( | struct gpiod_line * | line | ) |
Check if the line is an open-source GPIO.
line | GPIO line object. |
bool gpiod_line_is_used | ( | struct gpiod_line * | line | ) |
Check if the line is currently in use.
line | GPIO line object. |
The user space can't know exactly why a line is busy. It may have been requested by another process or hogged by the kernel. It only matters that the line is used and we can't request it.
const char* gpiod_line_name | ( | struct gpiod_line * | line | ) |
Read the GPIO line name.
line | GPIO line object. |
bool gpiod_line_needs_update | ( | struct gpiod_line * | line | ) |
Check if the line info needs to be updated.
line | GPIO line object. |
The line is updated by calling gpiod_line_update() from within gpiod_chip_get_line() and on every line request/release. However: an error returned from gpiod_line_update() only breaks the execution of the former. The request/release routines only set the internal up-to-date flag to false and continue their execution. This routine allows to check if a line info update failed at some point and we should call gpiod_line_update() explicitly.
unsigned int gpiod_line_offset | ( | struct gpiod_line * | line | ) |
Read the GPIO line offset.
line | GPIO line object. |
int gpiod_line_update | ( | struct gpiod_line * | line | ) |
Re-read the line info.
line | GPIO line object. |
The line info is initially retrieved from the kernel by gpiod_chip_get_line(). Users can use this line to manually re-read the line info.