libgpiod
Loading...
Searching...
No Matches
line-settings.hpp
Go to the documentation of this file.
1/* SPDX-License-Identifier: LGPL-2.1-or-later */
2/* SPDX-FileCopyrightText: 2022 Bartosz Golaszewski <brgl@bgdev.pl> */
3
8#ifndef __LIBGPIOD_CXX_LINE_SETTINGS_HPP__
9#define __LIBGPIOD_CXX_LINE_SETTINGS_HPP__
10
11#if !defined(__LIBGPIOD_GPIOD_CXX_INSIDE__)
12#error "Only gpiod.hpp can be included directly."
13#endif
14
15#include <chrono>
16#include <memory>
17
18#include "line.hpp"
19
20namespace gpiod {
21
22class line_config;
23
27class line_settings final
28{
29public:
30
35
41
46 line_settings(line_settings&& other) noexcept;
47
49
56
63
68 line_settings& reset() noexcept;
69
76
81 line::direction direction() const;
82
89
94 line::edge edge_detection() const;
95
102
107 line::bias bias() const;
108
115
120 line::drive drive() const;
121
128
133 bool active_low() const noexcept;
134
140 line_settings& set_debounce_period(const ::std::chrono::microseconds& period);
141
146 ::std::chrono::microseconds debounce_period() const noexcept;
147
154
159 line::clock event_clock() const;
160
166 line_settings& set_output_value(line::value value);
167
172 line::value output_value() const;
173
174private:
175
176 struct impl;
177
178 ::std::unique_ptr<impl> _m_priv;
179
180 friend line_config;
181};
182
189::std::ostream& operator<<(::std::ostream& out, const line_settings& settings);
190
191} /* namespace gpiod */
192
193#endif /* __LIBGPIOD_CXX_LINE_SETTINGS_HPP__ */
Contains a set of line config options used in line requests and reconfiguration.
Definition line-config.hpp:29
Stores GPIO line settings.
Definition line-settings.hpp:28
line_settings & set_bias(line::bias bias)
Set bias setting.
line_settings()
Initializes the line_settings object with default values.
line_settings(line_settings &&other) noexcept
Move constructor.
line::bias bias() const
Get bias setting.
line::clock event_clock() const
Get the event clock used for edge event timestamps.
line_settings & reset() noexcept
Reset the line settings to default values.
line::drive drive() const
Get drive setting.
bool active_low() const noexcept
Get the active-low setting.
line::value output_value() const
Get the output value.
line_settings & set_direction(line::direction direction)
Set direction.
line_settings & operator=(const line_settings &other)
Copy assignment operator.
line_settings & set_active_low(bool active_low)
Set the active-low setting.
line_settings & set_output_value(line::value value)
Set the output value.
line_settings & set_edge_detection(line::edge edge)
Set edge detection.
line_settings(const line_settings &other)
Copy constructor.
line_settings & set_debounce_period(const ::std::chrono::microseconds &period)
Set debounce period.
line_settings & set_event_clock(line::clock event_clock)
Set the event clock to use for edge event timestamps.
line::direction direction() const
Get direction.
line_settings & set_drive(line::drive drive)
Set drive setting.
::std::chrono::microseconds debounce_period() const noexcept
Get debounce period.
line_settings & operator=(line_settings &&other)
Move assignment operator.
line::edge edge_detection() const
Get edge detection.
Definition chip-info.hpp:18