discoLight
Loading...
Searching...
No Matches
LgpioGPIO.h
1
32#ifndef LGPIOGPIO_H_
33#define LGPIOGPIO_H_
34
35
36#include "GPIOcfg.h"
37#include "GPIO.h"
38
39#if (GPIO_LIB_USED==LGPIO)
40#include <lgpio.h>
41
42#include <mutex> // std::mutex, std::unique_lock
43#include <condition_variable> // std::condition_variable
44
45#define NUMBER_OF_GPIO_PINS (28)
46
47namespace SWE4211RPi {
48
49typedef int (*CallbackType)(int);
50
55class LgpioGPIO : public GPIO{
56public:
64 LgpioGPIO(int number, DIRECTION dir, VALUE val = GPIO_LOW);
65
70 virtual ~LgpioGPIO(); //destructor will unexport the pin
71
72 static void freeGPIOInstance(LgpioGPIO& instance);
73
74protected:
78 int number;
79
80private:
86 static int initialized;
87
88public:
89 // General Input and Output Settings
94 virtual void setValue(GPIO::VALUE);
95
100 virtual GPIO::VALUE getValue();
101
102// Edge and Interrupt Methods
103
111 virtual void enableEdgeInterrupt(EDGE edgeType);
112
113
114
119 virtual void handleInterruptDrivenGPIOPin();
120
125 virtual void handleInterruptDrivenGPIOPin2(lgGpioAlert_p evt);
126
127};
128
129} /* namespace SWE4211RPi */
130#endif
131
132#endif /* GPIO_H_ */