Skip to content

Commit fe7cd62

Browse files
kwagyemanclaude
andcommitted
docs: Polish shield and sensor pages with usage examples and API detail.
Across the shield pages (battery, can-rs232, can, gigabit-poe, lcd, pir, poe, rs422-rs485, touch-lcd, wifi) and sensor pages (flir-boson, flir-lepton, genx320, mt9v024, multispectral-event, multispectral-thermal-ov5640, ov5640, pag7936, ps5520): - Drop "compatible with all OpenMV Cams" / FPS marketing bullets in favor of board-supported notes and concrete spec rows. - Add full Usage sections with worked examples — touch overlay with FT6X36, Lepton temperature measurement (low + high range), PAG7936/OV5640 thermal overlay with optional GPU homography, GENX320 histogram + event modes (calibration, AFK, biases, STC, desktop streaming), and standalone OV5640 JPEG capture. - Cross-reference API symbols throughout (csi.CSI, csi.IOCTL_*, image.PALETTE_*, Image.draw_image / draw_event_histogram, etc.). - Expand library/omv.csi.rst with descriptions for all GENX320 IOCTLs, bias presets, individual biases, STC modes, event-type constants, and the LEPTON ioctls. - Normalize "5MP" capitalization across sensor and quickref pages. - Convert per-board availability list in library/index.rst to rubrics so they don't clutter the right-side TOC. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 7cce636 commit fe7cd62

32 files changed

Lines changed: 2133 additions & 188 deletions

docs/library/index.rst

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,7 @@ on each board. All the modules in *Common*, *Frozen Python helpers*, and
210210
*Networking helpers* (above) are available on every camera board unless
211211
otherwise noted.
212212

213-
OPENMV_N6 (STM32N6)
214-
^^^^^^^^^^^^^^^^^^^
213+
.. rubric:: OPENMV_N6 (STM32N6)
215214

216215
OpenMV N6 (STM32N6 — STMicroelectronics' first NPU-equipped MCU):
217216

@@ -220,8 +219,7 @@ OpenMV N6 (STM32N6 — STMicroelectronics' first NPU-equipped MCU):
220219
* :mod:`ssd1306` — OLED driver
221220
* :mod:`tb6612` — TB6612 motor driver
222221

223-
OPENMV_AE3 (Alif Ensemble E3)
224-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
222+
.. rubric:: OPENMV_AE3 (Alif Ensemble E3)
225223

226224
OpenMV AE3 (Alif Ensemble E3 MCU):
227225

@@ -230,8 +228,7 @@ OpenMV AE3 (Alif Ensemble E3 MCU):
230228
* :mod:`romfs` — ROMFS helper utilities
231229
* :mod:`pca9674a` — PCA9674A I2C expander driver
232230

233-
OPENMV_RT1060 (i.MX RT1060)
234-
^^^^^^^^^^^^^^^^^^^^^^^^^^^
231+
.. rubric:: OPENMV_RT1060 (i.MX RT1060)
235232

236233
OpenMV RT1060:
237234

@@ -244,8 +241,7 @@ OpenMV RT1060:
244241
* :mod:`tb6612` — TB6612 motor driver
245242
* :mod:`pca9674a` — PCA9674A I2C expander driver
246243

247-
OPENMVPT (Pure Thermal, STM32H7 + DVI/HDMI)
248-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
244+
.. rubric:: OPENMVPT (Pure Thermal, STM32H7 + DVI/HDMI)
249245

250246
OpenMV Pure Thermal:
251247

@@ -260,8 +256,7 @@ OpenMV Pure Thermal:
260256
* :mod:`ssd1306` — OLED driver
261257
* :mod:`tb6612` — TB6612 motor driver
262258

263-
OPENMV2 / OPENMV3 / OPENMV4 / OPENMV4P (STM32)
264-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
259+
.. rubric:: OPENMV2 / OPENMV3 / OPENMV4 / OPENMV4P (STM32)
265260

266261
Legacy STM32-based OpenMV camera boards:
267262

@@ -274,8 +269,7 @@ Legacy STM32-based OpenMV camera boards:
274269
* :mod:`ssd1306` — OLED driver
275270
* :mod:`tb6612` — TB6612 motor driver
276271

277-
ARDUINO_GIGA (STM32H7 + touchscreen)
278-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
272+
.. rubric:: ARDUINO_GIGA (STM32H7 + touchscreen)
279273

280274
Arduino Giga R1 WiFi:
281275

@@ -287,8 +281,7 @@ Arduino Giga R1 WiFi:
287281
* :mod:`gt911` — GT911 5-point capacitive touch controller
288282
* :mod:`ft5x06` — capacitive touchscreen driver
289283

290-
ARDUINO_PORTENTA_H7 (STM32H7)
291-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
284+
.. rubric:: ARDUINO_PORTENTA_H7 (STM32H7)
292285

293286
Arduino Portenta H7:
294287

@@ -302,8 +295,7 @@ Arduino Portenta H7:
302295
* :mod:`ssd1306` — OLED driver
303296
* :mod:`tb6612` — TB6612 motor driver
304297

305-
ARDUINO_NICLA_VISION (STM32H7)
306-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
298+
.. rubric:: ARDUINO_NICLA_VISION (STM32H7)
307299

308300
Arduino Nicla Vision:
309301

@@ -315,8 +307,7 @@ Arduino Nicla Vision:
315307
* :mod:`onewire` — 1-Wire bus protocol
316308
* :mod:`neopixel` — control of WS2812 / NeoPixel LEDs
317309

318-
ARDUINO_NANO_33_BLE_SENSE (Nordic nRF52840)
319-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
310+
.. rubric:: ARDUINO_NANO_33_BLE_SENSE (Nordic nRF52840)
320311

321312
Arduino Nano 33 BLE Sense — board-specific :doc:`imu <imu>` wrapper
322313
that selects between the LSM9DS1 (Rev 1) and BMI270 + BMM150 (Rev 2)
@@ -334,8 +325,7 @@ sensor sets, plus:
334325
* :mod:`ds18x20` — DS18x20 temperature sensor driver
335326
* :mod:`neopixel` — control of WS2812 / NeoPixel LEDs
336327

337-
ARDUINO_NANO_RP2040_CONNECT / RPI_PICO (RP2)
338-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
328+
.. rubric:: ARDUINO_NANO_RP2040_CONNECT / RPI_PICO (RP2)
339329

340330
RP2040-based boards. The Arduino Nano RP2040 Connect adds a few extra
341331
companion-chip drivers; the Raspberry Pi Pico ships only with the core

docs/library/omv.csi.rst

Lines changed: 134 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -885,149 +885,253 @@ Constants
885885
.. data:: IOCTL_GENX320_SET_BIASES
886886
:type: int
887887

888-
Sets the GENX320 sensor biases to a preset. See `CSI.ioctl`.
888+
Sets the GENX320 sensor biases to one of the
889+
``GENX320_BIASES_*`` presets. See `CSI.ioctl`. After
890+
`CSI.reset` the driver applies `csi.GENX320_BIASES_LOW_NOISE`,
891+
not `csi.GENX320_BIASES_DEFAULT` — use this ioctl to switch to
892+
a different preset when the application needs more sensitivity
893+
or bandwidth.
889894

890895
.. data:: GENX320_BIASES_DEFAULT
891896
:type: int
892897

893-
Default biases for the GENX320 camera sensor.
898+
GenX320 datasheet defaults — balanced sensitivity, noise, and
899+
bandwidth for general scenes.
894900

895901
.. data:: GENX320_BIASES_LOW_LIGHT
896902
:type: int
897903

898-
Low light biases for the GENX320 camera sensor.
904+
Tuned for low-light conditions — both contrast thresholds
905+
loosened for higher sensitivity, FO lowered, HPF disabled so
906+
slow brightness changes still register.
899907

900908
.. data:: GENX320_BIASES_ACTIVE_MARKER
901909
:type: int
902910

903-
Active marker biases for the GENX320 camera sensor.
911+
Tuned for tracking high-contrast blinking LEDs (active markers)
912+
— contrast thresholds raised so only sharp transitions trigger,
913+
FO and HPF cranked high to maximize bandwidth and reject slow
914+
ambient drift, REFR=0 so every blink edge is captured.
904915

905916
.. data:: GENX320_BIASES_LOW_NOISE
906917
:type: int
907918

908-
Low noise biases for the GENX320 camera sensor.
919+
Driver default — lower sensitivity than ``DEFAULT`` (raised
920+
contrast thresholds) and a lower FO for less background-noise
921+
activity. Best for static or slow scenes where false events
922+
would dominate.
909923

910924
.. data:: GENX320_BIASES_HIGH_SPEED
911925
:type: int
912926

913-
High speed biases for the GENX320 camera sensor.
927+
Tuned for fast-motion scenes — higher FO for wider pixel
928+
bandwidth, higher HPF to reject slow changes, higher REFR for
929+
a longer dead time after each event so the readout doesn't
930+
saturate.
914931

915932
.. data:: IOCTL_GENX320_SET_BIAS
916933
:type: int
917934

918-
Sets a single GENX320 camera sensor bias. See `CSI.ioctl`.
935+
Sets a single GENX320 sensor bias to a DAC value. Pass a
936+
``GENX320_BIAS_*`` constant (`csi.GENX320_BIAS_DIFF_OFF`,
937+
`csi.GENX320_BIAS_DIFF_ON`, `csi.GENX320_BIAS_FO`,
938+
`csi.GENX320_BIAS_HPF`, or `csi.GENX320_BIAS_REFR`) and an
939+
integer DAC value. Each bias is independent — call this ioctl
940+
repeatedly to tweak only the biases you need after applying a
941+
preset. See `CSI.ioctl`.
919942

920943
.. data:: GENX320_BIAS_DIFF_OFF
921944
:type: int
922945

923-
Selects the GENX320 DIFF OFF bias.
946+
Negative comparator contrast threshold — controls how much a
947+
pixel has to darken before a `csi.PIX_OFF_EVENT` fires. Lower
948+
value = more sensitive (more events).
924949

925950
.. data:: GENX320_BIAS_DIFF_ON
926951
:type: int
927952

928-
Selects the GENX320 DIFF ON bias.
953+
Positive comparator contrast threshold — controls how much a
954+
pixel has to brighten before a `csi.PIX_ON_EVENT` fires. Lower
955+
value = more sensitive (more events).
929956

930957
.. data:: GENX320_BIAS_FO
931958
:type: int
932959

933-
Selects the GENX320 FO bias.
960+
Pixel low-pass cut-off frequency — trades pixel bandwidth
961+
(speed/latency) against background-noise activity. Higher
962+
value = faster pixel response, more noise.
934963

935964
.. data:: GENX320_BIAS_HPF
936965
:type: int
937966

938-
Selects the GENX320 HPF bias.
967+
Pixel high-pass cut-off frequency — rejects slow brightness
968+
changes. Higher value = slower changes filtered out (only
969+
fast transitions register).
939970

940971
.. data:: GENX320_BIAS_REFR
941972
:type: int
942973

943-
Selects the GENX320 REFR bias.
974+
Pixel refractory period — dead time after a pixel emits an
975+
event during which it cannot fire again. Higher value =
976+
longer dead time, fewer events from a busy pixel.
944977

945978
.. data:: IOCTL_GENX320_SET_AFK
946979
:type: int
947980

948-
Sets the GENX320 anti-flicker filter. See `CSI.ioctl`.
981+
Sets the GENX320 anti-flicker (AFK) filter, which rejects
982+
events from pixels toggling at a periodic frequency band
983+
(fluorescent lighting, LED-driven displays, etc.). Pass
984+
``enable`` (1 to enable, 0 to disable) and, when enabling,
985+
the band edges in hertz: ``(enable, freq_low_hz, freq_high_hz)``.
986+
See `CSI.ioctl`.
949987

950988
.. data:: IOCTL_GENX320_SET_STC
951989
:type: int
952990

953-
Sets the GENX320 spatio-temporal contrast filter mode. See `CSI.ioctl`.
991+
Sets the GENX320 spatio-temporal contrast (STC) filter mode.
992+
Pass a ``GENX320_STC_*`` constant
993+
(`csi.GENX320_STC_DISABLE`, `csi.GENX320_STC_ONLY`,
994+
`csi.GENX320_STC_TRAIL_ONLY`, `csi.GENX320_STC_TRAIL`)
995+
followed by the threshold(s) the mode requires (in
996+
milliseconds). See `CSI.ioctl`.
954997

955998
.. data:: GENX320_STC_DISABLE
956999
:type: int
9571000

958-
Disable the GENX320 STC/trail filter.
1001+
Disable the GENX320 STC/trail filter — every event passes
1002+
through.
9591003

9601004
.. data:: GENX320_STC_ONLY
9611005
:type: int
9621006

963-
Enable only the spatio-temporal contrast filter on the GENX320.
1007+
*Keeps the second event of a burst*; drops the first event
1008+
and any later events. Takes one parameter, ``stc_threshold``
1009+
in milliseconds — events within that window of a prior event
1010+
on the same pixel are considered part of the same burst.
9641011

9651012
.. data:: GENX320_STC_TRAIL_ONLY
9661013
:type: int
9671014

968-
Enable only the trail filter on the GENX320.
1015+
*Keeps the first event of a burst*; drops subsequent events
1016+
on the same pixel until ``trail_threshold`` has elapsed. Takes
1017+
one parameter, ``trail_threshold`` in milliseconds.
9691018

9701019
.. data:: GENX320_STC_TRAIL
9711020
:type: int
9721021

973-
Enable both the STC and trail filters on the GENX320.
1022+
*Keeps the first event of a burst plus subsequent edges* —
1023+
combines `csi.GENX320_STC_ONLY` and `csi.GENX320_STC_TRAIL_ONLY`.
1024+
Takes two parameters, ``stc_threshold`` and ``trail_threshold``
1025+
(both ms); the sensor requires the two to stay within roughly
1026+
a 13:1 ratio.
9741027

9751028
.. data:: IOCTL_GENX320_SET_MODE
9761029
:type: int
9771030

978-
Sets the GENX320 camera sensor operating mode. See `CSI.ioctl`.
1031+
Sets the GENX320 operating mode. Pass `csi.GENX320_MODE_HISTO`
1032+
for the on-chip event histogram (the cam behaves like a
1033+
regular grayscale camera at the configured framerate) or
1034+
`csi.GENX320_MODE_EVENT` followed by the row-axis length of
1035+
the event ``ndarray`` (a power of two between 1024 and
1036+
65536) for raw event streaming. See `CSI.ioctl`.
9791037

9801038
.. data:: GENX320_MODE_HISTO
9811039
:type: int
9821040

983-
Sets the GENX320 to histogram mode.
1041+
Histogram mode — events are accumulated on-chip into per-pixel
1042+
bins and reported as a 320x320 grayscale frame at the
1043+
configured rate (~20-350 FPS). The cam looks like a regular
1044+
camera, so all the standard image-processing routines work
1045+
directly.
9841046

9851047
.. data:: GENX320_MODE_EVENT
9861048
:type: int
9871049

988-
Sets the GENX320 to event mode.
1050+
Event mode — bypasses the on-chip histogram and streams raw
1051+
events into a numpy ``ndarray`` with microsecond timestamps,
1052+
for applications that need full temporal detail rather than a
1053+
pre-binned frame.
9891054

9901055
.. data:: IOCTL_GENX320_READ_EVENTS
9911056
:type: int
9921057

993-
Populates an ndarray with event information from the GENX320. See `CSI.ioctl`.
1058+
Reads raw events into a uint16 ``ndarray`` of shape
1059+
``(EVT_res, 6)`` (with ``EVT_res`` matching the buffer size
1060+
passed to `csi.IOCTL_GENX320_SET_MODE`). The columns are
1061+
``[0]`` event type (`csi.PIX_OFF_EVENT`, `csi.PIX_ON_EVENT`,
1062+
`csi.EXT_TRIGGER_RISING`/``FALLING``,
1063+
`csi.RST_TRIGGER_RISING`/``FALLING``), ``[1]`` seconds
1064+
timestamp, ``[2]`` milliseconds, ``[3]`` microseconds,
1065+
``[4]`` X coord (0-319), ``[5]`` Y coord (0-319). Returns the
1066+
number of events written into the buffer, leaving older rows
1067+
beyond that count untouched. See `CSI.ioctl`.
9941068

9951069
.. data:: IOCTL_GENX320_CALIBRATE
9961070
:type: int
9971071

998-
Automatically turns off hot pixels on the GENX320. See `CSI.ioctl`.
1072+
Automatically disables hot pixels — pixels that fire
1073+
spuriously even on a static scene. The driver builds a
1074+
320x320 per-pixel hit count, computes the mean and standard
1075+
deviation, and disables any pixel whose count exceeds
1076+
``mean + sigma * stddev``. Pass an event-count budget
1077+
(events to tally before computing statistics — higher = more
1078+
reliable estimate, slower; ~10000 is a good default) and a
1079+
sigma float (lower = more aggressive, ~0.5 default). Returns
1080+
the number of pixels disabled. Aim the cam at a static scene
1081+
first so motion-driven events don't get counted against
1082+
pixels that are actually fine. See `CSI.ioctl`.
9991083

10001084
.. data:: IOCTL_GENX320_READ_EVENTS_RAW
10011085
:type: int
10021086

1003-
Returns a raw event-frame `image.Image` from the GENX320. See `CSI.ioctl`.
1087+
Returns a raw event-frame `image.Image` from the GENX320,
1088+
with the events still in the chip's native packed encoding —
1089+
useful if you want to forward the raw stream to a PC for
1090+
off-line decoding rather than process it on the cam. See
1091+
`CSI.ioctl`.
10041092

10051093
.. data:: PIX_OFF_EVENT
10061094
:type: int
10071095

1008-
Pixel-off event.
1096+
GENX320 event type (column ``[0]``) — a pixel detected a
1097+
brightness decrease (the negative-contrast threshold was
1098+
crossed). Columns ``[4]/[5]`` carry the pixel's X/Y.
10091099

10101100
.. data:: PIX_ON_EVENT
10111101
:type: int
10121102

1013-
Pixel-on event.
1103+
GENX320 event type (column ``[0]``) — a pixel detected a
1104+
brightness increase (the positive-contrast threshold was
1105+
crossed). Columns ``[4]/[5]`` carry the pixel's X/Y.
10141106

10151107
.. data:: RST_TRIGGER_RISING
10161108
:type: int
10171109

1018-
Pixel reset rising-edge event.
1110+
GENX320 event type (column ``[0]``) — pixel-reset trigger,
1111+
rising edge. X/Y are unused. Not generated by the firmware
1112+
at this time.
10191113

10201114
.. data:: RST_TRIGGER_FALLING
10211115
:type: int
10221116

1023-
Pixel reset falling-edge event.
1117+
GENX320 event type (column ``[0]``) — pixel-reset trigger,
1118+
falling edge. X/Y are unused. Not generated by the firmware
1119+
at this time.
10241120

10251121
.. data:: EXT_TRIGGER_RISING
10261122
:type: int
10271123

1028-
External trigger rising-edge event.
1124+
GENX320 event type (column ``[0]``) — the sensor's external
1125+
trigger pin saw a rising edge. The GENX320's external trigger
1126+
input is wired to the camera's frame-sync line, also routed
1127+
to **P10** on the processor and the pin header. X/Y are
1128+
unused.
10291129

10301130
.. data:: EXT_TRIGGER_FALLING
10311131
:type: int
10321132

1033-
External trigger falling-edge event.
1133+
GENX320 event type (column ``[0]``) — the sensor's external
1134+
trigger pin saw a falling edge. The GENX320's external trigger
1135+
input is wired to the camera's frame-sync line, also routed
1136+
to **P10** on the processor and the pin header. X/Y are
1137+
unused.

0 commit comments

Comments
 (0)