LMA
Lightweight Metrology for AC
Loading...
Searching...
No Matches
LMA_Core.h
1
7
8#ifndef _LMA_CORE_H
9#define _LMA_CORE_H
10
11#include "LMA_Port.h"
12
19
26
30void LMA_Init(LMA_Config *const p_config_arg);
31
36void LMA_Deinit(void);
37
45void LMA_PhaseRegister(LMA_Phase *const p_phase);
46
52void LMA_NeutralRegister(LMA_Phase *const p_phase, LMA_Neutral *const p_neutral);
53
66void LMA_ComputationHookRegister(LMA_Phase *const p_phase, float (*comp_hook)(float *i, float *v, float *f));
67
71void LMA_GlobalLoadCalibration(const LMA_GlobalCalibration *const p_calib);
72
77void LMA_PhaseLoadCalibration(LMA_Phase *const p_phase, const LMA_PhaseCalibration *const p_calib);
78
83void LMA_NeutralLoadCalibration(LMA_Neutral *const p_neutral, const LMA_NeutralCalibration *const p_calib);
84
88void LMA_Start(void);
89
93void LMA_Stop(void);
94
104void LMA_PhaseCalibrate(LMA_PhaseCalibArgs *const calib_args);
105
109void LMA_GlobalCalibrate(LMA_GlobalCalibArgs *const calib_args);
110
114void LMA_EnergySet(LMA_SystemEnergy *const p_energy);
115
119void LMA_EnergyGet(LMA_SystemEnergy *const p_energy);
120
125LMA_Status LMA_StatusGet(const LMA_Phase *const p_phase);
126
128
134
139void LMA_MeasurementsGet(LMA_Phase *const p_phase, LMA_Measurements *const p_measurements);
140
146void LMA_ConsumptionDataGet(const LMA_SystemEnergy *const p_se, LMA_ConsumptionData *const p_ec);
147
152bool LMA_MeasurementsReady(LMA_Phase *const p_phase);
153
155
157
164
167void LMA_CB_ADC(void);
168
172void LMA_CB_TMR(void);
173
176void LMA_CB_RTC(void);
177
179
180#endif /* _LMA_CORE_H */
Porting file declarations for the LMA codebase.
void LMA_CB_ADC(void)
ADC CALLBACK - Processes the ADC samples according to the number of phases registered.
Definition LMA_Core.c:572
void LMA_CB_RTC(void)
RTC CALLBACK - Process periodic rtc interrupt.
Definition LMA_Core.c:952
void LMA_CB_TMR(void)
TMR CALLBACK - 10ms periodic timer - processes the accumulated ADC values as accumulated by the ADC C...
Definition LMA_Core.c:785
void LMA_Start(void)
Starts LMA Operation.
Definition LMA_Core.c:347
void LMA_EnergySet(LMA_SystemEnergy *const p_energy)
Sets the energy data.
Definition LMA_Core.c:476
void LMA_PhaseCalibrate(LMA_PhaseCalibArgs *const calib_args)
Performs a calibration command according to the flags passed.
Definition LMA_Core.c:371
void LMA_ComputationHookRegister(LMA_Phase *const p_phase, float(*comp_hook)(float *i, float *v, float *f))
Registers a hook to be called during parameter computations.
Definition LMA_Core.c:327
void LMA_Init(LMA_Config *const p_config_arg)
Initalises the Light-Weight Metrology for AC Framework according to the config.
Definition LMA_Core.c:262
void LMA_Stop(void)
Stops LMA Operation.
Definition LMA_Core.c:364
void LMA_NeutralLoadCalibration(LMA_Neutral *const p_neutral, const LMA_NeutralCalibration *const p_calib)
Loads calibration data to a neutral.
Definition LMA_Core.c:342
void LMA_PhaseRegister(LMA_Phase *const p_phase)
Registers a phase to the library.
Definition LMA_Core.c:295
void LMA_NeutralRegister(LMA_Phase *const p_phase, LMA_Neutral *const p_neutral)
Registers the systems neutral line to the library (if used)
Definition LMA_Core.c:319
void LMA_GlobalLoadCalibration(const LMA_GlobalCalibration *const p_calib)
Loads calibration data to a system (and config).
Definition LMA_Core.c:332
void LMA_EnergyGet(LMA_SystemEnergy *const p_energy)
Gets the energy data.
Definition LMA_Core.c:484
LMA_Status LMA_StatusGet(const LMA_Phase *const p_phase)
Gets copy of the current phase status using critical secrtions.
Definition LMA_Core.c:492
void LMA_PhaseLoadCalibration(LMA_Phase *const p_phase, const LMA_PhaseCalibration *const p_calib)
Loads calibration data to a phase.
Definition LMA_Core.c:337
void LMA_Deinit(void)
Deinitialises LMA.
Definition LMA_Core.c:273
void LMA_GlobalCalibrate(LMA_GlobalCalibArgs *const calib_args)
Performs a calibration command according to the flags passed.
Definition LMA_Core.c:440
void LMA_MeasurementsGet(LMA_Phase *const p_phase, LMA_Measurements *const p_measurements)
Outputs current snap shot of measurement set.
Definition LMA_Core.c:504
void LMA_ConsumptionDataGet(const LMA_SystemEnergy *const p_se, LMA_ConsumptionData *const p_ec)
Converts current snap shot of energy consumed by the meter in Wh.
Definition LMA_Core.c:529
bool LMA_MeasurementsReady(LMA_Phase *const p_phase)
Checks whether measurements are ready.
Definition LMA_Core.c:553
LMA_Status
Phase status.
Definition LMA_Types.h:54
Runtime LMA Configuration.
Definition LMA_Types.h:396
Energy computation data.
Definition LMA_Types.h:158
Calibration arguments (global)
Definition LMA_Types.h:385
Global/System calibration data.
Definition LMA_Types.h:199
Measurement output.
Definition LMA_Types.h:143
Neutral calibration data.
Definition LMA_Types.h:222
Neutral data.
Definition LMA_Types.h:260
Calibration arguments (per phase)
Definition LMA_Types.h:373
Phase calibration data.
Definition LMA_Types.h:210
Phase data.
Definition LMA_Types.h:271
Energy data.
Definition LMA_Types.h:304