> This page is for version 3.0 (Latest) (default).
> For other versions, use one of these documentation indexes:
> - 3.0 (Latest) (default): https://docs.nvidia.com/holoscan/sensor-bridge/3-0/llms.txt
> - 2.7: https://docs.nvidia.com/holoscan/sensor-bridge/2-7/llms.txt
> - Archives: https://docs.nvidia.com/holoscan/sensor-bridge/archives/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/holoscan/sensor-bridge/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/holoscan/sensor-bridge/_mcp/server.

# hololink::module::SequencerInterfaceV1

> A list of memory operations that an HSB device runs by itself when a trigger event occurs.

A list of memory operations that an HSB device runs by itself when a trigger event occurs.

A sequencer lets time-critical work (for example reading a sensor's registers over I2C at the end of every frame) be done by the device hardware at the moment of the trigger, rather than by the host after the fact. Operations are recorded with write_uint32(), read_uint32() and poll(), then loaded onto the device and armed with enable(). Each time the sequencer's trigger event occurs the device runs the whole list, in the order recorded, without interruption.

Which event triggers a sequencer depends on how it was obtained: each `*_sequencer` accessor of [HololinkInterfaceV1](hololinkinterfacev1) (software, GPIO, sensor frame start or end) and of the data channel interfaces yields a sequencer for its own event.

Results of read and poll operations are left in the sequencer's memory on the device. A recorded operation is identified by the index returned when it was added: the index of a 32-bit word in the sequence. The device address of the word at index `i` is `location()`` + 4 * i`.

HSB executes sequences one-at-a-time: the current sequence must finish before another event can be handled– so be aware that a long-running poll operation may affect other event handling. Also note that some operations (like I2C transactions) always go through sequencer (to avoid reentrancy), so sequencer occupation may not be entirely obvious.

```cpp showLineNumbers={false}
#include <hololink/module/sequencer.hpp>
```

**Inherits from:** `hololink::module::Service< SequencerInterfaceV1 >` (public)

---

## Methods

### write_uint32 \[#writeuint32]

```cpp showLineNumbers={false}
virtual unsigned hololink::module::SequencerInterfaceV1::write_uint32(
    uint32_t address,
    uint32_t data
)
```

Add a memory write to the sequence.

When the sequence runs, `data` is written to the HSB local bus at `address`.

**Returns:** Index of the word holding `data`.

**Throws:** `std::runtime_error` if enable() has been called.

**Parameters**

**`address`** `uint32_t`

Device location to write.

---

**`data`** `uint32_t`

Value to write.

---

### read_uint32 \[#readuint32]

```cpp showLineNumbers={false}
virtual unsigned hololink::module::SequencerInterfaceV1::read_uint32(
    uint32_t address,
    uint32_t initial_value = 0xFFFFFFFFu
)
```

Add a memory read to the sequence.

When the sequence runs, the memory at `address` is read and the value stored at the returned index.

Operations can only be added before enable() is called.

**Returns:** Index at which the value read is stored.

**Throws:** `std::runtime_error` if enable() has been called.

**Parameters**

**`address`** `uint32_t`

Device memory to read.

---

**`initial_value`** `uint32_t` — default: 0xFFFFFFFFu

Value held at the returned index until the first time the sequence runs, so that a result that hasn't been produced yet can be recognized.

---

### poll \[#poll]

```cpp showLineNumbers={false}
virtual unsigned hololink::module::SequencerInterfaceV1::poll(
    uint32_t address,
    uint32_t mask,
    uint32_t match
)
```

Add a wait to the sequence: the sequence stops at this point until a memory value has the expected value.

When the sequence runs, the memory at `address` is read repeatedly until `(value & mask) == match`, and only then does the sequence continue. The poll times out if the match does not occur within the timeout configured on the device.

Operations can only be added before enable() is called.

**Returns:** Index at which the most recent value read from `address` is stored.

**Throws:** `std::runtime_error` if enable() has been called.

**Parameters**

**`address`** `uint32_t`

Device memory to read.

---

**`mask`** `uint32_t`

Bits of the value to compare.

---

**`match`** `uint32_t`

Value the masked bits must equal.

---

### enable \[#enable]

```cpp showLineNumbers={false}
virtual hololink_module_status_t hololink::module::SequencerInterfaceV1::enable()
```

Load the sequence onto the device and arm it for its trigger.

Call this once, after the last operation has been added. From then on the device runs the sequence each time the trigger event occurs, and location() can be used.

**Returns:** HOLOLINK_MODULE_OK or an error status.

**Throws:** `std::runtime_error` if the sequencer has already been enabled.

### location \[#location]

```cpp showLineNumbers={false}
virtual uint32_t hololink::module::SequencerInterfaceV1::location()
```

The device address at which the sequence is stored.

The word for an operation's index is at this address plus four times the index. Use it to read back results, or to update data to be written.

**Returns:** The address.

**Throws:** `std::runtime_error` if enable() has not been called.

### module \[#module]

```cpp showLineNumbers={false}
std::shared_ptr<Module> hololink::module::ServiceBase::module() const
```

The [Module](module) that this service was published from.

The service holds no strong reference to its [Module](module), so this does not extend the [Module](module)'s lifetime.

**Returns:** The owning [Module](module), or an empty pointer if the service has not been published or its [Module](module) no longer exists.

---

## Static methods

### get_service \[#getservice]

```cpp showLineNumbers={false}
static std::shared_ptr<SequencerInterfaceV1> hololink::module::Service<SequencerInterfaceV1>::get_service(
    std::shared_ptr<Module> module,
    const char *instance_id,
    bool allow_null = false
)
```

Type-safe way to fetch a std::shared_ptr to an instance of \<Derived> from a [Module](module).

Note that [Module](module) usually caches instances, it's likely that calls to get_service with the same locator_id will return pointers to the same implementation object.

**Returns:** A shared pointer to the service instance.

**Parameters**

**`module`** `std::shared_ptr<Module>`

Is the shared object that owns the instance we wish to fetch

---

**`instance_id`** `const char *`

Names the specific object, usually expressed as a set of "name=value;..." pairs, as defined by the implementations themselves. This name is normally fetched by calling `Derived::locator_id(enumeration_metadata)`.

---

**`allow_null`** `bool` — default: false

The default value of `false` causes this routine to throw a std::runtime_error if the service cannot be found within the module; this would be expected to terminate the calling program. If the application wants to handle the error, pass in `true` here and get_service will return `nullptr` when this module doesn't provide the requested service.

---

### for_each_type_id \[#foreachtypeid]

```cpp showLineNumbers={false}
static bool hololink::module::Service<SequencerInterfaceV1>::for_each_type_id(
    Callback &&cb
)
```

Iterate over every type_id supported by this instance.

The callback signature is `bool(const char*)` — returning false halts the walk; true continues. Iteration is depth-first, so you'll see the most specific implementation types first.