36 this->
mark_failed(LOG_STR(
"Connected device does not match a known MCP9600 or MCP9601 sensor"));
40 bool success = this->
write_byte(MCP9600_REGISTER_STATUS, 0x00);
42 success &= this->
write_byte(MCP9600_REGISTER_CONFIG, 0x00);
43 success &= this->
write_byte(MCP9600_REGISTER_ALERT1_CONFIG, 0x00);
44 success &= this->
write_byte(MCP9600_REGISTER_ALERT2_CONFIG, 0x00);
45 success &= this->
write_byte(MCP9600_REGISTER_ALERT3_CONFIG, 0x00);
46 success &= this->
write_byte(MCP9600_REGISTER_ALERT4_CONFIG, 0x00);
47 success &= this->
write_byte(MCP9600_REGISTER_ALERT1_HYSTERESIS, 0x00);
48 success &= this->
write_byte(MCP9600_REGISTER_ALERT2_HYSTERESIS, 0x00);
49 success &= this->
write_byte(MCP9600_REGISTER_ALERT3_HYSTERESIS, 0x00);
50 success &= this->
write_byte(MCP9600_REGISTER_ALERT4_HYSTERESIS, 0x00);
51 success &= this->
write_byte_16(MCP9600_REGISTER_ALERT1_LIMIT, 0x0000);
52 success &= this->
write_byte_16(MCP9600_REGISTER_ALERT2_LIMIT, 0x0000);
53 success &= this->
write_byte_16(MCP9600_REGISTER_ALERT3_LIMIT, 0x0000);
54 success &= this->
write_byte_16(MCP9600_REGISTER_ALERT4_LIMIT, 0x0000);
57 this->
mark_failed(LOG_STR(
"Failed to update device configuration"));
75 uint16_t raw_hot_junction_temperature;
76 if (!this->
read_byte_16(MCP9600_REGISTER_HOT_JUNCTION, &raw_hot_junction_temperature)) {
80 float hot_junction_temperature = int16_t(raw_hot_junction_temperature) * 0.0625;
85 uint16_t raw_cold_junction_temperature;
86 if (!this->
read_byte_16(MCP9600_REGISTER_COLD_JUNTION, &raw_cold_junction_temperature)) {
90 float cold_junction_temperature = int16_t(raw_cold_junction_temperature) * 0.0625;