Skip to content

File RailMonitor.h

FileList > Firmware > Libraries > PowerMonitor > RailMonitor.h

Go to the source code of this file

PDU monitoring node — one supply rail: condition flags, window statistics, page packing (#216). More...

  • #include <stdint.h>
  • #include <NodeStatus.h>
  • #include <CANProtocol.h>

Namespaces

Type Name
namespace OpenSkyhawk
Thin wrapper over Adafruit_ADS1115; see ADS1115.h .
namespace Pdu

Classes

Type Name
struct Latch
A condition that must hold setMs to raise and its clear condition holdclearMs to drop.
class RailMonitor
struct Config
Per-rail limits.

Detailed Description

Fed one converted sample per scan (rail mV, current mA). Keeps: * condition flags (PduRailFlag) with set persistence, clear persistence and hysteresis, so a brief blip neither raises nor drops a flag; * window statistics for its PDU_RAIL_* page — average + minimum voltage, average current — reset each time the page is sent periodically; * the peak current for the PDU_STATUS page, reset each time that page is sent periodically. It is a FaultSource, so its worst condition reaches HEALTH_n.faultId through aggregateFaults().

Hardware-free: the caller converts ADC counts (PduMath) and supplies the clock, so the logic is tested with injected values.

Note:

Static lifetime only (FaultSource registry rule) — construct as a global.

Copyright:

GPL-2.0-only — see Firmware/LICENSE


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