no-OS
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ade7754.h
Go to the documentation of this file.
1/***************************************************************************/
33#ifndef __ADE7754_H__
34#define __ADE7754_H__
35
36#include <stdbool.h>
37#include <stdint.h>
38#include <string.h>
39#include "no_os_util.h"
40#include "no_os_spi.h"
41#include "no_os_gpio.h"
42#include "no_os_irq.h"
43#include "no_os_delay.h"
44#include "no_os_units.h"
45#include "no_os_alloc.h"
46#include "no_os_crc16.h"
47#include "no_os_print_log.h"
48#include <stdlib.h>
49#include <errno.h>
50#include <math.h>
51
52/* SPI commands */
53#define ADE7754_SPI_READ NO_OS_BIT(7)
54
55/* Version product */
56#define ADE7754_VERSION 0x3F
57/* Use a register that has a non-zero value at reset */
58#define ADE7754_REG_VERSION_PRODUCT 0x0D
59
60/* Miscellaneous Definitions */
61#define IS_5BITS_REG(x) ((x) >= ADE7754_REG_APHCAL && (x) <= ADE7754_REG_CPHCAL)
62#define IS_8BITS_REG(x) (((x) == ADE7754_REG_TEMP) \
63 || ((x) >= ADE7754_REG_OPMODE && (x) <= ADE7754_REG_VAMODE) \
64 || ((x) >= ADE7754_REG_SAGCYC && (x) <= ADE7754_REG_GAIN) \
65 || ((x) >= ADE7754_REG_WDIV && (x) <= ADE7754_REG_VADIV) \
66 ||((x) >= ADE7754_REG_CHKSUM && (x) <= ADE7754_REG_VERSION))
67#define IS_12BITS_REG(x) (((x) >= ADE7754_REG_AWG && (x) <= ADE7754_REG_CVAG) \
68 || ((x) >= ADE7754_REG_AAPOS && (x) <= ADE7754_REG_CFDEN) \
69 || ((x) >= ADE7754_REG_AIRMSOS && (x) <= ADE7754_REG_CVGAIN))
70#define IS_15BITS_REG(x) ((x) == ADE7754_REG_PERIOD)
71#define IS_16BITS_REG(x) ((x) >= ADE7754_REG_IRQEN && (x) <= ADE7754_REG_LINCYC)
72#define IS_24BITS_REG(x) (((x) >= ADE7754_REG_AENERGY && (x) <= ADE7754_REG_LVAENERGY) \
73 || ((x) == ADE7754_REG_WFORM) \
74 || ((x) >= ADE7754_REG_AIRMS && (x) <= ADE7754_REG_CVRMS))
75
76/* Delay after reset */
77/* A data transfer to the ADE7754 should
78not take place for at least 18 µs
79after a software reset. */
80#define ADE7754_RESET_DEL 20
81
82/* ADE7754 Register Map */
83#define ADE7754_REG_AENERGY 0x01
84#define ADE7754_REG_RAENERGY 0x02
85#define ADE7754_REG_LAENERGY 0x03
86#define ADE7754_REG_VAENERGY 0x04
87#define ADE7754_REG_RVAENERGY 0x05
88#define ADE7754_REG_LVAENERGY 0x06
89#define ADE7754_REG_PERIOD 0x07
90#define ADE7754_REG_TEMP 0x08
91#define ADE7754_REG_WFORM 0x09
92#define ADE7754_REG_OPMODE 0x0A
93#define ADE7754_REG_MMODE 0x0B
94#define ADE7754_REG_WAVMODE 0x0C
95#define ADE7754_REG_WATMODE 0x0D
96#define ADE7754_REG_VAMODE 0X0E
97#define ADE7754_REG_IRQEN 0x0F
98#define ADE7754_REG_STATUS 0x10
99#define ADE7754_REG_RSTATUS 0x11
100#define ADE7754_REG_ZXTOUT 0x12
101#define ADE7754_REG_LINCYC 0x13
102#define ADE7754_REG_SAGCYC 0x14
103#define ADE7754_REG_SAGLVL 0x15
104#define ADE7754_REG_VPEAK 0x16
105#define ADE7754_REG_IPEAK 0x17
106#define ADE7754_REG_GAIN 0x18
107#define ADE7754_REG_AWG 0x19
108#define ADE7754_REG_BWG 0x1A
109#define ADE7754_REG_CWG 0X1B
110#define ADE7754_REG_AVAG 0x1C
111#define ADE7754_REG_BVAG 0x1D
112#define ADE7754_REG_CVAG 0x1E
113#define ADE7754_REG_APHCAL 0x1F
114#define ADE7754_REG_BPHCAL 0x20
115#define ADE7754_REG_CPHCAL 0x21
116#define ADE7754_REG_AAPOS 0x22
117#define ADE7754_REG_BAPOS 0x23
118#define ADE7754_REG_CAPOS 0x24
119#define ADE7754_REG_CFNUM 0x25
120#define ADE7754_REG_CFDEN 0x26
121#define ADE7754_REG_WDIV 0x27
122#define ADE7754_REG_VADIV 0x28
123#define ADE7754_REG_AIRMS 0x29
124#define ADE7754_REG_BIRMS 0x2A
125#define ADE7754_REG_CIRMS 0x2B
126#define ADE7754_REG_AVRMS 0x2C
127#define ADE7754_REG_BVRMS 0x2D
128#define ADE7754_REG_CVRMS 0x2E
129#define ADE7754_REG_AIRMSOS 0x2F
130#define ADE7754_REG_BIRMSOS 0x30
131#define ADE7754_REG_CIRMSOS 0x31
132#define ADE7754_REG_AVRMSOS 0x32
133#define ADE7754_REG_BVRMSOS 0x33
134#define ADE7754_REG_CVRMSOS 0x34
135#define ADE7754_REG_AAPGAIN 0x35
136#define ADE7754_REG_BAPGAIN 0x36
137#define ADE7754_REG_CAPGAIN 0x37
138#define ADE7754_REG_AVGAIN 0x38
139#define ADE7754_REG_BVGAIN 0x39
140#define ADE7754_REG_CVGAIN 0x3A
141#define ADE7754_REG_CHKSUM 0x3E
142#define ADE7754_REG_VERSION 0x3F
143
144/* ADE7754_REG_OPMODE Bit Definition */
145#define ADE7754_SWRST_MSK NO_OS_BIT(6)
146#define ADE7754_DISMOD_MSK NO_OS_GENMASK(5, 3)
147#define ADE7754_DISCF_MSK NO_OS_BIT(2)
148#define ADE7754_DISLPF_MSK NO_OS_BIT(1)
149#define ADE7754_DISHPF_MSK NO_OS_BIT(0)
150
151/* ADE7754_REG_GAIN Bit Definition */
152#define ADE7754_PGA2_MSK NO_OS_GENMASK(6, 5)
153#define ADE7754_NO_LOAD_MSK NO_OS_BIT(3)
154#define ADE7754_ABS_MSK NO_OS_BIT(2)
155#define ADE7754_PGA1_MSK NO_OS_GENMASK(1, 0)
156
157/* ADE7754_REG_CFNUM Bit Definition */
158#define ADE7754_NEGC_MSK NO_OS_BIT(14)
159#define ADE7754_NEGB_MSK NO_OS_BIT(13)
160#define ADE7754_NEGA_MSK NO_OS_BIT(12)
161#define ADE7754_CFNUM_MSK NO_OS_GENMASK(11, 0)
162
163/* ADE7754_REG_MMODE Bit Definition */
164#define ADE7754_ZXSEL_MSK NO_OS_GENMASK(6, 4)
165#define ADE7754_PEAKSEL_MSK NO_OS_GENMASK(3, 2)
166#define ADE7754_PERDSEL_MSK NO_OS_GENMASK(1, 0)
167
168/* ADE7754_REG_WAVMODE Bit Definition */
169#define ADE7754_LVARSEL_MSK NO_OS_BIT(5)
170#define ADE7754_DTRT_MSK NO_OS_GENMASK(4, 3)
171#define ADE7754_WAVSEL_MSK NO_OS_GENMASK(2, 0)
172
173/* ADE7754_REG_WATMODE Bit Definition */
174#define ADE7754_WATM_MSK NO_OS_GENMASK(7, 6)
175#define ADE7754_WATSEL_MSK NO_OS_GENMASK(5, 3)
176#define ADE7754_LWATSEL_MSK NO_OS_GENMASK(2, 0)
177
178/* ADE7754_REG_VAMODE Bit Definition */
179#define ADE7754_VAMOD_MSK NO_OS_GENMASK(7, 6)
180#define ADE7754_VASEL_MSK NO_OS_GENMASK(5, 3)
181#define ADE7754_LVASEL_MSK NO_OS_GENMASK(2, 0)
182
183/* ADE7754_REG_IRQEN/ADE7754_REG_RSTATUS/ADE7754_REG_STATUS Bit Definition */
184#define ADE7754_VAEHF_MSK NO_OS_BIT(15)
185#define ADE7754_WFSM_MSK NO_OS_BIT(14)
186#define ADE7754_PKI_MSK NO_OS_BIT(13)
187#define ADE7754_PKV_MSK NO_OS_BIT(12)
188/* bit 11 reserved in the IRQEN register*/
189#define ADE7754_RESET_MSK NO_OS_BIT(11)
190#define ADE7754_LENERGY_MSK NO_OS_BIT(10)
191#define ADE7754_ZXC_MSK NO_OS_BIT(9)
192#define ADE7754_ZXB_MSK NO_OS_BIT(8)
193#define ADE7754_ZXA_MSK NO_OS_BIT(7)
194#define ADE7754_ZXTOC_MSK NO_OS_BIT(6)
195#define ADE7754_ZXTOB_MSK NO_OS_BIT(5)
196#define ADE7754_ZXTOA_MSK NO_OS_BIT(4)
197#define ADE7754_SAGC_MSK NO_OS_BIT(3)
198#define ADE7754_SAGB_MSK NO_OS_BIT(2)
199#define ADE7754_SAGA_MSK NO_OS_BIT(1)
200#define ADE7754_AEHF_MSK NO_OS_BIT(0)
201
207 /* normal operation */
209 /* switch off the current channel ADCs*/
211 /* switch off the voltage channel ADCs */
213 /* put the ADE7754 in sleep mode */
215 /* swap voltage and currents channels */
217 /* switch off current channel ADCsand redirect the current
218 input signal to the voltage channel signal paths*/
220 /* switch off voltage channel ADCs and redirect the voltage
221 input signal to the current channel signal paths */
223 /* put the ADE7754 in power-down mode*/
225};
226
232 /* Gain */
233 /* gain 1 */
235 /* gain 2 */
237 /* gain 4 */
239};
240
247 /* phase A */
249 /* phase B */
251 /* phase C */
253};
254
261 /* part 1 */
263 /* part 2 */
265 /* part 3 */
267};
268
274 /* Voltage phase A */
276 /* Voltage phase B */
278 /* Voltage phase C */
280 /* Current phase A */
282 /* Current phase B */
284 /* Current phase C */
286};
287
293 /* 26 kSPS (CLKIN/3/128) */
295 /* 13 kSPS (CLKIN/3/256) */
297 /* 6.5 kSPS (CLKIN/3/512) */
299 /* 3.3 kSPS (CLKIN/3/1024) */
301};
302
308 /* Active energy calculation */
309 /* formula 1 VA * IA + VB * IB + VC * IC */
311 /* formula 2 VA * (IA – IB) + 0 + VC * (IC – IB) */
313 /* formula 3 VA * (IA - IB) + 0 + VC * IC */
315};
316
322 /* Apparent energy calculation */
323 /* formula 1 VArms * IArms + VBrms * IBrms + VCrms * ICrms */
325 /* formula 2 VArms * IArms + (VArms + VCrms)/2 * IBrms + VCrms * ICrms */
327 /* formula 3 VArms * IArms + VArms * IBrms + VCrms * ICrms */
329};
330
343
358
369
388
395 int32_t per_reg_val;
396};
397
405};
406
407/* Initialize the device. */
408int ade7754_init(struct ade7754_dev **device,
410
411/* Setup device */
412int ade7754_setup(struct ade7754_dev *dev);
413
414/* Read device register. */
415int ade7754_read(struct ade7754_dev *dev, uint16_t reg_addr,
416 int32_t *reg_data);
417
418/* Write device register. */
419int ade7754_write(struct ade7754_dev *dev, uint16_t reg_addr,
420 uint32_t reg_data);
421
422/* Update specific register bits. */
423int ade7754_update_bits(struct ade7754_dev *dev, uint16_t reg_addr,
424 uint32_t mask, uint32_t reg_data);
425
426/* Remove the device and release resources. */
427int ade7754_remove(struct ade7754_dev *dev);
428
429/* Reset the device using SW reset. */
430int ade7754_sw_reset(struct ade7754_dev *dev);
431
432/* Reset the device using HW reset. */
433int ade7754_hw_reset(struct ade7754_dev *dev);
434
435/* Version product */
437 uint32_t *data_read);
438
439/* Write Ipeak val */
440int ade7754_write_ipk_val(struct ade7754_dev *dev, uint32_t val);
441
442/* Write Vpeak val */
443int ade7754_write_vpk_val(struct ade7754_dev *dev, uint32_t val);
444
445/* Get interrupt indicator from STATUS register */
446int ade7754_get_int_status(struct ade7754_dev *dev, uint32_t msk,
447 uint8_t *status);
448
449/* Clear irq STATUS flags */
451 int32_t *reg_data);
452
453/* Enable/Disable interrupt */
454int ade7754_enable_irq(struct ade7754_dev *dev,
455 uint32_t msk, uint8_t en);
456
457/* Select waveform register update rate */
459 enum ade7754_data_rate sel);
460
461/* Select source of sampled data for wave register */
463 enum ade7754_wavsel sel);
464
465/* Select the gain of the current channels inputs. */
466int ade7754_current_gain(struct ade7754_dev *dev,
467 enum ade7754_pga_gain sel);
468
469/* Select the gain of the voltage channels inputs. */
470int ade7754_voltage_gain(struct ade7754_dev *dev,
471 enum ade7754_pga_gain sel);
472
473/* Select the formula used for active energy calculation */
475 enum ade7754_watm sel);
476
477/* Select the formula used for apparent energy calculation */
479 enum ade7754_vamod sel);
480
481/* Select the source of the measurement of the voltage line period. */
482int ade7754_period_source(struct ade7754_dev *dev,
483 enum ade7754_phsel sel);
484
485/* Select the phases used for zx, period, sag detection */
486int ade7754_zxsel(struct ade7754_dev *dev,
487 enum ade7754_phsel sel);
488
489/* Select part of the line active energy formula separately,
490depending on the line active energy measurement method. */
492 enum ade7754_formsel sel);
493
494/* Select part of the line apparent energy formula separately,
495depending on the line active energy measurement method. */
497 enum ade7754_formsel sel);
498
499/* Select part of the active energy formula separately,
500depending on the line active energy measurement method. */
502 enum ade7754_formsel sel);
503
504/* Select part of the apparent energy formula separately,
505depending on the line active energy measurement method. */
507 enum ade7754_formsel sel);
508
509/* Select the source of the voltage & current peak detection. */
510int ade7754_peak_source(struct ade7754_dev *dev,
511 enum ade7754_phsel sel);
512
513/* Operation mode of the ADCs. */
514int ade7754_adcs_mode(struct ade7754_dev *dev,
515 enum ade7754_dismod sel);
516
517/* Read energy values */
518int ade7754_energy_vals(struct ade7754_dev *dev,
519 struct ade7754_energy_values *data);
520
521/* Read rms values phase A */
523 struct ade7754_rms_values *data);
524
525/* Read rms values phase B */
527 struct ade7754_rms_values *data);
528
529/* Read rms values phase C */
531 struct ade7754_rms_values *data);
532
533/* Read period value */
534int ade7754_period_val(struct ade7754_dev *dev,
535 struct ade7754_period_value *data);
536
537/* Read temperature value */
539 struct ade7754_temp_value *data);
540
541#endif /* __ADE7754_H__ */
struct ad7616_init_param init_param
Definition ad7616_sdz.c:107
int ade7754_voltage_gain(struct ade7754_dev *dev, enum ade7754_pga_gain sel)
Select the gain of the voltage channels inputs.
Definition ade7754.c:579
int ade7754_get_int_status(struct ade7754_dev *dev, uint32_t msk, uint8_t *status)
Get interrupt indicator from STATUS register.
Definition ade7754.c:475
ade7754_vamod
ADE7754 select the formula used for apparent energy calculation.
Definition ade7754.h:321
@ ADE7754_APP_E_FORMULA_1
Definition ade7754.h:324
@ ADE7754_APP_E_FORMULA_3
Definition ade7754.h:328
@ ADE7754_APP_E_FORMULA_2
Definition ade7754.h:326
int ade7754_wat_formula_term(struct ade7754_dev *dev, enum ade7754_formsel sel)
Select part of the active energy formula separately, depending on the line active energy measurement ...
Definition ade7754.c:690
int ade7754_lwat_formula_term(struct ade7754_dev *dev, enum ade7754_formsel sel)
Select part of the line active energy formula separately, depending on the line active energy measure...
Definition ade7754.c:658
ade7754_watm
ADE7754 select the formula used for active energy calculation.
Definition ade7754.h:307
@ ADE7754_ACTIVE_E_FORMULA_1
Definition ade7754.h:310
@ ADE7754_ACTIVE_E_FORMULA_2
Definition ade7754.h:312
@ ADE7754_ACTIVE_E_FORMULA_3
Definition ade7754.h:314
int ade7754_sw_reset(struct ade7754_dev *dev)
Reset the device using SW reset.
Definition ade7754.c:372
int ade7754_init(struct ade7754_dev **device, struct ade7754_init_param init_param)
Initialize the device.
Definition ade7754.c:58
int ade7754_update_bits(struct ade7754_dev *dev, uint16_t reg_addr, uint32_t mask, uint32_t reg_data)
Update specific register bits.
Definition ade7754.c:321
ade7754_dismod
ADE7754 ADCs can be turned off by using these bits.
Definition ade7754.h:206
@ ADE7754_SWITCH_OFF_VOLTAGE_ADC
Definition ade7754.h:212
@ ADE7754_OFF_VOLTAGE_ADCS_REDIRECTED_TO_CURRENT
Definition ade7754.h:222
@ ADE7754_SWITCH_OFF_CURRENT_ADC
Definition ade7754.h:210
@ ADE7754_OFF_CURRENT_ADCS_REDIRECTED_TO_VOLTAGE
Definition ade7754.h:219
@ ADE7754_POWER_DOWN_MODE
Definition ade7754.h:224
@ ADE7754_SWAP_VOLTAGE_CURRENT
Definition ade7754.h:216
@ ADE7754_SLEEP_MODE
Definition ade7754.h:214
@ ADE7754_NORMAL_OPERATION
Definition ade7754.h:208
int ade7754_read(struct ade7754_dev *dev, uint16_t reg_addr, int32_t *reg_data)
Read device register.
Definition ade7754.c:199
int ade7754_adcs_mode(struct ade7754_dev *dev, enum ade7754_dismod sel)
Operation mode of the ADCs.
Definition ade7754.c:736
int ade7754_wave_update_rate(struct ade7754_dev *dev, enum ade7754_data_rate sel)
Select waveform register update rate.
Definition ade7754.c:536
int ade7754_write(struct ade7754_dev *dev, uint16_t reg_addr, uint32_t reg_data)
Write device register.
Definition ade7754.c:265
int ade7754_remove(struct ade7754_dev *dev)
Remove the device and release resources.
Definition ade7754.c:343
int ade7754_clear_irq_status(struct ade7754_dev *dev, int32_t *reg_data)
Clear irq status flags.
Definition ade7754.c:500
int ade7754_rms_vals_phase_c(struct ade7754_dev *dev, struct ade7754_rms_values *data)
Read rms values phase C.
Definition ade7754.c:842
ade7754_phsel
ADE7754 select the phase of peak detection or the source for the voltage line period measurement.
Definition ade7754.h:246
@ ADE7754_PHASE_B
Definition ade7754.h:250
@ ADE7754_PHASE_A
Definition ade7754.h:248
@ ADE7754_PHASE_C
Definition ade7754.h:252
int ade7754_hw_reset(struct ade7754_dev *dev)
Reset the device using HW reset.
Definition ade7754.c:392
ade7754_wavsel
ADE7754 select the source of the waveform sample.
Definition ade7754.h:273
@ ADE7754_VOLTAGE_PHASE_C
Definition ade7754.h:279
@ ADE7754_CURRENT_PHASE_A
Definition ade7754.h:281
@ ADE7754_VOLTAGE_PHASE_B
Definition ade7754.h:277
@ ADE7754_VOLTAGE_PHASE_A
Definition ade7754.h:275
@ ADE7754_CURRENT_PHASE_B
Definition ade7754.h:283
@ ADE7754_CURRENT_PHASE_C
Definition ade7754.h:285
ade7754_pga_gain
ADE7754 select the PGA gain for current and voltage ch inputs.
Definition ade7754.h:231
@ ADE7754_PGA_GAIN_2
Definition ade7754.h:236
@ ADE7754_PGA_GAIN_1
Definition ade7754.h:234
@ ADE7754_PGA_GAIN_4
Definition ade7754.h:238
int ade7754_current_gain(struct ade7754_dev *dev, enum ade7754_pga_gain sel)
Select the gain of the current channels inputs.
Definition ade7754.c:564
int ade7754_energy_vals(struct ade7754_dev *dev, struct ade7754_energy_values *data)
Read energy values.
Definition ade7754.c:749
int ade7754_write_vpk_val(struct ade7754_dev *dev, uint32_t val)
Write Vpeak val.
Definition ade7754.c:457
int ade7754_va_formula_term(struct ade7754_dev *dev, enum ade7754_formsel sel)
Select part of the apparent energy formula separately, depending on the line active energy measuremen...
Definition ade7754.c:706
ade7754_formsel
ADE7754 select each part of the formula separately depending on the line active energy measurement me...
Definition ade7754.h:260
@ ADE7754_FORMULA_PART_3
Definition ade7754.h:266
@ ADE7754_FORMULA_PART_1
Definition ade7754.h:262
@ ADE7754_FORMULA_PART_2
Definition ade7754.h:264
int ade7754_period_source(struct ade7754_dev *dev, enum ade7754_phsel sel)
Select the source of the measurement of the voltage line period.
Definition ade7754.c:624
int ade7754_enable_irq(struct ade7754_dev *dev, uint32_t msk, uint8_t en)
Enable/Disable interrupt.
Definition ade7754.c:524
int ade7754_wave_sample_data_source(struct ade7754_dev *dev, enum ade7754_wavsel sel)
Select source of sampled data for wave register.
Definition ade7754.c:549
int ade7754_zxsel(struct ade7754_dev *dev, enum ade7754_phsel sel)
Select the phases used for counting the number of zero crossing in the line active and apparent accum...
Definition ade7754.c:642
int ade7754_active_energy_formula(struct ade7754_dev *dev, enum ade7754_watm sel)
Select the formula used for active energy calculation.
Definition ade7754.c:594
int ade7754_rms_vals_phase_a(struct ade7754_dev *dev, struct ade7754_rms_values *data)
Read rms values phase A.
Definition ade7754.c:780
ade7754_data_rate
ADE7754 select the data rate.
Definition ade7754.h:292
@ ADE7754_DATA_RATE_13_KSPS
Definition ade7754.h:296
@ ADE7754_DATA_RATE_3_KSPS
Definition ade7754.h:300
@ ADE7754_DATA_RATE_6_5KSPS
Definition ade7754.h:298
@ ADE7754_DATA_RATE_26_KSPS
Definition ade7754.h:294
int ade7754_write_ipk_val(struct ade7754_dev *dev, uint32_t val)
Write Ipeak val.
Definition ade7754.c:440
int ade7754_rms_vals_phase_b(struct ade7754_dev *dev, struct ade7754_rms_values *data)
Read rms values phase B.
Definition ade7754.c:811
int ade7754_version_product(struct ade7754_dev *dev, uint32_t *data_read)
Version product.
Definition ade7754.c:416
int ade7754_peak_source(struct ade7754_dev *dev, enum ade7754_phsel sel)
Select the source of the voltage & current peak detection.
Definition ade7754.c:721
int ade7754_setup(struct ade7754_dev *dev)
Setup the ADE7754 device.
Definition ade7754.c:134
int ade7754_temperature_val(struct ade7754_dev *dev, struct ade7754_temp_value *data)
Read temperature value.
Definition ade7754.c:898
int ade7754_lva_formula_term(struct ade7754_dev *dev, enum ade7754_formsel sel)
Select part of the line apparent energy formula separately, depending on the line active energy measu...
Definition ade7754.c:674
int ade7754_period_val(struct ade7754_dev *dev, struct ade7754_period_value *data)
Read period value.
Definition ade7754.c:873
int ade7754_apparent_energy_formula(struct ade7754_dev *dev, enum ade7754_vamod sel)
Select the formula used for apparent energy calculation.
Definition ade7754.c:609
Error macro definition for ARM Compiler.
Header file of CRC-16 computation.
Header file of Delay functions.
Header file of GPIO Interface.
Header file of IRQ interface.
Print messages helpers.
Header file of SPI Interface.
Header file of Units.
Header file of utility functions.
ADE7754 Device structure.
Definition ade7754.h:348
struct no_os_irq_ctrl_desc * irq_ctrl
Definition ade7754.h:356
uint32_t irq_status
Definition ade7754.h:354
struct no_os_gpio_desc * gpio_reset
Definition ade7754.h:352
struct no_os_spi_desc * spi_desc
Definition ade7754.h:350
ADE7754 energy registers values.
Definition ade7754.h:363
int32_t active_energy_reg_val
Definition ade7754.h:365
int32_t apparent_energy_reg_val
Definition ade7754.h:367
ADE7754 Device initialization parameters.
Definition ade7754.h:335
struct no_os_gpio_init_param * gpio_reset
Definition ade7754.h:339
struct no_os_spi_init_param * spi_init
Definition ade7754.h:337
struct no_os_irq_ctrl_desc * irq_ctrl
Definition ade7754.h:341
ADE7754 period value.
Definition ade7754.h:393
int32_t per_reg_val
Definition ade7754.h:395
ADE7754 rms registers values.
Definition ade7754.h:374
int32_t current_rms_reg_val_phase_a
Definition ade7754.h:376
int32_t voltage_rms_reg_val_phase_b
Definition ade7754.h:382
int32_t voltage_rms_reg_val_phase_a
Definition ade7754.h:378
int32_t current_rms_reg_val_phase_c
Definition ade7754.h:384
int32_t voltage_rms_reg_val_phase_c
Definition ade7754.h:386
int32_t current_rms_reg_val_phase_b
Definition ade7754.h:380
ADE7754 pq values.
Definition ade7754.h:402
int32_t temp_reg_val
Definition ade7754.h:404
Definition ad9361_util.h:63
Structure holding the GPIO descriptor.
Definition no_os_gpio.h:84
Structure holding the parameters for GPIO initialization.
Definition no_os_gpio.h:67
Definition no_os_irq.h:117
Structure holding SPI descriptor.
Definition no_os_spi.h:180
Structure holding the parameters for SPI initialization.
Definition no_os_spi.h:128