Pin forgectrl: the crash watch; its catalog case and the drill's latch bit

forgectrl 161686f adds the head-accelerometer crash watch (two tiers
on the LIS2HH12's interrupt generators, armed inside the laser's
armed window). The catalog grows cooling.crash-watch-plumbing - the
unarmed half of the watch provable without a button press: accel_watch
stays at watch through an unarmed session, three zeros read as the
three crash gates off, an out-of-range threshold is refused - and
_COOL_COVERS widens to src/accel.*. The armed-tier bench drill is a
BRINGUP next-work item.

The de-risk drill script's CTRL7 write moves from bit 0 (4D_IG1) to
bit 2 (LIR1), the latch the datasheet actually puts there; the drill's
findings did not depend on latching (a continuous gravity signal).
This commit is contained in:
ScottW514
2026-08-31 18:47:49 -04:00
parent 4a0338a03f
commit c7c96f9cbe
4 changed files with 89 additions and 33 deletions
+3 -2
View File
@@ -70,7 +70,8 @@ WHO_AM_I = 0x0F
WHO_AM_I_LIS2HH12 = 0x41
CTRL1 = 0x20
CTRL4 = 0x23 # bits 5:4 = FS (00=+/-2g, 10=+/-4g, 11=+/-8g)
CTRL7 = 0x26 # bit 0 = LIR1 (latch IG_SRC1, read-to-clear)
CTRL7 = 0x26 # bit 2 = LIR1 (latch IG_SRC1, read-to-clear;
# bit 3 = LIR2, bits 1:0 are the 4D enables)
OUT_X_L = 0x28
IG_CFG1 = 0x30 # AOI,6D,ZHIE,ZLIE,YHIE,YLIE,XHIE,XLIE
IG_SRC1 = 0x31 # IA(6),ZH,ZL,YH,YL,XH,XL
@@ -182,7 +183,7 @@ def main():
# Arm IG1: latch the source (CTRL7 LIR1), set the thresholds and
# duration, then enable the axes last. Preserve CTRL7's other bits.
ctrl7 = rd(fd, CTRL7)
wr(fd, CTRL7, ctrl7 | 0x01)
wr(fd, CTRL7, ctrl7 | 0x04)
wr(fd, IG_THS_X1, ths)
wr(fd, IG_THS_Y1, ths)
wr(fd, IG_THS_Z1, ths)