@@ -61,6 +61,7 @@ bool Adafruit_MAX31865::begin(max31865_numwires_t wires) {
61
61
setWires (wires);
62
62
enableBias (false );
63
63
autoConvert (false );
64
+ setThresholds (0 , 0xFFFF );
64
65
clearFault ();
65
66
66
67
// Serial.print("config: ");
@@ -139,6 +140,41 @@ void Adafruit_MAX31865::enable50Hz(bool b) {
139
140
writeRegister8 (MAX31865_CONFIG_REG, t);
140
141
}
141
142
143
+ /* *************************************************************************/
144
+ /* !
145
+ @brief Write the lower and upper values into the threshold fault
146
+ register to values as returned by readRTD()
147
+ @param lower raw lower threshold
148
+ @param upper raw upper threshold
149
+ */
150
+ /* *************************************************************************/
151
+ void Adafruit_MAX31865::setThresholds (uint16_t lower, uint16_t upper) {
152
+ writeRegister8 (MAX31865_LFAULTLSB_REG, lower & 0xFF );
153
+ writeRegister8 (MAX31865_LFAULTMSB_REG, lower >> 8 );
154
+ writeRegister8 (MAX31865_HFAULTLSB_REG, upper & 0xFF );
155
+ writeRegister8 (MAX31865_HFAULTMSB_REG, upper >> 8 );
156
+ }
157
+
158
+ /* *************************************************************************/
159
+ /* !
160
+ @brief Read the raw 16-bit lower threshold value
161
+ @return The raw unsigned 16-bit value, NOT temperature!
162
+ */
163
+ /* *************************************************************************/
164
+ uint16_t Adafruit_MAX31865::getLowerThreshold (void ) {
165
+ return readRegister16 (MAX31865_LFAULTMSB_REG);
166
+ }
167
+
168
+ /* *************************************************************************/
169
+ /* !
170
+ @brief Read the raw 16-bit lower threshold value
171
+ @return The raw unsigned 16-bit value, NOT temperature!
172
+ */
173
+ /* *************************************************************************/
174
+ uint16_t Adafruit_MAX31865::getUpperThreshold (void ) {
175
+ return readRegister16 (MAX31865_HFAULTMSB_REG);
176
+ }
177
+
142
178
/* *************************************************************************/
143
179
/* !
144
180
@brief How many wires we have in our RTD setup, can be MAX31865_2WIRE,
0 commit comments