PF1550 Driver
API reference
Loading...
Searching...
No Matches
Classes | Namespaces | Enumerations | Functions
pf1550_diagnostics.hpp File Reference

PF1550 diagnostic / fault-classification types and snapshot containers. More...

#include <cstddef>
#include <cstdint>
#include "pf1550_registers.hpp"
Include dependency graph for pf1550_diagnostics.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  pf1550::FaultFlags
 Bitset of latched fault flags. More...
 
struct  pf1550::RailDiagnostics
 Per-rail status snapshot (latched + live + control byte). More...
 
struct  pf1550::DiagnosticSnapshot
 Full diagnostic snapshot returned by PF1550::ReadDiagnosticSnapshot(). More...
 
struct  pf1550::SelfTestResult
 Result of a power self-test pass. More...
 

Namespaces

namespace  pf1550
 

Enumerations

enum class  pf1550::RailId : uint8_t {
  pf1550::Sw1 = 0 , pf1550::Sw2 = 1 , pf1550::Sw3 = 2 , pf1550::Ldo1 = 3 ,
  pf1550::Ldo2 = 4 , pf1550::Ldo3 = 5 , pf1550::Vsnvs = 6 , pf1550::COUNT = 7
}
 Logical identifier for each independently-controllable PF1550 output. More...
 
enum class  pf1550::FaultSeverity : uint8_t { pf1550::kInfo = 0 , pf1550::kWarning = 1 , pf1550::kCritical = 2 , pf1550::kMcuKill = 3 }
 Severity classification for a fault. More...
 

Functions

constexpr RailId pf1550::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.
 
constexpr FaultSeverity pf1550::FaultSeverityPortentaH7 (uint32_t single_flag) noexcept
 Classify the severity of a Portenta H7 eval fault.
 
constexpr FaultSeverity pf1550::WorstSeverityPortentaH7 (FaultFlags fl) noexcept
 Return the worst-case severity across an aggregated bitmask.
 
constexpr const char * pf1550::RailName (RailId id) noexcept
 Human-readable rail label ("SW1", "LDO2", …).
 
constexpr const char * pf1550::PmicStateName (PmicState s) noexcept
 Human-readable name for a PmicState enumerator.
 
constexpr const char * pf1550::ChargerStateName (ChargerState s) noexcept
 Human-readable name for a ChargerState enumerator.
 
constexpr const char * pf1550::FaultSeverityName (FaultSeverity s) noexcept
 Human-readable name for a FaultSeverity.
 

Detailed Description

PF1550 diagnostic / fault-classification types and snapshot containers.

These POD types are exchanged between the low-level driver and HAL handlers / managers. They contain no I²C dependencies so they can be passed across cores, logged, or unit-tested on the host.

The PMIC reports faults via three orthogonal sources:

  1. INT_CATEGORY (0x06) — master summary of pending interrupt categories (CHG, SW1/2/3, LDO, ONKEY, TEMP, MISC).
  2. Per-category STAT registers — RW1C latched events (SW_INT_STAT0..2, LDO_INT_STAT0, TEMP_INT_STAT0, …).
  3. Per-category SENSE registers — read-only live state used to differentiate a transient event from an ongoing condition.

The diagnostics snapshot in this file captures all three so a host can decide between latched warning, ongoing fault, and MCU-power-affecting fault without re-reading the bus.

Host fault mapping
Downstream products that reuse this driver must keep their own traceability table in sync when adding or removing a flag here.