periph 1.0.0 → 1.1.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.
- package/README.md +49 -0
- package/examples/adc_dac/hx711/complete.js +42 -0
- package/examples/adc_dac/hx711/demo.js +35 -0
- package/examples/adc_dac/hx711/minimal.js +16 -0
- package/examples/adc_dac/mcp4728/complete.js +41 -0
- package/examples/adc_dac/mcp4728/demo.js +41 -0
- package/examples/adc_dac/mcp4728/minimal.js +11 -0
- package/examples/display/pcf8576/complete.js +32 -0
- package/examples/display/pcf8576/demo.js +48 -0
- package/examples/display/pcf8576/minimal.js +18 -0
- package/examples/environmental/aht21/complete.js +30 -0
- package/examples/environmental/aht21/demo.js +44 -0
- package/examples/environmental/aht21/minimal.js +12 -0
- package/examples/environmental/bme280/complete.js +34 -0
- package/examples/environmental/bme280/demo.js +67 -0
- package/examples/environmental/bme280/minimal.js +18 -0
- package/examples/environmental/bme680/complete.js +37 -0
- package/examples/environmental/bme680/demo.js +52 -0
- package/examples/environmental/bme680/minimal.js +19 -0
- package/examples/gas/ens160/complete.js +52 -0
- package/examples/gas/ens160/demo.js +52 -0
- package/examples/gas/ens160/minimal.js +27 -0
- package/examples/imu/mpu6050/complete.js +56 -0
- package/examples/imu/mpu6050/demo.js +34 -0
- package/examples/imu/mpu6050/minimal.js +14 -0
- package/examples/light/apds9960/complete.js +62 -0
- package/examples/light/apds9960/demo.js +32 -0
- package/examples/light/apds9960/minimal.js +12 -0
- package/examples/memory/24aa02uid/complete.js +40 -0
- package/examples/memory/24aa02uid/demo.js +40 -0
- package/examples/memory/24aa02uid/minimal.js +12 -0
- package/examples/pressure/bmp280/complete.js +22 -18
- package/examples/pressure/bmp280/demo.js +34 -18
- package/examples/pressure/bmp280/minimal.js +4 -4
- package/package.json +1 -1
- package/src/chips/adc_dac/hx711.js +165 -0
- package/src/chips/adc_dac/mcp4728.js +284 -0
- package/src/chips/display/pcf8576.js +223 -0
- package/src/chips/environmental/aht21.js +170 -0
- package/src/chips/environmental/bme280.js +366 -0
- package/src/chips/environmental/bme680.js +489 -0
- package/src/chips/gas/ens160.js +280 -0
- package/src/chips/imu/mpu6050.js +266 -0
- package/src/chips/light/apds9960.js +464 -0
- package/src/chips/memory/_24aa02uid.js +179 -0
- package/src/chips/pressure/bmp280.js +154 -191
- package/src/transport/hx711.js +105 -0
- package/examples/display/.gitkeep +0 -0
- package/examples/environmental/.gitkeep +0 -0
- package/examples/imu/.gitkeep +0 -0
- package/examples/light/.gitkeep +0 -0
- package/examples/pressure/.gitkeep +0 -0
- package/src/chips/display/.gitkeep +0 -0
- package/src/chips/environmental/.gitkeep +0 -0
- package/src/chips/imu/.gitkeep +0 -0
- package/src/chips/light/.gitkeep +0 -0
- package/src/chips/pressure/.gitkeep +0 -0
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const _REG_CAL_START = 0x88;
|
|
4
|
+
const _REG_H1 = 0xA1;
|
|
5
|
+
const _REG_ID = 0xD0;
|
|
6
|
+
const _REG_RESET = 0xE0;
|
|
7
|
+
const _REG_CAL_H2 = 0xE1;
|
|
8
|
+
const _REG_CTRL_HUM = 0xF2;
|
|
9
|
+
const _REG_STATUS = 0xF3;
|
|
10
|
+
const _REG_CTRL_MEAS = 0xF4;
|
|
11
|
+
const _REG_CONFIG = 0xF5;
|
|
12
|
+
const _REG_DATA_START = 0xF7;
|
|
13
|
+
|
|
14
|
+
const _CHIP_ID = 0x60;
|
|
15
|
+
const _RESET_CMD = 0xB6;
|
|
16
|
+
|
|
17
|
+
const _MEAS_TIME_MS = 9;
|
|
18
|
+
|
|
19
|
+
function _delay(ms) {
|
|
20
|
+
const start = Date.now();
|
|
21
|
+
while (Date.now() - start < ms) { /* spin */ }
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function _signExtend12(raw) {
|
|
25
|
+
if (raw & 0x800) return raw - 0x1000;
|
|
26
|
+
return raw;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* BME280 combined humidity + pressure + temperature sensor — minimal interface.
|
|
31
|
+
*
|
|
32
|
+
* Provides calibrated temperature (°C), pressure (hPa), and humidity (%RH)
|
|
33
|
+
* with no configuration beyond the transport. I²C address is 0x76 (SDO=GND)
|
|
34
|
+
* or 0x77 (SDO=VDDIO).
|
|
35
|
+
*
|
|
36
|
+
* Default: forced mode, osrs_t=×1, osrs_p=×1, osrs_h=×1, IIR filter off.
|
|
37
|
+
*
|
|
38
|
+
* @param {object} transport - Configured I²C or SPI transport.
|
|
39
|
+
* @param {string} [busType='i2c'] - Bus type: 'i2c' or 'spi'.
|
|
40
|
+
*/
|
|
41
|
+
class BME280Minimal {
|
|
42
|
+
constructor(transport, busType = 'i2c') {
|
|
43
|
+
this._transport = transport;
|
|
44
|
+
this._busType = busType;
|
|
45
|
+
this._mode = 0;
|
|
46
|
+
this._osrsT = 1;
|
|
47
|
+
this._osrsP = 1;
|
|
48
|
+
this._osrsH = 1;
|
|
49
|
+
this._filter = 0;
|
|
50
|
+
this._tSb = 0;
|
|
51
|
+
this._tFine = 0;
|
|
52
|
+
this._readCalibration();
|
|
53
|
+
this._writeReg(_REG_CTRL_HUM, this._osrsH);
|
|
54
|
+
this._writeReg(_REG_CTRL_MEAS, (1 << 5) | (1 << 2) | 0);
|
|
55
|
+
this._writeReg(_REG_CONFIG, 0);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
_readCalibration() {
|
|
59
|
+
const data = this._transport.writeRead(Buffer.from([_REG_CAL_START]), 26);
|
|
60
|
+
this._digT1 = data.readUInt16LE(0);
|
|
61
|
+
this._digT2 = data.readInt16LE(2);
|
|
62
|
+
this._digT3 = data.readInt16LE(4);
|
|
63
|
+
this._digP1 = data.readUInt16LE(6);
|
|
64
|
+
this._digP2 = data.readInt16LE(8);
|
|
65
|
+
this._digP3 = data.readInt16LE(10);
|
|
66
|
+
this._digP4 = data.readInt16LE(12);
|
|
67
|
+
this._digP5 = data.readInt16LE(14);
|
|
68
|
+
this._digP6 = data.readInt16LE(16);
|
|
69
|
+
this._digP7 = data.readInt16LE(18);
|
|
70
|
+
this._digP8 = data.readInt16LE(20);
|
|
71
|
+
this._digP9 = data.readInt16LE(22);
|
|
72
|
+
this._digH1 = data[25];
|
|
73
|
+
|
|
74
|
+
const h = this._transport.writeRead(Buffer.from([_REG_CAL_H2]), 7);
|
|
75
|
+
this._digH2 = h.readInt16LE(0);
|
|
76
|
+
this._digH3 = h[2];
|
|
77
|
+
this._digH4 = _signExtend12(((h[3] << 4) | (h[4] & 0x0F)) & 0x0FFF);
|
|
78
|
+
this._digH5 = _signExtend12(((h[5] << 4) | ((h[4] >> 4) & 0x0F)) & 0x0FFF);
|
|
79
|
+
this._digH6 = h.readInt8(6);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
_writeReg(reg, value) {
|
|
83
|
+
const addr = this._busType === 'spi' ? (reg & 0x7F) : reg;
|
|
84
|
+
this._transport.write(Buffer.from([addr, value]));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
_readReg(reg, n) {
|
|
88
|
+
return this._transport.writeRead(Buffer.from([reg]), n);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
_triggerAndRead() {
|
|
92
|
+
if (this._mode !== 3) {
|
|
93
|
+
this._writeReg(_REG_CTRL_HUM, this._osrsH);
|
|
94
|
+
const ctrl = (this._osrsT << 5) | (this._osrsP << 2) | 1;
|
|
95
|
+
this._writeReg(_REG_CTRL_MEAS, ctrl);
|
|
96
|
+
_delay(_MEAS_TIME_MS);
|
|
97
|
+
}
|
|
98
|
+
const raw = this._readReg(_REG_DATA_START, 8);
|
|
99
|
+
const adcP = (raw[0] << 12) | (raw[1] << 4) | (raw[2] >> 4);
|
|
100
|
+
const adcT = (raw[3] << 12) | (raw[4] << 4) | (raw[5] >> 4);
|
|
101
|
+
const adcH = (raw[6] << 8) | raw[7];
|
|
102
|
+
return { adcP, adcT, adcH };
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
_compensateTemp(adcT) {
|
|
106
|
+
const digT1 = this._digT1;
|
|
107
|
+
const digT2 = this._digT2;
|
|
108
|
+
const digT3 = this._digT3;
|
|
109
|
+
const var1 = (((adcT >> 3) - (digT1 << 1)) * digT2) >> 11;
|
|
110
|
+
const var2 = (((((adcT >> 4) - digT1) * ((adcT >> 4) - digT1)) >> 12) * digT3) >> 14;
|
|
111
|
+
this._tFine = var1 + var2;
|
|
112
|
+
return ((this._tFine * 5 + 128) >> 8) / 100.0;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
_compensatePressure(adcP) {
|
|
116
|
+
const tFine = BigInt(this._tFine);
|
|
117
|
+
const digP1 = BigInt(this._digP1);
|
|
118
|
+
const digP2 = BigInt(this._digP2);
|
|
119
|
+
const digP3 = BigInt(this._digP3);
|
|
120
|
+
const digP4 = BigInt(this._digP4);
|
|
121
|
+
const digP5 = BigInt(this._digP5);
|
|
122
|
+
const digP6 = BigInt(this._digP6);
|
|
123
|
+
const digP7 = BigInt(this._digP7);
|
|
124
|
+
const digP8 = BigInt(this._digP8);
|
|
125
|
+
const digP9 = BigInt(this._digP9);
|
|
126
|
+
|
|
127
|
+
let var1 = tFine - 128000n;
|
|
128
|
+
let var2 = var1 * var1 * digP6;
|
|
129
|
+
var2 = var2 + ((var1 * digP5) << 17n);
|
|
130
|
+
var2 = var2 + (digP4 << 35n);
|
|
131
|
+
var1 = ((var1 * var1 * digP3) >> 8n) + ((var1 * digP2) << 12n);
|
|
132
|
+
var1 = (((1n << 47n) + var1) * digP1) >> 33n;
|
|
133
|
+
if (var1 === 0n) return 0.0;
|
|
134
|
+
let p = 1048576n - BigInt(adcP);
|
|
135
|
+
p = (((p << 31n) - var2) * 3125n) / var1;
|
|
136
|
+
var1 = (digP9 * (p >> 13n) * (p >> 13n)) >> 25n;
|
|
137
|
+
var2 = (digP8 * p) >> 19n;
|
|
138
|
+
p = ((p + var1 + var2) >> 8n) + (digP7 << 4n);
|
|
139
|
+
return Number(p) / 256.0 / 100.0;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
_compensateHumidity(adcH) {
|
|
143
|
+
const tFine = this._tFine;
|
|
144
|
+
const digH1 = this._digH1;
|
|
145
|
+
const digH2 = this._digH2;
|
|
146
|
+
const digH3 = this._digH3;
|
|
147
|
+
const digH4 = this._digH4;
|
|
148
|
+
const digH5 = this._digH5;
|
|
149
|
+
const digH6 = this._digH6;
|
|
150
|
+
|
|
151
|
+
let v = tFine - 76800;
|
|
152
|
+
v = (((((adcH << 14) - (digH4 << 20) - (digH5 * v)) + 16384) >> 15) *
|
|
153
|
+
(((((((v * digH6) >> 10) * (((v * digH3) >> 11) + 32768)) >> 10) + 2097152) *
|
|
154
|
+
digH2 + 8192) >> 14));
|
|
155
|
+
v = v - (((((v >> 15) * (v >> 15)) >> 7) * digH1) >> 4);
|
|
156
|
+
if (v < 0) v = 0;
|
|
157
|
+
if (v > 419430400) v = 419430400;
|
|
158
|
+
return (v >> 12) / 1024.0;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Read calibrated temperature.
|
|
163
|
+
* @returns {number} Temperature in degrees Celsius.
|
|
164
|
+
*/
|
|
165
|
+
temperature() {
|
|
166
|
+
const { adcP, adcT, adcH } = this._triggerAndRead();
|
|
167
|
+
return this._compensateTemp(adcT);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Read calibrated pressure.
|
|
172
|
+
*
|
|
173
|
+
* Reads all three ADCs and refreshes t_fine.
|
|
174
|
+
*
|
|
175
|
+
* @returns {number} Pressure in hPa.
|
|
176
|
+
*/
|
|
177
|
+
pressure() {
|
|
178
|
+
const { adcP, adcT, adcH } = this._triggerAndRead();
|
|
179
|
+
this._compensateTemp(adcT);
|
|
180
|
+
return this._compensatePressure(adcP);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Read calibrated humidity.
|
|
185
|
+
*
|
|
186
|
+
* Reads all three ADCs and refreshes t_fine.
|
|
187
|
+
*
|
|
188
|
+
* @returns {number} Relative humidity in %RH.
|
|
189
|
+
*/
|
|
190
|
+
humidity() {
|
|
191
|
+
const { adcP, adcT, adcH } = this._triggerAndRead();
|
|
192
|
+
this._compensateTemp(adcT);
|
|
193
|
+
return this._compensateHumidity(adcH);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* BME280 full interface — extends BME280Minimal with configuration, dew point, and altitude helpers.
|
|
199
|
+
*
|
|
200
|
+
* @param {object} transport - Configured I²C or SPI transport.
|
|
201
|
+
* @param {string} [busType='i2c'] - Bus type: 'i2c' or 'spi'.
|
|
202
|
+
*/
|
|
203
|
+
class BME280Full extends BME280Minimal {
|
|
204
|
+
static OSRS_SKIP = 0;
|
|
205
|
+
static OSRS_X1 = 1;
|
|
206
|
+
static OSRS_X2 = 2;
|
|
207
|
+
static OSRS_X4 = 3;
|
|
208
|
+
static OSRS_X8 = 4;
|
|
209
|
+
static OSRS_X16 = 5;
|
|
210
|
+
|
|
211
|
+
static MODE_SLEEP = 0;
|
|
212
|
+
static MODE_FORCED = 1;
|
|
213
|
+
static MODE_NORMAL = 3;
|
|
214
|
+
|
|
215
|
+
static FILTER_OFF = 0;
|
|
216
|
+
static FILTER_2 = 1;
|
|
217
|
+
static FILTER_4 = 2;
|
|
218
|
+
static FILTER_8 = 3;
|
|
219
|
+
static FILTER_16 = 4;
|
|
220
|
+
|
|
221
|
+
static T_SB_0_5_MS = 0;
|
|
222
|
+
static T_SB_62_5_MS = 1;
|
|
223
|
+
static T_SB_125_MS = 2;
|
|
224
|
+
static T_SB_250_MS = 3;
|
|
225
|
+
static T_SB_500_MS = 4;
|
|
226
|
+
static T_SB_1000_MS = 5;
|
|
227
|
+
static T_SB_10_MS = 6;
|
|
228
|
+
static T_SB_20_MS = 7;
|
|
229
|
+
|
|
230
|
+
static STATUS_MEASURING = 0x08;
|
|
231
|
+
static STATUS_IM_UPDATE = 0x01;
|
|
232
|
+
|
|
233
|
+
constructor(transport, busType = 'i2c') {
|
|
234
|
+
super(transport, busType);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Write ctrl_hum, config, and ctrl_meas registers in the correct order.
|
|
239
|
+
* @param {number} osrsT - Temperature oversampling (0–5).
|
|
240
|
+
* @param {number} osrsP - Pressure oversampling (0–5).
|
|
241
|
+
* @param {number} osrsH - Humidity oversampling (0–5).
|
|
242
|
+
* @param {number} mode - Power mode (0=sleep, 1=forced, 3=normal).
|
|
243
|
+
* @param {number} filter - IIR filter coefficient (0–4).
|
|
244
|
+
* @param {number} tSb - Standby time in normal mode (0–7; codes 6/7 mean
|
|
245
|
+
* 10 ms / 20 ms on the BME280, not 2000 ms / 4000 ms).
|
|
246
|
+
*/
|
|
247
|
+
configure(osrsT, osrsP, osrsH, mode, filter, tSb) {
|
|
248
|
+
this._osrsT = osrsT;
|
|
249
|
+
this._osrsP = osrsP;
|
|
250
|
+
this._osrsH = osrsH;
|
|
251
|
+
this._mode = mode;
|
|
252
|
+
this._filter = filter;
|
|
253
|
+
this._tSb = tSb;
|
|
254
|
+
this._writeReg(_REG_CTRL_HUM, osrsH);
|
|
255
|
+
this._writeReg(_REG_CONFIG, (tSb << 5) | (filter << 2));
|
|
256
|
+
this._writeReg(_REG_CTRL_MEAS, (osrsT << 5) | (osrsP << 2) | mode);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Update temperature, pressure, and humidity oversampling.
|
|
261
|
+
* @param {number} osrsT - Temperature oversampling (0–5).
|
|
262
|
+
* @param {number} osrsP - Pressure oversampling (0–5).
|
|
263
|
+
* @param {number} osrsH - Humidity oversampling (0–5).
|
|
264
|
+
*/
|
|
265
|
+
setOversampling(osrsT, osrsP, osrsH) {
|
|
266
|
+
this._osrsT = osrsT;
|
|
267
|
+
this._osrsP = osrsP;
|
|
268
|
+
this._osrsH = osrsH;
|
|
269
|
+
this._writeReg(_REG_CTRL_HUM, osrsH);
|
|
270
|
+
this._writeReg(_REG_CTRL_MEAS, (osrsT << 5) | (osrsP << 2) | this._mode);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Update power mode.
|
|
275
|
+
* @param {number} mode - Power mode (0=sleep, 1=forced, 3=normal).
|
|
276
|
+
*/
|
|
277
|
+
setMode(mode) {
|
|
278
|
+
this._mode = mode;
|
|
279
|
+
this._writeReg(_REG_CTRL_MEAS, (this._osrsT << 5) | (this._osrsP << 2) | mode);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Update IIR filter coefficient.
|
|
284
|
+
* @param {number} coeff - Filter coefficient (0–4).
|
|
285
|
+
*/
|
|
286
|
+
setFilter(coeff) {
|
|
287
|
+
this._filter = coeff;
|
|
288
|
+
this._writeReg(_REG_CONFIG, (this._tSb << 5) | (coeff << 2));
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Update standby time for normal mode.
|
|
293
|
+
* @param {number} tSb - Standby time value (0–7). On the BME280 codes 6/7
|
|
294
|
+
* mean 10 ms / 20 ms (not 2000 ms / 4000 ms).
|
|
295
|
+
*/
|
|
296
|
+
setStandby(tSb) {
|
|
297
|
+
this._tSb = tSb;
|
|
298
|
+
this._writeReg(_REG_CONFIG, (tSb << 5) | (this._filter << 2));
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Read the status register.
|
|
303
|
+
* @returns {number} Status byte; bit 3 = measuring, bit 0 = im_update.
|
|
304
|
+
*/
|
|
305
|
+
status() {
|
|
306
|
+
const data = this._readReg(_REG_STATUS, 1);
|
|
307
|
+
return data[0];
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Compute altitude above sea level from the current pressure.
|
|
312
|
+
* @param {number} [seaLevelHpa=1013.25] - Reference sea-level pressure in hPa.
|
|
313
|
+
* @returns {number} Altitude in metres.
|
|
314
|
+
*/
|
|
315
|
+
altitude(seaLevelHpa = 1013.25) {
|
|
316
|
+
const p = this.pressure();
|
|
317
|
+
return 44330 * (1 - Math.pow(p / seaLevelHpa, 1 / 5.255));
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Compute sea-level pressure from current pressure and known altitude.
|
|
322
|
+
* @param {number} altitudeM - Altitude in metres.
|
|
323
|
+
* @returns {number} Sea-level pressure in hPa.
|
|
324
|
+
*/
|
|
325
|
+
seaLevelPressure(altitudeM) {
|
|
326
|
+
const p = this.pressure();
|
|
327
|
+
return p / Math.pow(1 - altitudeM / 44330, 5.255);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Compute dew point from current temperature and humidity.
|
|
332
|
+
* @returns {number} Dew point in degrees Celsius.
|
|
333
|
+
*/
|
|
334
|
+
dewPoint() {
|
|
335
|
+
const t = this.temperature();
|
|
336
|
+
const h = this.humidity();
|
|
337
|
+
if (h <= 0) return -Infinity;
|
|
338
|
+
const a = 17.27;
|
|
339
|
+
const b = 237.7;
|
|
340
|
+
const alpha = (a * t) / (b + t) + Math.log(h / 100.0);
|
|
341
|
+
return (b * alpha) / (a - alpha);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Read the chip ID register.
|
|
346
|
+
* @returns {number} Chip ID; expect 0x60.
|
|
347
|
+
*/
|
|
348
|
+
chipId() {
|
|
349
|
+
const data = this._readReg(_REG_ID, 1);
|
|
350
|
+
return data[0];
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Perform a soft reset, re-read calibration, and re-apply configuration.
|
|
355
|
+
*/
|
|
356
|
+
reset() {
|
|
357
|
+
this._writeReg(_REG_RESET, _RESET_CMD);
|
|
358
|
+
_delay(2);
|
|
359
|
+
this._readCalibration();
|
|
360
|
+
this._writeReg(_REG_CTRL_HUM, this._osrsH);
|
|
361
|
+
this._writeReg(_REG_CONFIG, (this._tSb << 5) | (this._filter << 2));
|
|
362
|
+
this._writeReg(_REG_CTRL_MEAS, (this._osrsT << 5) | (this._osrsP << 2) | this._mode);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
module.exports = { BME280Minimal, BME280Full };
|