iGpio.h
1 /*
2  * iGpio.h
3  */
4 
5 #pragma once
6 
7 #include <map>
8 #include <list>
9 #include <vector>
10 #include <string>
11 #include <boost/system/error_code.hpp>
12 #include <mutex>
13 
14 namespace dpyGpio {
15 
17  INPUT = 0,
18  OUTPUT = 1
19 };
20 
21 enum EdgeType {
22  FALLING = 0,
23  RISING = 1,
24  BOTH = 2
25 };
26 
27 /*
28  * @brief Structure containing Gpio information
29  */
30 struct GpioInfoConf {
31  std::string alias="";
32  std::string type;
33  std::string address="1";
35  int default_value=0;
36  bool active_low=false;
37  bool hardware_inverted = false;
38  EdgeType edge_type;
39  int publish=0;
40  int bouncing_time=3;
41 };
42 
43 /*
44  * @brief Structure containing Gpio status event
45  */
46 struct GpioStatus {
47  bool value=false;
48  int counter=0;
49 };
50 
51 typedef boost::function<void(const std::string& gpioid, const GpioStatus& statusEvent)> GpioEventFunction;
52 
53 }
boost::function< void(const std::string &gpioid, const GpioStatus &statusEvent)> GpioEventFunction
Gpio event handler function.
Definition: iGpio.h:51
int publish
publish, not publish or publish only after a number of changes
Definition: iGpio.h:39
GpioDirection direction
Gpio direction (INPUT, OUTPUT)
Definition: iGpio.h:34
int default_value
Gpio default value.
Definition: iGpio.h:35
int bouncing_time
Bouncing time.
Definition: iGpio.h:40
bool active_low
True if Gpio active when low.
Definition: iGpio.h:36
Deepsy GPIO namespace that includes the different enums, structs or method signatures that should be ...
Definition: gpioApi.h:12
INPUT.
Definition: iGpio.h:17
bool hardware_inverted
True if inverted hardware logic.
Definition: iGpio.h:37
Definition: iGpio.h:30
EdgeType edge_type
enum FALLING, RISING, BOTH
Definition: iGpio.h:38
std::string alias
Gpio alias.
Definition: iGpio.h:31
GpioDirection
Definition: iGpio.h:16
OUTPUT.
Definition: iGpio.h:18
std::string address
Gpio address.
Definition: iGpio.h:33
Definition: iGpio.h:46
std::string type
Gpio type (MCU, SYSFS, GPIO_KEY, PIC_MCU)
Definition: iGpio.h:32