From a826d13ae7b3e20648566ddecca23bd6fe8f856b Mon Sep 17 00:00:00 2001 From: John Klug Date: Wed, 8 Nov 2023 14:17:55 -0600 Subject: libgpiod 2 added for GPIO store and show in IOTR/MTR3 --- include/Device/Device.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/Device/Device.h b/include/Device/Device.h index 7a20f04..e02c352 100644 --- a/include/Device/Device.h +++ b/include/Device/Device.h @@ -128,9 +128,25 @@ class Device { void AddToDeviceInfo(const std::string Port, const std::string ProductID); }; + + class gpio_request { + private: + struct gpiod_request_config *request_config; + struct gpiod_line_config *line_config; + struct gpiod_line_settings *settings; + struct gpiod_line_request *line_request; // Result of creating a request + struct gpiod_chip *chip; + unsigned int rq_offset; + struct gpiod_chip *gpiod_ctxless_find_line(Device *device, std::string name, unsigned int *r_offset); + public: + struct gpiod_line_request *request(); + unsigned int offset(); + gpio_request(Device *device, const std::string name); + ~gpio_request(); + }; std::vector> accessoryCardsList; - + public: Device(); void getSystemTreeJson(const char *dir_name); @@ -158,6 +174,7 @@ class Device { void Verbose(bool val); bool Verbose(); void writeJson(); + void simpleError(std::string msg, int error, int exitval); }; #endif /* DEVICE_H_ */ -- cgit v1.2.3