no-OS
Loading...
Searching...
No Matches
powrms_data_processing.h File Reference

POWRMS data processing header for POWRMS project. More...

#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include "example.h"
Include dependency graph for powrms_data_processing.h:

Classes

struct  powrms_variables
 
struct  adc_data
 

Macros

#define VARIABLE_NUMBER   3
 
#define NUMERIC_LENGTH   6
 
#define INTEGER_NUMERIC_LENGTH   4
 
#define FLOATING_POINT_LENGTH   2
 
#define VARIABLE_NAMES   {"Fq:", "Zi:", "Zo:"}
 
#define PRECISION_SCALE_FACTOR   1000
 
#define PRECISION_RESOLUTION   (1.0 / PRECISION_SCALE_FACTOR)
 
#define FREQUENCY_RANGE_NR   11
 
#define PRECISION_ARRAY_SIZE   308
 
#define PRECISION_POINTS_FREQ   14
 
#define PRECISION_POINTS_FREQ_ALL   (2 * PRECISION_POINTS_FREQ)
 
#define TEMPERATURE_CORRECTION_COEFFS   3
 

Enumerations

enum  variable_names {
  SIGNAL_FREQUENCY ,
  INPUT_IMPEDANCE ,
  OUTPUT_IMPEDANCE ,
  NR_OF_INPUT_VARIABLES
}
 

Functions

void update_values_of_digit (struct powrms_variables *input_var, uint8_t increment_pos)
 Update the value of an input variable based on digit increment.
 
void update_values_from_new_value (struct powrms_variables *input_var, double new_value)
 Update the digits array based on a new value.
 
void sync_all_digits_from_values (void)
 Synchronize all input variables' digits arrays with their current values.
 
int calculate_power ()
 

Variables

uint8_t pointer_poz_x
 
uint8_t pointer_poz_y
 
struct powrms_variables input_variables [VARIABLE_NUMBER]
 
bool enter_pressed
 
uint32_t frequency_MHz_ranges [FREQUENCY_RANGE_NR]
 
volatile struct adc_data adc_data_input
 
int32_t use_eeprom_calibration_data
 
int32_t precision_values [PRECISION_ARRAY_SIZE]
 
int32_t precision_values_reverse [PRECISION_ARRAY_SIZE]
 
double temperature_precision_values [TEMPERATURE_CORRECTION_COEFFS *FREQUENCY_RANGE_NR]
 
int32_t temperature_compensation_value
 
double poly_5000MHz_intercept
 
double poly_5000MHz_c_x
 
double poly_5000MHz_c_f
 
double poly_5000MHz_c_x2
 
double poly_5000MHz_c_xf
 
double poly_5000MHz_c_f2
 
double poly_5000MHz_c_x3
 
double poly_5000MHz_c_x2f
 
double poly_5000MHz_c_xf2
 
double poly_5000MHz_c_f3
 
double poly_5000MHz_intercept_reverse
 
double poly_5000MHz_c_x_reverse
 
double poly_5000MHz_c_f_reverse
 
double poly_5000MHz_c_x2_reverse
 
double poly_5000MHz_c_xf_reverse
 
double poly_5000MHz_c_f2_reverse
 
double poly_5000MHz_c_x3_reverse
 
double poly_5000MHz_c_x2f_reverse
 
double poly_5000MHz_c_xf2_reverse
 
double poly_5000MHz_c_f3_reverse
 

Detailed Description

POWRMS data processing header for POWRMS project.

Author
Robert Budai (rober.nosp@m.t.bu.nosp@m.dai@a.nosp@m.nalo.nosp@m.g.com)

Copyright 2025(c) Analog Devices, Inc.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Macro Definition Documentation

◆ FLOATING_POINT_LENGTH

#define FLOATING_POINT_LENGTH   2

◆ FREQUENCY_RANGE_NR

#define FREQUENCY_RANGE_NR   11

◆ INTEGER_NUMERIC_LENGTH

#define INTEGER_NUMERIC_LENGTH   4

◆ NUMERIC_LENGTH

#define NUMERIC_LENGTH   6

◆ PRECISION_ARRAY_SIZE

#define PRECISION_ARRAY_SIZE   308

◆ PRECISION_POINTS_FREQ

#define PRECISION_POINTS_FREQ   14

◆ PRECISION_POINTS_FREQ_ALL

#define PRECISION_POINTS_FREQ_ALL   (2 * PRECISION_POINTS_FREQ)

◆ PRECISION_RESOLUTION

#define PRECISION_RESOLUTION   (1.0 / PRECISION_SCALE_FACTOR)

◆ PRECISION_SCALE_FACTOR

#define PRECISION_SCALE_FACTOR   1000

◆ TEMPERATURE_CORRECTION_COEFFS

#define TEMPERATURE_CORRECTION_COEFFS   3

◆ VARIABLE_NAMES

#define VARIABLE_NAMES   {"Fq:", "Zi:", "Zo:"}

◆ VARIABLE_NUMBER

#define VARIABLE_NUMBER   3

Enumeration Type Documentation

◆ variable_names

Enumerator
SIGNAL_FREQUENCY 
INPUT_IMPEDANCE 
OUTPUT_IMPEDANCE 
NR_OF_INPUT_VARIABLES 

Function Documentation

◆ calculate_power()

int calculate_power ( )

◆ sync_all_digits_from_values()

void sync_all_digits_from_values ( void )

Synchronize all input variables' digits arrays with their current values.

This function updates the digits array for all input variables based on their current value field. Useful after loading values from EEPROM or other external sources that modify the value but not the digits.

◆ update_values_from_new_value()

void update_values_from_new_value ( struct powrms_variables * input_var,
double new_value )

Update the digits array based on a new value.

Parameters
input_varPointer to the variable structure to update
new_valueThe new value to set (will be clamped to valid range)

◆ update_values_of_digit()

void update_values_of_digit ( struct powrms_variables * input_var,
uint8_t increment_pos )

Update the value of an input variable based on digit increment.

Parameters
input_varPointer to the variable structure to update
increment_posPosition of the digit to increment (0-based index)

Update the value of an input variable based on digit increment.

Variable Documentation

◆ adc_data_input

volatile struct adc_data adc_data_input
extern

◆ enter_pressed

bool enter_pressed
extern

◆ frequency_MHz_ranges

uint32_t frequency_MHz_ranges[FREQUENCY_RANGE_NR]
extern

◆ input_variables

struct powrms_variables input_variables[VARIABLE_NUMBER]
extern

◆ pointer_poz_x

uint8_t pointer_poz_x
extern

◆ pointer_poz_y

uint8_t pointer_poz_y
extern

◆ poly_5000MHz_c_f

double poly_5000MHz_c_f
extern

◆ poly_5000MHz_c_f2

double poly_5000MHz_c_f2
extern

◆ poly_5000MHz_c_f2_reverse

double poly_5000MHz_c_f2_reverse
extern

◆ poly_5000MHz_c_f3

double poly_5000MHz_c_f3
extern

◆ poly_5000MHz_c_f3_reverse

double poly_5000MHz_c_f3_reverse
extern

◆ poly_5000MHz_c_f_reverse

double poly_5000MHz_c_f_reverse
extern

◆ poly_5000MHz_c_x

double poly_5000MHz_c_x
extern

◆ poly_5000MHz_c_x2

double poly_5000MHz_c_x2
extern

◆ poly_5000MHz_c_x2_reverse

double poly_5000MHz_c_x2_reverse
extern

◆ poly_5000MHz_c_x2f

double poly_5000MHz_c_x2f
extern

◆ poly_5000MHz_c_x2f_reverse

double poly_5000MHz_c_x2f_reverse
extern

◆ poly_5000MHz_c_x3

double poly_5000MHz_c_x3
extern

◆ poly_5000MHz_c_x3_reverse

double poly_5000MHz_c_x3_reverse
extern

◆ poly_5000MHz_c_x_reverse

double poly_5000MHz_c_x_reverse
extern

◆ poly_5000MHz_c_xf

double poly_5000MHz_c_xf
extern

◆ poly_5000MHz_c_xf2

double poly_5000MHz_c_xf2
extern

◆ poly_5000MHz_c_xf2_reverse

double poly_5000MHz_c_xf2_reverse
extern

◆ poly_5000MHz_c_xf_reverse

double poly_5000MHz_c_xf_reverse
extern

◆ poly_5000MHz_intercept

double poly_5000MHz_intercept
extern

◆ poly_5000MHz_intercept_reverse

double poly_5000MHz_intercept_reverse
extern

◆ precision_values

int32_t precision_values[PRECISION_ARRAY_SIZE]
extern

◆ precision_values_reverse

int32_t precision_values_reverse[PRECISION_ARRAY_SIZE]
extern

◆ temperature_compensation_value

int32_t temperature_compensation_value
extern

◆ temperature_precision_values

double temperature_precision_values[TEMPERATURE_CORRECTION_COEFFS * FREQUENCY_RANGE_NR]
extern

◆ use_eeprom_calibration_data

int32_t use_eeprom_calibration_data
extern