PiImageStreamer
Loading...
Searching...
No Matches
LgpioGPIO.h
Go to the documentation of this file.
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
48#define NUMBER_OF_GPIO_PINS (28)
49
50namespace SWE4211RPi {
51
55typedef int (*CallbackType)(int);
56
62class LgpioGPIO : public GPIO{
63public:
71 LgpioGPIO(int number, DIRECTION dir, VALUE val = GPIO_LOW);
72
77 virtual ~LgpioGPIO();
78
84 static void freeGPIOInstance(LgpioGPIO& instance);
85
86protected:
92 int number;
93
94private:
100 static int initialized;
101
102public:
103 // General Input and Output Settings
108 virtual void setValue(GPIO::VALUE value);
109
114 virtual GPIO::VALUE getValue();
115
116// Edge and Interrupt Methods
117
125 virtual void enableEdgeInterrupt(EDGE edgeType);
126
127
128
133 virtual void handleInterruptDrivenGPIOPin();
134
140 virtual void handleInterruptDrivenGPIOPin2(lgGpioAlert_p evt);
141
142};
143
144} /* namespace SWE4211RPi */
145#endif
146
147#endif /* LGPIOGPIO_H_ */