libgpiod  2.1.3
Data Structures
gpiod::line Namespace Reference

Namespace containing various type definitions for GPIO lines. More...

Data Structures

class  offset
 Wrapper around unsigned int for representing line offsets. More...
 
enum class  value { INACTIVE = 0 , ACTIVE = 1 }
 Logical line states. More...
 
enum class  direction { AS_IS = 1 , INPUT , OUTPUT }
 Direction settings. More...
 
enum class  edge { NONE = 1 , RISING , FALLING , BOTH }
 Edge detection settings. More...
 
enum class  bias {
  AS_IS = 1 , UNKNOWN , DISABLED , PULL_UP ,
  PULL_DOWN
}
 Internal bias settings. More...
 
enum class  drive { PUSH_PULL = 1 , OPEN_DRAIN , OPEN_SOURCE }
 Drive settings. More...
 
enum class  clock { MONOTONIC = 1 , REALTIME , HTE }
 Event clock settings. More...
 
using offsets = ::std::vector< offset >
 Vector of line offsets.
 
using values = ::std::vector< value >
 Vector of line values.
 
using value_mapping = ::std::pair< offset, value >
 Represents a mapping of a line offset to line logical state.
 
using value_mappings = ::std::vector< value_mapping >
 Vector of offset->value mappings. More...
 
::std::ostream & operator<< (::std::ostream &out, value val)
 Stream insertion operator for logical line values. More...
 
::std::ostream & operator<< (::std::ostream &out, direction dir)
 Stream insertion operator for direction values. More...
 
::std::ostream & operator<< (::std::ostream &out, edge edge)
 Stream insertion operator for edge detection values. More...
 
::std::ostream & operator<< (::std::ostream &out, bias bias)
 Stream insertion operator for bias values. More...
 
::std::ostream & operator<< (::std::ostream &out, drive drive)
 Stream insertion operator for drive values. More...
 
::std::ostream & operator<< (::std::ostream &out, clock clock)
 Stream insertion operator for event clock values. More...
 
::std::ostream & operator<< (::std::ostream &out, const values &vals)
 Stream insertion operator for the list of output values. More...
 
::std::ostream & operator<< (::std::ostream &out, const offsets &offs)
 Stream insertion operator for the list of line offsets. More...
 
::std::ostream & operator<< (::std::ostream &out, const value_mapping &mapping)
 Stream insertion operator for the offset-to-value mapping. More...
 
::std::ostream & operator<< (::std::ostream &out, const value_mappings &mappings)
 Stream insertion operator for the list of offset-to-value mappings. More...
 

Detailed Description

Namespace containing various type definitions for GPIO lines.

Typedef Documentation

◆ value_mappings

using gpiod::line::value_mappings = typedef ::std::vector<value_mapping>

Vector of offset->value mappings.

Each mapping is defined as a pair of an unsigned and signed integers.

Definition at line 184 of file line.hpp.

Enumeration Type Documentation

◆ bias

enum gpiod::line::bias
strong

Internal bias settings.

Enumerator
AS_IS 

Don't change the bias setting when applying line config.

UNKNOWN 

The internal bias state is unknown.

DISABLED 

The internal bias is disabled.

PULL_UP 

The internal pull-up bias is enabled.

PULL_DOWN 

The internal pull-down bias is enabled.

Definition at line 125 of file line.hpp.

◆ clock

enum gpiod::line::clock
strong

Event clock settings.

Enumerator
MONOTONIC 

Line uses the monotonic clock for edge event timestamps.

REALTIME 

Line uses the realtime clock for edge event timestamps.

Definition at line 155 of file line.hpp.

◆ direction

Direction settings.

Enumerator
AS_IS 

Request the line(s), but don't change current direction.

INPUT 

Direction is input - we're reading the state of a GPIO line.

OUTPUT 

Direction is output - we're driving the GPIO line.

Definition at line 97 of file line.hpp.

◆ drive

enum gpiod::line::drive
strong

Drive settings.

Enumerator
PUSH_PULL 

Drive setting is push-pull.

OPEN_DRAIN 

Line output is open-drain.

OPEN_SOURCE 

Line output is open-source.

Definition at line 142 of file line.hpp.

◆ edge

enum gpiod::line::edge
strong

Edge detection settings.

Enumerator
NONE 

Line edge detection is disabled.

RISING 

Line detects rising edge events.

FALLING 

Line detect falling edge events.

BOTH 

Line detects both rising and falling edge events.

Definition at line 110 of file line.hpp.

◆ value

enum gpiod::line::value
strong

Logical line states.

Enumerator
INACTIVE 

Line is inactive.

ACTIVE 

Line is active.

Definition at line 86 of file line.hpp.

Function Documentation

◆ operator<<() [1/10]

::std::ostream& gpiod::line::operator<< ( ::std::ostream &  out,
bias  bias 
)

Stream insertion operator for bias values.

Parameters
outOutput stream.
biasValue to insert into the output stream in a human-readable form.
Returns
Reference to out.

◆ operator<<() [2/10]

::std::ostream& gpiod::line::operator<< ( ::std::ostream &  out,
clock  clock 
)

Stream insertion operator for event clock values.

Parameters
outOutput stream.
clockValue to insert into the output stream in a human-readable form.
Returns
Reference to out.

◆ operator<<() [3/10]

::std::ostream& gpiod::line::operator<< ( ::std::ostream &  out,
const offsets offs 
)

Stream insertion operator for the list of line offsets.

Parameters
outOutput stream.
offsObject to insert into the output stream in a human-readable form.
Returns
Reference to out.

◆ operator<<() [4/10]

::std::ostream& gpiod::line::operator<< ( ::std::ostream &  out,
const value_mapping mapping 
)

Stream insertion operator for the offset-to-value mapping.

Parameters
outOutput stream.
mappingValue to insert into the output stream in a human-readable form.
Returns
Reference to out.

◆ operator<<() [5/10]

::std::ostream& gpiod::line::operator<< ( ::std::ostream &  out,
const value_mappings mappings 
)

Stream insertion operator for the list of offset-to-value mappings.

Parameters
outOutput stream.
mappingsObject to insert into the output stream in a human-readable form.
Returns
Reference to out.

◆ operator<<() [6/10]

::std::ostream& gpiod::line::operator<< ( ::std::ostream &  out,
const values vals 
)

Stream insertion operator for the list of output values.

Parameters
outOutput stream.
valsObject to insert into the output stream in a human-readable form.
Returns
Reference to out.

◆ operator<<() [7/10]

::std::ostream& gpiod::line::operator<< ( ::std::ostream &  out,
direction  dir 
)

Stream insertion operator for direction values.

Parameters
outOutput stream.
dirValue to insert into the output stream in a human-readable form.
Returns
Reference to out.

◆ operator<<() [8/10]

::std::ostream& gpiod::line::operator<< ( ::std::ostream &  out,
drive  drive 
)

Stream insertion operator for drive values.

Parameters
outOutput stream.
driveValue to insert into the output stream in a human-readable form.
Returns
Reference to out.

◆ operator<<() [9/10]

::std::ostream& gpiod::line::operator<< ( ::std::ostream &  out,
edge  edge 
)

Stream insertion operator for edge detection values.

Parameters
outOutput stream.
edgeValue to insert into the output stream in a human-readable form.
Returns
Reference to out.

◆ operator<<() [10/10]

::std::ostream& gpiod::line::operator<< ( ::std::ostream &  out,
value  val 
)

Stream insertion operator for logical line values.

Parameters
outOutput stream.
valValue to insert into the output stream in a human-readable form.
Returns
Reference to out.