8 #ifndef __LIBGPIOD_CXX_CHIP_HPP__
9 #define __LIBGPIOD_CXX_CHIP_HPP__
11 #if !defined(__LIBGPIOD_GPIOD_CXX_INSIDE__)
12 #error "Only gpiod.hpp can be included directly."
30 class request_builder;
50 explicit chip(const ::std::filesystem::path&
path);
60 chip& operator=(
const chip& other) =
delete;
67 chip& operator=(
chip&& other) noexcept;
76 explicit operator bool()
const noexcept;
89 ::std::filesystem::path
path()
const;
161 ::std::shared_ptr<impl> _m_priv;
174 ::std::ostream& operator<<(::std::ostream& out,
const chip&
chip);
Represents an immutable snapshot of GPIO chip information.
line_info get_line_info(line::offset offset) const
Retrieve the current snapshot of line information for a single line.
line_info watch_line_info(line::offset offset) const
Wrapper around gpiod::chip::get_line_info that retrieves the line info and starts watching the line f...
info_event read_info_event() const
Read a single line status change event from this chip.
void unwatch_line_info(line::offset offset) const
Stop watching the line at given offset for info events.
request_builder prepare_request()
Create a request_builder associated with this chip.
Intermediate object storing the configuration for a line request.
int get_line_offset_from_name(const ::std::string &name) const
Map a GPIO line's name to its offset within the chip.
Immutable object containing data about a single line info event.
chip_info get_info() const
Get information about the chip.
Contains an immutable snapshot of the line's state at the time when the object of this class was inst...
void close()
Close the GPIO chip device file and free associated resources.
::std::filesystem::path path() const
Get the filesystem path that was used to open this GPIO chip.
Wrapper around unsigned int for representing line offsets.
int fd() const
Get the file descriptor associated with this chip.
bool wait_info_event(const ::std::chrono::nanoseconds &timeout) const
Wait for line status events on any of the watched lines exposed by this chip.
chip(const ::std::filesystem::path &path)
Instantiates a new chip object by opening the device file indicated by the path argument.