libgpiod  1.4.1
gpiod.hpp
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 /*
3  * This file is part of libgpiod.
4  *
5  * Copyright (C) 2017-2018 Bartosz Golaszewski <bartekgola@gmail.com>
6  */
7 
8 #ifndef __LIBGPIOD_GPIOD_CXX_HPP__
9 #define __LIBGPIOD_GPIOD_CXX_HPP__
10 
11 #include <bitset>
12 #include <chrono>
13 #include <gpiod.h>
14 #include <memory>
15 #include <string>
16 #include <vector>
17 
18 namespace gpiod {
19 
20 class line;
21 class line_bulk;
22 class line_event;
23 class line_iter;
24 class chip_iter;
25 
38 class chip
39 {
40 public:
41 
45  GPIOD_API chip(void) = default;
46 
52  GPIOD_API chip(const ::std::string& device, int how = OPEN_LOOKUP);
53 
58  GPIOD_API chip(const chip& other) = default;
59 
64  GPIOD_API chip(chip&& other) = default;
65 
71  GPIOD_API chip& operator=(const chip& other) = default;
72 
78  GPIOD_API chip& operator=(chip&& other) = default;
79 
83  GPIOD_API ~chip(void) = default;
84 
93  GPIOD_API void open(const ::std::string &device, int how = OPEN_LOOKUP);
94 
98  GPIOD_API void reset(void) noexcept;
99 
104  GPIOD_API ::std::string name(void) const;
105 
110  GPIOD_API ::std::string label(void) const;
111 
116  GPIOD_API unsigned int num_lines(void) const;
117 
123  GPIOD_API line get_line(unsigned int offset) const;
124 
130  GPIOD_API line find_line(const ::std::string& name) const;
131 
137  GPIOD_API line_bulk get_lines(const ::std::vector<unsigned int>& offsets) const;
138 
143  GPIOD_API line_bulk get_all_lines(void) const;
144 
150  GPIOD_API line_bulk find_lines(const ::std::vector<::std::string>& names) const;
151 
157  GPIOD_API bool operator==(const chip& rhs) const noexcept;
158 
164  GPIOD_API bool operator!=(const chip& rhs) const noexcept;
165 
170  GPIOD_API explicit operator bool(void) const noexcept;
171 
176  GPIOD_API bool operator!(void) const noexcept;
177 
182  enum : int {
193  };
194 
195 private:
196 
197  chip(::gpiod_chip* chip);
198 
199  void throw_if_noref(void) const;
200 
201  ::std::shared_ptr<::gpiod_chip> _m_chip;
202 
203  friend chip_iter;
204  friend line_iter;
205 };
206 
211 {
215  enum : int {
228  };
229 
230  GPIOD_API static const ::std::bitset<32> FLAG_ACTIVE_LOW;
232  GPIOD_API static const ::std::bitset<32> FLAG_OPEN_SOURCE;
234  GPIOD_API static const ::std::bitset<32> FLAG_OPEN_DRAIN;
237  ::std::string consumer;
241  ::std::bitset<32> flags;
243 };
244 
252 class line
253 {
254 public:
255 
259  GPIOD_API line(void);
260 
265  GPIOD_API line(const line& other) = default;
266 
271  GPIOD_API line(line&& other) = default;
272 
278  GPIOD_API line& operator=(const line& other) = default;
279 
285  GPIOD_API line& operator=(line&& other) = default;
286 
290  GPIOD_API ~line(void) = default;
291 
296  GPIOD_API unsigned int offset(void) const;
297 
302  GPIOD_API ::std::string name(void) const;
303 
309  GPIOD_API ::std::string consumer(void) const;
310 
315  GPIOD_API int direction(void) const noexcept;
316 
321  GPIOD_API int active_state(void) const noexcept;
322 
328  GPIOD_API bool is_used(void) const;
329 
334  GPIOD_API bool is_open_drain(void) const;
335 
340  GPIOD_API bool is_open_source(void) const;
341 
347  GPIOD_API void request(const line_request& config, int default_val = 0) const;
348 
352  GPIOD_API void release(void) const;
353 
358  GPIOD_API bool is_requested(void) const;
359 
364  GPIOD_API int get_value(void) const;
365 
370  GPIOD_API void set_value(int val) const;
371 
378  GPIOD_API bool event_wait(const ::std::chrono::nanoseconds& timeout) const;
379 
384  GPIOD_API line_event event_read(void) const;
385 
390  GPIOD_API int event_get_fd(void) const;
391 
396  GPIOD_API const chip& get_chip(void) const;
397 
405  GPIOD_API void reset(void);
406 
412  GPIOD_API bool operator==(const line& rhs) const noexcept;
413 
419  GPIOD_API bool operator!=(const line& rhs) const noexcept;
420 
425  GPIOD_API explicit operator bool(void) const noexcept;
426 
432  GPIOD_API bool operator!(void) const noexcept;
433 
437  enum : int {
442  };
443 
447  enum : int {
452  };
453 
454 private:
455 
456  line(::gpiod_line* line, const chip& owner);
457 
458  void throw_if_null(void) const;
459 
460  ::gpiod_line* _m_line;
461  chip _m_chip;
462 
463  friend chip;
464  friend line_bulk;
465  friend line_iter;
466 };
467 
473 GPIOD_API line find_line(const ::std::string& name);
474 
479 {
480 
484  enum : int {
489  };
490 
491  ::std::chrono::nanoseconds timestamp;
497 };
498 
506 {
507 public:
508 
512  GPIOD_API line_bulk(void) = default;
513 
519  GPIOD_API line_bulk(const ::std::vector<line>& lines);
520 
525  GPIOD_API line_bulk(const line_bulk& other) = default;
526 
531  GPIOD_API line_bulk(line_bulk&& other) = default;
532 
538  GPIOD_API line_bulk& operator=(const line_bulk& other) = default;
539 
545  GPIOD_API line_bulk& operator=(line_bulk&& other) = default;
546 
550  GPIOD_API ~line_bulk(void) = default;
551 
558  GPIOD_API void append(const line& new_line);
559 
565  GPIOD_API line& get(unsigned int offset);
566 
573  GPIOD_API line& operator[](unsigned int offset);
574 
579  GPIOD_API unsigned int size(void) const noexcept;
580 
585  GPIOD_API bool empty(void) const noexcept;
586 
590  GPIOD_API void clear(void);
591 
598  GPIOD_API void request(const line_request& config,
599  const std::vector<int> default_vals = std::vector<int>()) const;
600 
604  GPIOD_API void release(void) const;
605 
611  GPIOD_API ::std::vector<int> get_values(void) const;
612 
618  GPIOD_API void set_values(const ::std::vector<int>& values) const;
619 
627  GPIOD_API line_bulk event_wait(const ::std::chrono::nanoseconds& timeout) const;
628 
633  GPIOD_API explicit operator bool(void) const noexcept;
634 
639  GPIOD_API bool operator!(void) const noexcept;
640 
644  GPIOD_API static const unsigned int MAX_LINES;
645 
649  class iterator
650  {
651  public:
652 
656  GPIOD_API iterator(void) = default;
657 
662  GPIOD_API iterator(const iterator& other) = default;
663 
668  GPIOD_API iterator(iterator&& other) = default;
669 
675  GPIOD_API iterator& operator=(const iterator& other) = default;
676 
682  GPIOD_API iterator& operator=(iterator&& other) = default;
683 
687  GPIOD_API ~iterator(void) = default;
688 
694 
699  GPIOD_API const line& operator*(void) const;
700 
705  GPIOD_API const line* operator->(void) const;
706 
713  GPIOD_API bool operator==(const iterator& rhs) const noexcept;
714 
721  GPIOD_API bool operator!=(const iterator& rhs) const noexcept;
722 
723  private:
724 
725  iterator(const ::std::vector<line>::iterator& it);
726 
727  ::std::vector<line>::iterator _m_iter;
728 
729  friend line_bulk;
730  };
731 
736  GPIOD_API iterator begin(void) noexcept;
737 
742  GPIOD_API iterator end(void) noexcept;
743 
744 private:
745 
746  void throw_if_empty(void) const;
747  void to_line_bulk(::gpiod_line_bulk* bulk) const;
748 
749  ::std::vector<line> _m_bulk;
750 };
751 
759 
765 GPIOD_API chip_iter begin(chip_iter iter) noexcept;
766 
772 GPIOD_API chip_iter end(const chip_iter& iter) noexcept;
773 
778 {
779 public:
780 
784  GPIOD_API chip_iter(void) = default;
785 
790  GPIOD_API chip_iter(const chip_iter& other) = default;
791 
796  GPIOD_API chip_iter(chip_iter&& other) = default;
797 
803  GPIOD_API chip_iter& operator=(const chip_iter& other) = default;
804 
810  GPIOD_API chip_iter& operator=(chip_iter&& other) = default;
811 
815  GPIOD_API ~chip_iter(void) = default;
816 
822 
827  GPIOD_API const chip& operator*(void) const;
828 
833  GPIOD_API const chip* operator->(void) const;
834 
841  GPIOD_API bool operator==(const chip_iter& rhs) const noexcept;
842 
849  GPIOD_API bool operator!=(const chip_iter& rhs) const noexcept;
850 
851 private:
852 
853  chip_iter(::gpiod_chip_iter* iter);
854 
855  ::std::shared_ptr<::gpiod_chip_iter> _m_iter;
856  chip _m_current;
857 
858  friend chip_iter make_chip_iter(void);
859 };
860 
866 GPIOD_API line_iter begin(line_iter iter) noexcept;
867 
873 GPIOD_API line_iter end(const line_iter& iter) noexcept;
874 
879 {
880 public:
881 
885  GPIOD_API line_iter(void) = default;
886 
891  GPIOD_API line_iter(const chip& owner);
892 
897  GPIOD_API line_iter(const line_iter& other) = default;
898 
903  GPIOD_API line_iter(line_iter&& other) = default;
904 
910  GPIOD_API line_iter& operator=(const line_iter& other) = default;
911 
917  GPIOD_API line_iter& operator=(line_iter&& other) = default;
918 
922  GPIOD_API ~line_iter(void) = default;
923 
929 
934  GPIOD_API const line& operator*(void) const;
935 
940  GPIOD_API const line* operator->(void) const;
941 
948  GPIOD_API bool operator==(const line_iter& rhs) const noexcept;
949 
956  GPIOD_API bool operator!=(const line_iter& rhs) const noexcept;
957 
958 private:
959 
960  ::std::shared_ptr<::gpiod_line_iter> _m_iter;
961  line _m_current;
962 };
963 
968 } /* namespace gpiod */
969 
970 #endif /* __LIBGPIOD_GPIOD_CXX_HPP__ */
gpiod::line_bulk::empty
GPIOD_API bool empty(void) const noexcept
Check if this line_bulk doesn't hold any lines.
gpiod::line_event::event_type
int event_type
Type of the event that occurred.
Definition: gpiod.hpp:493
gpiod::line_bulk::event_wait
GPIOD_API line_bulk event_wait(const ::std::chrono::nanoseconds &timeout) const
Poll the set of lines for line events.
gpiod::line_bulk::set_values
GPIOD_API void set_values(const ::std::vector< int > &values) const
Set values of all lines held by this object.
gpiod::chip::chip
GPIOD_API chip(void)=default
Default constructor.
gpiod::line::direction
GPIOD_API int direction(void) const noexcept
Get current direction of this line.
gpiod::line_iter::operator++
GPIOD_API line_iter & operator++(void)
Advance the iterator by one element.
gpiod_line_bulk
Helper structure for storing a set of GPIO line objects.
Definition: gpiod.h:545
gpiod::chip_iter::~chip_iter
GPIOD_API ~chip_iter(void)=default
Destructor.
gpiod::line::name
GPIOD_API ::std::string name(void) const
Get the name of this line (if any).
gpiod::line_bulk::iterator::operator++
GPIOD_API iterator & operator++(void)
Advance the iterator by one element.
gpiod::line::is_open_drain
GPIOD_API bool is_open_drain(void) const
Check if this line represents an open-drain GPIO.
gpiod::chip_iter::make_chip_iter
friend chip_iter make_chip_iter(void)
Create a new chip_iter.
gpiod::line::DIRECTION_OUTPUT
@ DIRECTION_OUTPUT
Line's direction setting is output.
Definition: gpiod.hpp:440
gpiod::line_request::flags
::std::bitset< 32 > flags
Additional request flags.
Definition: gpiod.hpp:241
gpiod::chip::name
GPIOD_API ::std::string name(void) const
Return the name of the chip held by this object.
gpiod::line::offset
GPIOD_API unsigned int offset(void) const
Get the offset of this line.
gpiod::line_bulk::begin
GPIOD_API iterator begin(void) noexcept
Returns an iterator to the first line.
gpiod::line_bulk::MAX_LINES
static const GPIOD_API unsigned int MAX_LINES
Max number of lines that this object can hold.
Definition: gpiod.hpp:644
gpiod::line::line
GPIOD_API line(void)
Default constructor.
gpiod::line_iter::operator*
const GPIOD_API line & operator*(void) const
Dereference current element.
gpiod::line_request::EVENT_RISING_EDGE
@ EVENT_RISING_EDGE
Listen for rising edge events.
Definition: gpiod.hpp:224
gpiod::line_bulk::operator!
GPIOD_API bool operator!(void) const noexcept
Check if this object doesn't hold any lines.
gpiod::line_request::DIRECTION_OUTPUT
@ DIRECTION_OUTPUT
Request for driving the GPIO lines.
Definition: gpiod.hpp:220
gpiod::line_request::FLAG_OPEN_DRAIN
static GPIOD_API const ::std::bitset< 32 > FLAG_OPEN_DRAIN
The line is an open-drain port.
Definition: gpiod.hpp:234
gpiod::chip::label
GPIOD_API ::std::string label(void) const
Return the label of the chip held by this object.
gpiod::line_bulk::get_values
GPIOD_API ::std::vector< int > get_values(void) const
Read values from all lines held by this object.
gpiod::chip::~chip
GPIOD_API ~chip(void)=default
Destructor.
gpiod::line_request::EVENT_FALLING_EDGE
@ EVENT_FALLING_EDGE
Listen for falling edge events.
Definition: gpiod.hpp:222
gpiod::line_iter::operator==
GPIOD_API bool operator==(const line_iter &rhs) const noexcept
Check if this operator points to the same element.
gpiod::line_bulk::end
GPIOD_API iterator end(void) noexcept
Returns an iterator to the element following the last line.
gpiod::line_request::request_type
int request_type
Type of the request.
Definition: gpiod.hpp:239
gpiod::chip
Represents a GPIO chip.
Definition: gpiod.hpp:38
gpiod::line_bulk::get
GPIOD_API line & get(unsigned int offset)
Get the line at given offset.
gpiod::line::active_state
GPIOD_API int active_state(void) const noexcept
Get current active state of this line.
gpiod::chip::get_line
GPIOD_API line get_line(unsigned int offset) const
Get the line exposed by this chip at given offset.
gpiod::line_request
Stores the configuration for line requests.
Definition: gpiod.hpp:210
gpiod::chip_iter::operator=
GPIOD_API chip_iter & operator=(const chip_iter &other)=default
Assignment operator.
gpiod::chip::OPEN_BY_PATH
@ OPEN_BY_PATH
Assume the string is a path to the GPIO chardev.
Definition: gpiod.hpp:185
gpiod::line_bulk::iterator
Iterator for iterating over lines held by line_bulk.
Definition: gpiod.hpp:649
gpiod::line_bulk::~line_bulk
GPIOD_API ~line_bulk(void)=default
Destructor.
gpiod::line_bulk::release
GPIOD_API void release(void) const
Release all lines held by this object.
gpiod::chip::num_lines
GPIOD_API unsigned int num_lines(void) const
Return the number of lines exposed by this chip.
gpiod::chip::OPEN_LOOKUP
@ OPEN_LOOKUP
Open based on the best guess what the supplied string is.
Definition: gpiod.hpp:183
GPIOD_API
#define GPIOD_API
Makes symbol visible.
Definition: gpiod.h:58
gpiod::line
Represents a single GPIO line.
Definition: gpiod.hpp:252
gpiod::line::operator=
GPIOD_API line & operator=(const line &other)=default
Assignment operator.
gpiod::line_bulk::clear
GPIOD_API void clear(void)
Remove all lines from this object.
gpiod::line_bulk
Represents a set of GPIO lines.
Definition: gpiod.hpp:505
gpiod::line_iter::operator->
const GPIOD_API line * operator->(void) const
Member access operator.
gpiod::line_bulk::iterator::operator==
GPIOD_API bool operator==(const iterator &rhs) const noexcept
Check if this operator points to the same element.
gpiod::line_event::timestamp
::std::chrono::nanoseconds timestamp
Best estimate of time of event occurrence in nanoseconds.
Definition: gpiod.hpp:491
gpiod::line_iter::line_iter
GPIOD_API line_iter(void)=default
Default constructor.
gpiod::line_request::EVENT_BOTH_EDGES
@ EVENT_BOTH_EDGES
Listen for all types of events.
Definition: gpiod.hpp:226
gpiod::chip::operator=
GPIOD_API chip & operator=(const chip &other)=default
Assignment operator.
gpiod::chip::OPEN_BY_NAME
@ OPEN_BY_NAME
Assume the string is the name of the chip.
Definition: gpiod.hpp:187
gpiod::chip_iter::operator++
GPIOD_API chip_iter & operator++(void)
Advance the iterator by one element.
gpiod::line::~line
GPIOD_API ~line(void)=default
Destructor.
gpiod::chip_iter::operator->
const GPIOD_API chip * operator->(void) const
Member access operator.
gpiod::line::request
GPIOD_API void request(const line_request &config, int default_val=0) const
Request this line.
gpiod::line_bulk::append
GPIOD_API void append(const line &new_line)
Add a line to this line_bulk object.
gpiod::line_bulk::iterator::~iterator
GPIOD_API ~iterator(void)=default
Destructor.
gpiod::chip_iter::operator==
GPIOD_API bool operator==(const chip_iter &rhs) const noexcept
Check if this operator points to the same element.
gpiod::line_event::source
line source
Line object referencing the GPIO line on which the event occurred.
Definition: gpiod.hpp:495
gpiod::line_request::DIRECTION_INPUT
@ DIRECTION_INPUT
Request for reading line values.
Definition: gpiod.hpp:218
gpiod::chip_iter
Allows to iterate over all GPIO chips present on the system.
Definition: gpiod.hpp:777
gpiod::make_chip_iter
GPIOD_API chip_iter make_chip_iter(void)
Create a new chip_iter.
gpiod::chip_iter::chip_iter
GPIOD_API chip_iter(void)=default
Default constructor.
gpiod::chip::OPEN_BY_LABEL
@ OPEN_BY_LABEL
Assume the string is the label of the GPIO chip.
Definition: gpiod.hpp:189
gpiod::line_bulk::iterator::operator=
GPIOD_API iterator & operator=(const iterator &other)=default
Assignment operator.
gpiod::find_line
GPIOD_API line find_line(const ::std::string &name)
Find a GPIO line by name.
gpiod::line::event_wait
GPIOD_API bool event_wait(const ::std::chrono::nanoseconds &timeout) const
Wait for an event on this line.
gpiod::line_event::FALLING_EDGE
@ FALLING_EDGE
Falling edge event.
Definition: gpiod.hpp:487
gpiod::line_bulk::size
GPIOD_API unsigned int size(void) const noexcept
Get the number of lines currently held by this object.
gpiod::chip_iter::operator!=
GPIOD_API bool operator!=(const chip_iter &rhs) const noexcept
Check if this operator doesn't point to the same element.
gpiod::line_bulk::line_bulk
GPIOD_API line_bulk(void)=default
Default constructor.
gpiod::chip::get_lines
GPIOD_API line_bulk get_lines(const ::std::vector< unsigned int > &offsets) const
Get a set of lines exposed by this chip at given offsets.
gpiod::chip::find_line
GPIOD_API line find_line(const ::std::string &name) const
Get the line exposed by this chip by name.
gpiod::begin
GPIOD_API line_iter begin(line_iter iter) noexcept
Support for range-based loops for line iterators.
gpiod::line::operator!
GPIOD_API bool operator!(void) const noexcept
Check if this object doesn't reference any GPIO line.
gpiod::chip::operator==
GPIOD_API bool operator==(const chip &rhs) const noexcept
Equality operator.
gpiod::line::set_value
GPIOD_API void set_value(int val) const
Set the value of this line.
gpiod::chip::reset
GPIOD_API void reset(void) noexcept
Reset the internal smart pointer owned by this object.
gpiod::line_iter::operator!=
GPIOD_API bool operator!=(const line_iter &rhs) const noexcept
Check if this operator doesn't point to the same element.
gpiod::end
GPIOD_API line_iter end(const line_iter &iter) noexcept
Support for range-based loops for line iterators.
gpiod::line::event_read
GPIOD_API line_event event_read(void) const
Read a line event.
gpiod::chip::OPEN_BY_NUMBER
@ OPEN_BY_NUMBER
Assume the string is the number of the GPIO chip.
Definition: gpiod.hpp:191
gpiod::line_iter
Allows to iterate over all lines owned by a GPIO chip.
Definition: gpiod.hpp:878
gpiod::line_request::FLAG_ACTIVE_LOW
static GPIOD_API const ::std::bitset< 32 > FLAG_ACTIVE_LOW
Set the active state to 'low' (high is the default).
Definition: gpiod.hpp:230
gpiod::line::reset
GPIOD_API void reset(void)
Reset the state of this object.
gpiod::chip::find_lines
GPIOD_API line_bulk find_lines(const ::std::vector<::std::string > &names) const
Get a set of lines exposed by this chip by their names.
gpiod::chip_iter::operator*
const GPIOD_API chip & operator*(void) const
Dereference current element.
gpiod::line_bulk::iterator::operator*
const GPIOD_API line & operator*(void) const
Dereference current element.
gpiod::line::get_value
GPIOD_API int get_value(void) const
Read the line value.
gpiod::line::is_open_source
GPIOD_API bool is_open_source(void) const
Check if this line represents an open-source GPIO.
gpiod::line::is_requested
GPIOD_API bool is_requested(void) const
Check if this user has ownership of this line.
gpiod::line_request::consumer
::std::string consumer
Consumer name to pass to the request.
Definition: gpiod.hpp:237
gpiod::line::is_used
GPIOD_API bool is_used(void) const
Check if this line is used by the kernel or other user space process.
gpiod::line_request::DIRECTION_AS_IS
@ DIRECTION_AS_IS
Request for values, don't change the direction.
Definition: gpiod.hpp:216
gpiod::line::operator==
GPIOD_API bool operator==(const line &rhs) const noexcept
Check if two line objects reference the same GPIO line.
gpiod::line::ACTIVE_HIGH
@ ACTIVE_HIGH
Line's active state is high.
Definition: gpiod.hpp:450
gpiod::line::DIRECTION_INPUT
@ DIRECTION_INPUT
Line's direction setting is input.
Definition: gpiod.hpp:438
gpiod::line_bulk::iterator::operator!=
GPIOD_API bool operator!=(const iterator &rhs) const noexcept
Check if this operator doesn't point to the same element.
gpiod::line_bulk::operator[]
GPIOD_API line & operator[](unsigned int offset)
Get the line at given offset without bounds checking.
gpiod::line_bulk::iterator::iterator
GPIOD_API iterator(void)=default
Default constructor.
gpiod::chip::operator!
GPIOD_API bool operator!(void) const noexcept
Check if this object doesn't hold a reference to a GPIO chip.
gpiod::line::release
GPIOD_API void release(void) const
Release the line if it was previously requested.
gpiod::line::consumer
GPIOD_API ::std::string consumer(void) const
Get the consumer of this line (if any).
gpiod::line_iter::~line_iter
GPIOD_API ~line_iter(void)=default
Destructor.
gpiod::line_request::FLAG_OPEN_SOURCE
static GPIOD_API const ::std::bitset< 32 > FLAG_OPEN_SOURCE
The line is an open-source port.
Definition: gpiod.hpp:232
gpiod::chip::open
GPIOD_API void open(const ::std::string &device, int how=OPEN_LOOKUP)
Open a GPIO chip.
gpiod::line_event::RISING_EDGE
@ RISING_EDGE
Rising edge event.
Definition: gpiod.hpp:485
gpiod::line_bulk::request
GPIOD_API void request(const line_request &config, const std::vector< int > default_vals=std::vector< int >()) const
Request all lines held by this object.
gpiod::line::event_get_fd
GPIOD_API int event_get_fd(void) const
Get the event file descriptor associated with this line.
gpiod::line::operator!=
GPIOD_API bool operator!=(const line &rhs) const noexcept
Check if two line objects reference different GPIO lines.
gpiod::chip::get_all_lines
GPIOD_API line_bulk get_all_lines(void) const
Get all lines exposed by this chip.
gpiod::line::ACTIVE_LOW
@ ACTIVE_LOW
Line's active state is low.
Definition: gpiod.hpp:448
gpiod::line_iter::operator=
GPIOD_API line_iter & operator=(const line_iter &other)=default
Assignment operator.
gpiod::line_event
Describes a single GPIO line event.
Definition: gpiod.hpp:478
gpiod::chip::operator!=
GPIOD_API bool operator!=(const chip &rhs) const noexcept
Inequality operator.
gpiod::line::get_chip
const GPIOD_API chip & get_chip(void) const
Get the reference to the parent chip.
gpiod::line_bulk::iterator::operator->
const GPIOD_API line * operator->(void) const
Member access operator.
gpiod::line_bulk::operator=
GPIOD_API line_bulk & operator=(const line_bulk &other)=default
Assignment operator.