Adafruit Library
ws_ds18x20.h
Go to the documentation of this file.
1 
16 #ifndef WIPPERSNAPPER_DS18X20_H
17 #define WIPPERSNAPPER_DS18X20_H
18 
19 #include "Wippersnapper.h"
20 
21 #include <Adafruit_Sensor.h>
22 #include <DallasTemperature.h>
23 
25 struct ds18x20Obj {
26  OneWire *
28  char onewire_pin[5];
29  DallasTemperature
31  DeviceAddress dallasTempAddr;
33  wippersnapper_i2c_v1_I2CDeviceSensorProperties sensorProperties[2] =
34  wippersnapper_i2c_v1_I2CDeviceSensorProperties_init_zero;
35  long sensorPeriodPrv;
37 };
38 
39 // forward decl.
40 class Wippersnapper;
41 
42 /**************************************************************************/
47 /**************************************************************************/
48 class ws_ds18x20 {
49 public:
50  ws_ds18x20();
51  ~ws_ds18x20();
52 
53  bool
54  addDS18x20(wippersnapper_ds18x20_v1_Ds18x20InitRequest *msgDs18x20InitReq);
55  void deleteDS18x20(
56  wippersnapper_ds18x20_v1_Ds18x20DeInitRequest *msgDS18x20DeinitReq);
57  void update();
58 
59 private:
60  std::vector<ds18x20Obj *>
61  _ds18xDrivers;
62 };
63 extern Wippersnapper WS;
64 
65 #endif // WIPPERSNAPPER_DS18X20_H
int sensorPropertiesCount
Tracks # of sensorProperties.
Definition: ws_ds18x20.h:32
long sensorPeriodPrv
Last time the sensor was polled, in millis.
Definition: ws_ds18x20.h:36
Class that provides storage and functions for the Adafruit IO Wippersnapper interface.
Definition: Wippersnapper.h:283
DallasTemperature * dallasTempObj
Pointer to a DallasTemperature sensor object.
Definition: ws_ds18x20.h:30
Class that provides an interface with DS18X20-compatible sensors.
Definition: ws_ds18x20.h:48
Definition: ws_ds18x20.h:25
OneWire * oneWire
Pointer to an OneWire bus used by a DallasTemperature object.
Definition: ws_ds18x20.h:27
DeviceAddress dallasTempAddr
Temperature sensor&#39;s address.
Definition: ws_ds18x20.h:31
wippersnapper_i2c_v1_I2CDeviceSensorProperties sensorProperties[2]
Definition: ws_ds18x20.h:33
Wippersnapper WS
Definition: Wippersnapper.cpp:36
char onewire_pin[5]
Pin utilized by the OneWire bus, used for addressing.
Definition: ws_ds18x20.h:28