LightHub 4.6.0
Open-source smart home controller firmware
Loading...
Searching...
No Matches
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//#ifndef I2C_CLOCK
11//#define I2C_CLOCK 4000
12//#endif
13
14//#define CCS811_ADDR 0x5B //Default I2C Address
16#define CCS811_ADDR 0x5A //Alternate I2C Address
17
18#if defined (ARDUINO_ARCH_ESP8266)
19
20 // #if not defined (TWI_SCL) && defined (D1)
21 // #define TWI_SCL D1
22 // #endif
23
24 // #if not defined (WAK_PIN) && defined (D3)
25 // #define WAK_PIN D3
26 // #endif
27
28 #if defined (TWI_SCL)
29 #define SCL_LOW() (GPES = (1 << TWI_SCL))
30 #define SCL_HIGH() (GPEC = (1 << TWI_SCL))
31 #define SCL_RESET
32 #endif
33
34#endif
35
36
37
38#if defined (ARDUINO_ARCH_ESP32)
39//#undef WAK_PIN
40#undef SCL_RESET
41//#ifndef WAK_PIN
42//#define WAK_PIN 17
43//#endif
44#endif
45
46#if defined(ARDUINO_ARCH_AVR)
47//#ifndef WAK_PIN
48//#define WAK_PIN 3 // for LightHub UEXT SCS Pin
49//#endif
50#endif
51
52
53class Input;
68class in_ccs811 : public abstractIn {
69public:
70 //CCS811 ccs811(CCS811_ADDR);
71 //uint16_t ccs811Baseline;
72 in_ccs811(Input * _in):abstractIn(_in){};
73 int Setup() override;
74 int Poll(short cause) override;
75
76protected:
77 void printDriverError( CCS811Core::status errorCode );
78 void printSensorError();
79};
80
94class in_hdc1080 : public abstractIn {
95public:
96 //ClosedCube_HDC1080 hdc1080;
98 int Setup() override;
99 int Poll(short cause) override;
100
101protected:
102 void printSerialNumber();
103};
104#endif
A single LightHub input (digital/analog pin, sensor, encoder, ...).
Definition inputs.h:204
friend Input
Definition abstractin.h:29
abstractIn(Input *_in)
Definition abstractin.h:18
void printDriverError(CCS811Core::status errorCode)
Definition in_ccs811_hdc1080.cpp:209
void printSensorError()
Definition in_ccs811_hdc1080.cpp:236
in_ccs811(Input *_in)
Definition in_ccs811_hdc1080.h:72
int Poll(short cause) override
Definition in_ccs811_hdc1080.cpp:136
int Setup() override
Definition in_ccs811_hdc1080.cpp:23
in_hdc1080(Input *_in)
Definition in_ccs811_hdc1080.h:97
int Poll(short cause) override
Definition in_ccs811_hdc1080.cpp:90
void printSerialNumber()
Definition in_ccs811_hdc1080.cpp:196
int Setup() override
Definition in_ccs811_hdc1080.cpp:69
LightHub input system (digital/analog pins, sensors, encoders).