Skip to main content

PowerTelemetry.h File

PMBus rail power telemetry. More...

Included Headers

#include <chrono> #include <cstdint> #include <memory> #include <string> #include <vector>

Namespaces Index

namespacesimaai
namespaceneat

Classes Index

structPowerRailConfig

Configuration for one PMBus rail exposed by a paged PMIC. More...

structPowerFieldReading

One scalar rail field read from a PMIC. More...

structPowerRailReading

Snapshot for one rail. More...

structPowerSnapshot

Point-in-time board power snapshot. More...

structPowerMonitorOptions

Options for a PowerMonitor. More...

structPowerFieldSummary

Summary statistics for one scalar rail field. More...

structPowerRailSummary

Summary statistics for one rail. More...

structPowerSummary

Aggregated power monitor result. More...

classPowerMonitor

Background SOM power sampler. More...

Description

PMBus rail power telemetry.

File Listing

The file content with the documentation metadata removed is:

1
6#pragma once
7
8#include <chrono>
9#include <cstdint>
10#include <memory>
11#include <string>
12#include <vector>
13
14namespace simaai::neat {
15
21 Auto,
24 Custom,
25};
26
36 std::string name;
37 int i2c_bus = 3;
38 std::uint8_t i2c_addr = 0;
39 std::uint8_t page = 0;
40 int vout_exponent = -8;
41 int iout_exponent = -6;
42 int pout_exponent = -5;
43};
44
50 bool available = false;
51 std::uint8_t raw = 0;
52 double value = 0.0;
53 std::string error;
54};
55
69};
70
76 std::chrono::steady_clock::time_point timestamp{};
77 std::vector<PowerRailReading> rails;
78 double total_watts = 0.0;
79 std::uint64_t rails_with_power = 0;
80};
81
87 bool enabled = false;
91 std::vector<PowerRailConfig>
93};
94
100 std::uint64_t samples = 0;
101 std::uint64_t errors = 0;
102 double avg = 0.0;
103 double min = 0.0;
104 double max = 0.0;
105};
106
116};
117
123 bool enabled = false;
124 std::uint64_t samples = 0;
125 double duration_seconds = 0.0;
126 double total_avg_watts = 0.0;
127 double total_min_watts = 0.0;
128 double total_max_watts = 0.0;
129 double energy_joules = 0.0;
130 std::vector<PowerRailSummary> rails;
131};
132
137std::vector<PowerRailConfig> default_modalix_som_power_rails();
138
146std::vector<PowerRailConfig> default_modalix_dvt_power_rails();
147
153
159
164std::vector<PowerRailConfig> power_rails_for_profile(PowerMonitorProfile profile);
165
171board_power_monitor_options(int sample_interval_ms = 100,
173
179
185
191
196std::string format_power_summary(const PowerSummary& summary);
197
202std::string power_summary_to_json(const PowerSummary& summary, int indent = 2);
203
213public:
214 explicit PowerMonitor(PowerMonitorOptions options = {});
216
217 PowerMonitor(const PowerMonitor&) = delete;
219
221 PowerMonitor& operator=(PowerMonitor&&) noexcept;
222
224 void start();
226 void stop();
232 bool running() const;
233
234private:
235 class Impl;
236 std::unique_ptr<Impl> impl_;
237};
238
239} // namespace simaai::neat

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.