| LightHub v4.0.0 Smarthome controller firmware

in_ccs811_hdc1080.h
Go to the documentation of this file.
1
2 #pragma once
3 #ifndef CSSHDC_DISABLE
4 #include <inputs.h>
5 #include <abstractin.h>
6 #include <Wire.h>
7 #include "ClosedCube_HDC1080.h"
8 #include "SparkFunCCS811.h" //Click here to get the library: http://librarymanager/All#SparkFun_CCS811
9
10 //#define CCS811_ADDR 0x5B //Default I2C Address
11 #define CCS811_ADDR 0x5A //Alternate I2C Address
12
13 #if defined (ARDUINO_ARCH_ESP8266)
14 #define twi_scl D1
15 #ifndef WAK_PIN
16 #define WAK_PIN D3
17 #endif
18
19 #define SCL_LOW() (GPES = (1 << twi_scl))
20 #define SCL_HIGH() (GPEC = (1 << twi_scl))
21 #define SCL_RESET
22 #endif
23
24 /*
25 #if defined (__SAM3X8E__)
26 #define SCL_LOW() digitalWrite(21,LOW)
27 #define SCL_HIGH() digitalWrite(21,HIGH)
28 #define SCL_RESET
29 #endif
30 */
31
32 #if defined (ARDUINO_ARCH_ESP32)
33 #undef WAK_PIN
34 #undef SCL_RESET
35 //#ifndef WAK_PIN
36 //#define WAK_PIN 17
37 //#endif
38 #endif
39
40 #if defined(ARDUINO_ARCH_AVR)
41 #ifndef WAK_PIN
42 #define WAK_PIN 3 // for LightHub UEXT SCS Pin
43 #endif
44 #endif
45
46
47 class Input;
48 class in_ccs811 : public abstractIn {
49 public:
50 //CCS811 ccs811(CCS811_ADDR);
51 //uint16_t ccs811Baseline;
52 in_ccs811(Input * _in):abstractIn(_in){};
53 int Setup() override;
54 int Poll(short cause) override;
55
56 protected:
57 void printDriverError( CCS811Core::status errorCode );
58 void printSensorError();
59 };
60
61 class in_hdc1080 : public abstractIn {
62 public:
63 //ClosedCube_HDC1080 hdc1080;
64 in_hdc1080(Input * _in):abstractIn(_in){};
65 int Setup() override;
66 int Poll(short cause) override;
67
68 protected:
69 void printSerialNumber();
70 };
71 #endif
in_hdc1080::in_hdc1080
in_hdc1080(Input *_in)
Definition: in_ccs811_hdc1080.h:64
in_hdc1080::printSerialNumber
void printSerialNumber()
Definition: in_ccs811_hdc1080.cpp:194
in_hdc1080::Setup
int Setup() override
Definition: in_ccs811_hdc1080.cpp:61
in_ccs811::printSensorError
void printSensorError()
Definition: in_ccs811_hdc1080.cpp:233
abstractin.h
in_ccs811::Setup
int Setup() override
Definition: in_ccs811_hdc1080.cpp:22
in_ccs811
Definition: in_ccs811_hdc1080.h:48
in_hdc1080::Poll
int Poll(short cause) override
Definition: in_ccs811_hdc1080.cpp:88
Input
Definition: inputs.h:132
inputs.h
in_ccs811::printDriverError
void printDriverError(CCS811Core::status errorCode)
Definition: in_ccs811_hdc1080.cpp:207
in_ccs811::Poll
int Poll(short cause) override
Definition: in_ccs811_hdc1080.cpp:134
in_ccs811::in_ccs811
in_ccs811(Input *_in)
Definition: in_ccs811_hdc1080.h:52
abstractIn
Definition: abstractin.h:6
in_hdc1080
Definition: in_ccs811_hdc1080.h:61