use upstream gpio code

This commit is contained in:
Robin Müller 2022-03-28 19:12:55 +02:00
parent 2739328404
commit 2f2c393a4e
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC

View File

@ -20,7 +20,7 @@ enum class GpioTypes {
GPIO_REGULAR_BY_CHIP,
GPIO_REGULAR_BY_LABEL,
GPIO_REGULAR_BY_LINE_NAME,
TYPE_CALLBACK
CALLBACK
};
static constexpr gpioId_t NO_GPIO = -1;
@ -57,7 +57,7 @@ class GpioBase {
// Can be used to cast GpioBase to a concrete child implementation
gpio::GpioTypes gpioType = gpio::GpioTypes::NONE;
std::string consumer;
gpio::Direction direction = gpio::Direction::DIR_IN;
gpio::Direction direction = gpio::Direction::IN;
gpio::Levels initValue = gpio::Levels::NONE;
};
@ -79,13 +79,8 @@ class GpiodRegularBase : public GpioBase {
class GpiodRegularByChip : public GpiodRegularBase {
public:
GpiodRegularByChip()
<<<<<<< HEAD
: GpiodRegularBase(gpio::GpioTypes::GPIO_REGULAR_BY_CHIP, std::string(),
gpio::Direction::DIR_IN, gpio::LOW, 0) {}
=======
: GpiodRegularBase(gpio::GpioTypes::GPIO_REGULAR_BY_CHIP, std::string(), gpio::Direction::IN,
gpio::Levels::LOW, 0) {}
>>>>>>> upstream/development
GpiodRegularByChip(std::string chipname_, int lineNum_, std::string consumer_,
gpio::Direction direction_, gpio::Levels initValue_)
@ -94,13 +89,8 @@ class GpiodRegularByChip : public GpiodRegularBase {
chipname(chipname_) {}
GpiodRegularByChip(std::string chipname_, int lineNum_, std::string consumer_)
<<<<<<< HEAD
: GpiodRegularBase(gpio::GpioTypes::GPIO_REGULAR_BY_CHIP, consumer_, gpio::Direction::DIR_IN,
gpio::LOW, lineNum_),
=======
: GpiodRegularBase(gpio::GpioTypes::GPIO_REGULAR_BY_CHIP, consumer_, gpio::Direction::IN,
gpio::Levels::LOW, lineNum_),
>>>>>>> upstream/development
chipname(chipname_) {}
std::string chipname;
@ -115,13 +105,8 @@ class GpiodRegularByLabel : public GpiodRegularBase {
label(label_) {}
GpiodRegularByLabel(std::string label_, int lineNum_, std::string consumer_)
<<<<<<< HEAD
: GpiodRegularBase(gpio::GpioTypes::GPIO_REGULAR_BY_LABEL, consumer_, gpio::Direction::DIR_IN,
gpio::LOW, lineNum_),
=======
: GpiodRegularBase(gpio::GpioTypes::GPIO_REGULAR_BY_LABEL, consumer_, gpio::Direction::IN,
gpio::Levels::LOW, lineNum_),
>>>>>>> upstream/development
label(label_) {}
std::string label;
@ -141,13 +126,8 @@ class GpiodRegularByLineName : public GpiodRegularBase {
lineName(lineName_) {}
GpiodRegularByLineName(std::string lineName_, std::string consumer_)
<<<<<<< HEAD
: GpiodRegularBase(gpio::GpioTypes::GPIO_REGULAR_BY_LINE_NAME, consumer_,
gpio::Direction::DIR_IN, gpio::LOW),
=======
: GpiodRegularBase(gpio::GpioTypes::GPIO_REGULAR_BY_LINE_NAME, consumer_, gpio::Direction::IN,
gpio::Levels::LOW),
>>>>>>> upstream/development
lineName(lineName_) {}
std::string lineName;
@ -157,7 +137,7 @@ class GpioCallback : public GpioBase {
public:
GpioCallback(std::string consumer, gpio::Direction direction_, gpio::Levels initValue_,
gpio::gpio_cb_t callback, void* callbackArgs)
: GpioBase(gpio::GpioTypes::TYPE_CALLBACK, consumer, direction_, initValue_),
: GpioBase(gpio::GpioTypes::CALLBACK, consumer, direction_, initValue_),
callback(callback),
callbackArgs(callbackArgs) {}