periph 1.3.3 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/README.md +36 -0
  2. package/examples/adc_dac/ad5251/complete.js +66 -0
  3. package/examples/adc_dac/ad5251/demo.js +69 -0
  4. package/examples/adc_dac/ad5251/minimal.js +23 -0
  5. package/examples/adc_dac/ad5252/complete.js +66 -0
  6. package/examples/adc_dac/ad5252/demo.js +69 -0
  7. package/examples/adc_dac/ad5252/minimal.js +23 -0
  8. package/examples/adc_dac/ads7828/complete.js +46 -0
  9. package/examples/adc_dac/ads7828/demo.js +45 -0
  10. package/examples/adc_dac/ads7828/minimal.js +17 -0
  11. package/examples/adc_dac/cat5171/complete.js +52 -0
  12. package/examples/adc_dac/cat5171/demo.js +59 -0
  13. package/examples/adc_dac/cat5171/minimal.js +23 -0
  14. package/examples/adc_dac/cs43l22/complete.js +88 -0
  15. package/examples/adc_dac/cs43l22/demo.js +56 -0
  16. package/examples/adc_dac/cs43l22/minimal.js +20 -0
  17. package/examples/adc_dac/ds1881/complete.js +62 -0
  18. package/examples/adc_dac/ds1881/demo.js +61 -0
  19. package/examples/adc_dac/ds1881/minimal.js +25 -0
  20. package/examples/adc_dac/ds3502/complete.js +46 -0
  21. package/examples/adc_dac/ds3502/demo.js +54 -0
  22. package/examples/adc_dac/ds3502/minimal.js +28 -0
  23. package/examples/adc_dac/es8311/complete.js +80 -0
  24. package/examples/adc_dac/es8311/demo.js +59 -0
  25. package/examples/adc_dac/es8311/minimal.js +18 -0
  26. package/examples/adc_dac/mcp3422/complete.js +48 -0
  27. package/examples/adc_dac/mcp3422/demo.js +49 -0
  28. package/examples/adc_dac/mcp3422/minimal.js +25 -0
  29. package/examples/adc_dac/mcp4xxx/complete.js +97 -0
  30. package/examples/adc_dac/mcp4xxx/demo.js +76 -0
  31. package/examples/adc_dac/mcp4xxx/minimal.js +22 -0
  32. package/examples/display/sh1106/complete.js +101 -0
  33. package/examples/display/sh1106/demo.js +68 -0
  34. package/examples/display/sh1106/minimal.js +25 -0
  35. package/examples/display/ssd1305/complete.js +129 -0
  36. package/examples/display/ssd1305/demo.js +71 -0
  37. package/examples/display/ssd1305/minimal.js +25 -0
  38. package/examples/display/ssd1306/complete.js +115 -0
  39. package/examples/display/ssd1306/demo.js +70 -0
  40. package/examples/display/ssd1306/minimal.js +25 -0
  41. package/examples/environmental/am2315/complete.js +34 -0
  42. package/examples/environmental/am2315/demo.js +46 -0
  43. package/examples/environmental/am2315/minimal.js +21 -0
  44. package/examples/humidity/htu21df/complete.js +49 -0
  45. package/examples/humidity/htu21df/demo.js +50 -0
  46. package/examples/humidity/htu21df/minimal.js +22 -0
  47. package/examples/humidity/sht31/complete.js +53 -0
  48. package/examples/humidity/sht31/demo.js +53 -0
  49. package/examples/humidity/sht31/minimal.js +21 -0
  50. package/examples/humidity/si7021/complete.js +55 -0
  51. package/examples/humidity/si7021/demo.js +58 -0
  52. package/examples/humidity/si7021/minimal.js +21 -0
  53. package/examples/imu/bno055/complete.js +85 -0
  54. package/examples/imu/bno055/demo.js +70 -0
  55. package/examples/imu/bno055/minimal.js +20 -0
  56. package/examples/imu/qmi8658a/complete.js +134 -0
  57. package/examples/imu/qmi8658a/demo.js +81 -0
  58. package/examples/imu/qmi8658a/minimal.js +22 -0
  59. package/examples/io_expander/pca6408a/complete.js +63 -0
  60. package/examples/io_expander/pca6408a/demo.js +58 -0
  61. package/examples/io_expander/pca6408a/minimal.js +20 -0
  62. package/examples/io_expander/pca6416a/complete.js +68 -0
  63. package/examples/io_expander/pca6416a/demo.js +60 -0
  64. package/examples/io_expander/pca6416a/minimal.js +20 -0
  65. package/examples/io_expander/pca9536/complete.js +63 -0
  66. package/examples/io_expander/pca9536/demo.js +57 -0
  67. package/examples/io_expander/pca9536/minimal.js +20 -0
  68. package/examples/io_expander/pca9539/complete.js +68 -0
  69. package/examples/io_expander/pca9539/demo.js +60 -0
  70. package/examples/io_expander/pca9539/minimal.js +20 -0
  71. package/examples/light/max44009/complete.js +56 -0
  72. package/examples/light/max44009/demo.js +49 -0
  73. package/examples/light/max44009/minimal.js +22 -0
  74. package/examples/memory/at24c02n/complete.js +39 -0
  75. package/examples/memory/at24c02n/demo.js +39 -0
  76. package/examples/memory/at24c02n/minimal.js +15 -0
  77. package/examples/memory/at24c64/complete.js +39 -0
  78. package/examples/memory/at24c64/demo.js +39 -0
  79. package/examples/memory/at24c64/minimal.js +15 -0
  80. package/examples/memory/cat24c512/complete.js +39 -0
  81. package/examples/memory/cat24c512/demo.js +39 -0
  82. package/examples/memory/cat24c512/minimal.js +15 -0
  83. package/examples/motor/tmc2130/complete.js +138 -0
  84. package/examples/motor/tmc2130/demo.js +96 -0
  85. package/examples/motor/tmc2130/minimal.js +30 -0
  86. package/examples/motor/tmc2208/complete.js +92 -0
  87. package/examples/motor/tmc2208/demo.js +85 -0
  88. package/examples/motor/tmc2208/minimal.js +25 -0
  89. package/examples/motor/tmc2209/complete.js +106 -0
  90. package/examples/motor/tmc2209/demo.js +97 -0
  91. package/examples/motor/tmc2209/minimal.js +25 -0
  92. package/examples/motor/tmc5160/complete.js +205 -0
  93. package/examples/motor/tmc5160/demo.js +104 -0
  94. package/examples/motor/tmc5160/minimal.js +35 -0
  95. package/examples/other/pca9541/complete.js +52 -0
  96. package/examples/other/pca9541/demo.js +61 -0
  97. package/examples/other/pca9541/minimal.js +23 -0
  98. package/examples/power/axp2101/complete.js +135 -0
  99. package/examples/power/axp2101/demo.js +68 -0
  100. package/examples/power/axp2101/minimal.js +24 -0
  101. package/examples/rtc/pcf85063a/complete.js +68 -0
  102. package/examples/rtc/pcf85063a/demo.js +76 -0
  103. package/examples/rtc/pcf85063a/minimal.js +20 -0
  104. package/examples/temperature/tmp102/complete.js +74 -0
  105. package/examples/temperature/tmp102/demo.js +71 -0
  106. package/examples/temperature/tmp102/minimal.js +20 -0
  107. package/examples/tof/vl6180x/complete.js +62 -0
  108. package/examples/tof/vl6180x/demo.js +77 -0
  109. package/examples/tof/vl6180x/minimal.js +23 -0
  110. package/package.json +1 -1
  111. package/src/chips/adc_dac/ad5251.js +345 -0
  112. package/src/chips/adc_dac/ad5252.js +345 -0
  113. package/src/chips/adc_dac/ads7828.js +225 -0
  114. package/src/chips/adc_dac/cat5171.js +213 -0
  115. package/src/chips/adc_dac/cs43l22.js +645 -0
  116. package/src/chips/adc_dac/ds1881.js +357 -0
  117. package/src/chips/adc_dac/ds3502.js +241 -0
  118. package/src/chips/adc_dac/es8311.js +621 -0
  119. package/src/chips/adc_dac/mcp3422.js +312 -0
  120. package/src/chips/adc_dac/mcp4xxx.js +982 -0
  121. package/src/chips/display/mono_oled.js +182 -0
  122. package/src/chips/display/sh1106.js +496 -0
  123. package/src/chips/display/ssd1305.js +655 -0
  124. package/src/chips/display/ssd1306.js +458 -0
  125. package/src/chips/environmental/am2315.js +237 -0
  126. package/src/chips/humidity/htu21df.js +222 -0
  127. package/src/chips/humidity/sht31.js +284 -0
  128. package/src/chips/humidity/si7021.js +282 -0
  129. package/src/chips/imu/bno055.js +496 -0
  130. package/src/chips/imu/qmi8658a.js +1011 -0
  131. package/src/chips/io_expander/pca6408a.js +407 -0
  132. package/src/chips/io_expander/pca6416a.js +455 -0
  133. package/src/chips/io_expander/pca9536.js +398 -0
  134. package/src/chips/io_expander/pca9539.js +457 -0
  135. package/src/chips/light/max44009.js +336 -0
  136. package/src/chips/memory/at24c02n.js +220 -0
  137. package/src/chips/memory/at24c64.js +220 -0
  138. package/src/chips/memory/cat24c512.js +221 -0
  139. package/src/chips/motor/tmc2130.js +537 -0
  140. package/src/chips/motor/tmc2208.js +490 -0
  141. package/src/chips/motor/tmc2209.js +565 -0
  142. package/src/chips/motor/tmc5160.js +900 -0
  143. package/src/chips/other/pca9541.js +315 -0
  144. package/src/chips/power/axp2101.js +968 -0
  145. package/src/chips/rtc/pcf85063a.js +482 -0
  146. package/src/chips/temperature/tmp102.js +361 -0
  147. package/src/chips/tof/vl6180x.js +580 -0
  148. package/src/connection/uart.js +9 -0
  149. package/src/connection/uart_mock.js +65 -0
  150. package/src/discovery/registry.js +85 -8
@@ -0,0 +1,361 @@
1
+ 'use strict';
2
+
3
+ const _REG_TEMPERATURE = 0x00;
4
+ const _REG_CONFIG = 0x01;
5
+ const _REG_T_LOW = 0x02;
6
+ const _REG_T_HIGH = 0x03;
7
+
8
+ // CONFIGURATION (0x01) bits.
9
+ const _CFG_OS = 0x8000;
10
+ const _CFG_F_SHIFT = 11;
11
+ const _CFG_F_MASK = 0x1800;
12
+ const _CFG_POL = 0x0400;
13
+ const _CFG_TM = 0x0200;
14
+ const _CFG_SD = 0x0100;
15
+ const _CFG_CR_SHIFT = 6;
16
+ const _CFG_CR_MASK = 0x00C0;
17
+ const _CFG_AL = 0x0020;
18
+ const _CFG_EM = 0x0010;
19
+ const _CFG_WRITABLE = 0x9FD0;
20
+ const _CFG_RESERVED = 0x6000; // R1:R0, read-only, always 11
21
+
22
+ const _LSB_C = 0.0625;
23
+ const _LIMIT_MIN = -55.0;
24
+ const _LIMIT_MAX = 150.0;
25
+ const _CONVERSION_RATES = [0.25, 1.0, 4.0, 8.0];
26
+ const _FAULT_QUEUES = [1, 2, 4, 6];
27
+
28
+ const _sleep = (ms) => new Promise((r) => setTimeout(r, ms));
29
+
30
+ function _signed(value, bits) {
31
+ const sign = 1 << (bits - 1);
32
+ return (value ^ sign) - sign;
33
+ }
34
+
35
+ // Raw signed count of a TEMPERATURE/limit register; bit 0 = 1 marks the 13-bit format.
36
+ function _decodeRaw(raw16) {
37
+ if (raw16 & 0x0001) return _signed(raw16 >> 3, 13);
38
+ return _signed(raw16 >> 4, 12);
39
+ }
40
+
41
+ /**
42
+ * TMP102 12-bit digital temperature sensor with ALERT output (Texas
43
+ * Instruments) — minimal interface.
44
+ *
45
+ * Two-wire temperature sensor (0.0625 °C per LSB, ±0.5 °C typical) read over
46
+ * an I²C/SMBus-compatible bus. Registers are 16-bit, big-endian, addressed
47
+ * through a persistent Register Pointer. Four selectable addresses
48
+ * (0x48–0x4B) via the ADD0 strap.
49
+ *
50
+ * The constructor makes no bus access: the power-on default (continuous
51
+ * conversion at 4 Hz, comparator mode, 12-bit) already serves the primary
52
+ * use case.
53
+ */
54
+ class TMP102Minimal {
55
+ /**
56
+ * @param {import('../../connection/register_connection').RegisterConnection} connection - I²C or SMBus register connection (0x48–0x4B).
57
+ */
58
+ constructor(connection) {
59
+ this._conn = connection;
60
+ }
61
+
62
+ async _readReg(reg) {
63
+ const buf = await this._conn.readReg(reg & 0xFF, 2);
64
+ return buf.readUInt16BE(0);
65
+ }
66
+
67
+ async _writeReg(reg, value) {
68
+ await this._conn.writeReg(reg & 0xFF, Buffer.from([(value >> 8) & 0xFF, value & 0xFF]));
69
+ }
70
+
71
+ /**
72
+ * Read the temperature. Decodes the 12-bit (0.0625 °C per LSB) or, in
73
+ * extended mode, 13-bit two's-complement value; the format is taken from
74
+ * bit 0 of the result.
75
+ * @returns {Promise<number>} Temperature in °C.
76
+ */
77
+ async readTemperature() {
78
+ return _decodeRaw(await this._readReg(_REG_TEMPERATURE)) * _LSB_C;
79
+ }
80
+ }
81
+
82
+ /**
83
+ * TMP102 full interface — extends Minimal with conversion rate, extended mode,
84
+ * the T_LOW/T_HIGH limits, fault queue, polarity, thermostat mode,
85
+ * shutdown/one-shot, alert status, general-call reset and the ALERT
86
+ * interrupt API.
87
+ */
88
+ class TMP102Full extends TMP102Minimal {
89
+ /**
90
+ * @param {import('../../connection/register_connection').RegisterConnection} connection - I²C or SMBus register connection (0x48–0x4B).
91
+ */
92
+ constructor(connection) {
93
+ super(connection);
94
+ this._callback = null;
95
+ this._edgeHandler = null;
96
+ this._pollTimer = null;
97
+ }
98
+
99
+ async _updateConfig(clear, set) {
100
+ const config = ((await this.readConfig()) & ~clear) | set;
101
+ await this.writeConfig(config);
102
+ }
103
+
104
+ /**
105
+ * Read the raw signed temperature count.
106
+ * @returns {Promise<number>} Signed 12-bit (13-bit in extended mode) count; temperature = count × 0.0625 °C.
107
+ */
108
+ async readRaw() {
109
+ return _decodeRaw(await this._readReg(_REG_TEMPERATURE));
110
+ }
111
+
112
+ /**
113
+ * Read the 16-bit CONFIGURATION register (reset value 0x60A0).
114
+ * @returns {Promise<number>} Register value.
115
+ */
116
+ async readConfig() {
117
+ return this._readReg(_REG_CONFIG);
118
+ }
119
+
120
+ /**
121
+ * Write the 16-bit CONFIGURATION register; read-only bits (R1:R0, AL,
122
+ * bits 3:0) are masked out.
123
+ * @param {number} value - Register value; only OS, F1:F0, POL, TM, SD, CR1:CR0 and EM are applied.
124
+ * @returns {Promise<void>}
125
+ */
126
+ async writeConfig(value) {
127
+ await this._writeReg(_REG_CONFIG, (value & _CFG_WRITABLE) | _CFG_RESERVED);
128
+ }
129
+
130
+ /**
131
+ * Set the conversion rate.
132
+ * @param {number} hz - 0.25, 1, 4 or 8 Hz.
133
+ * @returns {Promise<void>}
134
+ * @throws {RangeError} If hz is not a supported rate.
135
+ */
136
+ async setConversionRate(hz) {
137
+ const code = _CONVERSION_RATES.indexOf(hz);
138
+ if (code < 0) throw new RangeError('hz must be 0.25, 1, 4 or 8');
139
+ await this._updateConfig(_CFG_CR_MASK, code << _CFG_CR_SHIFT);
140
+ }
141
+
142
+ /**
143
+ * Enable or disable the 13-bit extended mode (EM bit).
144
+ * @param {boolean} on - true for 13-bit (-256…+255.9375 °C), false for 12-bit.
145
+ * @returns {Promise<void>}
146
+ */
147
+ async setExtendedMode(on) {
148
+ await this._updateConfig(_CFG_EM, on ? _CFG_EM : 0);
149
+ }
150
+
151
+ async _setLimit(reg, celsius) {
152
+ const extended = ((await this.readConfig()) & _CFG_EM) !== 0;
153
+ let c = Math.min(Math.max(celsius, _LIMIT_MIN), _LIMIT_MAX);
154
+ const steps = c / _LSB_C;
155
+ let counts = steps >= 0 ? Math.floor(steps + 0.5) : -Math.floor(-steps + 0.5);
156
+ if (extended) {
157
+ await this._writeReg(reg, (counts << 3) & 0xFFF8);
158
+ } else {
159
+ if (counts > 2047) counts = 2047;
160
+ await this._writeReg(reg, (counts << 4) & 0xFFF0);
161
+ }
162
+ }
163
+
164
+ async _getLimit(reg) {
165
+ const extended = ((await this.readConfig()) & _CFG_EM) !== 0;
166
+ const raw16 = await this._readReg(reg);
167
+ const counts = extended ? _signed(raw16 >> 3, 13) : _signed(raw16 >> 4, 12);
168
+ return counts * _LSB_C;
169
+ }
170
+
171
+ /**
172
+ * Set the T_HIGH limit (reset 80 °C).
173
+ * @param {number} celsius - Limit in °C, rounded to 0.0625 °C and clamped to -55…+150 °C (12-bit mode: up to +127.9375 °C).
174
+ * @returns {Promise<void>}
175
+ */
176
+ async setTHigh(celsius) {
177
+ await this._setLimit(_REG_T_HIGH, celsius);
178
+ }
179
+
180
+ /**
181
+ * Read the T_HIGH limit.
182
+ * @returns {Promise<number>} Limit in °C.
183
+ */
184
+ async getTHigh() {
185
+ return this._getLimit(_REG_T_HIGH);
186
+ }
187
+
188
+ /**
189
+ * Set the T_LOW limit (reset 75 °C).
190
+ * @param {number} celsius - Limit in °C, rounded to 0.0625 °C and clamped to -55…+150 °C (12-bit mode: up to +127.9375 °C).
191
+ * @returns {Promise<void>}
192
+ */
193
+ async setTLow(celsius) {
194
+ await this._setLimit(_REG_T_LOW, celsius);
195
+ }
196
+
197
+ /**
198
+ * Read the T_LOW limit.
199
+ * @returns {Promise<number>} Limit in °C.
200
+ */
201
+ async getTLow() {
202
+ return this._getLimit(_REG_T_LOW);
203
+ }
204
+
205
+ /**
206
+ * Set the number of consecutive faults that trigger ALERT.
207
+ * @param {number} count - 1, 2, 4 or 6.
208
+ * @returns {Promise<void>}
209
+ * @throws {RangeError} If count is not a supported value.
210
+ */
211
+ async setFaultQueue(count) {
212
+ const code = _FAULT_QUEUES.indexOf(count);
213
+ if (code < 0) throw new RangeError('count must be 1, 2, 4 or 6');
214
+ await this._updateConfig(_CFG_F_MASK, code << _CFG_F_SHIFT);
215
+ }
216
+
217
+ /**
218
+ * Set the ALERT polarity (POL bit).
219
+ * @param {boolean} activeHigh - true for active-high, false for active-low (default).
220
+ * @returns {Promise<void>}
221
+ */
222
+ async setPolarity(activeHigh) {
223
+ await this._updateConfig(_CFG_POL, activeHigh ? _CFG_POL : 0);
224
+ }
225
+
226
+ /**
227
+ * Select the thermostat mode (TM bit).
228
+ * @param {boolean} interrupt - true for interrupt mode, false for comparator mode (default).
229
+ * @returns {Promise<void>}
230
+ */
231
+ async setThermostatMode(interrupt) {
232
+ await this._updateConfig(_CFG_TM, interrupt ? _CFG_TM : 0);
233
+ }
234
+
235
+ /**
236
+ * Shut the device down after the current conversion (SD=1).
237
+ * @returns {Promise<void>}
238
+ */
239
+ async shutdown() {
240
+ await this._updateConfig(0, _CFG_SD);
241
+ }
242
+
243
+ /**
244
+ * Resume continuous conversion (SD=0).
245
+ * @returns {Promise<void>}
246
+ */
247
+ async wake() {
248
+ await this._updateConfig(_CFG_SD, 0);
249
+ }
250
+
251
+ /**
252
+ * Take a single conversion and return the temperature. Puts the device in
253
+ * shutdown if needed, sets OS=1, polls OS until the conversion is done
254
+ * (30 ms timeout) and restores the previous mode.
255
+ * @returns {Promise<number>} Temperature in °C.
256
+ * @throws {Error} If the conversion does not finish within 30 ms.
257
+ */
258
+ async oneShot() {
259
+ let config = await this.readConfig();
260
+ const wasRunning = (config & _CFG_SD) === 0;
261
+ if (wasRunning) {
262
+ config |= _CFG_SD;
263
+ await this.writeConfig(config);
264
+ }
265
+ await this.writeConfig(config | _CFG_OS);
266
+ let done = false;
267
+ for (let i = 0; i < 30; i++) {
268
+ await _sleep(1);
269
+ if ((await this.readConfig()) & _CFG_OS) { done = true; break; }
270
+ }
271
+ const temperature = await this.readTemperature();
272
+ if (wasRunning) await this.wake();
273
+ if (!done) throw new Error('TMP102: one-shot conversion timed out');
274
+ return temperature;
275
+ }
276
+
277
+ /**
278
+ * Report whether ALERT is currently active.
279
+ * @returns {Promise<boolean>} true while the comparator state is alerting (AL bit corrected for POL).
280
+ */
281
+ async alertState() {
282
+ const config = await this.readConfig();
283
+ const al = (config & _CFG_AL) !== 0;
284
+ // AL reads 1 while inactive with POL=0 (inverted); POL=1 flips it.
285
+ return (config & _CFG_POL) ? al : !al;
286
+ }
287
+
288
+ /**
289
+ * Send the general-call reset (0x00 0x06). Resets every general-call
290
+ * device on the bus to power-up values. Needs a Connection that transmits
291
+ * the bytes to the general-call address.
292
+ * @returns {Promise<void>}
293
+ */
294
+ async reset() {
295
+ await this._conn.write(Buffer.from([0x00, 0x06]));
296
+ }
297
+
298
+ /**
299
+ * Read the alert state and clear an interrupt-mode alert (reads
300
+ * CONFIGURATION, then TEMPERATURE).
301
+ * @returns {Promise<boolean>} true while the comparator state is alerting.
302
+ */
303
+ async pollInterrupt() {
304
+ const alerting = await this.alertState();
305
+ await this._readReg(_REG_TEMPERATURE);
306
+ return alerting;
307
+ }
308
+
309
+ /**
310
+ * Subscribe to ALERT events. With an interrupt pin on the connection the
311
+ * callback runs on every active ALERT edge (direction follows POL);
312
+ * otherwise a 1 s polling task calls it when pollInterrupt() reports an alert.
313
+ * @param {(temperatureC: number) => void} callback
314
+ * @returns {Promise<void>}
315
+ */
316
+ async onInterrupt(callback) {
317
+ this._callback = callback;
318
+ if (this._conn.intPin) {
319
+ const activeHigh = ((await this.readConfig()) & _CFG_POL) !== 0;
320
+ this._edgeHandler = async () => {
321
+ const t = await this.readTemperature();
322
+ if (this._callback) this._callback(t);
323
+ };
324
+ await this._conn.intPin.onEdge(this._edgeHandler, activeHigh ? 'rising' : 'falling');
325
+ } else {
326
+ let busy = false;
327
+ this._pollTimer = setInterval(async () => {
328
+ if (busy) return;
329
+ busy = true;
330
+ try {
331
+ if (await this.pollInterrupt()) {
332
+ const t = await this.readTemperature();
333
+ if (this._callback) this._callback(t);
334
+ }
335
+ } finally {
336
+ busy = false;
337
+ }
338
+ }, 1000);
339
+ }
340
+ }
341
+
342
+ /**
343
+ * Unsubscribe and stop delivery.
344
+ * @returns {Promise<void>}
345
+ */
346
+ async offInterrupt() {
347
+ if (this._conn.intPin && this._edgeHandler) {
348
+ await this._conn.intPin.offEdge(this._edgeHandler);
349
+ this._edgeHandler = null;
350
+ }
351
+ if (this._pollTimer) {
352
+ clearInterval(this._pollTimer);
353
+ this._pollTimer = null;
354
+ }
355
+ this._callback = null;
356
+ }
357
+ }
358
+
359
+ TMP102Minimal.I2C_ADDRESS = 0x48;
360
+
361
+ module.exports = { TMP102Minimal, TMP102Full };