SDAA201 January 2026 MSPM0C1104
The metrology computation engine performs the actual sampling and computation based on the information collected from the voltage and current ADC channels. The engine acts in a time-critical background process and a less time-critical foreground process.
The background process is triggered by the ADC at the sample rate. This process runs in the interrupt services routine of the ADC and is processed automatically.
The foreground process is triggered by the completion of background process at the reporting and update rate. The background process sets the flag HAL_ADC_PHASE_A_DATA_READY
in the variable phaseDataReady to indicate that data is ready to be processed by the foreground. The application then needs to monitor this flag to trigger the foreground process by calling to EM_processForegroundData(). In the actual computation, use the following formulas in the metrology computation