MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / constructor

Method constructor

modules/drivers/mcp9808/mcp9808.js:28–38  ·  view source on GitHub ↗
(dictionary)

Source from the content-addressed store, hash-verified

26
27class MCP9808 extends SMBus {
28 constructor(dictionary) {
29 super(Object.assign({address: 0x18}, dictionary));
30
31 if (0x0054 !== super.readWord(6, true))
32 throw new Error("invalid manufacturer id");
33 if (0x0400 !== super.readWord(7, true))
34 throw new Error("unexpected device id / revision");
35
36 super.writeWord(4, 0x0FFF, true); // max-out T Crit so it never triggers
37 super.writeWord(1, 0x0020); // reset configuration register (clear interrupt!)
38 }
39
40 configure(dictionary) {
41 if (dictionary.alert) {

Callers

nothing calls this directly

Calls 2

readWordMethod · 0.45
writeWordMethod · 0.45

Tested by

no test coverage detected