From 49fea296212deae3b0301ddd12eccdfbe359b80f Mon Sep 17 00:00:00 2001 From: sneakers-the-rat Date: Mon, 18 May 2026 16:51:12 -0700 Subject: [PATCH] add docs links to opal kelly devices --- docs/api/devices/stream.md | 8 +++++++- mio/devices/stream/nodes.py | 14 +++++++++++++- mio/interfaces/opalkelly.py | 8 +++----- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/docs/api/devices/stream.md b/docs/api/devices/stream.md index 5d270284..099d53e9 100644 --- a/docs/api/devices/stream.md +++ b/docs/api/devices/stream.md @@ -21,7 +21,13 @@ A window displaying the image transferred from the Miniscope and a graph plottin A YAML file is used to configure Stream DAQ based on the device configuration. The device configuration needs to match the imaging and data capture hardware for proper operation. This file is used to set up hardware, define data formats, and set data preambles. The contents of this YAML file will be parsed into a {class}`mio.devices.stream.config.StreamDevConfig `, which then configures the Stream DAQ. ### FPGA (Opal Kelly) configuration -The `bitstream` field in the device configuration yaml file specifies the image that will be uploaded to the opal kelly board. This file needs to be placed in `mio.devices`. +The `bitstream` field in the device configuration yaml file specifies the image that will be uploaded to the opal kelly board. This file needs to be placed in `mio.interfaces`. + +```{tip} +See the FPGA repository for further information about the FPGA code: + + +``` #### Bitstream file nomenclature diff --git a/mio/devices/stream/nodes.py b/mio/devices/stream/nodes.py index 2bd88db9..b4b333cc 100644 --- a/mio/devices/stream/nodes.py +++ b/mio/devices/stream/nodes.py @@ -98,7 +98,19 @@ def iter_buffers( def init_okdev(BIT_FILE: Path, read_length: int) -> Union["okDev", okDevMock]: - """Create a connection to an :class:`.okDev` device""" + """ + Create a connection to an :class:`.okDev` device + + Writes to the FPGA to reset its state: + + * put the manchester decoder at reset mode + * sleep 0.01 + * un-reset all components + * put the clock generator/multiplier at reset + * sleep 0.01 + * un-reset all components (presumably the system is ready at this point). + + """ # FIXME: when multiprocessing bug resolved, remove this and just mock in tests if os.environ.get("PYTEST_CURRENT_TEST") or os.environ.get("STREAMDAQ_MOCKRUN"): dev = okDevMock(read_length=read_length) diff --git a/mio/interfaces/opalkelly.py b/mio/interfaces/opalkelly.py index 550bc5d9..ffaee048 100644 --- a/mio/interfaces/opalkelly.py +++ b/mio/interfaces/opalkelly.py @@ -20,13 +20,11 @@ class okDev(ok.okCFrontPanel): """ - I/O and configuration for an (what kind of opal kelly device?) + I/O and configuration for an Opal Kelly FPGA - .. todo:: - - Phil: document what this thing does, including how bitfiles work - and how they're generated/where they're located. + Uses the FPGA code found here: https://github.com/Aharoni-Lab/wireless_fpga_daq + See that repository's README for further documentation. """ def __init__(self, read_length: int, serial_id: str = ""):