> 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::MipiDphyInterfaceV1

> Programs the MIPI D-PHY receivers of a device.

Programs the MIPI D-PHY receivers of a device.

Each physical MIPI interface on the device has its own D-PHY receiver. Use program() to tell a receiver how many CSI-2 data lanes the attached sensor drives and at what rate, so that it samples the incoming data correctly. A receiver that is never programmed keeps the FPGA's default configuration.

The service is looked up per device, using the enumeration metadata for that device. It is only relevant for devices supporting MIPI D-PHYs.

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

**Inherits from:** `hololink::module::ConfigurableService< MipiDphyInterfaceV1 >` (public)

---

## Methods

### program \[#program]

```cpp showLineNumbers={false}
virtual hololink_module_status_t hololink::module::MipiDphyInterfaceV1::program(
    unsigned physical_mipi_interface,
    unsigned lane_count,
    unsigned line_rate_mbps
)
```

Configure one D-PHY receiver for a given lane count and line rate.

Sets the number of active CSI-2 data lanes and the data-lane HS-SETTLE window, which is derived from `line_rate_mbps` so that it falls within the D-PHY specification's T_HS-SETTLE limits for that rate. The setting takes effect on the receiver's subsequent input; call this before starting the sensor's CSI-2 transmission. It may be called again to reprogram the same receiver.

Parameters are validated before the device is modified. If an error is returned for a parameter problem, the receiver is unchanged.

**Returns:** HOLOLINK_MODULE_OK on success. HOLOLINK_MODULE_INVALID_PARAMETER if `physical_mipi_interface` does not exist on this design, `lane_count` is outside 1..4, `line_rate_mbps` exceeds the design's maximum, or no valid settle window can be programmed for `line_rate_mbps` (for example, a rate too low for the design to represent). HOLOLINK_MODULE_NOT_FOUND if the device has no usable D-PHY or the receiver cannot be reached. Other error statuses are returned if communicating with the device fails.

**Parameters**

**`physical_mipi_interface`** `unsigned`

Zero-based index of the MIPI interface to program. The number of interfaces depends on the FPGA design.

---

**`lane_count`** `unsigned`

Number of CSI-2 data lanes the sensor transmits on, from 1 to 4.

---

**`line_rate_mbps`** `unsigned`

Bit rate of each data lane, in Mbps, or LINE_RATE_DESIGN_MAXIMUM for the fastest rate the design supports.

---

### configure \[#configure]

```cpp showLineNumbers={false}
virtual void hololink::module::ConfigurableService<MipiDphyInterfaceV1>::configure(
    const EnumerationMetadata &
)
```

Use `metadata` contents to initialize this instance.

This routine is guaranteed to be called the first time a call to get_service(metadata) is called on a specific service instance.

### 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]

#### Fetch a service

```cpp showLineNumbers={false}
static std::shared_ptr<MipiDphyInterfaceV1> hololink::module::ConfigurableService<MipiDphyInterfaceV1>::get_service(
    const EnumerationMetadata &metadata,
    bool allow_null = false
)
```

Fetch a service, configured by [EnumerationMetadata](enumerationmetadata).

[Module](module) usually caches service objects; so when a specific service instance isn't found, it will be constructed with the current values in [EnumerationMetadata](enumerationmetadata). Later calls to get_service are likely to return that cached instance, ignoring changes to any enumeration metadata that aren't specifically related to service addressing.

**Returns:** A shared pointer to the requested service (\<Derived>).

**Throws:** `std::runtime_error` when allow_null==false and the service lookup (or construction) fails.

**Parameters**

**`metadata`** `const EnumerationMetadata &`

Addressing and configuration for the service.

---

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

Use `true` to return nullptr when the service cannot be resolved; the default `false` value raises a std::runtime_error.

---

#### Overload 2

inline

```cpp showLineNumbers={false}
static std::shared_ptr<MipiDphyInterfaceV1> hololink::module::Service<MipiDphyInterfaceV1>::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<MipiDphyInterfaceV1>::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.

---

## Member variables

| Name                                        | Type       | Description                                                                                     |
| ------------------------------------------- | ---------- | ----------------------------------------------------------------------------------------------- |
| `LINE_RATE_DESIGN_MAXIMUM` static constexpr | `unsigned` | Pass as `line_rate_mbps` to program() to select the fastest line rate the FPGA design supports. |