|
@@ -166,7 +166,7 @@ void MAX31865::begin(max31865_numwires_t wires, float zero, float ref) {
|
166
|
166
|
" _miso: ", _miso,
|
167
|
167
|
" _sclk: ", _sclk,
|
168
|
168
|
" _mosi: ", _mosi,
|
169
|
|
- " config: ", readRegister8(MAX31856_CONFIG_REG)
|
|
169
|
+ " config: ", readRegister8(MAX31865_CONFIG_REG)
|
170
|
170
|
);
|
171
|
171
|
#endif
|
172
|
172
|
}
|
|
@@ -177,14 +177,14 @@ void MAX31865::begin(max31865_numwires_t wires, float zero, float ref) {
|
177
|
177
|
* @return The raw unsigned 8-bit FAULT status register
|
178
|
178
|
*/
|
179
|
179
|
uint8_t MAX31865::readFault() {
|
180
|
|
- return readRegister8(MAX31856_FAULTSTAT_REG);
|
|
180
|
+ return readRegister8(MAX31865_FAULTSTAT_REG);
|
181
|
181
|
}
|
182
|
182
|
|
183
|
183
|
/**
|
184
|
184
|
* Clear all faults in FAULTSTAT.
|
185
|
185
|
*/
|
186
|
186
|
void MAX31865::clearFault() {
|
187
|
|
- setConfig(MAX31856_CONFIG_FAULTSTAT, 1);
|
|
187
|
+ setConfig(MAX31865_CONFIG_FAULTSTAT, 1);
|
188
|
188
|
}
|
189
|
189
|
|
190
|
190
|
/**
|
|
@@ -193,7 +193,7 @@ void MAX31865::clearFault() {
|
193
|
193
|
* @param b If true, auto conversion is enabled
|
194
|
194
|
*/
|
195
|
195
|
void MAX31865::autoConvert(bool b) {
|
196
|
|
- setConfig(MAX31856_CONFIG_MODEAUTO, b);
|
|
196
|
+ setConfig(MAX31865_CONFIG_MODEAUTO, b);
|
197
|
197
|
}
|
198
|
198
|
|
199
|
199
|
/**
|
|
@@ -202,7 +202,7 @@ void MAX31865::autoConvert(bool b) {
|
202
|
202
|
* @param b If true, 50Hz noise is filtered, else 60Hz(default)
|
203
|
203
|
*/
|
204
|
204
|
void MAX31865::enable50HzFilter(bool b) {
|
205
|
|
- setConfig(MAX31856_CONFIG_FILT50HZ, b);
|
|
205
|
+ setConfig(MAX31865_CONFIG_FILT50HZ, b);
|
206
|
206
|
}
|
207
|
207
|
|
208
|
208
|
/**
|
|
@@ -211,7 +211,7 @@ void MAX31865::enable50HzFilter(bool b) {
|
211
|
211
|
* @param b If true bias is enabled, else disabled
|
212
|
212
|
*/
|
213
|
213
|
void MAX31865::enableBias(bool b) {
|
214
|
|
- setConfig(MAX31856_CONFIG_BIAS, b);
|
|
214
|
+ setConfig(MAX31865_CONFIG_BIAS, b);
|
215
|
215
|
|
216
|
216
|
// From the datasheet:
|
217
|
217
|
// Note that if VBIAS is off (to reduce supply current between conversions), any filter
|
|
@@ -226,7 +226,7 @@ void MAX31865::enableBias(bool b) {
|
226
|
226
|
* Start a one-shot temperature reading.
|
227
|
227
|
*/
|
228
|
228
|
void MAX31865::oneShot() {
|
229
|
|
- setConfig(MAX31856_CONFIG_1SHOT, 1);
|
|
229
|
+ setConfig(MAX31865_CONFIG_1SHOT, 1);
|
230
|
230
|
|
231
|
231
|
// From the datasheet:
|
232
|
232
|
// Note that a single conversion requires approximately 52ms in 60Hz filter
|
|
@@ -242,12 +242,12 @@ void MAX31865::oneShot() {
|
242
|
242
|
* @param wires The number of wires in enum format
|
243
|
243
|
*/
|
244
|
244
|
void MAX31865::setWires(max31865_numwires_t wires) {
|
245
|
|
- uint8_t t = readRegister8(MAX31856_CONFIG_REG);
|
|
245
|
+ uint8_t t = readRegister8(MAX31865_CONFIG_REG);
|
246
|
246
|
if (wires == MAX31865_3WIRE)
|
247
|
|
- t |= MAX31856_CONFIG_3WIRE;
|
|
247
|
+ t |= MAX31865_CONFIG_3WIRE;
|
248
|
248
|
else // 2 or 4 wire
|
249
|
|
- t &= ~MAX31856_CONFIG_3WIRE;
|
250
|
|
- writeRegister8(MAX31856_CONFIG_REG, t);
|
|
249
|
+ t &= ~MAX31865_CONFIG_3WIRE;
|
|
250
|
+ writeRegister8(MAX31865_CONFIG_REG, t);
|
251
|
251
|
}
|
252
|
252
|
|
253
|
253
|
/**
|
|
@@ -261,7 +261,7 @@ uint16_t MAX31865::readRaw() {
|
261
|
261
|
enableBias(true);
|
262
|
262
|
|
263
|
263
|
oneShot();
|
264
|
|
- uint16_t rtd = readRegister16(MAX31856_RTDMSB_REG);
|
|
264
|
+ uint16_t rtd = readRegister16(MAX31865_RTDMSB_REG);
|
265
|
265
|
|
266
|
266
|
#ifdef MAX31865_DEBUG
|
267
|
267
|
SERIAL_ECHOLNPGM("RTD MSB:", (rtd >> 8), " RTD LSB:", (rtd & 0x00FF));
|
|
@@ -352,12 +352,12 @@ float MAX31865::temperature(float Rrtd) {
|
352
|
352
|
* @param enable whether to enable or disable the value
|
353
|
353
|
*/
|
354
|
354
|
void MAX31865::setConfig(uint8_t config, bool enable) {
|
355
|
|
- uint8_t t = readRegister8(MAX31856_CONFIG_REG);
|
|
355
|
+ uint8_t t = readRegister8(MAX31865_CONFIG_REG);
|
356
|
356
|
if (enable)
|
357
|
357
|
t |= config;
|
358
|
358
|
else
|
359
|
359
|
t &= ~config; // disable
|
360
|
|
- writeRegister8(MAX31856_CONFIG_REG, t);
|
|
360
|
+ writeRegister8(MAX31865_CONFIG_REG, t);
|
361
|
361
|
}
|
362
|
362
|
|
363
|
363
|
/**
|