Skip to content

feat(cameras): Use firmware I2C command for stellarHD sensor controls - #638

Open
brandonhs wants to merge 5 commits into
mainfrom
636-switch-to-new-sensor-controls-via-i2c-instead-of-asic-interface
Open

brandonhs wants to merge 5 commits into
mainfrom
636-switch-to-new-sensor-controls-via-i2c-instead-of-asic-interface

Conversation

@brandonhs

@brandonhs brandonhs commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Summary

Switches stellarHD sensor reads/writes from the ASIC mailbox workaround (0x1674–0x1678) to the firmware sensor I2C command (XU unit 3, selector 2, 64-byte payload).

  • Shutter, ISO and strobe width write their high/low registers in one 2-byte transaction instead of two mailbox writes, and no longer poll REG_TRIG for completion (which could block up to 5 s).

  • The sensor slave id is read from 0x8601, falling back to 0x60.

  • Auto exposure now uses bit 0 of 0x8100 (0x61 on / 0x60 off), set by changing only that bit. The legacy 0x1673 register is still written alongside it, because firmware with the older workaround only changes AE through that register. Removes the mislabelled REG_STROBE_ENABLED.

  • Fixes the AE readback unpacking asic_read's (ret, val) in the wrong order.

  • Since writes are now fast, integer sliders send their value every 50 ms while dragging, and the +/− buttons send immediately. Camera controls are no longer rendered through a component defined inside CameraControls, which remounted every slider on each store update and broke dragging.

  • Device settings saves are queued: settings update in memory immediately and the file is written by a background thread at most once per second, so a slider drag no longer rewrites the file on every update. Pending saves are flushed on shutdown.

  • Silences the per-option debug log, which fired on every live slider update.

Fixes #636
Fixes #637

Type of change

  • Bug fix
  • Feature / Refactor
  • Breaking change
  • Misc.

Quick Checklist

  • I have reviewed my own code.
  • I have tested these changes locally (stellarHD sensor controls and slider drag).
  • I have tested these changes on the following platforms (optional):
    • SVC
    • microSVC (optional)
    • SVC Pro

Replace the ASIC mailbox (0x1674-0x1678) with the firmware sensor I2C
command on XU unit 3, selector 2. High/low register pairs are written in
a single transaction and no longer poll for completion.

Move auto exposure from the 0x1673 workaround register to bit 0 of
0x8100, and fix the AE readback unpacking asic_read in the wrong order.
Throttle updates to every 50 ms during a drag now that sensor writes are
fast. Render camera controls without a nested component so store updates
mid-drag no longer remount the slider.
@brandonhs brandonhs linked an issue Nov 24, 2026 that may be closed by this pull request
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Preview build: preview-pr-638 (v0.9.0-pr638.b291329, built from b291329)

curl -s https://raw.githubusercontent.com/DeepWaterExploration/dweOS/main/install.sh | sudo bash -s preview-pr-638

Rebuilt on every push. Closing this pull request deletes the preview.

Firmware with the older auto exposure workaround only changes AE when
0x1673 is written, so set it alongside bit 0 of 0x8100.
Update settings in memory immediately and write the file from a
background thread at most once per second, so bursts of control changes
(e.g. dragging a slider) become a single write. Pending saves are
flushed on cleanup.
Live slider updates made this log on every change.
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.

Auto exposure readback unpacks asic_read result in the wrong order Switch to new sensor controls via i2c instead of asic interface

1 participant