|
libgpiod
1.6.2
|
Represents a set of GPIO lines. More...
#include <gpiod.hpp>
Data Structures | |
| class | iterator |
| Iterator for iterating over lines held by line_bulk. More... | |
Public Member Functions | |
| GPIOD_API | line_bulk (void)=default |
| Default constructor. More... | |
| GPIOD_API | line_bulk (const ::std::vector< line > &lines) |
| Construct a line_bulk from a vector of lines. More... | |
| GPIOD_API | line_bulk (const line_bulk &other)=default |
| Copy constructor. More... | |
| GPIOD_API | line_bulk (line_bulk &&other)=default |
| Move constructor. More... | |
| GPIOD_API line_bulk & | operator= (const line_bulk &other)=default |
| Assignment operator. More... | |
| GPIOD_API line_bulk & | operator= (line_bulk &&other)=default |
| Move assignment operator. More... | |
| GPIOD_API | ~line_bulk (void)=default |
| Destructor. | |
| GPIOD_API void | append (const line &new_line) |
| Add a line to this line_bulk object. More... | |
| GPIOD_API line & | get (unsigned int offset) |
| Get the line at given offset. More... | |
| GPIOD_API line & | operator[] (unsigned int offset) |
| Get the line at given offset without bounds checking. More... | |
| GPIOD_API unsigned int | size (void) const noexcept |
| Get the number of lines currently held by this object. More... | |
| GPIOD_API bool | empty (void) const noexcept |
| Check if this line_bulk doesn't hold any lines. More... | |
| GPIOD_API void | clear (void) |
| Remove all lines from this object. | |
| 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. More... | |
| GPIOD_API void | release (void) const |
| Release all lines held by this object. | |
| GPIOD_API ::std::vector< int > | get_values (void) const |
| Read values from all lines held by this object. More... | |
| GPIOD_API void | set_values (const ::std::vector< int > &values) const |
| Set values of all lines held by this object. More... | |
| GPIOD_API void | set_config (int direction, ::std::bitset< 32 > flags, const ::std::vector< int > values=::std::vector< int >()) const |
| Set configuration of all lines held by this object. More... | |
| GPIOD_API void | set_flags (::std::bitset< 32 > flags) const |
| Set configuration flags of all lines held by this object. More... | |
| GPIOD_API void | set_direction_input () const |
| Change the direction all lines held by this object to input. | |
| GPIOD_API void | set_direction_output (const ::std::vector< int > &values) const |
| Change the direction all lines held by this object to output. More... | |
| GPIOD_API line_bulk | event_wait (const ::std::chrono::nanoseconds &timeout) const |
| Poll the set of lines for line events. More... | |
| GPIOD_API | operator bool (void) const noexcept |
| Check if this object holds any lines. More... | |
| GPIOD_API bool | operator! (void) const noexcept |
| Check if this object doesn't hold any lines. More... | |
| GPIOD_API iterator | begin (void) noexcept |
| Returns an iterator to the first line. More... | |
| GPIOD_API iterator | end (void) noexcept |
| Returns an iterator to the element following the last line. More... | |
Static Public Attributes | |
| static GPIOD_API const unsigned int | MAX_LINES |
| Max number of lines that this object can hold. | |
Represents a set of GPIO lines.
Internally an object of this class stores an array of line objects owned by a single chip.
|
default |
Default constructor.
Creates an empty line_bulk object.
Construct a line_bulk from a vector of lines.
| lines | Vector of gpiod::line objects. |
Copy constructor.
| other | Other line_bulk object. |
Move constructor.
| other | Other line_bulk object. |
Returns an iterator to the first line.
|
noexcept |
Check if this line_bulk doesn't hold any lines.
Returns an iterator to the element following the last line.
Get the line at given offset.
| offset | Offset of the line to get. |
| GPIOD_API ::std::vector<int> gpiod::line_bulk::get_values | ( | void | ) | const |
Read values from all lines held by this object.
|
explicitnoexcept |
Check if this object holds any lines.
|
noexcept |
Check if this object doesn't hold any lines.
Get the line at given offset without bounds checking.
| offset | Offset of the line to get. |
| GPIOD_API void gpiod::line_bulk::request | ( | const line_request & | config, |
| const ::std::vector< int > | default_vals = ::std::vector< int >() |
||
| ) | const |
Request all lines held by this object.
| config | Request config (see gpiod::line_request). |
| default_vals | Vector of default values. Only relevant for output direction requests. |
| GPIOD_API void gpiod::line_bulk::set_config | ( | int | direction, |
| ::std::bitset< 32 > | flags, | ||
| const ::std::vector< int > | values = ::std::vector< int >() |
||
| ) | const |
Set configuration of all lines held by this object.
| direction | New direction. |
| flags | Replacement flags. |
| values | Vector of values to set. Must be the same size as the number of lines held by this line_bulk. Only relevant for output direction requests. |
| GPIOD_API void gpiod::line_bulk::set_direction_output | ( | const ::std::vector< int > & | values | ) | const |
Change the direction all lines held by this object to output.
| values | Vector of values to set. Must be the same size as the number of lines held by this line_bulk. |
| GPIOD_API void gpiod::line_bulk::set_flags | ( | ::std::bitset< 32 > | flags | ) | const |
Set configuration flags of all lines held by this object.
| flags | Replacement flags. |
| GPIOD_API void gpiod::line_bulk::set_values | ( | const ::std::vector< int > & | values | ) | const |
Set values of all lines held by this object.
| values | Vector of values to set. Must be the same size as the number of lines held by this line_bulk. |
|
noexcept |
Get the number of lines currently held by this object.