Skip to content
Snippets Groups Projects
Select Git revision
  • mh/blecentral
  • patch-2
  • patch-1
  • filenames-blacklist
  • rahix/ble-fix
  • master default protected
  • genofire/ble-rewrite
  • koalo/bhi160-works-but-dirty
  • ch3/splashscreen
  • m
  • rahix/simple_menu
  • ios-workarounds
  • koalo/wip/i2c-for-python
  • renze/safe_mode
  • renze/hatchery_apps
  • schneider/fundamental-test
  • koalo/factory-reset
  • msgctl/gfx_rle
  • msgctl/faultscreen
  • msgctl/textbuffer_api
  • v1.2
  • v1.1
  • v1.0
  • release-1
  • bootloader-v1
  • v0.0
26 results

sensor-streams.rst

Blame
  • Forked from card10 / firmware
    1218 commits behind the upstream repository.
    sensor-streams.rst 1.32 KiB

    Sensor Streams

    Sensor drivers can make their data available to core 1 in a stream-like format. This allows batch-reading many samples and shoud reduce pressure on the Epicardium API this way. Sensor streams are read on core 1 using :c:func:`epic_stream_read`.

    This page intends to document how to add this stream interface to a sensor driver. It also serves as a reference of existing streams. For that, take a look at the definitions in the :c:type:`stream_descriptor` enum.

    Adding a new Stream

    The list of possible sensor streams must be known at compile time. Each stream gets a unique ID in the :c:type:`stream_descriptor` enum. Please do not assign IDs manually but instead let the enum assign sequencial IDs. :c:macro:`SD_MAX` must always be the highest stream ID. Additionally, please document what this stream is for using a doc-comment so it shows up on this page.

    When a sensor driver enables data collection, it should also register its respective stream. This is done using a :c:type:`stream_info` object. Pass this object to :c:func:`stream_register` to make your stream available. Your driver must guarantee the :c:member:`stream_info.queue` handle to be valid until deregistration using :c:func:`stream_deregister`.

    Definitions