(dictionary)
| 27 | |
| 28 | class TMP102 extends SMBus { |
| 29 | constructor(dictionary) { |
| 30 | super(Object.assign({address: 0x48}, dictionary)); |
| 31 | super.writeBlock(3, 0x7f, 0xf8); // disable alert |
| 32 | // Configuration register is 0xA060 on reset as per data sheet |
| 33 | const config = super.readWord(1); |
| 34 | if (!(0x1000 & config)) { |
| 35 | super.writeWord(1, super.readWord(1) | 0x1000); // turn on 13-bit range (Extended Mode - EM bit) |
| 36 | Timer.delay(250); // wait for a new reading to be available, so it is at the correct resolution |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | configure(dictionary) { |
| 41 | if (dictionary.alert) { |
nothing calls this directly
no test coverage detected