Loading...
Searching...
No Matches
line-settings.hpp
Go to the documentation of this file.
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* SPDX-FileCopyrightText: 2022 Bartosz Golaszewski <brgl@bgdev.pl> */
#ifndef __LIBGPIOD_CXX_LINE_SETTINGS_HPP__
#define __LIBGPIOD_CXX_LINE_SETTINGS_HPP__
#if !defined(__LIBGPIOD_GPIOD_CXX_INSIDE__)
#error "Only gpiod.hpp can be included directly."
#endif
#include <chrono>
#include <memory>
#include "line.hpp"
namespace gpiod {
class line_config;
class line_settings final
{
public:
line_settings();
line_settings(const line_settings& other);
line_settings(line_settings&& other) noexcept;
~line_settings();
line_settings& operator=(const line_settings& other);
line_settings& operator=(line_settings&& other);
line_settings& reset() noexcept;
line_settings& set_direction(line::direction direction);
line::direction direction() const;
line_settings& set_edge_detection(line::edge edge);
line::edge edge_detection() const;
line_settings& set_bias(line::bias bias);
line::bias bias() const;
line_settings& set_drive(line::drive drive);
line::drive drive() const;
line_settings& set_active_low(bool active_low);
bool active_low() const noexcept;
line_settings& set_debounce_period(const ::std::chrono::microseconds& period);
::std::chrono::microseconds debounce_period() const noexcept;
line_settings& set_event_clock(line::clock event_clock);
line::clock event_clock() const;
line_settings& set_output_value(line::value value);
line::value output_value() const;
private:
struct impl;
::std::unique_ptr<impl> _m_priv;
friend line_config;
};
::std::ostream& operator<<(::std::ostream& out, const line_settings& settings);
} /* namespace gpiod */
#endif /* __LIBGPIOD_CXX_LINE_SETTINGS_HPP__ */
gpiod::line_config
Contains a set of line config options used in line requests and reconfiguration.
Definition line-config.hpp:29
gpiod::line_settings
Stores GPIO line settings.
Definition line-settings.hpp:28
gpiod::line_settings::set_bias
line_settings & set_bias(line::bias bias)
Set bias setting.
gpiod::line_settings::line_settings
line_settings()
Initializes the line_settings object with default values.
gpiod::line_settings::line_settings
line_settings(line_settings &&other) noexcept
Move constructor.
gpiod::line_settings::bias
line::bias bias() const
Get bias setting.
gpiod::line_settings::event_clock
line::clock event_clock() const
Get the event clock used for edge event timestamps.
gpiod::line_settings::reset
line_settings & reset() noexcept
Reset the line settings to default values.
gpiod::line_settings::drive
line::drive drive() const
Get drive setting.
gpiod::line_settings::active_low
bool active_low() const noexcept
Get the active-low setting.
gpiod::line_settings::output_value
line::value output_value() const
Get the output value.
gpiod::line_settings::set_direction
line_settings & set_direction(line::direction direction)
Set direction.
gpiod::line_settings::operator=
line_settings & operator=(const line_settings &other)
Copy assignment operator.
gpiod::line_settings::set_active_low
line_settings & set_active_low(bool active_low)
Set the active-low setting.
gpiod::line_settings::set_output_value
line_settings & set_output_value(line::value value)
Set the output value.
gpiod::line_settings::set_edge_detection
line_settings & set_edge_detection(line::edge edge)
Set edge detection.
gpiod::line_settings::line_settings
line_settings(const line_settings &other)
Copy constructor.
gpiod::line_settings::set_debounce_period
line_settings & set_debounce_period(const ::std::chrono::microseconds &period)
Set debounce period.
gpiod::line_settings::set_event_clock
line_settings & set_event_clock(line::clock event_clock)
Set the event clock to use for edge event timestamps.
gpiod::line_settings::direction
line::direction direction() const
Get direction.
gpiod::line_settings::set_drive
line_settings & set_drive(line::drive drive)
Set drive setting.
gpiod::line_settings::debounce_period
::std::chrono::microseconds debounce_period() const noexcept
Get debounce period.
gpiod::line_settings::~line_settings
~line_settings()
gpiod::line_settings::operator=
line_settings & operator=(line_settings &&other)
Move assignment operator.
gpiod::line_settings::edge_detection
line::edge edge_detection() const
Get edge detection.
line.hpp
gpiod::line
Namespace containing various type definitions for GPIO lines.
Definition line.hpp:24
gpiod
Definition chip-info.hpp:18