Skip to content

Class OpenSkyhawk::RailMonitor

ClassList > OpenSkyhawk > RailMonitor

  • #include <RailMonitor.h>

Inherits the following classes: OpenSkyhawk::FaultSource

Classes

Type Name
struct Config
Per-rail limits.

Public Functions

Type Name
RailMonitor (const Config & cfg)
TelemPayload buildPage (bool resetWindow)
Build this rail's PDU_RAIL_* page from the current window.
virtual NodeFaultCode faultCode () override const
Current fault code ( NodeFaultCode::NONE when healthy). Cheap/const, cached state only.
virtual const char * faultDetail () override const
Human-readable fault detail for the local DiagSerial tap only — never on the wire.
uint8_t flags () const
Current PduRailFlag bits (all zero = healthy).
int32_t lastMa () const
Last converted current, mA — DiagSerial / bring-up.
uint16_t lastMv () const
Last converted voltage, mV — DiagSerial / bring-up.
uint16_t peakMa () const
Peak current since the last reset, mA (≥ 0).
void resetPeak ()
Restart the peak — called when the PDU_STATUS page is sent periodically.
void sample (uint16_t vMv, int32_t iMa, bool vRailed, uint32_t nowMs, bool armed)
Feed one scan.

Public Functions inherited from OpenSkyhawk::FaultSource

See OpenSkyhawk::FaultSource

Type Name
virtual NodeFaultCode faultCode () const
Current fault code ( NodeFaultCode::NONE when healthy). Cheap/const, cached state only.
virtual const char * faultDetail () const
Human-readable fault detail for the local DiagSerial tap only — never on the wire.
FaultSource * next () const
Next fault source; nullptr at end.

Public Static Functions inherited from OpenSkyhawk::FaultSource

See OpenSkyhawk::FaultSource

Type Name
FaultSource * head ()
Head of the self-registered fault-source list.

Protected Functions inherited from OpenSkyhawk::FaultSource

See OpenSkyhawk::FaultSource

Type Name
FaultSource ()
Registers this instance into the list.
~FaultSource () = default
Protected, non-virtual: a base/mixin, never deleted through this type.

Public Functions Documentation

function RailMonitor

explicit OpenSkyhawk::RailMonitor::RailMonitor (
    const Config & cfg
) 

function buildPage

Build this rail's PDU_RAIL_* page from the current window.

TelemPayload OpenSkyhawk::RailMonitor::buildPage (
    bool resetWindow
) 

Parameters:

  • resetWindow true for the periodic send (window restarts); false for an edge send.

function faultCode

Current fault code ( NodeFaultCode::NONE when healthy). Cheap/const, cached state only.

virtual NodeFaultCode OpenSkyhawk::RailMonitor::faultCode () override const

Implements OpenSkyhawk::FaultSource::faultCode


function faultDetail

Human-readable fault detail for the local DiagSerial tap only — never on the wire.

virtual const char * OpenSkyhawk::RailMonitor::faultDetail () override const

Implements OpenSkyhawk::FaultSource::faultDetail


function flags

Current PduRailFlag bits (all zero = healthy).

uint8_t OpenSkyhawk::RailMonitor::flags () const


function lastMa

Last converted current, mA — DiagSerial / bring-up.

inline int32_t OpenSkyhawk::RailMonitor::lastMa () const


function lastMv

Last converted voltage, mV — DiagSerial / bring-up.

inline uint16_t OpenSkyhawk::RailMonitor::lastMv () const


function peakMa

Peak current since the last reset, mA (≥ 0).

inline uint16_t OpenSkyhawk::RailMonitor::peakMa () const


function resetPeak

Restart the peak — called when the PDU_STATUS page is sent periodically.

inline void OpenSkyhawk::RailMonitor::resetPeak () 


function sample

Feed one scan.

void OpenSkyhawk::RailMonitor::sample (
    uint16_t vMv,
    int32_t iMa,
    bool vRailed,
    uint32_t nowMs,
    bool armed
) 

Parameters:

  • vMv Rail voltage, mV.
  • iMa Rail current, mA (signed — residual offset may read slightly negative).
  • vRailed Voltage channel at the top of the ADC range (can't measure).
  • nowMs millis().
  • armed false during the power-up blanking window: statistics accumulate but every flag is held clear (rail ramp + inrush would otherwise trip UV / OC).


The documentation for this class was generated from the following file Firmware/Libraries/PowerMonitor/RailMonitor.h