Loading...
Searching...
No Matches
line-info.hpp
Go to the documentation of this file.
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* SPDX-FileCopyrightText: 2021-2022 Bartosz Golaszewski <brgl@bgdev.pl> */
#ifndef __LIBGPIOD_CXX_LINE_INFO_HPP__
#define __LIBGPIOD_CXX_LINE_INFO_HPP__
#if !defined(__LIBGPIOD_GPIOD_CXX_INSIDE__)
#error "Only gpiod.hpp can be included directly."
#endif
#include <chrono>
#include <iostream>
#include <memory>
#include <string>
namespace gpiod {
class chip;
class info_event;
class line_info final
{
public:
line_info(const line_info& other) noexcept;
line_info(line_info&& other) noexcept;
~line_info();
line_info& operator=(const line_info& other) noexcept;
line_info& operator=(line_info&& other) noexcept;
line::offset offset() const noexcept;
::std::string name() const noexcept;
bool used() const noexcept;
::std::string consumer() const noexcept;
line::direction direction() const;
line::edge edge_detection() const;
line::bias bias() const;
line::drive drive() const;
bool active_low() const noexcept;
bool debounced() const noexcept;
::std::chrono::microseconds debounce_period() const noexcept;
line::clock event_clock() const;
private:
line_info();
struct impl;
::std::shared_ptr<impl> _m_priv;
friend chip;
friend info_event;
};
::std::ostream& operator<<(::std::ostream& out, const line_info& info);
} /* namespace gpiod */
#endif /* __LIBGPIOD_CXX_LINE_INFO_HPP__ */
gpiod::chip
Represents a GPIO chip.
Definition chip.hpp:37
gpiod::info_event
Immutable object containing data about a single line info event.
Definition info-event.hpp:30
gpiod::line::offset
Wrapper around unsigned int for representing line offsets.
Definition line.hpp:30
gpiod::line_info
Contains an immutable snapshot of the line's state at the time when the object of this class was inst...
Definition line-info.hpp:30
gpiod::line_info::line_info
line_info(const line_info &other) noexcept
Copy constructor.
gpiod::line_info::event_clock
line::clock event_clock() const
Read the current event clock setting used for edge event timestamps.
gpiod::line_info::debounced
bool debounced() const noexcept
Check if this line is debounced (either by hardware or by the kernel software debouncer).
gpiod::line_info::drive
line::drive drive() const
Read the GPIO line drive setting.
gpiod::line_info::operator=
line_info & operator=(line_info &&other) noexcept
Move assignment operator.
gpiod::line_info::offset
line::offset offset() const noexcept
Get the hardware offset of the line.
gpiod::line_info::direction
line::direction direction() const
Read the GPIO line direction setting.
gpiod::line_info::debounce_period
::std::chrono::microseconds debounce_period() const noexcept
Read the current debounce period in microseconds.
gpiod::line_info::~line_info
~line_info()
gpiod::line_info::edge_detection
line::edge edge_detection() const
Read the current edge detection setting of this line.
gpiod::line_info::consumer
::std::string consumer() const noexcept
Read the GPIO line consumer name.
gpiod::line_info::operator=
line_info & operator=(const line_info &other) noexcept
Copy assignment operator.
gpiod::line_info::name
::std::string name() const noexcept
Get the GPIO line name.
gpiod::line_info::active_low
bool active_low() const noexcept
Check if the signal of this line is inverted.
gpiod::line_info::bias
line::bias bias() const
Read the GPIO line bias setting.
gpiod::line_info::used
bool used() const noexcept
Check if the line is currently in use.
gpiod::line_info::line_info
line_info(line_info &&other) noexcept
Move constructor.
gpiod::line
Namespace containing various type definitions for GPIO lines.
Definition line.hpp:24
gpiod
Definition chip-info.hpp:18