1 #ifdef HAS_THERMAL_LM75A
10 ReadAccRegister(LM75A_REG_TOS
, buffer
, 2);
12 DBGLN("thermal lma75 read Tos = 0x%x", buffer
[0]);
16 ERRLN("thermal lma75 init failed!");
23 uint8_t LM75A::read_lm75a()
26 ReadAccRegister(LM75A_REG_TEMP
, buffer
, 2);
28 // ignore the second byte as it's the decimal part of a degree.
32 void LM75A::update_lm75a_threshold(uint8_t tos
, uint8_t thyst
)
37 WriteAccRegister(LM75A_REG_THYST
, buffer
, 2);
41 WriteAccRegister(LM75A_REG_TOS
, buffer
, 2);
44 void LM75A::ReadAccRegister(uint8_t reg
, uint8_t *data
, int size
)
46 Wire
.beginTransmission(LM75A_I2C_ADDRESS
);
48 Wire
.endTransmission();
50 Wire
.requestFrom(LM75A_I2C_ADDRESS
, size
); // request 1 bytes from slave device
51 Wire
.readBytes(data
, size
);
54 void LM75A::WriteAccRegister(uint8_t reg
, uint8_t *data
, int size
)
56 Wire
.beginTransmission(LM75A_I2C_ADDRESS
);
58 Wire
.write(data
, size
);
59 Wire
.endTransmission();