LMA
Lightweight Metrology for AC
Loading...
Searching...
No Matches
Callbacks

Description

LMA Interrupt Callbacks

The LMA Callbacks are the foundation of LMA's operation, these callbacks are installed in the appropraite interrupts service routines (ISR's) and invoke LMA's core operation.

Functions

void LMA_CB_ADC (void)
 ADC CALLBACK - Processes the ADC samples according to the number of phases registered.
void LMA_CB_TMR (void)
 TMR CALLBACK - 10ms periodic timer - processes the accumulated ADC values as accumulated by the ADC CB and computes the measured parameters.
void LMA_CB_RTC (void)
 RTC CALLBACK - Process periodic rtc interrupt.

Function Documentation

◆ LMA_CB_ADC()

void LMA_CB_ADC ( void )

ADC CALLBACK - Processes the ADC samples according to the number of phases registered.

The ADC Callback handles:

  1. Sample processing and accumulation.
  2. Energy Impulse Management.

It does not update the measured parameters - this is done in the TMR callback.

Here is the call graph for this function:

◆ LMA_CB_TMR()

void LMA_CB_TMR ( void )

TMR CALLBACK - 10ms periodic timer - processes the accumulated ADC values as accumulated by the ADC CB and computes the measured parameters.

The TMR Callback computes and updates:

  1. Energy consumption in units (how much energy is consumed in Ws/VARs/VAs per ADC interval)
  2. Power
  3. Voltage
  4. Current
  5. Frequency

For each phase.

◆ LMA_CB_RTC()

void LMA_CB_RTC ( void )

RTC CALLBACK - Process periodic rtc interrupt.

The RTC isr calling this should ideally have nested interrupts enabled in which the ADC can interrupt us. This callback allows us to calibrate sampling frequency.

Here is the call graph for this function: