LightHub
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 //#ifndef WAK_PIN
35 //#define WAK_PIN 17
36 //#endif
37 #endif
38 
39 #if defined(ARDUINO_ARCH_AVR)
40 #ifndef WAK_PIN
41 #define WAK_PIN 3 // for LightHub UEXT SCS Pin
42 #endif
43 #endif
44 
45 
46 class Input;
47 class in_ccs811 : public abstractIn {
48 public:
49  //CCS811 ccs811(CCS811_ADDR);
50  //uint16_t ccs811Baseline;
51  in_ccs811(Input * _in):abstractIn(_in){};
52  int Setup() override;
53  int Poll(short cause) override;
54 
55 protected:
56  void printDriverError( CCS811Core::status errorCode );
57  void printSensorError();
58 };
59 
60 class in_hdc1080 : public abstractIn {
61 public:
62  //ClosedCube_HDC1080 hdc1080;
63  in_hdc1080(Input * _in):abstractIn(_in){};
64  int Setup() override;
65  int Poll(short cause) override;
66 
67 protected:
68  void printSerialNumber();
69 };
70 #endif
in_hdc1080::in_hdc1080
in_hdc1080(Input *_in)
Definition: in_ccs811_hdc1080.h:63
in_hdc1080::printSerialNumber
void printSerialNumber()
Definition: in_ccs811_hdc1080.cpp:181
in_hdc1080::Setup
int Setup() override
Definition: in_ccs811_hdc1080.cpp:61
in_ccs811::printSensorError
void printSensorError()
Definition: in_ccs811_hdc1080.cpp:220
abstractin.h
in_ccs811::Setup
int Setup() override
Definition: in_ccs811_hdc1080.cpp:22
in_ccs811
Definition: in_ccs811_hdc1080.h:47
in_hdc1080::Poll
int Poll(short cause) override
Definition: in_ccs811_hdc1080.cpp:88
Input
Definition: inputs.h:131
inputs.h
in_ccs811::printDriverError
void printDriverError(CCS811Core::status errorCode)
Definition: in_ccs811_hdc1080.cpp:194
in_ccs811::Poll
int Poll(short cause) override
Definition: in_ccs811_hdc1080.cpp:128
in_ccs811::in_ccs811
in_ccs811(Input *_in)
Definition: in_ccs811_hdc1080.h:51
abstractIn
Definition: abstractin.h:6
in_hdc1080
Definition: in_ccs811_hdc1080.h:60