# C API

C API provides Mobilint NPU monitoring and telemetry.

This header is plain C (C99) so that mbltml/capi.h can be included from C translation units. Keep it free of C++-only constructs such as digit separators and default member initializers; test/test\_capi.c guards this.

The structs below therefore carry no default member initializers. Every field is filled in by the API that returns them; a caller that declares one itself is responsible for initializing it (e.g. `= {0}`).

## Data structures

| Name | Description |
| --- | --- |
| [`mbltmlCoreId_t`](<https://docs.mobilint.com/runtime/kr/v1.5/api/mbltml/cpp/mbltmlcoreid_t/index.md>) | Composite identifier of an NPU core (cluster + core). |
| [`mbltmlCoreInfo_t`](<https://docs.mobilint.com/runtime/kr/v1.5/api/mbltml/cpp/mbltmlcoreinfo_t/index.md>) | Per-core usage record returned by [mbltmlGetCoreInfos()](<#mbltmlgetcoreinfos>). |
| [`mbltmlProcessInfo_t`](<https://docs.mobilint.com/runtime/kr/v1.5/api/mbltml/cpp/mbltmlprocessinfo_t/index.md>) | Per-process usage record returned by [mbltmlGetProcessInfos()](<#mbltmlgetprocessinfos>). |

## Macros

### MBLTML\_DRIVER\_VERSION\_BUFFER\_SIZE

```cpp
#define MBLTML_DRIVER_VERSION_BUFFER_SIZE 80
```

Buffer size (bytes) guaranteed sufficient for [mbltmlGetDriverVersion()](<#mbltmlgetdriverversion>).

### MBLTML\_ON\_DEVICE\_DRIVER\_VERSION\_BUFFER\_SIZE

```cpp
#define MBLTML_ON_DEVICE_DRIVER_VERSION_BUFFER_SIZE 80
```

Buffer size (bytes) guaranteed sufficient for [mbltmlGetOnDeviceDriverVersion()](<#mbltmlgetondevicedriverversion>).

### MBLTML\_FIRMWARE\_VERSION\_BUFFER\_SIZE

```cpp
#define MBLTML_FIRMWARE_VERSION_BUFFER_SIZE 80
```

Buffer size (bytes) guaranteed sufficient for [mbltmlGetFirmwareVersion()](<#mbltmlgetfirmwareversion>).

### MBLTML\_NODE\_NAME\_BUFFER\_SIZE

```cpp
#define MBLTML_NODE_NAME_BUFFER_SIZE 80
```

Buffer size (bytes) guaranteed sufficient for [mbltmlGetNodeName()](<#mbltmlgetnodename>).

### MBLTML\_PCIE\_SLOT\_BUFFER\_SIZE

```cpp
#define MBLTML_PCIE_SLOT_BUFFER_SIZE 80
```

Buffer size (bytes) guaranteed sufficient for [mbltmlGetPcieSlot()](<#mbltmlgetpcieslot>).

## Enumerations

### mbltmlDriverType\_t

```cpp
enum mbltmlDriverType_t
```

Identifier of a Mobilint NPU driver.

Used to select a driver when calling family-scoped APIs such as [mbltmlGetDriverVersion()](<#mbltmlgetdriverversion>), and to describe the family of an individual device returned by [mbltmlGetDriverType()](<#mbltmlgetdrivertype>).

| Value | Description |
| --- | --- |
| `MBLTML_DRIVER_ERROR = 0x0` | Invalid or uninitialized value. |
| `MBLTML_DRIVER_ARIES = 0x1` | ARIES (PCIe) Driver. |
| `MBLTML_DRIVER_REGULUS = 0x2` | REGULUS (SoC) Driver. |
| `MBLTML_DRIVER_REGULUS_USB = 0x4` | REGULUS (USB) Driver. |

### mbltmlTargetDeviceType\_t

```cpp
enum mbltmlTargetDeviceType_t
```

Specific target device type of a Mobilint NPU.

| Value | Description |
| --- | --- |
| `MBLTML_TARGET_DEVICE_ARIES_RA = 0x00000001` | aries-ra. |
| `MBLTML_TARGET_DEVICE_REGULUS_RA = 0x00000002` | regulus-ra. |
| `MBLTML_TARGET_DEVICE_ARIES_RB = 0x00000003` | aries-rb. |
| `MBLTML_TARGET_DEVICE_REGULUS_RB = 0x00000004` | regulus-rb. |
| `MBLTML_TARGET_DEVICE_REGULUS_RA_USB = 0x00000005` | regulus-ra-usb. |
| `MBLTML_TARGET_DEVICE_REGULUS_RB_USB = 0x00000006` | regulus-rb-usb. |
| `MBLTML_TARGET_DEVICE_ERROR = 0x7FFFFFFF` | Invalid or uninitialized. |

### mbltmlStatusCode\_t

```cpp
enum mbltmlStatusCode_t
```

Status code returned by mbltml APIs.

| Value | Description |
| --- | --- |
| `MBLTML_SUCCESS = 0` | Operation completed successfully. |
| `MBLTML_UNINITIALIZED = 1` | API used before initialization. |
| `MBLTML_DRIVER_NOT_FOUND = 2` | Required driver could not be located. |
| `MBLTML_INVALID_ARGUMENT = 3` | Invalid argument (NULL or out-of-range). |
| `MBLTML_NOT_SUPPORTED = 4` | Feature not supported on target device. |
| `MBLTML_INSUFFICIENT_LENGTH = 5` | Output buffer is too small. |
| `MBLTML_DEVICE_NOT_FOUND = 6` | Requested target device could not be located. |

### mbltmlExtraPmicId\_t

```cpp
enum mbltmlExtraPmicId_t
```

Identifier of an extra PMIC rail.

Selects which auxiliary PMIC rail is reported by the mbltmlGetExtraPmic\*() APIs. The active selection is changed with [mbltmlSetExtraPmicID()](<#mbltmlsetextrapmicid>) and can be queried via [mbltmlGetExtraPmicId()](<#mbltmlgetextrapmicid>).

| Value | Description |
| --- | --- |
| `MBLTML_EXTRA_PMIC_ID_NPU = 0` | NPU rail. |
| `MBLTML_EXTRA_PMIC_ID_DDR = 1` | DDR rail. |
| `MBLTML_EXTRA_PMIC_ID_PMIC = 2` | PMIC rail. |
| `MBLTML_EXTRA_PMIC_ID_GOLDFINGER = 3` | Goldfinger rail. |

### mbltmlCluster\_t

```cpp
enum mbltmlCluster_t
```

NPU cluster identifier within a device.

| Value | Description |
| --- | --- |
| `MBLTML_CLUSTER_0 = 1 << 16` | Cluster 0. |
| `MBLTML_CLUSTER_1 = 2 << 16` | Cluster 1. |
| `MBLTML_CLUSTER_ERROR = 0x7FFF0000` | Invalid or uninitialized state. |

### mbltmlCore\_t

```cpp
enum mbltmlCore_t
```

NPU core identifier within a cluster.

| Value | Description |
| --- | --- |
| `MBLTML_CORE_0 = 1` | Local core 0. |
| `MBLTML_CORE_1 = 2` | Local core 1. |
| `MBLTML_CORE_2 = 3` | Local core 2. |
| `MBLTML_CORE_3 = 4` | Local core 3. |
| `MBLTML_CORE_GLOBAL = 0x0000FFFE` | Global (all cores aggregated). |
| `MBLTML_CORE_ERROR = 0x0000FFFF` | Invalid or uninitialized state. |

## Functions

### mbltmlInit

```cpp
mbltmlStatusCode_t mbltmlInit()
```

Initialize the mbltml library.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, otherwise an appropriate [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code.

### mbltmlShutdown

```cpp
mbltmlStatusCode_t mbltmlShutdown()
```

Release all resources held by the mbltml library.

After this call, any further API usage requires re-initialization via [mbltmlInit()](<#mbltmlinit>).

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, otherwise an appropriate [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code.

### mbltmlGetDeviceCount

```cpp
mbltmlStatusCode_t mbltmlGetDeviceCount(unsigned int *counts)
```

Get the total number of devices detected by the library.

> [!NOTE]
>
> Supported on all driver types.

This returns the number of all detected devices regardless of their target device type, including devices whose target device type could not be identified.

> [!CAUTION]
>
> **Attention**
>
> Do not confuse this with [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>). Since unidentified devices are not addressable by any (`tdt`, `dev_no`) pair, this count may exceed the sum over every [mbltmlTargetDeviceType\_t](<#mbltmltargetdevicetype-t>).

**Parameters**

- `counts` *\[out\]* — Pointer that receives the device count.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `counts` is `NULL`, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetTargetDeviceCount

```cpp
mbltmlStatusCode_t mbltmlGetTargetDeviceCount(mbltmlTargetDeviceType_t tdt, unsigned int *counts)
```

Get the number of detected devices of a specific target device type.

> [!NOTE]
>
> Supported on all driver types.

**Parameters**

- `tdt` *\[in\]* — Target device type whose device count is queried.
- `counts` *\[out\]* — Pointer that receives the device count. Set to 0 if no device of `tdt` is detected.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `counts` is `NULL`, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetDriverVersion

```cpp
mbltmlStatusCode_t mbltmlGetDriverVersion(mbltmlDriverType_t dt, char *version, unsigned int length)
```

Get the driver version string for a specific driver.

> [!NOTE]
>
> Supported on all driver types.

A buffer of [MBLTML\_DRIVER\_VERSION\_BUFFER\_SIZE](<#mbltml-driver-version-buffer-size>) bytes guarantees success. The resulting string is NUL-terminated. On failure, the contents of `version` are left unmodified.

**Parameters**

- `dt` *\[in\]* — Driver type whose driver version is queried.
- `version` *\[out\]* — Output buffer that receives the version string.
- `length` *\[in\]* — Size, in bytes, of `version`.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `version` is `NULL`, [MBLTML\_INSUFFICIENT\_LENGTH](<#mbltmlstatuscode-t>) if `length` is too small, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetDriverRevision

```cpp
mbltmlStatusCode_t mbltmlGetDriverRevision(mbltmlDriverType_t dt, uint32_t *revision)
```

Get the driver revision number for a specific driver.

> [!NOTE]
>
> Supported on all driver types.

**Parameters**

- `dt` *\[in\]* — Driver type whose driver revision is queried.
- `revision` *\[out\]* — Pointer that receives the revision number.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `revision` is `NULL`, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetNodeName

```cpp
mbltmlStatusCode_t mbltmlGetNodeName(mbltmlTargetDeviceType_t tdt, int dev_no, char *name, unsigned int length)
```

Get the node name of a device.

> [!NOTE]
>
> Supported on all driver types.

A buffer of [MBLTML\_NODE\_NAME\_BUFFER\_SIZE](<#mbltml-node-name-buffer-size>) bytes guarantees success. The resulting string is NUL-terminated. On failure, the contents of `name` are left unmodified.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `name` *\[out\]* — Output buffer that receives the node name.
- `length` *\[in\]* — Size, in bytes, of `name`.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `name` is `NULL`, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, [MBLTML\_INSUFFICIENT\_LENGTH](<#mbltmlstatuscode-t>) if `length` is too small, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetDriverType

```cpp
mbltmlStatusCode_t mbltmlGetDriverType(mbltmlTargetDeviceType_t tdt, int dev_no, mbltmlDriverType_t *driver_type)
```

Get the driver type of a device.

> [!NOTE]
>
> Supported on all driver types.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `driver_type` *\[out\]* — Pointer that receives the [mbltmlDriverType\_t](<#mbltmldrivertype-t>) value.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `driver_type` is `NULL`, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetOnDeviceDriverVersion

```cpp
mbltmlStatusCode_t mbltmlGetOnDeviceDriverVersion(mbltmlTargetDeviceType_t tdt, int dev_no, char *version, unsigned int length)
```

Get the on-device driver version string of a device.

> [!NOTE]
>
> Supported on [MBLTML\_DRIVER\_REGULUS\_USB](<#mbltmldrivertype-t>) only.

A buffer of [MBLTML\_ON\_DEVICE\_DRIVER\_VERSION\_BUFFER\_SIZE](<#mbltml-on-device-driver-version-buffer-size>) bytes guarantees success. The resulting string is NUL-terminated. On failure, the contents of `version` are left unmodified.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `version` *\[out\]* — Output buffer that receives the version string.
- `length` *\[in\]* — Size, in bytes, of `version`.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `version` is `NULL`, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, [MBLTML\_INSUFFICIENT\_LENGTH](<#mbltmlstatuscode-t>) if `length` is too small, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetOnDeviceDriverRevision

```cpp
mbltmlStatusCode_t mbltmlGetOnDeviceDriverRevision(mbltmlTargetDeviceType_t tdt, int dev_no, uint32_t *revision)
```

Get the on-device driver revision number of a device.

> [!NOTE]
>
> Supported on [MBLTML\_DRIVER\_REGULUS\_USB](<#mbltmldrivertype-t>) only.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `revision` *\[out\]* — Pointer that receives the on-device driver revision.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `revision` is `NULL`, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetFirmwareVersion

```cpp
mbltmlStatusCode_t mbltmlGetFirmwareVersion(mbltmlTargetDeviceType_t tdt, int dev_no, char *version, unsigned int length)
```

Get the firmware version string of a device.

> [!NOTE]
>
> Supported on [MBLTML\_DRIVER\_ARIES](<#mbltmldrivertype-t>) only.

A buffer of [MBLTML\_FIRMWARE\_VERSION\_BUFFER\_SIZE](<#mbltml-firmware-version-buffer-size>) bytes guarantees success. The resulting string is NUL-terminated. On failure, the contents of `version` are left unmodified.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `version` *\[out\]* — Output buffer that receives the version string.
- `length` *\[in\]* — Size, in bytes, of `version`.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `version` is `NULL`, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, [MBLTML\_INSUFFICIENT\_LENGTH](<#mbltmlstatuscode-t>) if `length` is too small, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetFirmwareRevision

```cpp
mbltmlStatusCode_t mbltmlGetFirmwareRevision(mbltmlTargetDeviceType_t tdt, int dev_no, uint32_t *revision)
```

Get the firmware revision number of a device.

> [!NOTE]
>
> Supported on [MBLTML\_DRIVER\_ARIES](<#mbltmldrivertype-t>) only.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `revision` *\[out\]* — Pointer that receives the firmware revision.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `revision` is `NULL`, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetFirmwareCRC

```cpp
mbltmlStatusCode_t mbltmlGetFirmwareCRC(mbltmlTargetDeviceType_t tdt, int dev_no, uint32_t *crc)
```

Get the CRC of the currently-loaded firmware image.

> [!NOTE]
>
> Supported on [MBLTML\_DRIVER\_ARIES](<#mbltmldrivertype-t>) only.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `crc` *\[out\]* — Pointer that receives the firmware CRC.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `crc` is `NULL`, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetTemperature

```cpp
mbltmlStatusCode_t mbltmlGetTemperature(mbltmlTargetDeviceType_t tdt, int dev_no, int *temperature)
```

Get the current die temperature of a device.

> [!NOTE]
>
> Supported on all driver types.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `temperature` *\[out\]* — Pointer that receives the temperature reading.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `temperature` is `NULL`, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetPcieSwitchTemperature

```cpp
mbltmlStatusCode_t mbltmlGetPcieSwitchTemperature(mbltmlTargetDeviceType_t tdt, int dev_no, int *temperature)
```

Get the current temperature of the PCIe switch of a device.

> [!NOTE]
>
> Supported on [MBLTML\_DRIVER\_ARIES](<#mbltmldrivertype-t>) only.

> [!NOTE]
>
> A valid reading is available only on the first aries-rb node of an MLA400 board. Any other ARIES device reports 0.

> [!NOTE]
>
> Requires ARIES firmware v1.2.5 or later. Earlier firmware reports 0.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `temperature` *\[out\]* — Pointer that receives the temperature reading.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `temperature` is `NULL`, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetChipId

```cpp
mbltmlStatusCode_t mbltmlGetChipId(mbltmlTargetDeviceType_t tdt, int dev_no, int *chip_id)
```

Get the chip ID of a device.

> [!NOTE]
>
> Supported on [MBLTML\_DRIVER\_ARIES](<#mbltmldrivertype-t>) only.

> [!NOTE]
>
> Requires ARIES firmware v1.2.5 or later. Earlier firmware reports 0.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `chip_id` *\[out\]* — Pointer that receives the chip ID.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `chip_id` is `NULL`, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetSignalType

```cpp
mbltmlStatusCode_t mbltmlGetSignalType(mbltmlTargetDeviceType_t tdt, int dev_no, uint32_t *signal_type)
```

Get the current signal-type indicator reported by the device.

> [!NOTE]
>
> Supported on all driver types.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `signal_type` *\[out\]* — Pointer that receives the signal-type value.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `signal_type` is `NULL`, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetNPUClock

```cpp
mbltmlStatusCode_t mbltmlGetNPUClock(mbltmlTargetDeviceType_t tdt, int dev_no, uint32_t *clock)
```

Get the current NPU clock frequency of a device.

> [!NOTE]
>
> Supported on all driver types.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `clock` *\[out\]* — Pointer that receives the NPU clock value.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `clock` is `NULL`, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetBusClock

```cpp
mbltmlStatusCode_t mbltmlGetBusClock(mbltmlTargetDeviceType_t tdt, int dev_no, uint32_t *clock)
```

Get the current bus clock frequency of a device.

> [!NOTE]
>
> Supported on [MBLTML\_DRIVER\_ARIES](<#mbltmldrivertype-t>) only.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `clock` *\[out\]* — Pointer that receives the bus clock value.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `clock` is `NULL`, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetFanDuty

```cpp
mbltmlStatusCode_t mbltmlGetFanDuty(mbltmlTargetDeviceType_t tdt, int dev_no, int *fan_duty)
```

Get the current cooling-fan duty cycle of a device.

> [!NOTE]
>
> Supported on [MBLTML\_DRIVER\_ARIES](<#mbltmldrivertype-t>) only.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `fan_duty` *\[out\]* — Pointer that receives the fan duty value.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `fan_duty` is `NULL`, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetVendorId

```cpp
mbltmlStatusCode_t mbltmlGetVendorId(mbltmlTargetDeviceType_t tdt, int dev_no, uint32_t *vendor_id)
```

Get the PCIe vendor ID of a device.

> [!NOTE]
>
> Supported on [MBLTML\_DRIVER\_ARIES](<#mbltmldrivertype-t>) only.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `vendor_id` *\[out\]* — Pointer that receives the vendor ID.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `vendor_id` is `NULL`, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetDeviceId

```cpp
mbltmlStatusCode_t mbltmlGetDeviceId(mbltmlTargetDeviceType_t tdt, int dev_no, uint32_t *device_id)
```

Get the PCIe device ID of a device.

> [!NOTE]
>
> Supported on [MBLTML\_DRIVER\_ARIES](<#mbltmldrivertype-t>) only.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `device_id` *\[out\]* — Pointer that receives the device ID.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `device_id` is `NULL`, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetSubVendorId

```cpp
mbltmlStatusCode_t mbltmlGetSubVendorId(mbltmlTargetDeviceType_t tdt, int dev_no, uint32_t *sub_vendor_id)
```

Get the PCIe subsystem vendor ID of a device.

> [!NOTE]
>
> Supported on [MBLTML\_DRIVER\_ARIES](<#mbltmldrivertype-t>) only.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `sub_vendor_id` *\[out\]* — Pointer that receives the subsystem vendor ID.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `sub_vendor_id` is `NULL`, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetSubDeviceId

```cpp
mbltmlStatusCode_t mbltmlGetSubDeviceId(mbltmlTargetDeviceType_t tdt, int dev_no, uint32_t *sub_device_id)
```

Get the PCIe subsystem device ID of a device.

> [!NOTE]
>
> Supported on [MBLTML\_DRIVER\_ARIES](<#mbltmldrivertype-t>) only.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `sub_device_id` *\[out\]* — Pointer that receives the subsystem device ID.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `sub_device_id` is `NULL`, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetPcieGen

```cpp
mbltmlStatusCode_t mbltmlGetPcieGen(mbltmlTargetDeviceType_t tdt, int dev_no, uint32_t *pcie_gen)
```

Get the negotiated PCIe link generation of a device.

> [!NOTE]
>
> Supported on [MBLTML\_DRIVER\_ARIES](<#mbltmldrivertype-t>) only.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `pcie_gen` *\[out\]* — Pointer that receives the PCIe generation.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `pcie_gen` is `NULL`, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetPcieLanes

```cpp
mbltmlStatusCode_t mbltmlGetPcieLanes(mbltmlTargetDeviceType_t tdt, int dev_no, uint32_t *pcie_lanes)
```

Get the negotiated PCIe link width (in lanes) of a device.

> [!NOTE]
>
> Supported on [MBLTML\_DRIVER\_ARIES](<#mbltmldrivertype-t>) only.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `pcie_lanes` *\[out\]* — Pointer that receives the lane count.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `pcie_lanes` is `NULL`, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetPcieRev

```cpp
mbltmlStatusCode_t mbltmlGetPcieRev(mbltmlTargetDeviceType_t tdt, int dev_no, uint32_t *pcie_rev)
```

Get the PCIe configuration-space revision ID of a device.

> [!NOTE]
>
> Supported on [MBLTML\_DRIVER\_ARIES](<#mbltmldrivertype-t>) only.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `pcie_rev` *\[out\]* — Pointer that receives the revision value.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `pcie_rev` is `NULL`, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetPcieClassCode

```cpp
mbltmlStatusCode_t mbltmlGetPcieClassCode(mbltmlTargetDeviceType_t tdt, int dev_no, uint32_t *pcie_class_code)
```

Get the PCIe configuration-space class code of a device.

> [!NOTE]
>
> Supported on [MBLTML\_DRIVER\_ARIES](<#mbltmldrivertype-t>) only.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `pcie_class_code` *\[out\]* — Pointer that receives the class code.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `pcie_class_code` is `NULL`, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetPcieSlot

```cpp
mbltmlStatusCode_t mbltmlGetPcieSlot(mbltmlTargetDeviceType_t tdt, int dev_no, char *pcie_slot, unsigned int length)
```

Get the PCIe slot location of a device.

> [!NOTE]
>
> Supported on [MBLTML\_DRIVER\_ARIES](<#mbltmldrivertype-t>) only.

The slot is formatted either as an ACPI path (e.g. "0-1-2") or as a BDF address (e.g. "0000:01:00.0"), depending on what the driver reports.

A buffer of [MBLTML\_PCIE\_SLOT\_BUFFER\_SIZE](<#mbltml-pcie-slot-buffer-size>) bytes guarantees success. The resulting string is NUL-terminated. On failure, the contents of `pcie_slot` are left unmodified.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `pcie_slot` *\[out\]* — Output buffer that receives the slot location.
- `length` *\[in\]* — Size, in bytes, of `pcie_slot`.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `pcie_slot` is `NULL`, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, [MBLTML\_INSUFFICIENT\_LENGTH](<#mbltmlstatuscode-t>) if `length` is too small, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetTotalPower

```cpp
mbltmlStatusCode_t mbltmlGetTotalPower(mbltmlTargetDeviceType_t tdt, int dev_no, double *power)
```

Get the total instantaneous power consumption of a device.

> [!NOTE]
>
> Supported on [MBLTML\_DRIVER\_ARIES](<#mbltmldrivertype-t>) only.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `power` *\[out\]* — Pointer that receives the power reading.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `power` is `NULL`, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetTotalCurrent

```cpp
mbltmlStatusCode_t mbltmlGetTotalCurrent(mbltmlTargetDeviceType_t tdt, int dev_no, double *current)
```

Get the total instantaneous current draw of a device.

> [!NOTE]
>
> Supported on [MBLTML\_DRIVER\_ARIES](<#mbltmldrivertype-t>) only.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `current` *\[out\]* — Pointer that receives the current reading.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `current` is `NULL`, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetTotalVoltage

```cpp
mbltmlStatusCode_t mbltmlGetTotalVoltage(mbltmlTargetDeviceType_t tdt, int dev_no, double *voltage)
```

Get the total instantaneous supply voltage of a device.

> [!NOTE]
>
> Supported on [MBLTML\_DRIVER\_ARIES](<#mbltmldrivertype-t>) only.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `voltage` *\[out\]* — Pointer that receives the voltage reading.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `voltage` is `NULL`, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetExtraPmicPower

```cpp
mbltmlStatusCode_t mbltmlGetExtraPmicPower(mbltmlTargetDeviceType_t tdt, int dev_no, double *power)
```

Get the power consumption of the extra PMIC rail currently selected for the device (W).

> [!NOTE]
>
> Supported on [MBLTML\_DRIVER\_ARIES](<#mbltmldrivertype-t>) only.

The selected rail is controlled by [mbltmlSetExtraPmicID()](<#mbltmlsetextrapmicid>) and can be queried via [mbltmlGetExtraPmicId()](<#mbltmlgetextrapmicid>).

The firmware refreshes this reading once per second. After changing the selected rail with [mbltmlSetExtraPmicID()](<#mbltmlsetextrapmicid>), allow up to 1 second for the new rail's value to be reported.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `power` *\[out\]* — Pointer that receives the power reading.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `power` is `NULL`, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetExtraPmicCurrent

```cpp
mbltmlStatusCode_t mbltmlGetExtraPmicCurrent(mbltmlTargetDeviceType_t tdt, int dev_no, double *current)
```

Get the current of the extra PMIC rail currently selected for the device (A).

> [!NOTE]
>
> Supported on [MBLTML\_DRIVER\_ARIES](<#mbltmldrivertype-t>) only.

The firmware refreshes this reading once per second. After changing the selected rail with [mbltmlSetExtraPmicID()](<#mbltmlsetextrapmicid>), allow up to 1 second for the new rail's value to be reported.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `current` *\[out\]* — Pointer that receives the current reading.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `current` is `NULL`, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetExtraPmicVoltage

```cpp
mbltmlStatusCode_t mbltmlGetExtraPmicVoltage(mbltmlTargetDeviceType_t tdt, int dev_no, double *voltage)
```

Get the voltage of the extra PMIC rail currently selected for the device (V).

> [!NOTE]
>
> Supported on [MBLTML\_DRIVER\_ARIES](<#mbltmldrivertype-t>) only.

The firmware refreshes this reading once per second. After changing the selected rail with [mbltmlSetExtraPmicID()](<#mbltmlsetextrapmicid>), allow up to 1 second for the new rail's value to be reported.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `voltage` *\[out\]* — Pointer that receives the voltage reading.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `voltage` is `NULL`, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetExtraPmicId

```cpp
mbltmlStatusCode_t mbltmlGetExtraPmicId(mbltmlTargetDeviceType_t tdt, int dev_no, mbltmlExtraPmicId_t *pmic_id)
```

Get the extra PMIC rail currently selected for the device.

> [!NOTE]
>
> Supported on [MBLTML\_DRIVER\_ARIES](<#mbltmldrivertype-t>) only.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `pmic_id` *\[out\]* — Pointer that receives the selected [mbltmlExtraPmicId\_t](<#mbltmlextrapmicid-t>) value.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `pmic_id` is `NULL`, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetTotalUtilization

```cpp
mbltmlStatusCode_t mbltmlGetTotalUtilization(mbltmlTargetDeviceType_t tdt, int dev_no, double *utilization)
```

Get the overall NPU utilization of a device.

> [!NOTE]
>
> Supported on all driver types.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `utilization` *\[out\]* — Pointer that receives the utilization value (typically a ratio in \[0.0, 1.0\] or a percentage).

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `utilization` is `NULL`, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetMemoryUsage

```cpp
mbltmlStatusCode_t mbltmlGetMemoryUsage(mbltmlTargetDeviceType_t tdt, int dev_no, int64_t *memory_usage)
```

Get the amount of device memory currently in use.

> [!NOTE]
>
> Supported on all driver types.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `memory_usage` *\[out\]* — Pointer that receives the in-use memory, in bytes.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `memory_usage` is `NULL`, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetMemoryTotal

```cpp
mbltmlStatusCode_t mbltmlGetMemoryTotal(mbltmlTargetDeviceType_t tdt, int dev_no, int64_t *memory_total)
```

Get the total amount of device memory available.

> [!NOTE]
>
> Supported on all driver types.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `memory_total` *\[out\]* — Pointer that receives the total memory, in bytes.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `memory_total` is `NULL`, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetProcessInfos

```cpp
mbltmlStatusCode_t mbltmlGetProcessInfos(mbltmlTargetDeviceType_t tdt, int dev_no, mbltmlProcessInfo_t *infos, unsigned int *info_count)
```

Get per-process usage information for a device.

> [!NOTE]
>
> Supported on all driver types.

This call supports the standard two-step query pattern:

- Pass `*info_count` == `0` (with `infos` either `NULL` or unused) to learn the required entry count, which is written back to `info_count`.
- Pass a buffer with `*info_count` set to its capacity to retrieve up to that many entries; the actual entry count is written back to `info_count`.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `infos` *\[out\]* — Output array that receives the process records. May be `NULL` when `*info_count` is `0`.
- `info_count` *\[in,out\]* — On input, the capacity of `infos` in entries (or `0` to query the required size). On output, the number of entries written or required.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `info_count` is `NULL`, or if `infos` is `NULL` while `*info_count` is non-zero, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, [MBLTML\_INSUFFICIENT\_LENGTH](<#mbltmlstatuscode-t>) if `infos` is too small to hold all entries, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlGetCoreInfos

```cpp
mbltmlStatusCode_t mbltmlGetCoreInfos(mbltmlTargetDeviceType_t tdt, int dev_no, mbltmlCoreInfo_t *infos, unsigned int *info_count)
```

Get per-core usage information for a device.

> [!NOTE]
>
> Supported on all driver types.

The two-step query pattern documented in [mbltmlGetProcessInfos()](<#mbltmlgetprocessinfos>) applies.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `infos` *\[out\]* — Output array that receives the core records. May be `NULL` when `*info_count` is `0`.
- `info_count` *\[in,out\]* — On input, the capacity of `infos` in entries (or `0` to query the required size). On output, the number of entries written or required.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `info_count` is `NULL`, or if `infos` is `NULL` while `*info_count` is non-zero, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, [MBLTML\_INSUFFICIENT\_LENGTH](<#mbltmlstatuscode-t>) if `infos` is too small to hold all entries, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.

### mbltmlSetExtraPmicID

```cpp
mbltmlStatusCode_t mbltmlSetExtraPmicID(mbltmlTargetDeviceType_t tdt, int dev_no, mbltmlExtraPmicId_t pmic_id)
```

Select which extra PMIC rail subsequent mbltmlGetExtraPmic\*() queries refer to.

> [!NOTE]
>
> Supported on aries-rb device ([MBLTML\_TARGET\_DEVICE\_ARIES\_RB](<#mbltmltargetdevicetype-t>)) only.

The underlying readings are refreshed by firmware once per second; allow up to 1 second after this call before [mbltmlGetExtraPmicPower()](<#mbltmlgetextrapmicpower>), [mbltmlGetExtraPmicCurrent()](<#mbltmlgetextrapmiccurrent>) and [mbltmlGetExtraPmicVoltage()](<#mbltmlgetextrapmicvoltage>) reflect the newly selected rail.

**Parameters**

- `tdt` *\[in\]* — Target device type of the device.
- `dev_no` *\[in\]* — Device index within `tdt`. See [mbltmlGetTargetDeviceCount()](<#mbltmlgettargetdevicecount>) for the count.
- `pmic_id` *\[in\]* — Identifier of the extra PMIC rail to select.

**Returns**

[MBLTML\_SUCCESS](<#mbltmlstatuscode-t>) on success, [MBLTML\_INVALID\_ARGUMENT](<#mbltmlstatuscode-t>) if `dev_no` is out of range of the `tdt` device count, [MBLTML\_DEVICE\_NOT\_FOUND](<#mbltmlstatuscode-t>) if no device of `tdt` is detected, or another [mbltmlStatusCode\_t](<#mbltmlstatuscode-t>) error code on failure.
