-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnonBlockingDS18B20.h
48 lines (42 loc) · 1.19 KB
/
nonBlockingDS18B20.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Only modify this file to include
// - function definitions (prototypes)
// - include files
// - extern variable definitions
// In the appropriate section
#ifndef _nonBlockingDS18B20_H_
#define _nonBlockingDS18B20_H_
#include "Arduino.h"
#include <DallasTemperature.h>
struct tempSensorInfo;
class nonBlockingDS18B20: public DallasTemperature {
public:
nonBlockingDS18B20(OneWire *w) :
DallasTemperature(w) {
}
~nonBlockingDS18B20() {
if (infoPtr) {
free(infoPtr);
}
}
void getAddressFromTempSensorIndex(DeviceAddress, uint8_t);
void setUseConversionTimer(boolean);
boolean startConvertion(void);
boolean startConvertion(uint8_t);
boolean isConversionDone(void);
boolean getUseConversionTimer();
uint8_t begin(uint8_t);
uint8_t getOneWireIndexFromTempSensorIndex(uint8_t);
int16_t getLatestTempRaw(uint8_t);
float getLatestTempC(uint8_t);
float getLatestTempF(uint8_t);
private:
boolean parasiteMode;
boolean conversionInProcess;
boolean useConversionTimer = true;
uint8_t numTempSensors;
uint32_t waitTime;
uint32_t conversionStartTime;
tempSensorInfo *infoPtr;
void updateTemps(void);
};
#endif /* _nonBlockingDS18B20_H_ */