added option to open gpio by label instead of gpiochip*

This commit is contained in:
Jakob Meier
2021-09-20 18:38:18 +02:00
parent 7000ba05c5
commit 70a3749dbe
2 changed files with 36 additions and 7 deletions

View File

@ -85,7 +85,19 @@ public:
GpioBase(gpio::GpioTypes::GPIO_REGULAR, consumer_, gpio::Direction::IN, 0),
chipname(chipname_), lineNum(lineNum_) {
}
std::string chipname;
GpiodRegular(std::string consumer_, gpio::Direction direction_, int initValue_,
std::string label_, int lineNum_) :
GpioBase(gpio::GpioTypes::GPIO_REGULAR, consumer_, direction_, initValue_), label(
label_), lineNum(lineNum_) {
}
GpiodRegular(std::string consumer_, std::string label_, int lineNum_) :
GpioBase(gpio::GpioTypes::GPIO_REGULAR, consumer_, gpio::Direction::IN, 0), label(
label_), lineNum(lineNum_) {
}
std::string chipname = "NONE";
std::string label = "NONE";
int lineNum = 0;
struct gpiod_line* lineHandle = nullptr;
};