Skip to content

Resolve nine internal contradictions in the API spec#7

Merged
lkasso merged 1 commit into
mainfrom
lkasso/spec-internal-contradictions
Jun 13, 2026
Merged

Resolve nine internal contradictions in the API spec#7
lkasso merged 1 commit into
mainfrom
lkasso/spec-internal-contradictions

Conversation

@lkasso

@lkasso lkasso commented Jun 13, 2026

Copy link
Copy Markdown
Member

Summary

A careful review found nine places where the spec contradicted itself — prose vs. register table vs. worked example vs. wire-level reference giving implementers conflicting models. Each is resolved toward the canonical source, cross-checked against MetaWear-SDK-Cpp and our firmware-1.7.2 hardware testing.

# Area Fix
1 Event workflow examples Broken entry format → source triple + target module/register + param length; switch index 0x000xFF
2 Logging example Add Trigger packed byte (two triggers for a 6-byte sample); 4-byte readout → required 8 bytes; wire-ref formula was backwards
3 Data-processor source table Temperature 0xC1/GPIO 0x07 fed processors nothing on HW → loud-read forms 0x81/0x87/0x86
4 SPI wire-level layout Invented separate bytes + dropped MOSI/MISO → packed config byte matching the table and both SDKs
5 Sensor fusion setup "auto-configured, don't configure separately" was backwards → host must configure + start the underlying sensors
6 Command-format table "bit 8"→bit 7; removed a stray vertical-tab control char; documented bit 6 (data-id/silent)
7 Temperature 0-based channel index (not 1-based selector); 0.25 °C → 0.125 °C
8 LED Flash example Little-endian read as big-endian (50 ms / 500 ms, not 12800 / 62465)
9 Module discovery Absent modules do respond (bare 2-byte header); detect by length, not timeout

mkdocs build --strict passes; all cross-page anchors verified.

🤖 Generated with Claude Code

A careful read found nine places where the spec disagreed with itself —
the prose, register tables, worked examples, and wire-level reference
giving an implementer conflicting models. Each is resolved in favor of
the canonical source (register table / SDK / hardware-verified note),
with cross-checks against MetaWear-SDK-Cpp and our fw 1.7.2 testing:

- Event workflow examples used a broken entry format (source tuple only);
  rewritten to source triple + target module/register + param length,
  with params alone in the 0x03 write. Switch source index 0x00 -> 0xFF.
- Logging example: Add Trigger packed byte (offset bits 0-4, length-1
  bits 5-7) shown as two separate bytes with an impossible 6-byte entry;
  now two triggers per 6-byte sample. Readout fixed from 4 bytes to the
  required 8 (count + notify delta). Wire-reference packed-byte formula
  was also backwards -> corrected.
- Data-processor source table: temperature 0xC1 and GPIO 0x07 fed
  processors nothing on hardware; corrected to the loud-read forms
  (0x81 / 0x87 / 0x86) per the read-signal-routing note.
- SPI wire-level layout invented separate mode/len/msb/nrf/id bytes and
  dropped MOSI/MISO; rewritten to the packed config byte matching the
  register table and both SDKs.
- Sensor fusion prose claimed the underlying acc/gyro/mag are configured
  automatically and must not be configured separately — the opposite of
  the truth; the host must configure and start them or fusion emits
  nothing.
- Command-format table: "bit 8" -> bit 7, removed a stray vertical-tab
  control char, and documented bit 6 (data-id/silent) alongside bit 7 in
  the packet section.
- Temperature: channel byte is a 0-based channel index (not a 1-based
  sensor selector); scale 0.25 C -> 0.125 C, matching the module section.
- LED Flash example: little-endian values read as big-endian
  (0x32 0x00 = 50 ms not 12800; 0xF4 0x01 = 500 ms not 62465).
- Module discovery: absent modules DO respond, with a bare 2-byte
  header (not "do not respond"); detect absence by length, not timeout.

mkdocs build --strict passes; all cross-page anchors verified.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lkasso lkasso merged commit c184509 into main Jun 13, 2026
2 checks passed
@lkasso lkasso deleted the lkasso/spec-internal-contradictions branch June 14, 2026 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant