DeterministicESPAsyncWebServer v6.28.0
Zero-allocation, bounded-execution async HTTP server for ESP32
Loading...
Searching...
No Matches
hw_health.h File Reference

Hardware-health diagnostics: rail droop, SPI CRC backoff, GPIO short, cap leakage (DETWS_ENABLE_HW_HEALTH). More...

#include "ServerConfig.h"
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Detailed Description

Hardware-health diagnostics: rail droop, SPI CRC backoff, GPIO short, cap leakage (DETWS_ENABLE_HW_HEALTH).

Four pure decision cores an app feeds with samples it reads from the hardware (ADC millivolts, a SPI CRC pass/fail, a driven-vs-readback GPIO level, a capacitor decay time). Each turns raw measurements into an actionable verdict for a "/health" panel or a fail-safe hook, without touching a peripheral itself:

  • Power-rail voltage-drop logger: track a rail's worst droop and count sag / brownout crossings.
  • SPI-bus CRC audit + clock backoff: a hysteretic state machine that halves the SPI clock after a run of CRC failures and steps it back up after a run of good transfers.
  • GPIO short-circuit test: compare a driven level to its readback to spot a short to ground / Vcc.
  • Capacitor-leakage diag: compare a measured RC decay time to the expected one to spot a leaky cap (too fast) or a high-ESR / open path (too slow).

Pure, zero heap, no stdlib, host-testable.

Definition in file hw_health.h.