Loading...
Searching...
No Matches
gpiod::line_info Class Referencefinal

Contains an immutable snapshot of the line's state at the time when the object of this class was instantiated. More...

`#include <line-info.hpp>`

## Public Member Functions

| line_info (const line_info &other) noexcept
| Copy constructor.
| line_info (line_info &&other) noexcept
| Move constructor.
| ~line_info ()
line_info & | operator= (const line_info &other) noexcept
| Copy assignment operator.
line_info & | operator= (line_info &&other) noexcept
| Move assignment operator.
line::offset | offset () const noexcept
| Get the hardware offset of the line.
::std::string | name () const noexcept
| Get the GPIO line name.
bool | used () const noexcept
| Check if the line is currently in use.
::std::string | consumer () const noexcept
| Read the GPIO line consumer name.
line::direction | direction () const
| Read the GPIO line direction setting.
line::edge | edge_detection () const
| Read the current edge detection setting of this line.
line::bias | bias () const
| Read the GPIO line bias setting.
line::drive | drive () const
| Read the GPIO line drive setting.
bool | active_low () const noexcept
| Check if the signal of this line is inverted.
bool | debounced () const noexcept
| Check if this line is debounced (either by hardware or by the kernel software debouncer).
::std::chrono::microseconds | debounce_period () const noexcept
| Read the current debounce period in microseconds.
line::clock | event_clock () const
| Read the current event clock setting used for edge event timestamps.

## Detailed Description

Contains an immutable snapshot of the line's state at the time when the object of this class was instantiated.

## Constructor & Destructor Documentation

## line_info() [1/2]

gpiod::line_info::line_info | ( | const line_info & | other | ) |

noexcept

Copy constructor.

Parameters

  other | Object to copy.

## line_info() [2/2]

gpiod::line_info::line_info | ( | line_info && | other | ) |

noexcept

Move constructor.

Parameters

  other | Object to move.

## ~line_info()

gpiod::line_info::~line_info | ( |  | ) |

## Member Function Documentation

## active_low()

bool gpiod::line_info::active_low | ( |  | ) | const

noexcept

Check if the signal of this line is inverted.

Returns
  True if this line is "active-low", false otherwise.

## bias()

line::bias gpiod::line_info::bias | ( |  | ) | const

Read the GPIO line bias setting.

Returns
  Returns BIAS_PULL_UP, BIAS_PULL_DOWN, BIAS_DISABLE or BIAS_UNKNOWN.

## consumer()

::std::string gpiod::line_info::consumer | ( |  | ) | const

noexcept

Read the GPIO line consumer name.

Returns
  Name of the GPIO consumer name as it is represented in the kernel. This routine returns an empty string if the line is not used.

## debounce_period()

::std::chrono::microseconds gpiod::line_info::debounce_period | ( |  | ) | const

noexcept

Read the current debounce period in microseconds.

Returns
  Current debounce period in microseconds, 0 if the line is not debounced.

## debounced()

bool gpiod::line_info::debounced | ( |  | ) | const

noexcept

Check if this line is debounced (either by hardware or by the kernel software debouncer).

Returns
  True if the line is debounced, false otherwise.

## direction()

line::direction gpiod::line_info::direction | ( |  | ) | const

Read the GPIO line direction setting.

Returns
  Returns DIRECTION_INPUT or DIRECTION_OUTPUT.

## drive()

line::drive gpiod::line_info::drive | ( |  | ) | const

Read the GPIO line drive setting.

Returns
  Returns DRIVE_PUSH_PULL, DRIVE_OPEN_DRAIN or DRIVE_OPEN_SOURCE.

## edge_detection()

line::edge gpiod::line_info::edge_detection | ( |  | ) | const

Read the current edge detection setting of this line.

Returns
  Returns EDGE_NONE, EDGE_RISING, EDGE_FALLING or EDGE_BOTH.

## event_clock()

line::clock gpiod::line_info::event_clock | ( |  | ) | const

Read the current event clock setting used for edge event timestamps.

Returns
  Returns MONOTONIC, REALTIME or HTE.

## name()

::std::string gpiod::line_info::name | ( |  | ) | const

noexcept

Get the GPIO line name.

Returns
  Name of the GPIO line as it is represented in the kernel. This routine returns an empty string if the line is unnamed.

## offset()

line::offset gpiod::line_info::offset | ( |  | ) | const

noexcept

Get the hardware offset of the line.

Returns
  Offset of the line within the parent chip.

## operator=() [1/2]

line_info & gpiod::line_info::operator= | ( | const line_info & | other | ) |

noexcept

Copy assignment operator.

Parameters

  other | Object to copy.

Returns
  Reference to self.

## operator=() [2/2]

line_info & gpiod::line_info::operator= | ( | line_info && | other | ) |

noexcept

Move assignment operator.

Parameters

  other | Object to move.

Returns
  Reference to self.

## used()

bool gpiod::line_info::used | ( |  | ) | const

noexcept

Check if the line is currently in use.

Returns
  True if the line is in use, false otherwise.

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.

The documentation for this class was generated from the following file:

- line-info.hpp