83 static constexpr uint32_t
kSw1Ls = 1u << 0;
84 static constexpr uint32_t
kSw1Hs = 1u << 1;
85 static constexpr uint32_t
kSw2Ls = 1u << 2;
86 static constexpr uint32_t
kSw2Hs = 1u << 3;
87 static constexpr uint32_t
kSw3Ls = 1u << 4;
88 static constexpr uint32_t
kSw3Hs = 1u << 5;
100 static constexpr uint32_t
kPwrOn = 1u << 16;
115 [[nodiscard]]
constexpr bool Any() const noexcept {
return value != 0; }
116 [[nodiscard]]
constexpr bool Has(uint32_t mask)
const noexcept {
return (
value & mask) != 0; }
117 constexpr void Set(uint32_t mask)
noexcept {
value |= mask; }
118 constexpr void Clear(uint32_t mask)
noexcept {
value &= ~mask; }
194 switch (single_flag) {
242 for (uint32_t bit = 0; bit < 32; ++bit) {
243 const uint32_t mask = 1u << bit;
244 if ((fl.value & mask) == 0)
continue;
246 if (
static_cast<uint8_t
>(sev) >
static_cast<uint8_t
>(worst)) {
275 default:
return "Unknown";
293 default:
return "Unknown";
RailId
Logical identifier for each independently-controllable PF1550 output.
Definition pf1550_diagnostics.hpp:43
@ Ldo3
LDO3 — Portenta +1V2 (STM32 DSI, ETH PHY).
@ Sw2
SW2 / BUCK2 — Portenta +3V3 / carrier VOUT.
@ Sw3
SW3 / BUCK3 — Portenta +3V1 VCORE (MCU + QSPI).
@ Ldo2
LDO2 — Portenta +1V8 (USB PHY, MIPI).
@ Sw1
SW1 / BUCK1 — Portenta +3V1SW (feeds LDO inputs).
@ Vsnvs
VSNVS — RTC / backup LDO (≤2 mA).
@ Ldo1
LDO1 — Portenta +1V0 (MIPI bridge analog).
constexpr const char * ChargerStateName(ChargerState s) noexcept
Human-readable name for a ChargerState enumerator.
Definition pf1550_diagnostics.hpp:280
constexpr FaultSeverity FaultSeverityPortentaH7(uint32_t single_flag) noexcept
Classify the severity of a Portenta H7 eval fault.
Definition pf1550_diagnostics.hpp:193
constexpr RailId FaultRail(uint32_t single_flag) noexcept
Map a single fault flag to the rail it relates to, or RailId::COUNT if the fault is system-wide.
Definition pf1550_diagnostics.hpp:176
constexpr const char * PmicStateName(PmicState s) noexcept
Human-readable name for a PmicState enumerator.
Definition pf1550_diagnostics.hpp:268
constexpr const char * FaultSeverityName(FaultSeverity s) noexcept
Human-readable name for a FaultSeverity.
Definition pf1550_diagnostics.hpp:298
FaultSeverity
Severity classification for a fault.
Definition pf1550_diagnostics.hpp:65
PmicState
STATE_INFO[5:0] values (Reg 0x67) describing the PMIC state machine.
Definition pf1550_registers.hpp:226
@ Wait
Wait / start-up before regulators are sequenced.
@ RegsDisable
REGS_DISABLE — all regulators off (post PWRON long-press).
@ Sleep
SLEEP / LPSR — minimal regulators.
@ Standby
STANDBY — standby-enabled regulators only.
@ Run
RUN — all OTP-sequenced regulators enabled.
ChargerState
CHG_SNS[3:0] values (Reg 0x87) describing the charger sub-state.
Definition pf1550_registers.hpp:236
@ LinearOnly
Linear-only mode, no charge.
@ TempShutdown
Off because TJ > TSHDN.
@ FastCC
Fast-charge constant-current.
@ ThermSuspend
Thermistor suspend.
@ PreCharge
Precharge mode (V_BATT < V_PRECHG.LB).
@ EndOfCharge
End-of-charge (I_BAT = I_EOC).
@ Off
Input invalid or charger disabled.
@ BatteryOv
Battery overvoltage.
@ Done
Done — battery full.
@ FastCV
Fast-charge constant-voltage.
constexpr FaultSeverity WorstSeverityPortentaH7(FaultFlags fl) noexcept
Return the worst-case severity across an aggregated bitmask.
Definition pf1550_diagnostics.hpp:240
constexpr const char * RailName(RailId id) noexcept
Human-readable rail label ("SW1", "LDO2", …).
Definition pf1550_diagnostics.hpp:254
NXP PF1550 family I2C register map, bit-field constants, and OTP keys.
Full diagnostic snapshot returned by PF1550::ReadDiagnosticSnapshot().
Definition pf1550_diagnostics.hpp:140
uint8_t state_info_reg
Reg 0x67 raw.
Definition pf1550_diagnostics.hpp:146
uint8_t otp_flavor
Reg 0x01 — 0x00 for A0EP.
Definition pf1550_diagnostics.hpp:144
uint8_t vbus_sns_reg
Reg 0x86.
Definition pf1550_diagnostics.hpp:150
uint16_t vbus_in_limit_ma
Decoded VBUS input current limit (mA).
Definition pf1550_diagnostics.hpp:151
uint8_t silicon_rev
Reg 0x02.
Definition pf1550_diagnostics.hpp:143
FaultFlags faults
Aggregated latched + sense conditions.
Definition pf1550_diagnostics.hpp:152
RailDiagnostics rails[static_cast< size_t >(RailId::COUNT)]
Definition pf1550_diagnostics.hpp:153
PmicState state
Decoded STATE_INFO[5:0].
Definition pf1550_diagnostics.hpp:147
ChargerState charger
Decoded CHG_SNS[3:0].
Definition pf1550_diagnostics.hpp:149
uint8_t device_id
Reg 0x00 — must equal 0x7C.
Definition pf1550_diagnostics.hpp:142
bool read_ok
All required I²C reads succeeded.
Definition pf1550_diagnostics.hpp:141
uint8_t int_category
Reg 0x06 — top-level interrupt summary.
Definition pf1550_diagnostics.hpp:145
uint8_t chg_sense_reg
Reg 0x87 raw.
Definition pf1550_diagnostics.hpp:148
Bitset of latched fault flags.
Definition pf1550_diagnostics.hpp:79
static constexpr uint32_t kBattOv
Definition pf1550_diagnostics.hpp:109
static constexpr uint32_t kTempShdn
THERM125I: die crossed 125 °C.
Definition pf1550_diagnostics.hpp:97
static constexpr uint32_t kLdo3Fault
Definition pf1550_diagnostics.hpp:93
static constexpr uint32_t kSw1Ls
Definition pf1550_diagnostics.hpp:83
static constexpr uint32_t kVbusInval
Definition pf1550_diagnostics.hpp:108
constexpr bool Any() const noexcept
Definition pf1550_diagnostics.hpp:115
static constexpr uint32_t kSw3Ls
Definition pf1550_diagnostics.hpp:87
static constexpr uint32_t kVsysLow
LOW_SYS_WARN_I: VSYS crossed LOW_SYS_WARN.
Definition pf1550_diagnostics.hpp:101
static constexpr uint32_t kChgFault
Definition pf1550_diagnostics.hpp:107
static constexpr uint32_t kTempWarn
THERM110I: die crossed 110 °C.
Definition pf1550_diagnostics.hpp:96
static constexpr uint32_t kLdo1Fault
Definition pf1550_diagnostics.hpp:91
constexpr void Set(uint32_t mask) noexcept
Definition pf1550_diagnostics.hpp:117
static constexpr uint32_t kLdo2Fault
Definition pf1550_diagnostics.hpp:92
static constexpr uint32_t kSw2Hs
Definition pf1550_diagnostics.hpp:86
uint32_t value
Definition pf1550_diagnostics.hpp:80
static constexpr uint32_t kPwrOn
PWRON_I: power-on button event.
Definition pf1550_diagnostics.hpp:100
static constexpr uint32_t kSw1Hs
Definition pf1550_diagnostics.hpp:84
constexpr bool Has(uint32_t mask) const noexcept
Definition pf1550_diagnostics.hpp:116
constexpr void Clear(uint32_t mask) noexcept
Definition pf1550_diagnostics.hpp:118
static constexpr uint32_t kI2cReadFail
Definition pf1550_diagnostics.hpp:112
static constexpr uint32_t kVsysOv
SYS_OVLO_I: VSYS crossed SYS_OVLO.
Definition pf1550_diagnostics.hpp:102
static constexpr uint32_t kI2cWriteFail
Definition pf1550_diagnostics.hpp:113
static constexpr uint32_t kSw3Hs
Definition pf1550_diagnostics.hpp:88
static constexpr uint32_t kWdiAssert
Never set: the PF1550 has no WDI interrupt bit.
Definition pf1550_diagnostics.hpp:103
static constexpr uint32_t kResetBmcu
Never set: the PF1550 has no RESETBMCU interrupt bit.
Definition pf1550_diagnostics.hpp:104
static constexpr uint32_t kSw2Ls
Definition pf1550_diagnostics.hpp:85
Per-rail status snapshot (latched + live + control byte).
Definition pf1550_diagnostics.hpp:124
uint8_t ctrl_reg
Raw SWn_CTRL, LDOn_CTRL or (VSNVS) VSNVS_CTRL byte.
Definition pf1550_diagnostics.hpp:125
bool sense_live
Live current-limit / fault sense bit set.
Definition pf1550_diagnostics.hpp:131
bool enabled_stby
STBY_EN bit set.
Definition pf1550_diagnostics.hpp:129
bool enabled_run
EN bit set.
Definition pf1550_diagnostics.hpp:128
uint16_t set_voltage_mv
Decoded target voltage in mV.
Definition pf1550_diagnostics.hpp:127
bool stat_latched
Any latched fault on this rail since last clear.
Definition pf1550_diagnostics.hpp:130
uint8_t volt_reg
Raw voltage register byte (RUN mode); 0 for VSNVS, which has none.
Definition pf1550_diagnostics.hpp:126
Result of a power self-test pass.
Definition pf1550_diagnostics.hpp:162
bool state_run
Definition pf1550_diagnostics.hpp:165
DiagnosticSnapshot snapshot
Definition pf1550_diagnostics.hpp:169
FaultFlags faults
Sticky fault snapshot at the time of test.
Definition pf1550_diagnostics.hpp:168
bool device_id_ok
Definition pf1550_diagnostics.hpp:164
bool all_rails_enabled
Definition pf1550_diagnostics.hpp:166
FaultSeverity worst_severity
Definition pf1550_diagnostics.hpp:167
bool ran
Definition pf1550_diagnostics.hpp:163