no-OS
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
common_data.h
Go to the documentation of this file.
1/***************************************************************************/
33#ifndef __COMMON_DATA_H__
34#define __COMMON_DATA_H__
35
36#include "ade7758.h"
37#include "no_os_uart.h"
38#include "no_os_pwm.h"
39#include "no_os_delay.h"
40#include "no_os_gpio.h"
41#include "no_os_spi.h"
42#include "no_os_print_log.h"
43#include "no_os_units.h"
44#include "no_os_util.h"
45#include "no_os_error.h"
46#include "maxim_uart.h"
47#include "maxim_gpio.h"
48#include "maxim_uart_stdio.h"
49#include "maxim_pwm.h"
50#include "maxim_spi.h"
51#include "maxim_irq.h"
52
53/* UART init params */
54extern struct no_os_uart_init_param uart_ip;
55/* GPIO LED init params */
57/* SPI init params */
59/* GPIO IRQ init params */
61/* GPIO interrupt init params */
63
64/* Read data interval in irq multiple */
65#define PRINT_INTERVAL 50
66
67/* Setup values for ADE7758 */
68/* value for R_small defined by user */
69#define RSMALL 1
70/* value for R high defined by user */
71#define RHIGH 0
72#define V_GAIN ((RSMALL + RHIGH) / RSMALL)
73/* Change the gain accordingly to the current sensor
74and sense circuit */
75#define I_GAIN 1
76/* RMS full scale code value defined by user */
77#define VOLTAGE_RMS_FS_CODE 1639101
78#define CURRENT_RMS_FS_CODE 1914753
79/* ADC input at full scale rms voltage mV */
80#define ADC_FS_RMS_IN 353.5
81/* Frequency calibration coeffiecient */
82#define FREQ_CC 0.0625
83/* Temperature resolution 3 °C / LSB */
84#define TEMP_G 3
85/* Temperature offset - user defined */
86#define ADE7758_AMB_T_CODE 0
87/* Ambient temperature °C - user defined */
88#define ADE7758_AMB_T_CELSIUS 0
89
90/* Read measurements */
91int read_measurements(struct ade7758_dev *dev);
92
93#endif /* __COMMON_DATA_H__ */
Header file of ADE7758 Driver.
struct no_os_uart_init_param uart_ip
Definition common_data.c:52
int read_measurements(struct ade7753_dev *dev)
Read measurements.
Definition common_data.c:41
struct no_os_gpio_init_param gpio_led1_ip
Definition platform.c:65
struct no_os_spi_init_param ade7758_spi_ip
Definition platform.c:82
struct no_os_irq_init_param ade7758_gpio_int_ip
Definition platform.c:92
struct no_os_gpio_init_param ade7758_gpio_irq_ip
Definition platform.c:74
Header file of Delay functions.
Error codes definition.
Header file of GPIO Interface.
Print messages helpers.
Header file of PWM Interface.
Header file of SPI Interface.
Header file of UART interface.
Header file of Units.
Header file of utility functions.
ADE7758 Device structure.
Definition ade7758.h:339
Structure holding the parameters for GPIO initialization.
Definition no_os_gpio.h:67
Structure holding the initial parameters for Interrupt Request.
Definition no_os_irq.h:101
Structure holding the parameters for SPI initialization.
Definition no_os_spi.h:128
Structure holding the parameters for UART initialization.
Definition no_os_uart.h:98