no-OS
Functions
common_data.c File Reference

Defines common data to be used by ADE7913 example project. More...

#include "common_data.h"
#include "platform.h"
Include dependency graph for common_data.c:

Functions

int interface_toggle_led (struct no_os_gpio_desc *gpio_led_desc)
 Toggle Led. More...
 
int rms_adc_values_read (struct ade7913_dev *dev, struct rms_adc_values *rms)
 Saves the current and voltage values of device 1 in rms_adc structure. More...
 
int rms_adc_values_read_2 (struct ade7913_dev *dev, struct rms_adc_values *rms)
 Saves the current and voltage values of device 2 in rms_adc structure. More...
 
int rms_adc_values_read_3 (struct ade7913_dev *dev, struct rms_adc_values *rms)
 Saves the current and voltage values of device 3 in rms_adc structure. More...
 
int64_t rms_filter_v1 (int32_t sample)
 Compute v1 rms value for device 1. More...
 
int64_t rms_filter_v2 (int32_t sample)
 Compute v2 rms value for device 1. More...
 
int64_t rms_filter_i (int32_t sample)
 Compute i rms value for device 1. More...
 
int64_t rms_filter_v1_2 (int32_t sample)
 Compute v1_2 rms value for device 2. More...
 
int64_t rms_filter_v2_2 (int32_t sample)
 Compute v2_2 rms value for device 2. More...
 
int64_t rms_filter_i_2 (int32_t sample)
 Compute i_2 rms value for device 2. More...
 
int64_t rms_filter_v1_3 (int32_t sample)
 Compute v1_3 rms value for device 3. More...
 
int64_t rms_filter_v2_3 (int32_t sample)
 Compute v2_3 rms value for device 3. More...
 
int64_t rms_filter_i_3 (int32_t sample)
 Compute i_3 rms value for device 3. More...
 
int64_t supply_scale_v (int32_t val)
 Scale V value. More...
 

Detailed Description

Defines common data to be used by ADE7913 example project.

Author
REtz (radu..nosp@m.etz@.nosp@m.analo.nosp@m.g.co.nosp@m.m)

Copyright (c) 2024 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.

Function Documentation

◆ interface_toggle_led()

int interface_toggle_led ( struct no_os_gpio_desc gpio_led_desc)

Toggle Led.

Toggle LED.

Parameters
gpio_led_desc- led descriptor
Returns
0 in case of success, negative error code otherwise.

◆ rms_adc_values_read()

int rms_adc_values_read ( struct ade7913_dev dev,
struct rms_adc_values rms 
)

Saves the current and voltage values of device 1 in rms_adc structure.

Parameters
dev- device structure
rms- structure holding the measurements values
Returns
0 in case of success, negative error code otherwise

◆ rms_adc_values_read_2()

int rms_adc_values_read_2 ( struct ade7913_dev dev,
struct rms_adc_values rms 
)

Saves the current and voltage values of device 2 in rms_adc structure.

Parameters
dev- device structure
rms- structure holding the measurements values
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ rms_adc_values_read_3()

int rms_adc_values_read_3 ( struct ade7913_dev dev,
struct rms_adc_values rms 
)

Saves the current and voltage values of device 3 in rms_adc structure.

Parameters
dev- device structure
rms- structure holding the measurements values
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ rms_filter_i()

int64_t rms_filter_i ( int32_t  sample)

Compute i rms value for device 1.

Compute i rms value.

Parameters
sample- i sample dev 1
Returns
i rms value
Here is the caller graph for this function:

◆ rms_filter_i_2()

int64_t rms_filter_i_2 ( int32_t  sample)

Compute i_2 rms value for device 2.

Parameters
sample- i sample dev 2
Returns
i rms value
Here is the caller graph for this function:

◆ rms_filter_i_3()

int64_t rms_filter_i_3 ( int32_t  sample)

Compute i_3 rms value for device 3.

Parameters
sample- i sample dev 3
Returns
i rms value
Here is the caller graph for this function:

◆ rms_filter_v1()

int64_t rms_filter_v1 ( int32_t  sample)

Compute v1 rms value for device 1.

Compute v1 rms value.

Parameters
sample- v1 sample dev 1
Returns
v1 rms value
Here is the caller graph for this function:

◆ rms_filter_v1_2()

int64_t rms_filter_v1_2 ( int32_t  sample)

Compute v1_2 rms value for device 2.

Parameters
sample- v1 sample dev 2
Returns
v1 rms value
Here is the caller graph for this function:

◆ rms_filter_v1_3()

int64_t rms_filter_v1_3 ( int32_t  sample)

Compute v1_3 rms value for device 3.

Parameters
sample- v1 sample dev 3
Returns
v1 rms value
Here is the caller graph for this function:

◆ rms_filter_v2()

int64_t rms_filter_v2 ( int32_t  sample)

Compute v2 rms value for device 1.

Compute v2 rms value.

Parameters
sample- v2 sample dev 1
Returns
v2 rms value
Here is the caller graph for this function:

◆ rms_filter_v2_2()

int64_t rms_filter_v2_2 ( int32_t  sample)

Compute v2_2 rms value for device 2.

Parameters
sample- v2 sample dev 2
Returns
v2 rms value
Here is the caller graph for this function:

◆ rms_filter_v2_3()

int64_t rms_filter_v2_3 ( int32_t  sample)

Compute v2_3 rms value for device 3.

Parameters
sample- v2 sample dev 3
Returns
v2 rms value
Here is the caller graph for this function:

◆ supply_scale_v()

int64_t supply_scale_v ( int32_t  val)

Scale V value.

Parameters
val- value to be scaled
Returns
scaled value
Here is the caller graph for this function: