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

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

#include "ade7978.h"
#include "no_os_uart.h"
#include "no_os_pwm.h"
#include "no_os_delay.h"
#include "no_os_gpio.h"
#include "no_os_spi.h"
#include "no_os_print_log.h"
#include "no_os_units.h"
#include "no_os_util.h"
#include "no_os_error.h"
#include "maxim_uart.h"
#include "maxim_gpio.h"
#include "maxim_uart_stdio.h"
#include "maxim_pwm.h"
#include "maxim_spi.h"
#include "maxim_irq.h"
Include dependency graph for common_data.h:

Classes

struct  measurements
 measurements structure. More...
 

Macros

#define ADE7978_SHUNT_RES   1
 
#define ADE7978_UP_RES   990000
 
#define ADE7978_DOWN_RES   1000
 
#define ADE7978_VOLTAGE_TR_FCN   ((ADE7978_DOWN_RES + ADE7978_UP_RES) / ADE7978_DOWN_RES)
 

Functions

int rms_adc_values_read (struct ade7978_dev *dev, struct measurements *value, enum ade7978_phase phase)
 Saves the current and voltage values of device 1 in rms_adc structure.
 

Detailed Description

Defines common data to be used by ADE7978 example project.

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

Copyright (c) 2024 Analog Devices, Inc.

SPDX-License-Identifier: BSD-3-Clause

Macro Definition Documentation

◆ ADE7978_DOWN_RES

#define ADE7978_DOWN_RES   1000

◆ ADE7978_SHUNT_RES

#define ADE7978_SHUNT_RES   1

◆ ADE7978_UP_RES

#define ADE7978_UP_RES   990000

◆ ADE7978_VOLTAGE_TR_FCN

#define ADE7978_VOLTAGE_TR_FCN   ((ADE7978_DOWN_RES + ADE7978_UP_RES) / ADE7978_DOWN_RES)

Function Documentation

◆ rms_adc_values_read()

int rms_adc_values_read ( struct ade7978_dev * dev,
struct measurements * value,
enum ade7978_phase phase )

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

Parameters
dev- device structure
value- structure holding the measurements values
phase- selects the phase for measurements read
Returns
0 in case of success, negative error code otherwise