File PduNode.h
FileList > Firmware > Libraries > PowerMonitor > PduNode.h
Go to the source code of this file
PDU monitoring node — the whole node in two calls (#216). More...
#include <stdint.h>#include <STM32Board.h>#include <CANProtocol.h>#include "RailMonitor.h"#include "BoardThermal.h"#include "PduCalStore.h"
Namespaces
| Type | Name |
|---|---|
| namespace | PduNode |
Detailed Description
A PDU sketch is just:
#include <PduNode.h>
void setup() { STM32Board::setDebug(true); PduNode::setup(); }
void loop() { PduNode::loop(); }
-DNODE_ID=N in platformio.ini. What runs:
* Node status — HB_n / HEALTH_n (board kind PDU, #344) / master-loss watchdog via CANProtocol::serviceNodeStatus(). Rail and thermal faults reach HEALTH_n.faultId through the FaultSource registry.
* Sampling — the four rail channels every PDU_SAMPLE_US (1 kHz target); the NTC and Vrefint every 100 ms. Faults are held clear for PDU_BOOT_BLANK_MS after boot.
* Telemetry — one TELEM_n frame per second, rotating PDU_RAIL_12V → PDU_RAIL_5V → PDU_STATUS; a page whose flags change goes out at once (≤ 1 per 100 ms per page); SYNC_REQ sends all three pages immediately.
* Calibration — DiagSerial (115200) commands, one per line: CAL SHOW · CAL VDDA <mV> (DMM reading of the 3V3 rail) · CAL ZERO (no load connected) · CAL CLEAR · RAW (live readings + scan rate). Stored per board in the reserved flash page (PduCalStore).
Rail faults are reported to the host only (TELEM_n flags + HEALTH_n.faultId). The status LEDs follow every other node — CAN / link state plus the master-loss WARNING — and don't change for rail faults (FirmwarePlan D14). The board's power LEDs (D3 12 V / D4 5 V / D5 3V3) are passive, wired to their rails, and show rail presence only — this firmware never drives them.
Copyright:
GPL-2.0-only — see Firmware/LICENSE
The documentation for this class was generated from the following file Firmware/Libraries/PowerMonitor/PduNode.h