@depz/sensor-sdk 0.4.2 → 0.6.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 +10 -7
- package/dist/dataset.d.ts.map +1 -1
- package/dist/dataset.js +15 -7
- package/dist/dataset.js.map +1 -1
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +3 -0
- package/dist/discovery.js.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/protocol/common.d.ts +6 -4
- package/dist/protocol/common.d.ts.map +1 -1
- package/dist/protocol/common.js +6 -4
- package/dist/protocol/common.js.map +1 -1
- package/dist/protocol/identity.d.ts +1 -1
- package/dist/protocol/identity.d.ts.map +1 -1
- package/dist/protocol/identity.js +1 -0
- package/dist/protocol/identity.js.map +1 -1
- package/dist/protocol/tmf8829.d.ts +113 -0
- package/dist/protocol/tmf8829.d.ts.map +1 -0
- package/dist/protocol/tmf8829.js +195 -0
- package/dist/protocol/tmf8829.js.map +1 -0
- package/dist/protocol/usb-ids.d.ts.map +1 -1
- package/dist/protocol/usb-ids.js +1 -0
- package/dist/protocol/usb-ids.js.map +1 -1
- package/dist/sensors/bno055/bno055.d.ts +8 -0
- package/dist/sensors/bno055/bno055.d.ts.map +1 -1
- package/dist/sensors/bno055/bno055.js +33 -2
- package/dist/sensors/bno055/bno055.js.map +1 -1
- package/dist/sensors/bno086/bno086.d.ts +27 -1
- package/dist/sensors/bno086/bno086.d.ts.map +1 -1
- package/dist/sensors/bno086/bno086.js +32 -2
- package/dist/sensors/bno086/bno086.js.map +1 -1
- package/dist/sensors/bno086/sh2.d.ts +14 -0
- package/dist/sensors/bno086/sh2.d.ts.map +1 -1
- package/dist/sensors/bno086/sh2.js +15 -0
- package/dist/sensors/bno086/sh2.js.map +1 -1
- package/dist/sensors/bno086/shtp.d.ts +12 -0
- package/dist/sensors/bno086/shtp.d.ts.map +1 -1
- package/dist/sensors/bno086/shtp.js +13 -0
- package/dist/sensors/bno086/shtp.js.map +1 -1
- package/dist/sensors/tmf8829/builder.d.ts +61 -0
- package/dist/sensors/tmf8829/builder.d.ts.map +1 -0
- package/dist/sensors/tmf8829/builder.js +175 -0
- package/dist/sensors/tmf8829/builder.js.map +1 -0
- package/dist/sensors/tmf8829/clock.d.ts +76 -0
- package/dist/sensors/tmf8829/clock.d.ts.map +1 -0
- package/dist/sensors/tmf8829/clock.js +166 -0
- package/dist/sensors/tmf8829/clock.js.map +1 -0
- package/dist/sensors/tmf8829/config.d.ts +22 -0
- package/dist/sensors/tmf8829/config.d.ts.map +1 -0
- package/dist/sensors/tmf8829/config.js +82 -0
- package/dist/sensors/tmf8829/config.js.map +1 -0
- package/dist/sensors/tmf8829/firmware-asset.d.ts +3 -0
- package/dist/sensors/tmf8829/firmware-asset.d.ts.map +1 -0
- package/dist/sensors/tmf8829/firmware-asset.js +7 -0
- package/dist/sensors/tmf8829/firmware-asset.js.map +1 -0
- package/dist/sensors/tmf8829/firmware-license.d.ts +3 -0
- package/dist/sensors/tmf8829/firmware-license.d.ts.map +1 -0
- package/dist/sensors/tmf8829/firmware-license.js +5 -0
- package/dist/sensors/tmf8829/firmware-license.js.map +1 -0
- package/dist/sensors/tmf8829/frames.d.ts +79 -0
- package/dist/sensors/tmf8829/frames.d.ts.map +1 -0
- package/dist/sensors/tmf8829/frames.js +190 -0
- package/dist/sensors/tmf8829/frames.js.map +1 -0
- package/dist/sensors/tmf8829/tmf8829.d.ts +144 -0
- package/dist/sensors/tmf8829/tmf8829.d.ts.map +1 -0
- package/dist/sensors/tmf8829/tmf8829.js +473 -0
- package/dist/sensors/tmf8829/tmf8829.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TMF8829 multizone dToF sensor over the SPI register bridge
|
|
3
|
+
* (contracts/14_SENSOR_TMF8829.md).
|
|
4
|
+
*
|
|
5
|
+
* The board is a thin bridge: this class runs the sensor — soft reset,
|
|
6
|
+
* sensor firmware download through the sensor bootloader, presets and the
|
|
7
|
+
* config page, start/stop — and turns the bridge's chunked frame stream into
|
|
8
|
+
* measurements (half-frame merge, histograms, ref-SPAD frames, clock model,
|
|
9
|
+
* capture time). Mirrors the Python reference `depz_sensor_sdk.tmf8829.Tmf8829`.
|
|
10
|
+
*/
|
|
11
|
+
import { DepzDevice, StreamQueue } from "../../device/device.js";
|
|
12
|
+
import { DepzError, DepzTimeoutError } from "../../errors.js";
|
|
13
|
+
import { TMF8829_INT_HISTOGRAMS, TMF8829_INT_RESULTS, TMF8829_READ_MAX, TMF8829_SF_REF_FRAME, TMF8829_WRITE_MAX, Tmf8829Cmd, Tmf8829EventCode, Tmf8829FrameReassembler, Tmf8829Rpt, packTmf8829ReadReg, packTmf8829StartStream, packTmf8829WriteReg, unpackTmf8829Event, unpackTmf8829FrameChunk, unpackTmf8829Info, unpackTmf8829RegData, } from "../../protocol/tmf8829.js";
|
|
14
|
+
import { decodeBase64 } from "../vl53l8/assets/decode.js";
|
|
15
|
+
import { Tmf8829MeasurementBuilder } from "./builder.js";
|
|
16
|
+
import { TMF8829_CFG_SIZE, TMF8829_DEFAULT_PERIOD_MS, TMF8829_PRESETS, TMF8829_PRESET_KILO_ITERATIONS, TMF8829_REG_CFG, tmf8829CfgGet, tmf8829CfgSet, tmf8829ConfigFields, } from "./config.js";
|
|
17
|
+
import { TMF8829_FP_GRID } from "./frames.js";
|
|
18
|
+
const REG_APP_ID = 0x00;
|
|
19
|
+
const REG_CMD_STAT = 0x08;
|
|
20
|
+
const REG_SERIAL = 0x1c;
|
|
21
|
+
const REG_CID_RID = 0x20;
|
|
22
|
+
const REG_INT_STATUS = 0xe1;
|
|
23
|
+
const REG_INT_ENAB = 0xe2;
|
|
24
|
+
const REG_ID = 0xe3;
|
|
25
|
+
const REG_REVID = 0xe4;
|
|
26
|
+
const REG_RESET = 0xf7;
|
|
27
|
+
const REG_ENABLE = 0xf8;
|
|
28
|
+
const REG_FIFOSTATUS = 0xfa;
|
|
29
|
+
const REG_FIFO = 0xff;
|
|
30
|
+
const DEVICE_ID = 0x9e;
|
|
31
|
+
const APP_ID_APP = 0x01;
|
|
32
|
+
const APP_ID_BL = 0x80;
|
|
33
|
+
const ENABLE_CPU_READY = 0x80;
|
|
34
|
+
const ENABLE_PUSEL_MASK = 0x30;
|
|
35
|
+
const ENABLE_PUSEL_BOOTMON = 0x10;
|
|
36
|
+
const ENABLE_PUSEL_RAM = 0x20;
|
|
37
|
+
const ENABLE_PON = 0x04;
|
|
38
|
+
const RESET_SOFT = 0x40;
|
|
39
|
+
const FIFO_ERROR_FLAGS = 0x30;
|
|
40
|
+
const BL_START_RAM_APP = 0x16;
|
|
41
|
+
const BL_I2C_OFF = 0x22;
|
|
42
|
+
const BL_W_FIFO_BOTH = 0x45;
|
|
43
|
+
const BL_STATUS_NAMES = { 0: "READY", 1: "ERR_PARAM", 2: "ERR_ADDR", 4: "ERR_FIFO" };
|
|
44
|
+
const CMD_MEASURE = 0x10;
|
|
45
|
+
const CMD_WRITE_PAGE = 0x15;
|
|
46
|
+
const CMD_LOAD_CONFIG_PAGE = 0x16;
|
|
47
|
+
const CMD_STOP = 0xff;
|
|
48
|
+
const STAT_OK = 0x00;
|
|
49
|
+
const STAT_ACCEPTED = 0x01;
|
|
50
|
+
const STAT_NAMES = {
|
|
51
|
+
0x00: "OK",
|
|
52
|
+
0x01: "ACCEPTED",
|
|
53
|
+
0x02: "ERR_CONFIG",
|
|
54
|
+
0x03: "ERR_APPLICATION",
|
|
55
|
+
0x04: "ERR_CONFIG_RESULT_SIZE",
|
|
56
|
+
0x05: "ERR_CONFIG_VCSEL",
|
|
57
|
+
0x06: "ERR_WAKEUP_TIMED",
|
|
58
|
+
0x07: "ERR_RESET_UNEXPECTED",
|
|
59
|
+
0x08: "ERR_UNKNOWN_CMD",
|
|
60
|
+
0x09: "ERR_UNKNOWN_CID",
|
|
61
|
+
0x0a: "ERR_STOP_0",
|
|
62
|
+
0x0b: "ERR_STOP_1",
|
|
63
|
+
0x0c: "ERR_STOP_2",
|
|
64
|
+
0x0d: "ERR_STOP_3",
|
|
65
|
+
0x0e: "ERR_OSC_TUNE",
|
|
66
|
+
};
|
|
67
|
+
/** ams tmf8829_application.hex load address (application 2.200.0). */
|
|
68
|
+
export const TMF8829_FIRMWARE_LOAD_ADDR = 0x00010000;
|
|
69
|
+
/** READ/WRITE_REG may wait behind a 25 KB histogram frame. */
|
|
70
|
+
const REGISTER_TIMEOUT_MS = 1000;
|
|
71
|
+
/** The sensor firmware image `init()` downloads (14 444 B, MIT). Lazily decoded. */
|
|
72
|
+
export async function tmf8829FirmwareImage() {
|
|
73
|
+
const mod = await import("./firmware-asset.js");
|
|
74
|
+
return decodeBase64(mod.tmf8829FirmwareB64);
|
|
75
|
+
}
|
|
76
|
+
const hex2 = (v) => `0x${v.toString(16).toUpperCase().padStart(2, "0")}`;
|
|
77
|
+
/** The sensor refused or did not answer (bootloader / application status). */
|
|
78
|
+
export class Tmf8829Error extends DepzError {
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* TMF8829 ToF device (8×8 … 48×32 zones, up to 4 peaks per zone, histograms).
|
|
82
|
+
* `init()` downloads the 14.4 KB sensor firmware (~0.15 s), `configure(preset,
|
|
83
|
+
* …)` writes the config page, `start()` streams measurements to
|
|
84
|
+
* `onMeasurement` / `measurements()`, `stop()` ends it. The sensor's EN pin is
|
|
85
|
+
* wired high: there is no sleep, recovery from any state is `init()`.
|
|
86
|
+
*/
|
|
87
|
+
export class Tmf8829 extends DepzDevice {
|
|
88
|
+
appVersion = null;
|
|
89
|
+
sensorSerial = null;
|
|
90
|
+
sleepImpl;
|
|
91
|
+
chain = Promise.resolve();
|
|
92
|
+
reassembler = new Tmf8829FrameReassembler();
|
|
93
|
+
builder = new Tmf8829MeasurementBuilder();
|
|
94
|
+
measCbs = [];
|
|
95
|
+
measQueues = [];
|
|
96
|
+
interruptCbs = [];
|
|
97
|
+
streamingFlag = false;
|
|
98
|
+
stopping = false;
|
|
99
|
+
cfg = null;
|
|
100
|
+
constructor(transport, opts) {
|
|
101
|
+
super(transport, opts);
|
|
102
|
+
this.sleepImpl = opts?.sleepImpl ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
|
|
103
|
+
}
|
|
104
|
+
// ── register access ────────────────────────────────────────────────────────
|
|
105
|
+
/**
|
|
106
|
+
* Read `length` bytes from `addr` in ≤1024-byte requests; reads that reach the
|
|
107
|
+
* FIFO port 0xFF stay there (the sensor does not auto-increment it).
|
|
108
|
+
*/
|
|
109
|
+
readRegisters(addr, length) {
|
|
110
|
+
return this.locked(() => this.rd(addr, length));
|
|
111
|
+
}
|
|
112
|
+
/** Write `data` from `addr` in ≤1023-byte requests (writes to 0xFF stay at 0xFF). */
|
|
113
|
+
writeRegisters(addr, data) {
|
|
114
|
+
return this.locked(() => this.wr(addr, data));
|
|
115
|
+
}
|
|
116
|
+
/** Raw host-interface registers, for diagnostics. */
|
|
117
|
+
sensorState() {
|
|
118
|
+
return this.locked(async () => {
|
|
119
|
+
const regs = {
|
|
120
|
+
ID: REG_ID,
|
|
121
|
+
REVID: REG_REVID,
|
|
122
|
+
ENABLE: REG_ENABLE,
|
|
123
|
+
RESET: REG_RESET,
|
|
124
|
+
APP_ID: REG_APP_ID,
|
|
125
|
+
CMD_STAT: REG_CMD_STAT,
|
|
126
|
+
INT_STATUS: REG_INT_STATUS,
|
|
127
|
+
INT_ENAB: REG_INT_ENAB,
|
|
128
|
+
FIFOSTATUS: REG_FIFOSTATUS,
|
|
129
|
+
};
|
|
130
|
+
const out = {};
|
|
131
|
+
for (const [k, a] of Object.entries(regs))
|
|
132
|
+
out[k] = await this.rd8(a);
|
|
133
|
+
return out;
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
/** Bridge counters (never touches the sensor, safe mid-stream). */
|
|
137
|
+
getBridgeInfo() {
|
|
138
|
+
return this.request(Tmf8829Cmd.GetInfo, undefined, {
|
|
139
|
+
matcher: DepzDevice.expectReport(Tmf8829Rpt.Info, unpackTmf8829Info),
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
// ── init ───────────────────────────────────────────────────────────────────
|
|
143
|
+
/**
|
|
144
|
+
* Bring the sensor from any state to its running RAM application: soft
|
|
145
|
+
* reset, bootloader, firmware download, start. Resolves [application
|
|
146
|
+
* version, sensor serial]. Stops a running stream first. `progress(done,
|
|
147
|
+
* total)` tracks the image download.
|
|
148
|
+
*/
|
|
149
|
+
async init(progress) {
|
|
150
|
+
if (this.streamingFlag)
|
|
151
|
+
await this.stop();
|
|
152
|
+
const image = await tmf8829FirmwareImage();
|
|
153
|
+
return this.locked(async () => {
|
|
154
|
+
await this.wr8(REG_ENABLE, ENABLE_PON | ENABLE_PUSEL_BOOTMON);
|
|
155
|
+
await this.sleepImpl(3);
|
|
156
|
+
await this.wr8(REG_RESET, RESET_SOFT);
|
|
157
|
+
await this.sleepImpl(3);
|
|
158
|
+
const dev = await this.rd8(REG_ID);
|
|
159
|
+
if (dev !== DEVICE_ID) {
|
|
160
|
+
throw new Tmf8829Error(`sensor ID ${hex2(dev)}, expected ${hex2(DEVICE_ID)} (no TMF8829 on the bus?)`);
|
|
161
|
+
}
|
|
162
|
+
await this.poll(REG_APP_ID, (v) => v === APP_ID_BL, 100, "sensor bootloader");
|
|
163
|
+
await this.blCmd(BL_I2C_OFF);
|
|
164
|
+
// ENABLE reads 0 over SPI until the sensor's I2C is off.
|
|
165
|
+
await this.poll(REG_ENABLE, (v) => (v & ENABLE_CPU_READY) !== 0, 100, "cpu_ready");
|
|
166
|
+
const padded = new Uint8Array(image.length + ((4 - (image.length % 4)) % 4)).fill(0xff);
|
|
167
|
+
padded.set(image);
|
|
168
|
+
const params = new Uint8Array(6);
|
|
169
|
+
const dv = new DataView(params.buffer);
|
|
170
|
+
dv.setUint32(0, TMF8829_FIRMWARE_LOAD_ADDR, true);
|
|
171
|
+
dv.setUint16(4, padded.length / 4, true);
|
|
172
|
+
await this.blCmd(BL_W_FIFO_BOTH, params);
|
|
173
|
+
await this.wr(REG_FIFO, padded, progress);
|
|
174
|
+
await this.blCmd(BL_START_RAM_APP);
|
|
175
|
+
await this.poll(REG_APP_ID, (v) => v === APP_ID_APP, 100, "START_RAM_APP");
|
|
176
|
+
const en = await this.rd8(REG_ENABLE); // wake-ups must boot the RAM application
|
|
177
|
+
await this.wr8(REG_ENABLE, (en & ~ENABLE_PUSEL_MASK) | ENABLE_PUSEL_RAM);
|
|
178
|
+
const ver = await this.rd(REG_APP_ID, 4);
|
|
179
|
+
this.appVersion = `${ver[1]}.${ver[2]}.${ver[3]}`;
|
|
180
|
+
const ser = await this.rd(REG_SERIAL, 4);
|
|
181
|
+
this.sensorSerial = new DataView(ser.buffer, ser.byteOffset, 4).getUint32(0, true);
|
|
182
|
+
this.cfg = null;
|
|
183
|
+
return [this.appVersion, this.sensorSerial];
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
// ── config page ────────────────────────────────────────────────────────────
|
|
187
|
+
/** LOAD_CONFIG_PAGE → the 190-byte page 0x22..0xDF now in the sensor. */
|
|
188
|
+
configPage() {
|
|
189
|
+
return this.locked(() => this.loadConfig());
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Load `preset` and write the config page. Every field a preset does not
|
|
193
|
+
* reset is written (contract 14 §4), so the result never depends on an
|
|
194
|
+
* earlier config. Rejects with `Tmf8829Error` when the sensor refuses the
|
|
195
|
+
* page (e.g. ERR_CONFIG_RESULT_SIZE) or a written field does not read back.
|
|
196
|
+
*/
|
|
197
|
+
configure(preset = "8x8", opts = {}) {
|
|
198
|
+
if (!(preset in TMF8829_PRESETS)) {
|
|
199
|
+
return Promise.reject(new RangeError(`unknown preset ${preset}; one of ${Object.keys(TMF8829_PRESETS).join(", ")}`));
|
|
200
|
+
}
|
|
201
|
+
if (this.streamingFlag)
|
|
202
|
+
return Promise.reject(new DepzError("configure() while streaming: stop() first"));
|
|
203
|
+
const peaks = opts.nrPeaks ?? 1;
|
|
204
|
+
// The 3-bit field takes 0..7, the sensor reports at most 4 peaks.
|
|
205
|
+
if (!Number.isInteger(peaks) || peaks < 1 || peaks > 4) {
|
|
206
|
+
return Promise.reject(new RangeError(`nrPeaks ${peaks}, must be 1..4`));
|
|
207
|
+
}
|
|
208
|
+
const want = {
|
|
209
|
+
period_ms: opts.periodMs ?? TMF8829_DEFAULT_PERIOD_MS,
|
|
210
|
+
kilo_iterations: opts.kiloIterations ?? TMF8829_PRESET_KILO_ITERATIONS[preset],
|
|
211
|
+
nr_peaks: opts.nrPeaks ?? 1,
|
|
212
|
+
signal_strength: opts.signalStrength ? 1 : 0,
|
|
213
|
+
noise_strength: opts.noiseStrength ? 1 : 0,
|
|
214
|
+
xtalk: opts.xtalk ? 1 : 0,
|
|
215
|
+
dump_histograms: opts.histograms ? 1 : 0,
|
|
216
|
+
ref_spad_frame: opts.refFrame ? 1 : 0,
|
|
217
|
+
...opts.fields,
|
|
218
|
+
};
|
|
219
|
+
return this.locked(async () => {
|
|
220
|
+
await this.appCmd(TMF8829_PRESETS[preset]);
|
|
221
|
+
const page = await this.loadConfig();
|
|
222
|
+
for (const [k, v] of Object.entries(want))
|
|
223
|
+
tmf8829CfgSet(page, k, v);
|
|
224
|
+
await this.wr(TMF8829_REG_CFG, page);
|
|
225
|
+
await this.appCmd(CMD_WRITE_PAGE);
|
|
226
|
+
const back = await this.loadConfig();
|
|
227
|
+
const stuck = Object.entries(want)
|
|
228
|
+
.filter(([k, v]) => tmf8829CfgGet(back, k) !== v)
|
|
229
|
+
.map(([k, v]) => `${k} wrote ${v}, reads ${tmf8829CfgGet(back, k)}`);
|
|
230
|
+
if (stuck.length)
|
|
231
|
+
throw new Tmf8829Error(`config fields did not stick: ${stuck.join(", ")}`);
|
|
232
|
+
const fields = tmf8829ConfigFields(back);
|
|
233
|
+
this.cfg = {
|
|
234
|
+
preset,
|
|
235
|
+
page: back,
|
|
236
|
+
histograms: !!opts.histograms,
|
|
237
|
+
refFrame: !!opts.refFrame,
|
|
238
|
+
fields,
|
|
239
|
+
grid: TMF8829_FP_GRID[fields.fp_mode] ?? [0, 0],
|
|
240
|
+
};
|
|
241
|
+
return this.cfg;
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
/** The last `configure()` result (null after `init()`). */
|
|
245
|
+
get config() {
|
|
246
|
+
return this.cfg;
|
|
247
|
+
}
|
|
248
|
+
// ── streaming ──────────────────────────────────────────────────────────────
|
|
249
|
+
get streaming() {
|
|
250
|
+
return this.streamingFlag;
|
|
251
|
+
}
|
|
252
|
+
/** MEASURE with the bridge stream armed; configures the 8x8 preset first if needed. */
|
|
253
|
+
async start() {
|
|
254
|
+
if (this.streamingFlag)
|
|
255
|
+
return;
|
|
256
|
+
const cfg = this.cfg ?? (await this.configure());
|
|
257
|
+
const intMask = TMF8829_INT_RESULTS | (cfg.histograms ? TMF8829_INT_HISTOGRAMS : 0);
|
|
258
|
+
await this.locked(async () => {
|
|
259
|
+
await this.wr8(REG_FIFOSTATUS, FIFO_ERROR_FLAGS); // sticky under/overrun
|
|
260
|
+
await this.wr8(REG_INT_STATUS, 0xff);
|
|
261
|
+
await this.wr8(REG_INT_ENAB, intMask);
|
|
262
|
+
this.reassembler.reset();
|
|
263
|
+
this.builder.reset();
|
|
264
|
+
await this.request(Tmf8829Cmd.StartStream, packTmf8829StartStream(intMask, cfg.refFrame ? TMF8829_SF_REF_FRAME : 0), { okCompletes: true });
|
|
265
|
+
this.streamingFlag = true;
|
|
266
|
+
try {
|
|
267
|
+
await this.appCmd(CMD_MEASURE, [STAT_OK, STAT_ACCEPTED]);
|
|
268
|
+
}
|
|
269
|
+
catch (e) {
|
|
270
|
+
this.streamingFlag = false;
|
|
271
|
+
await this.request(Tmf8829Cmd.StopStream, undefined, { okCompletes: true }).catch(() => { });
|
|
272
|
+
throw e;
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Sensor STOP, then the bridge stream (frames already queued drain). The
|
|
278
|
+
* bad-header event a STOP raises mid histogram dump is expected and
|
|
279
|
+
* swallowed.
|
|
280
|
+
*/
|
|
281
|
+
stop() {
|
|
282
|
+
return this.locked(async () => {
|
|
283
|
+
this.stopping = true;
|
|
284
|
+
try {
|
|
285
|
+
await this.appCmd(CMD_STOP);
|
|
286
|
+
await this.wr8(REG_INT_ENAB, 0);
|
|
287
|
+
await this.wr8(REG_INT_STATUS, 0xff);
|
|
288
|
+
if (this.streamingFlag)
|
|
289
|
+
await this.request(Tmf8829Cmd.StopStream, undefined, { okCompletes: true });
|
|
290
|
+
}
|
|
291
|
+
finally {
|
|
292
|
+
this.streamingFlag = false;
|
|
293
|
+
this.stopping = false;
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
async close() {
|
|
298
|
+
if (this.streamingFlag)
|
|
299
|
+
await this.stop().catch(() => { });
|
|
300
|
+
await super.close();
|
|
301
|
+
}
|
|
302
|
+
/** Subscribe to measurements (read-pump context; don't block). */
|
|
303
|
+
onMeasurement(cb) {
|
|
304
|
+
this.measCbs.push(cb);
|
|
305
|
+
return () => {
|
|
306
|
+
this.measCbs = this.measCbs.filter((c) => c !== cb);
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
/** Async iterator over measurements — bounded, drop-oldest. */
|
|
310
|
+
measurements(maxsize = 16) {
|
|
311
|
+
const queue = new StreamQueue(maxsize, () => {
|
|
312
|
+
this.measQueues = this.measQueues.filter((q) => q !== queue);
|
|
313
|
+
deregister();
|
|
314
|
+
});
|
|
315
|
+
this.measQueues.push(queue);
|
|
316
|
+
const deregister = this.registerStream(queue);
|
|
317
|
+
return queue;
|
|
318
|
+
}
|
|
319
|
+
/** Wait for the next measurement. */
|
|
320
|
+
async getMeasurement(timeoutMs = 2000) {
|
|
321
|
+
const queue = new StreamQueue(1);
|
|
322
|
+
this.measQueues.push(queue);
|
|
323
|
+
const deregister = this.registerStream(queue);
|
|
324
|
+
let timer;
|
|
325
|
+
try {
|
|
326
|
+
const result = await Promise.race([
|
|
327
|
+
queue.next(),
|
|
328
|
+
new Promise((_, reject) => {
|
|
329
|
+
timer = setTimeout(() => reject(new DepzTimeoutError(Tmf8829Rpt.Frame, timeoutMs)), timeoutMs);
|
|
330
|
+
}),
|
|
331
|
+
]);
|
|
332
|
+
if (result.done === true)
|
|
333
|
+
throw new DepzError("device closed");
|
|
334
|
+
return result.value;
|
|
335
|
+
}
|
|
336
|
+
finally {
|
|
337
|
+
if (timer !== undefined)
|
|
338
|
+
clearTimeout(timer);
|
|
339
|
+
this.measQueues = this.measQueues.filter((q) => q !== queue);
|
|
340
|
+
deregister();
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* RPT_TMF_EVENT that is not an expected stop artefact: a MOTION/PROXIMITY
|
|
345
|
+
* interrupt (code 0) or a refused frame header (code 1 — the sensor is lost,
|
|
346
|
+
* run `init()` again).
|
|
347
|
+
*/
|
|
348
|
+
onInterrupt(cb) {
|
|
349
|
+
this.interruptCbs.push(cb);
|
|
350
|
+
return () => {
|
|
351
|
+
this.interruptCbs = this.interruptCbs.filter((c) => c !== cb);
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
/** Frames the bridge dropped (frame_seq gaps) in this stream. */
|
|
355
|
+
get framesDropped() {
|
|
356
|
+
return this.reassembler.seqGaps;
|
|
357
|
+
}
|
|
358
|
+
/** Frames lost to reassembly (incomplete, out-of-order chunks) in this stream. */
|
|
359
|
+
get framesDiscarded() {
|
|
360
|
+
return this.reassembler.discarded;
|
|
361
|
+
}
|
|
362
|
+
get frameParseErrors() {
|
|
363
|
+
return this.builder.parseErrors;
|
|
364
|
+
}
|
|
365
|
+
/** Current clock ratio (Q16), for diagnostics. */
|
|
366
|
+
get clockRatioQ16() {
|
|
367
|
+
return this.builder.clock.ratioQ16;
|
|
368
|
+
}
|
|
369
|
+
// ── internal ───────────────────────────────────────────────────────────────
|
|
370
|
+
/** Run `fn` after every previously queued sequence (non-reentrant). */
|
|
371
|
+
locked(fn) {
|
|
372
|
+
const run = this.chain.then(fn, fn);
|
|
373
|
+
this.chain = run.catch(() => undefined);
|
|
374
|
+
return run;
|
|
375
|
+
}
|
|
376
|
+
async rd(addrIn, length) {
|
|
377
|
+
const out = new Uint8Array(length);
|
|
378
|
+
let addr = addrIn;
|
|
379
|
+
let off = 0;
|
|
380
|
+
while (off < length) {
|
|
381
|
+
const n = Math.min(length - off, TMF8829_READ_MAX);
|
|
382
|
+
const rep = await this.request(Tmf8829Cmd.ReadReg, packTmf8829ReadReg(addr, n), {
|
|
383
|
+
matcher: DepzDevice.expectReport(Tmf8829Rpt.RegData, unpackTmf8829RegData),
|
|
384
|
+
timeoutMs: REGISTER_TIMEOUT_MS,
|
|
385
|
+
});
|
|
386
|
+
if (rep.data.length !== n)
|
|
387
|
+
throw new DepzError(`READ_REG ${hex2(addr)}: expected ${n}, got ${rep.data.length}`);
|
|
388
|
+
out.set(rep.data, off);
|
|
389
|
+
off += n;
|
|
390
|
+
addr = Math.min(addr + n, REG_FIFO);
|
|
391
|
+
}
|
|
392
|
+
return out;
|
|
393
|
+
}
|
|
394
|
+
async rd8(addr) {
|
|
395
|
+
return (await this.rd(addr, 1))[0];
|
|
396
|
+
}
|
|
397
|
+
async wr(addrIn, data, progress) {
|
|
398
|
+
let addr = addrIn;
|
|
399
|
+
for (let off = 0; off < data.length; off += TMF8829_WRITE_MAX) {
|
|
400
|
+
const chunk = data.subarray(off, off + TMF8829_WRITE_MAX);
|
|
401
|
+
await this.request(Tmf8829Cmd.WriteReg, packTmf8829WriteReg(addr, chunk), {
|
|
402
|
+
okCompletes: true,
|
|
403
|
+
timeoutMs: REGISTER_TIMEOUT_MS,
|
|
404
|
+
});
|
|
405
|
+
if (addr !== REG_FIFO)
|
|
406
|
+
addr += chunk.length;
|
|
407
|
+
progress?.(Math.min(off + chunk.length, data.length), data.length);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
wr8(addr, value) {
|
|
411
|
+
return this.wr(addr, Uint8Array.of(value & 0xff));
|
|
412
|
+
}
|
|
413
|
+
async poll(addr, done, timeoutMs, what) {
|
|
414
|
+
const deadline = Date.now() + timeoutMs;
|
|
415
|
+
for (;;) {
|
|
416
|
+
const v = await this.rd8(addr);
|
|
417
|
+
if (done(v))
|
|
418
|
+
return v;
|
|
419
|
+
if (Date.now() > deadline)
|
|
420
|
+
throw new Tmf8829Error(`${what}: timeout, reg ${hex2(addr)} = ${hex2(v)}`);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
async blCmd(cmd, params) {
|
|
424
|
+
const payload = params?.length ? Uint8Array.of(cmd, params.length, ...params) : Uint8Array.of(cmd);
|
|
425
|
+
await this.wr(REG_CMD_STAT, payload);
|
|
426
|
+
const st = await this.poll(REG_CMD_STAT, (v) => v !== cmd, 100, `bootloader cmd ${hex2(cmd)}`);
|
|
427
|
+
if (st !== 0)
|
|
428
|
+
throw new Tmf8829Error(`bootloader cmd ${hex2(cmd)} -> ${BL_STATUS_NAMES[st] ?? hex2(st)}`);
|
|
429
|
+
}
|
|
430
|
+
async appCmd(cmd, accept = [STAT_OK], timeoutMs = 1000) {
|
|
431
|
+
await this.wr8(REG_CMD_STAT, cmd);
|
|
432
|
+
const st = await this.poll(REG_CMD_STAT, (v) => v < 0x10, timeoutMs, `sensor cmd ${hex2(cmd)}`);
|
|
433
|
+
if (!accept.includes(st))
|
|
434
|
+
throw new Tmf8829Error(`sensor cmd ${hex2(cmd)} -> ${STAT_NAMES[st] ?? hex2(st)}`);
|
|
435
|
+
return st;
|
|
436
|
+
}
|
|
437
|
+
async loadConfig() {
|
|
438
|
+
await this.appCmd(CMD_LOAD_CONFIG_PAGE);
|
|
439
|
+
const cid = await this.rd8(REG_CID_RID);
|
|
440
|
+
if (cid !== CMD_LOAD_CONFIG_PAGE)
|
|
441
|
+
throw new Tmf8829Error(`CID_RID ${hex2(cid)} after LOAD_CONFIG_PAGE`);
|
|
442
|
+
return this.rd(TMF8829_REG_CFG, TMF8829_CFG_SIZE);
|
|
443
|
+
}
|
|
444
|
+
handleReport(pkt) {
|
|
445
|
+
if (pkt.cmd === Tmf8829Rpt.Frame) {
|
|
446
|
+
if (pkt.payload.length < 21)
|
|
447
|
+
return true;
|
|
448
|
+
const raw = this.reassembler.feed(unpackTmf8829FrameChunk(pkt.payload));
|
|
449
|
+
if (raw === null)
|
|
450
|
+
return true;
|
|
451
|
+
const m = this.builder.add(raw.data, Number(raw.timestampUs), Number(raw.edgeUs));
|
|
452
|
+
if (m !== null) {
|
|
453
|
+
for (const cb of [...this.measCbs])
|
|
454
|
+
cb(m);
|
|
455
|
+
for (const q of [...this.measQueues])
|
|
456
|
+
q.push(m);
|
|
457
|
+
}
|
|
458
|
+
return true;
|
|
459
|
+
}
|
|
460
|
+
if (pkt.cmd === Tmf8829Rpt.Event) {
|
|
461
|
+
if (pkt.payload.length < 12)
|
|
462
|
+
return true;
|
|
463
|
+
const ev = unpackTmf8829Event(pkt.payload);
|
|
464
|
+
if (ev.code === Tmf8829EventCode.BadHeader && this.stopping)
|
|
465
|
+
return true; // expected on STOP (contract 14 §2)
|
|
466
|
+
for (const cb of [...this.interruptCbs])
|
|
467
|
+
cb(ev);
|
|
468
|
+
return true;
|
|
469
|
+
}
|
|
470
|
+
return false;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
//# sourceMappingURL=tmf8829.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tmf8829.js","sourceRoot":"","sources":["../../../src/sensors/tmf8829/tmf8829.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAsB,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EAC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
2
2
|
"name": "@depz/sensor-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "TypeScript SDK for the DEPZ USB sensor line (SR04, VL53L0X/L1CX/L1CB/L3CX/L4CD/L4CX, VL53L5CX/L7CX/L7CH/L8CX/L8CH, BNO086, BNO055) — WebSerial + Node",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|