From 3c9c6604614ada826fc37c8304442b13cb219445 Mon Sep 17 00:00:00 2001 From: Doxygen CI Date: Tue, 8 Sep 2020 20:38:54 +0000 Subject: [PATCH] Deploy code docs to GitHub Pages Travis build: Commit: --- html/_d_h_t_8h.html | 21 +++++++++++++++++++++ html/_d_h_t_8h_source.html | 12 ++++++++++-- html/_d_h_t___u_8h_source.html | 2 +- html/globals.html | 3 +++ html/globals_defs.html | 3 +++ html/search/all_7.js | 1 + html/search/defines_2.js | 1 + 7 files changed, 40 insertions(+), 3 deletions(-) diff --git a/html/_d_h_t_8h.html b/html/_d_h_t_8h.html index 129f10a..cd42721 100644 --- a/html/_d_h_t_8h.html +++ b/html/_d_h_t_8h.html @@ -96,6 +96,8 @@ Macros   #define AM2301   21   +#define microsecondsToClockCycles(a)   ((a) * (SystemCoreClock / 1000000L)) + 

Detailed Description

This is a library for DHT series of low cost temperature/humidity sensors.

@@ -230,6 +232,25 @@ Macros

AM2301

+
+ + +

◆ microsecondsToClockCycles

+ +
+
+ + + + + + + + +
#define microsecondsToClockCycles( a)   ((a) * (SystemCoreClock / 1000000L))
+
+

As of 7 Sep 2020 the Arduino Nano 33 BLE boards do not have microsecondsToClockCycles defined.

+
diff --git a/html/_d_h_t_8h_source.html b/html/_d_h_t_8h_source.html index 9fe0b62..deb8c4c 100644 --- a/html/_d_h_t_8h_source.html +++ b/html/_d_h_t_8h_source.html @@ -62,8 +62,16 @@ $(function() {
DHT.h
-Go to the documentation of this file.
1 
18 #ifndef DHT_H
19 #define DHT_H
20 
21 #include "Arduino.h"
22 
23 /* Uncomment to enable printing out nice debug messages. */
24 //#define DHT_DEBUG
25 
26 #define DEBUG_PRINTER \
27  Serial
30 /* Setup debug printing macros. */
31 #ifdef DHT_DEBUG
32 #define DEBUG_PRINT(...) \
33  { DEBUG_PRINTER.print(__VA_ARGS__); }
34 #define DEBUG_PRINTLN(...) \
35  { DEBUG_PRINTER.println(__VA_ARGS__); }
36 #else
37 #define DEBUG_PRINT(...) \
38  {}
39 #define DEBUG_PRINTLN(...) \
40  {}
41 #endif
42 
43 /* Define types of sensors. */
44 #define DHT11 11
45 #define DHT12 12
46 #define DHT22 22
47 #define DHT21 21
48 #define AM2301 21
53 class DHT {
54 public:
55  DHT(uint8_t pin, uint8_t type, uint8_t count = 6);
56  void begin(uint8_t usec = 55);
57  float readTemperature(bool S = false, bool force = false);
58  float convertCtoF(float);
59  float convertFtoC(float);
60  float computeHeatIndex(bool isFahrenheit = true);
61  float computeHeatIndex(float temperature, float percentHumidity,
62  bool isFahrenheit = true);
63  float readHumidity(bool force = false);
64  bool read(bool force = false);
65 
66 private:
67  uint8_t data[5];
68  uint8_t _pin, _type;
69 #ifdef __AVR
70  // Use direct GPIO access on an 8-bit AVR so keep track of the port and
71  // bitmask for the digital pin connected to the DHT. Other platforms will use
72  // digitalRead.
73  uint8_t _bit, _port;
74 #endif
75  uint32_t _lastreadtime, _maxcycles;
76  bool _lastresult;
77  uint8_t pullTime; // Time (in usec) to pull up data line before reading
78 
79  uint32_t expectPulse(bool level);
80 };
81 
85 class InterruptLock {
86 public:
87  InterruptLock() {
88 #if !defined(ARDUINO_ARCH_NRF52)
89  noInterrupts();
90 #endif
91  }
92  ~InterruptLock() {
93 #if !defined(ARDUINO_ARCH_NRF52)
94  interrupts();
95 #endif
96  }
97 };
98 
99 #endif
Class that stores state and functions for DHT.
Definition: DHT.h:56
-
Class that defines Interrupt Lock Avaiability.
Definition: DHT.h:88
+Go to the documentation of this file.
1 
18 #ifndef DHT_H
19 #define DHT_H
20 
21 #include "Arduino.h"
22 
23 /* Uncomment to enable printing out nice debug messages. */
24 //#define DHT_DEBUG
25 
26 #define DEBUG_PRINTER \
27  Serial
30 /* Setup debug printing macros. */
31 #ifdef DHT_DEBUG
32 #define DEBUG_PRINT(...) \
33  { DEBUG_PRINTER.print(__VA_ARGS__); }
34 #define DEBUG_PRINTLN(...) \
35  { DEBUG_PRINTER.println(__VA_ARGS__); }
36 #else
37 #define DEBUG_PRINT(...) \
38  {}
39 #define DEBUG_PRINTLN(...) \
40  {}
41 #endif
42 
43 /* Define types of sensors. */
44 #define DHT11 11
45 #define DHT12 12
46 #define DHT22 22
47 #define DHT21 21
48 #define AM2301 21
50 #if (TARGET_NAME == ARDUINO_NANO33BLE)
51 #ifndef microsecondsToClockCycles
52 
56 #define microsecondsToClockCycles(a) ((a) * (SystemCoreClock / 1000000L))
57 #endif
58 #endif
59 
63 class DHT {
64 public:
65  DHT(uint8_t pin, uint8_t type, uint8_t count = 6);
66  void begin(uint8_t usec = 55);
67  float readTemperature(bool S = false, bool force = false);
68  float convertCtoF(float);
69  float convertFtoC(float);
70  float computeHeatIndex(bool isFahrenheit = true);
71  float computeHeatIndex(float temperature, float percentHumidity,
72  bool isFahrenheit = true);
73  float readHumidity(bool force = false);
74  bool read(bool force = false);
75 
76 private:
77  uint8_t data[5];
78  uint8_t _pin, _type;
79 #ifdef __AVR
80  // Use direct GPIO access on an 8-bit AVR so keep track of the port and
81  // bitmask for the digital pin connected to the DHT. Other platforms will use
82  // digitalRead.
83  uint8_t _bit, _port;
84 #endif
85  uint32_t _lastreadtime, _maxcycles;
86  bool _lastresult;
87  uint8_t pullTime; // Time (in usec) to pull up data line before reading
88 
89  uint32_t expectPulse(bool level);
90 };
91 
95 class InterruptLock {
96 public:
97  InterruptLock() {
98 #if !defined(ARDUINO_ARCH_NRF52)
99  noInterrupts();
100 #endif
101  }
102  ~InterruptLock() {
103 #if !defined(ARDUINO_ARCH_NRF52)
104  interrupts();
105 #endif
106  }
107 };
108 
109 #endif
float convertCtoF(float)
Converts Celcius to Fahrenheit.
Definition: DHT.cpp:133
+
DHT(uint8_t pin, uint8_t type, uint8_t count=6)
Instantiates a new DHT class.
Definition: DHT.cpp:43
+
float convertFtoC(float)
Converts Fahrenheit to Celcius.
Definition: DHT.cpp:141
+
bool read(bool force=false)
Read value from sensor or return last one from less than two seconds.
Definition: DHT.cpp:232
+
float computeHeatIndex(bool isFahrenheit=true)
Compute Heat Index Simplified version that reads temp and humidity from sensor.
Definition: DHT.cpp:175
+
Class that stores state and functions for DHT.
Definition: DHT.h:66
+
void begin(uint8_t usec=55)
Setup sensor pins and set pull timings.
Definition: DHT.cpp:64
+
float readTemperature(bool S=false, bool force=false)
Read temperature.
Definition: DHT.cpp:86
+
Class that defines Interrupt Lock Avaiability.
Definition: DHT.h:98
+
float readHumidity(bool force=false)
Read Humidity.
Definition: DHT.cpp:149
Go to the documentation of this file.
1 
33 #ifndef DHT_U_H
34 #define DHT_U_H
35 
36 #include <Adafruit_Sensor.h>
37 #include <DHT.h>
38 
39 #define DHT_SENSOR_VERSION 1
45 class DHT_Unified {
46 public:
47  DHT_Unified(uint8_t pin, uint8_t type, uint8_t count = 6,
48  int32_t tempSensorId = -1, int32_t humiditySensorId = -1);
49  void begin();
50 
54  class Temperature : public Adafruit_Sensor {
55  public:
56  Temperature(DHT_Unified *parent, int32_t id);
57  bool getEvent(sensors_event_t *event);
58  void getSensor(sensor_t *sensor);
59 
60  private:
61  DHT_Unified *_parent;
62  int32_t _id;
63  };
64 
68  class Humidity : public Adafruit_Sensor {
69  public:
70  Humidity(DHT_Unified *parent, int32_t id);
71  bool getEvent(sensors_event_t *event);
72  void getSensor(sensor_t *sensor);
73 
74  private:
75  DHT_Unified *_parent;
76  int32_t _id;
77  };
78 
83  Temperature temperature() { return _temp; }
84 
89  Humidity humidity() { return _humidity; }
90 
91 private:
92  DHT _dht;
93  uint8_t _type;
94  Temperature _temp;
95  Humidity _humidity;
96 
97  void setName(sensor_t *sensor);
98  void setMinDelay(sensor_t *sensor);
99 };
100 
101 #endif
Humidity humidity()
Returns humidity stored in _humidity.
Definition: DHT_U.h:89
-
Class that stores state and functions for DHT.
Definition: DHT.h:56
+
Class that stores state and functions for DHT.
Definition: DHT.h:66
Class that stores state and functions about Temperature.
Definition: DHT_U.h:54
Class that stores state and functions for interacting with DHT_Unified.
Definition: DHT_U.h:45
diff --git a/html/globals.html b/html/globals.html index a60456d..bcdcf07 100644 --- a/html/globals.html +++ b/html/globals.html @@ -86,6 +86,9 @@ $(function() {
  • DHT_SENSOR_VERSION : DHT_U.h
  • +
  • microsecondsToClockCycles +: DHT.h +
  • MIN_INTERVAL : DHT.cpp
  • diff --git a/html/globals_defs.html b/html/globals_defs.html index 1fc50f9..2e01711 100644 --- a/html/globals_defs.html +++ b/html/globals_defs.html @@ -86,6 +86,9 @@ $(function() {
  • DHT_SENSOR_VERSION : DHT_U.h
  • +
  • microsecondsToClockCycles +: DHT.h +
  • MIN_INTERVAL : DHT.cpp
  • diff --git a/html/search/all_7.js b/html/search/all_7.js index 9bc38bc..d029170 100644 --- a/html/search/all_7.js +++ b/html/search/all_7.js @@ -1,4 +1,5 @@ var searchData= [ + ['microsecondstoclockcycles',['microsecondsToClockCycles',['../_d_h_t_8h.html#aa4a5bbc71d71ab25856c1366b6ca15bb',1,'DHT.h']]], ['min_5finterval',['MIN_INTERVAL',['../_d_h_t_8cpp.html#ae5d44a5fa9fd9d113f6bff639f06ddd6',1,'DHT.cpp']]] ]; diff --git a/html/search/defines_2.js b/html/search/defines_2.js index 9bc38bc..d029170 100644 --- a/html/search/defines_2.js +++ b/html/search/defines_2.js @@ -1,4 +1,5 @@ var searchData= [ + ['microsecondstoclockcycles',['microsecondsToClockCycles',['../_d_h_t_8h.html#aa4a5bbc71d71ab25856c1366b6ca15bb',1,'DHT.h']]], ['min_5finterval',['MIN_INTERVAL',['../_d_h_t_8cpp.html#ae5d44a5fa9fd9d113f6bff639f06ddd6',1,'DHT.cpp']]] ];