These files define constants (for
example, nominal voltage/frequency, sample rates), preprocessor macros for feature
enablement (for example, HARMONICS_SUPPORT, NEUTRAL_MONITOR_SUPPORT), and the critical
data structures that hold all metrology-related information.
metrologyData: The top-level
global structure, an instance of which holds all data for all phases, neutral, totals, and
system status.
phaseMetrology / neutralMetrology:
Structures within metrology data containing parameters (params) and readings (readings)
for each phase and the neutral line.
params: Stores configuration,
intermediate accumulations from background (like dotProd arrays), calibration-derived
values, and state variables (for example, for PLL, sag/swell).
readings: Stores the final calculated
metrology values (RMS, power, PF, and so on).
calibrationData
(metrology_nv_structs.h): Holds the calibration coefficients.