22 lines
726 B
C++
22 lines
726 B
C++
#ifndef GPIO_INPUT_HANDLE_H
|
|
#define GPIO_INPUT_HANDLE_H
|
|
#include "Gpio.h"
|
|
class GpioInputHandle : public VGpioInputHandle, public Gpio
|
|
{
|
|
public:
|
|
GpioInputHandle(const GpioPin &gpio, const unsigned int &pin, const signed char invalidInput);
|
|
virtual ~GpioInputHandle() = default;
|
|
void Init(void) override;
|
|
void UnInit(void) override;
|
|
void SetInputMonitor(std::shared_ptr<VGpioInputMonitor> monitor, void *context) override;
|
|
void CheckInputValue(void);
|
|
|
|
private:
|
|
const GpioPin mGpio;
|
|
const unsigned int mPin;
|
|
const signed char mInvalidInput;
|
|
SINT8 mLastPinValue;
|
|
std::weak_ptr<VGpioInputMonitor> mInputMonitor;
|
|
void *mContext;
|
|
};
|
|
#endif // !GPIO_INPUT_HANDLE_H
|