@@ -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