
Embedded Metering Library API
5.5.1.1.5 void metrology_init_analog_front_end_normal_mode (void)
Initialize the hardware of all metrology related ADC channels
Parameter: none
Return: none
5.5.1.1.6 void metrology_disable_analog_front_end (void)
Disable the hardware of all metrology related ADC channels
Parameter: none
Return: none
5.5.1.1.7 Procedure for Metrology Engine Initialization
1. metrology_init () - initialize uninitialized calibration parameter with default value
2. metrology_disable_analog_front_end () - prevent metrology ADCs from generating interrupt during
initialization
3. metrology_init_from_nv_data () – initialize dc filter
4. Do other setup operations that requires the ADC interrupt be disabled
5. metrology_switch_to_normal_mode () – switch to normal, initialize metrology related ADCs
5.5.1.2
Functions for Calculate and Reading the Readings
5.5.1.2.1 power_t calculate_phase_readings (void)
This function must be called by application explicitly when an indication is received to ensure correct
readings. This function performs the non-time critical metrology calculations with data collected in
background process. Upon returning all metrology reading is updated.
Parameter: none
Return: Active Power reading
5.5.1.2.2 power_t active_power (int ph)
Get the latest active power reading of phase ph
Parameter: ph = 1
Return: latest active power of phase ph
5.5.1.2.3 power_t reactive_power (int ph)
Returns the latest reactive power reading of phase ph. The returned value of this function is invalid when
the EVM is operating in dc measurement mode.
Parameter: ph = 1
Return: latest reactive power of phase ph
5.5.1.2.4 power_t apparent_power (int ph)
Returns the latest calculated apparent power reading of phase ph. The returned value of this function is
invalid when the EVM is operating in dc measurement mode.
Parameter: ph = 1
Return: latest apparent power of phase ph
38
Firmware and Embedded Metering Library API
SLAU587 – August 2014
Copyright © 2014, Texas Instruments Incorporated