Teademia 543afc9ff9 Implement of Rasp GPIO Input read
Import libwringpi and read handbutton input
2023-11-21 21:22:47 +08:00

30 lines
705 B
C++

#ifndef GPIODETECT_H
#define GPIODETECT_H
#include <QObject>
#include<QThread>
#include<QDebug>
#include<iostream>
#include"gpioinit.h"
#include<wiringPi.h>
using namespace std;
class gpiodetect : public QThread
{
Q_OBJECT
public:
explicit gpiodetect(QObject *parent = nullptr);
void run();
private:
bool Status=true; //Decide wether The Detect is going on
void Stop(); //Stop Detect
void Start(); //Lauch Detect
signals:
void Reboot(bool a); //Detect a reboot command and send it to Controller
void Pin_High(int pin); //Detect a high GPIO and send it to Controller
void Pin_Low(int pin);
};
#endif // GPIODETECT_H