Go to the documentation of this file.
33 #ifndef __COMMON_DATA_H__
34 #define __COMMON_DATA_H__
49 #include "maxim_uart.h"
50 #include "maxim_gpio.h"
51 #include "maxim_uart_stdio.h"
52 #include "maxim_pwm.h"
53 #include "maxim_spi.h"
54 #include "maxim_irq.h"
77 #define GPIO_LED_PORT 2
78 #define GPIO_LED_PIN 7
80 #define GPIO_SS_PORT 2
81 #define GPIO_SS_PIN 26
82 #define GPIO_SCK_PORT 2
83 #define GPIO_SCK_PIN 29
85 #define GPIO_RESET_PORT 2
86 #define GPIO_RESET_PIN 8
88 #define GPIO_OPS &max_gpio_ops
89 #define GPIO_EXTRA &ade9153_gpio_extra_ip
90 #define GPIO_RDY_PORT 2
91 #define GPIO_RDY_PIN 9
93 #define SPI_DEVICE_ID 0
94 #define SPI_BAUDRATE 1000000
96 #define SPI_SLAVE_NUM 1
99 #define UART_BAUD 115200
101 #define GPIO_IRQ_OPS &max_gpio_irq_ops
102 #define GPIO_CTRL_IRQ_ID 0
103 #define GPIO_IRQ_EXTRA &ade9153a_gpio_extra_ip
104 #define NVIC_GPIO_IRQ GPIO2_IRQn
106 #define RESET_TIME 500
109 #define READ_INTERVAL 3000
113 #define ADE9153A_VLEVEL 0x002C11E8
115 #define ADE9153A_RSMALL 0x03E8
117 #define ADE9153A_NO_SAMPLES 0x0F9F
119 #define ADE9153A_AIGAIN -(1 << 28)
120 #define ADE9153A_AIGAIN2 -(1 << 27)
124 #define ENERGY_CC 0.858307
126 #define POWER_CC 1508.743
128 #define RMS_CURENT_CC 0.838190
130 #define RMS_VOLTAGE_CC 13.41105
132 #define PF_CC 134217728
134 #define FREQ_CC 262144000
136 #define MULT_CC_50HZ 0.017578125
138 #define MULT_CC_60HZ 0.02109375
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
int interface_toggle_led(struct no_os_gpio_desc *gpio_led_desc)
Toggle LED.
Definition: interface.c:102
Header file of SPI Interface.
Header file of Delay functions.
struct no_os_uart_init_param uart_ip
Definition: common_data.c:52
struct no_os_spi_init_param ade9153a_spi_ip
Definition: common_data.c:116
struct no_os_gpio_init_param gpio_ss_ip
Definition: common_data.c:81
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
struct no_os_gpio_init_param ade9153a_gpio_rdy_ip
Definition: common_data.c:108
struct no_os_irq_init_param ade9153a_gpio_irq_ip
Definition: common_data.c:126
Header file of PWM Interface.
struct no_os_gpio_init_param gpio_sck_ip
Definition: common_data.c:90
struct no_os_gpio_init_param gpio_led1_ip
Definition: platform.c:68
int autocalibration_start(struct ade9153a_dev *dev)
Autocalibration start.
Definition: common_data.c:364
Structure holding the parameters for UART initialization.
Definition: no_os_uart.h:110
Header file of ADE9153A Driver.
int autocalibration_read_vals(struct ade9153a_dev *dev)
Autocalibration read values.
Definition: common_data.c:307
Structure holding the initial parameters for Interrupt Request.
Definition: no_os_irq.h:107
Header file of GPIO Interface.
Header file of UART interface.
ADE9153A Device structure.
Definition: ade9153a.h:712
Header file of utility functions.
int read_measurements(struct ade9153a_dev *dev)
Read measurements.
Definition: common_data.c:163
struct no_os_gpio_init_param gpio_reset_ip
Definition: platform.c:95
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140