libgpiod  1.6.1
Data Structures | Enumerations | Functions
C++ bindings

Data Structures

class  gpiod::chip
 Represents a GPIO chip. More...
 
struct  gpiod::line_request
 Stores the configuration for line requests. More...
 
class  gpiod::line
 Represents a single GPIO line. More...
 
struct  gpiod::line_event
 Describes a single GPIO line event. More...
 
class  gpiod::line_bulk::iterator
 Iterator for iterating over lines held by line_bulk. More...
 
class  gpiod::line_bulk
 Represents a set of GPIO lines. More...
 
class  gpiod::chip_iter
 Allows to iterate over all GPIO chips present on the system. More...
 
class  gpiod::line_iter
 Allows to iterate over all lines owned by a GPIO chip. More...
 

Enumerations

enum  : int {
  gpiod::chip::OPEN_LOOKUP = 1, gpiod::chip::OPEN_BY_PATH, gpiod::chip::OPEN_BY_NAME, gpiod::chip::OPEN_BY_LABEL,
  gpiod::chip::OPEN_BY_NUMBER
}
 Affect the way in which chip::chip and chip::open will try to open a GPIO chip character device. More...
 
enum  : int {
  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
}
 Request types. More...
 
enum  : int { gpiod::line::DIRECTION_INPUT = 1, gpiod::line::DIRECTION_OUTPUT }
 Possible direction settings. More...
 
enum  : int { gpiod::line::ACTIVE_LOW = 1, gpiod::line::ACTIVE_HIGH }
 Possible active state settings. More...
 
enum  : int { gpiod::line::BIAS_AS_IS = 1, gpiod::line::BIAS_DISABLE, gpiod::line::BIAS_PULL_UP, gpiod::line::BIAS_PULL_DOWN }
 Possible bias settings. More...
 
enum  : int { gpiod::line_event::RISING_EDGE = 1, gpiod::line_event::FALLING_EDGE }
 Possible event types. More...
 

Functions

GPIOD_API line gpiod::find_line (const ::std::string &name)
 Find a GPIO line by name. More...
 
GPIOD_API chip_iter gpiod::make_chip_iter (void)
 Create a new chip_iter. More...
 
GPIOD_API chip_iter gpiod::begin (chip_iter iter) noexcept
 Support for range-based loops for chip iterators. More...
 
GPIOD_API chip_iter gpiod::end (const chip_iter &iter) noexcept
 Support for range-based loops for chip iterators. More...
 
GPIOD_API line_iter gpiod::begin (line_iter iter) noexcept
 Support for range-based loops for line iterators. More...
 
GPIOD_API line_iter gpiod::end (const line_iter &iter) noexcept
 Support for range-based loops for line iterators. More...
 

Detailed Description

Enumeration Type Documentation

anonymous enum : int

Affect the way in which chip::chip and chip::open will try to open a GPIO chip character device.

Enumerator
OPEN_LOOKUP 

Open based on the best guess what the supplied string is.

OPEN_BY_PATH 

Assume the string is a path to the GPIO chardev.

OPEN_BY_NAME 

Assume the string is the name of the chip.

OPEN_BY_LABEL 

Assume the string is the label of the GPIO chip.

OPEN_BY_NUMBER 

Assume the string is the number of the GPIO chip.

Definition at line 186 of file gpiod.hpp.

anonymous enum : int

Request types.

Enumerator
DIRECTION_AS_IS 

Request for values, don't change the direction.

DIRECTION_INPUT 

Request for reading line values.

DIRECTION_OUTPUT 

Request for driving the GPIO lines.

EVENT_FALLING_EDGE 

Listen for falling edge events.

EVENT_RISING_EDGE 

Listen for rising edge events.

EVENT_BOTH_EDGES 

Listen for all types of events.

Definition at line 219 of file gpiod.hpp.

anonymous enum : int

Possible direction settings.

Enumerator
DIRECTION_INPUT 

Line's direction setting is input.

DIRECTION_OUTPUT 

Line's direction setting is output.

Definition at line 490 of file gpiod.hpp.

anonymous enum : int

Possible active state settings.

Enumerator
ACTIVE_LOW 

Line's active state is low.

ACTIVE_HIGH 

Line's active state is high.

Definition at line 500 of file gpiod.hpp.

anonymous enum : int

Possible bias settings.

Enumerator
BIAS_AS_IS 

Line's bias state is unknown.

BIAS_DISABLE 

Line's internal bias is disabled.

BIAS_PULL_UP 

Line's internal pull-up bias is enabled.

BIAS_PULL_DOWN 

Line's internal pull-down bias is enabled.

Definition at line 510 of file gpiod.hpp.

anonymous enum : int

Possible event types.

Enumerator
RISING_EDGE 

Rising edge event.

FALLING_EDGE 

Falling edge event.

Definition at line 551 of file gpiod.hpp.

Function Documentation

GPIOD_API chip_iter gpiod::begin ( chip_iter  iter)
noexcept

Support for range-based loops for chip iterators.

Parameters
iterA chip iterator.
Returns
Iterator unchanged.
GPIOD_API line_iter gpiod::begin ( line_iter  iter)
noexcept

Support for range-based loops for line iterators.

Parameters
iterA line iterator.
Returns
Iterator unchanged.
GPIOD_API chip_iter gpiod::end ( const chip_iter iter)
noexcept

Support for range-based loops for chip iterators.

Parameters
iterA chip iterator.
Returns
New end iterator.
GPIOD_API line_iter gpiod::end ( const line_iter iter)
noexcept

Support for range-based loops for line iterators.

Parameters
iterA line iterator.
Returns
New end iterator.
GPIOD_API line gpiod::find_line ( const ::std::string &  name)

Find a GPIO line by name.

Search all GPIO chips present on the system.

Parameters
nameName of the line.
Returns
Returns a line object - empty if the line was not found.
GPIOD_API chip_iter gpiod::make_chip_iter ( void  )

Create a new chip_iter.

Returns
New chip iterator object pointing to the first GPIO chip on the system.
Note
This function is needed as we already use the default constructor of gpiod::chip_iter as the return value of gpiod::end.