Project

General

Profile

Raspberry PI GPIO Scol plugin
rpipin.h
1
2#ifndef RPIPIN_H
3#define RPIPIN_H
4
5#include <boost/thread.hpp>
6
7#ifdef RPI
8#include "lcd.h"
9#endif
10
11class RpiPin
12{
13public:
14 RpiPin();
15
16 RpiPin(int pin, int mode);
17
18 ~RpiPin();
19
20 void SetPullUpDnControl(int mode);
21
22 void DigitalWrite(int value);
23
24 int DigitalRead();
25
26 void AnalogWrite(int value);
27
28 int AnalogRead();
29
30 void PwmWrite(int value);
31
32 void threadLoop();
33
34private:
35 int mPin;
36 int mMode;
37 boost::thread mThread;
38 bool mState;
39 int mSoftValue;
40};
41
42#endif //RPIPIN_H