capi.h Source File

capi.h Source File#

mbltml: capi.h Source File
mbltml v1.5
mbltml — EN
capi.h
Go to the documentation of this file.
1// Copyright ⓒ 2019- Mobilint, Inc. All rights reserved.
5
6#ifndef MOBILINT_MBLTML_CAPI_H_
7#define MOBILINT_MBLTML_CAPI_H_
8
9#include "mbltml/export.h"
10#include "mbltml/type.h"
11
16
18#define MBLTML_DRIVER_VERSION_BUFFER_SIZE 80
20#define MBLTML_ON_DEVICE_DRIVER_VERSION_BUFFER_SIZE 80
22#define MBLTML_FIRMWARE_VERSION_BUFFER_SIZE 80
24#define MBLTML_NODE_NAME_BUFFER_SIZE 80
26#define MBLTML_PCIE_SLOT_BUFFER_SIZE 80
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32/* ------------------------------------------------------------------------- */
33/* Initialization / CleanUp APIs */
34/* ------------------------------------------------------------------------- */
35
43
54
55/* ------------------------------------------------------------------------- */
56/* System-Wide Monitor APIs */
57/* ------------------------------------------------------------------------- */
58
78MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetDeviceCount(unsigned int* counts);
79
94 unsigned int* counts);
95
115 char* version,
116 unsigned int length);
117
131 uint32_t* revision);
132
133/* ------------------------------------------------------------------------- */
134/* Device-Wise Monitor APIs */
135/* ------------------------------------------------------------------------- */
136
161 int dev_no, char* name,
162 unsigned int length);
163
182 int dev_no,
183 mbltmlDriverType_t* driver_type);
184
209 mbltmlTargetDeviceType_t tdt, int dev_no, char* version, unsigned int length);
210
229 mbltmlTargetDeviceType_t tdt, int dev_no, uint32_t* revision);
230
255 int dev_no, char* version,
256 unsigned int length);
257
276 int dev_no,
277 uint32_t* revision);
278
297 int dev_no, uint32_t* crc);
298
317 int dev_no, int* temperature);
318
340 mbltmlTargetDeviceType_t tdt, int dev_no, int* temperature);
341
361 int* chip_id);
362
381 int dev_no, uint32_t* signal_type);
382
401 int dev_no, uint32_t* clock);
402
421 int dev_no, uint32_t* clock);
422
441 int dev_no, int* fan_duty);
442
461 int dev_no, uint32_t* vendor_id);
462
481 int dev_no, uint32_t* device_id);
482
501 int dev_no,
502 uint32_t* sub_vendor_id);
503
522 int dev_no,
523 uint32_t* sub_device_id);
524
543 int dev_no, uint32_t* pcie_gen);
544
563 int dev_no, uint32_t* pcie_lanes);
564
583 int dev_no, uint32_t* pcie_rev);
584
603 int dev_no,
604 uint32_t* pcie_class_code);
605
633 int dev_no, char* pcie_slot,
634 unsigned int length);
635
654 int dev_no, double* power);
655
674 int dev_no, double* current);
675
694 int dev_no, double* voltage);
695
722 int dev_no, double* power);
723
747 int dev_no, double* current);
748
772 int dev_no, double* voltage);
773
793 int dev_no,
794 mbltmlExtraPmicId_t* pmic_id);
795
815 int dev_no,
816 double* utilization);
817
836 int dev_no, int64_t* memory_usage);
837
856 int dev_no, int64_t* memory_total);
857
890 int dev_no,
891 mbltmlProcessInfo_t* infos,
892 unsigned int* info_count);
893
921 int dev_no, mbltmlCoreInfo_t* infos,
922 unsigned int* info_count);
923
924/* ------------------------------------------------------------------------- */
925/* Device-Wise Control APIs */
926/* ------------------------------------------------------------------------- */
927
951 int dev_no,
952 mbltmlExtraPmicId_t pmic_id);
953
954#ifdef __cplusplus
955}
956#endif
957
959
960#endif // MOBILINT_MBLTML_CAPI_H_
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetPcieClassCode(mbltmlTargetDeviceType_t tdt, int dev_no, uint32_t *pcie_class_code)
Get the PCIe configuration-space class code of a device.
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetSubVendorId(mbltmlTargetDeviceType_t tdt, int dev_no, uint32_t *sub_vendor_id)
Get the PCIe subsystem vendor ID of a device.
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetBusClock(mbltmlTargetDeviceType_t tdt, int dev_no, uint32_t *clock)
Get the current bus clock frequency of a device.
mbltmlTargetDeviceType_t
Specific target device type of a Mobilint NPU.
Definition type.h:43
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetSignalType(mbltmlTargetDeviceType_t tdt, int dev_no, uint32_t *signal_type)
Get the current signal-type indicator reported by the device.
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetNodeName(mbltmlTargetDeviceType_t tdt, int dev_no, char *name, unsigned int length)
Get the node name of a device.
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetDriverVersion(mbltmlDriverType_t dt, char *version, unsigned int length)
Get the driver version string for a specific driver.
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetTotalUtilization(mbltmlTargetDeviceType_t tdt, int dev_no, double *utilization)
Get the overall NPU utilization of a device.
MBLTML_EXPORT mbltmlStatusCode_t mbltmlShutdown()
Release all resources held by the mbltml library.
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetPcieSlot(mbltmlTargetDeviceType_t tdt, int dev_no, char *pcie_slot, unsigned int length)
Get the PCIe slot location of a device.
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetSubDeviceId(mbltmlTargetDeviceType_t tdt, int dev_no, uint32_t *sub_device_id)
Get the PCIe subsystem device ID of a device.
MBLTML_EXPORT 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).
MBLTML_EXPORT mbltmlStatusCode_t mbltmlInit()
Initialize the mbltml library.
MBLTML_EXPORT mbltmlStatusCode_t mbltmlSetExtraPmicID(mbltmlTargetDeviceType_t tdt, int dev_no, mbltmlExtraPmicId_t pmic_id)
Select which extra PMIC rail subsequent mbltmlGetExtraPmic*() queries refer to.
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetTotalPower(mbltmlTargetDeviceType_t tdt, int dev_no, double *power)
Get the total instantaneous power consumption of a device.
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetDeviceCount(unsigned int *counts)
Get the total number of devices detected by the library.
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetMemoryUsage(mbltmlTargetDeviceType_t tdt, int dev_no, int64_t *memory_usage)
Get the amount of device memory currently in use.
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetTargetDeviceCount(mbltmlTargetDeviceType_t tdt, unsigned int *counts)
Get the number of detected devices of a specific target device type.
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetPcieGen(mbltmlTargetDeviceType_t tdt, int dev_no, uint32_t *pcie_gen)
Get the negotiated PCIe link generation of a device.
MBLTML_EXPORT 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).
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetTotalCurrent(mbltmlTargetDeviceType_t tdt, int dev_no, double *current)
Get the total instantaneous current draw of a device.
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetOnDeviceDriverVersion(mbltmlTargetDeviceType_t tdt, int dev_no, char *version, unsigned int length)
Get the on-device driver version string of a device.
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetTotalVoltage(mbltmlTargetDeviceType_t tdt, int dev_no, double *voltage)
Get the total instantaneous supply voltage of a device.
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetChipId(mbltmlTargetDeviceType_t tdt, int dev_no, int *chip_id)
Get the chip ID of a device.
MBLTML_EXPORT 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).
mbltmlDriverType_t
Identifier of a Mobilint NPU driver.
Definition type.h:33
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetOnDeviceDriverRevision(mbltmlTargetDeviceType_t tdt, int dev_no, uint32_t *revision)
Get the on-device driver revision number of a device.
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetPcieRev(mbltmlTargetDeviceType_t tdt, int dev_no, uint32_t *pcie_rev)
Get the PCIe configuration-space revision ID of a device.
mbltmlStatusCode_t
Status code returned by mbltml APIs.
Definition type.h:56
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetCoreInfos(mbltmlTargetDeviceType_t tdt, int dev_no, mbltmlCoreInfo_t *infos, unsigned int *info_count)
Get per-core usage information for a device.
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetFirmwareCRC(mbltmlTargetDeviceType_t tdt, int dev_no, uint32_t *crc)
Get the CRC of the currently-loaded firmware image.
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetFanDuty(mbltmlTargetDeviceType_t tdt, int dev_no, int *fan_duty)
Get the current cooling-fan duty cycle of a device.
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetTemperature(mbltmlTargetDeviceType_t tdt, int dev_no, int *temperature)
Get the current die temperature of a device.
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetVendorId(mbltmlTargetDeviceType_t tdt, int dev_no, uint32_t *vendor_id)
Get the PCIe vendor ID of a device.
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetDriverRevision(mbltmlDriverType_t dt, uint32_t *revision)
Get the driver revision number for a specific driver.
mbltmlExtraPmicId_t
Identifier of an extra PMIC rail.
Definition type.h:73
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetDeviceId(mbltmlTargetDeviceType_t tdt, int dev_no, uint32_t *device_id)
Get the PCIe device ID of a device.
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetFirmwareVersion(mbltmlTargetDeviceType_t tdt, int dev_no, char *version, unsigned int length)
Get the firmware version string of a device.
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetExtraPmicId(mbltmlTargetDeviceType_t tdt, int dev_no, mbltmlExtraPmicId_t *pmic_id)
Get the extra PMIC rail currently selected for the device.
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetPcieLanes(mbltmlTargetDeviceType_t tdt, int dev_no, uint32_t *pcie_lanes)
Get the negotiated PCIe link width (in lanes) of a device.
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetProcessInfos(mbltmlTargetDeviceType_t tdt, int dev_no, mbltmlProcessInfo_t *infos, unsigned int *info_count)
Get per-process usage information for a device.
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetNPUClock(mbltmlTargetDeviceType_t tdt, int dev_no, uint32_t *clock)
Get the current NPU clock frequency of a device.
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetDriverType(mbltmlTargetDeviceType_t tdt, int dev_no, mbltmlDriverType_t *driver_type)
Get the driver type of a device.
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetMemoryTotal(mbltmlTargetDeviceType_t tdt, int dev_no, int64_t *memory_total)
Get the total amount of device memory available.
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetPcieSwitchTemperature(mbltmlTargetDeviceType_t tdt, int dev_no, int *temperature)
Get the current temperature of the PCIe switch of a device.
MBLTML_EXPORT mbltmlStatusCode_t mbltmlGetFirmwareRevision(mbltmlTargetDeviceType_t tdt, int dev_no, uint32_t *revision)
Get the firmware revision number of a device.
Per-core usage record returned by mbltmlGetCoreInfos().
Definition type.h:115
Per-process usage record returned by mbltmlGetProcessInfos().
Definition type.h:128