no-OS
ade9153a.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef __ADE9153A_H__
34 #define __ADE9153A_H__
35 
36 /******************************************************************************/
37 /***************************** Include Files **********************************/
38 /******************************************************************************/
39 #include <stdbool.h>
40 #include <stdint.h>
41 #include <string.h>
42 #include "no_os_util.h"
43 #include "no_os_spi.h"
44 #include "no_os_gpio.h"
45 #include "no_os_irq.h"
46 #include "no_os_delay.h"
47 #include "no_os_units.h"
48 #include "no_os_alloc.h"
49 #include "no_os_crc16.h"
50 #include "no_os_print_log.h"
51 #include <stdlib.h>
52 #include <errno.h>
53 #include <math.h>
54 
55 /******************************************************************************/
56 /********************** Macros and Constants Definitions **********************/
57 /******************************************************************************/
58 
59 /* SPI commands */
60 #define ADE9153A_SPI_READ NO_OS_BIT(3)
61 
62 /* Lock write key */
63 #define ADE9153A_LOCK_KEY 0x3C64
64 
65 /* Unlock write key */
66 #define ADE9153A_UNLOCK_KEY 0x4AD1
67 
68 /* COMPMODE val */
69 #define ADE9153A_COMPMODEVAL 0x0005
70 
71 /* RUN */
72 #define ADE9153A_RUN 0x0001
73 #define ADE9153A_STOP 0x0000
74 
75 /* Version product */
76 #define ADE9153A_VERSION 0x9153a
77 
78 /* Reset Delay */
79 #define ADE9153A_RESET_DEL 0x1F4
80 
81 /* Address range of 16 bit registers */
82 #define ADE9153A_START_16ADDR 0x473
83 #define ADE9153A_END_16ADDR 0x600
84 
85 /* ADE9153A CRC constants */
86 #define ADE9153A_CRC16_POLY 0x1021
87 #define ADE9153A_CRC16_INIT_VAL 0xFFFF
88 
89 #define ADE9153A_NO_BYTES_W_16 0x0004
90 #define ADE9153A_NO_BYTES_W_32 0x0006
91 #define ADE9153A_NO_BYTES_R_16 0x0006
92 #define ADE9153A_NO_BYTES_R_32 0x0008
93 
94 
95 /* ENABLE and DISABLE */
96 #define ENABLE 1u
97 #define DISABLE 0u
98 
99 /* ADE9153A Register Map */
100 #define ADE9153A_REG_AIGAIN 0x000
101 #define ADE9153A_REG_APHASECAL 0x001
102 #define ADE9153A_REG_AVGAIN 0x002
103 #define ADE9153A_REG_AIRMS_OS 0x003
104 #define ADE9153A_REG_AVRMS_OS 0x004
105 #define ADE9153A_REG_APGAIN 0x005
106 #define ADE9153A_REG_AWATT_OS 0x006
107 #define ADE9153A_REG_AFVAR_OS 0x007
108 #define ADE9153A_REG_AVRMS_OC_OS 0x008
109 #define ADE9153A_REG_AIRMS_OC_OS 0x009
110 #define ADE9153A_REG_BIGAIN 0x010
111 #define ADE9153A_REG_BPHASECAL 0x011
112 #define ADE9153A_REG_BIRMS_OS 0x013
113 #define ADE9153A_REG_BIRMS_OC_OS 0x019
114 #define ADE9153A_REG_CONFIG0 0x020
115 #define ADE9153A_REG_VNOM 0x021
116 #define ADE9153A_REG_DICOEFF 0x022
117 #define ADE9153A_REG_BI_PGAGAIN 0x023
118 #define ADE9153A_REG_MS_ACAL_CFG 0x030
119 #define ADE9153A_REG_MS_AICC_USER 0x045
120 #define ADE9153A_REG_MS_BICC_USER 0x046
121 #define ADE9153A_REG_MS_AVCC_USER 0x047
122 #define ADE9153A_REG_CT_PHASE_DELAY 0x049
123 #define ADE9153A_REG_CT_CORNER 0x04A
124 #define ADE9153A_REG_VDIV_RSMALL 0x04C
125 #define ADE9153A_REG_AI_WAV 0x200
126 #define ADE9153A_REG_AV_WAV 0x201
127 #define ADE9153A_REG_AIRMS 0x202
128 #define ADE9153A_REG_AVRMS 0x203
129 #define ADE9153A_REG_AWATT 0x204
130 #define ADE9153A_REG_AVA 0x206
131 #define ADE9153A_REG_AFVAR 0x207
132 #define ADE9153A_REG_APF 0x208
133 #define ADE9153A_REG_AIRMS_OC 0x209
134 #define ADE9153A_REG_AVRMS_OC 0x20A
135 #define ADE9153A_REG_BI_WAV 0x210
136 #define ADE9153A_REG_BIRMS 0x212
137 #define ADE9153A_REG_BIRMS_OC 0x219
138 #define ADE9153A_REG_MS_ACAL_AICC 0x220
139 #define ADE9153A_REG_MS_ACAL_AICERT 0x221
140 #define ADE9153A_REG_MS_ACAL_BICC 0x222
141 #define ADE9153A_REG_MS_ACAL_BICERT 0x223
142 #define ADE9153A_REG_MS_ACAL_AVCC 0x224
143 #define ADE9153A_REG_MS_ACAL_AVCERT 0x225
144 #define ADE9153A_REG_MS_STATUS_CURRENT 0x240
145 #define ADE9153A_REG_VERSION_DSP 0x241
146 #define ADE9153A_REG_VERSION_PRODUCT 0x242
147 #define ADE9153A_REG_AWATT_ACC 0x39D
148 #define ADE9153A_REG_AWATTHR_LO 0x39E
149 #define ADE9153A_REG_AWATTHR_HI 0x39F
150 #define ADE9153A_REG_AVA_ACC 0x3B1
151 #define ADE9153A_REG_AVAHR_LO 0x3B2
152 #define ADE9153A_REG_AVAHR_HI 0x3B3
153 #define ADE9153A_REG_AFVAR_ACC 0x3BB
154 #define ADE9153A_REG_AFVARHR_LO 0x3BC
155 #define ADE9153A_REG_AFVARHR_HI 0x3BD
156 #define ADE9153A_REG_PWATT_ACC 0x3EB
157 #define ADE9153A_REG_NWATT_ACC 0x3EF
158 #define ADE9153A_REG_PFVAR_ACC 0x3F3
159 #define ADE9153A_REG_NFVAR_ACC 0x3F7
160 #define ADE9153A_REG_IPEAK 0x400
161 #define ADE9153A_REG_VPEAK 0x401
162 #define ADE9153A_REG_STATUS 0x402
163 #define ADE9153A_REG_MASK 0x405
164 #define ADE9153A_REG_OI_LVL 0x409
165 #define ADE9153A_REG_OIA 0x40A
166 #define ADE9153A_REG_OIB 0x40B
167 #define ADE9153A_REG_USER_PERIOD 0x40E
168 #define ADE9153A_REG_VLEVEL 0x40F
169 #define ADE9153A_REG_DIP_LVL 0x410
170 #define ADE9153A_REG_DIPA 0x411
171 #define ADE9153A_REG_SWELL_LVL 0x414
172 #define ADE9153A_REG_SWELLA 0x415
173 #define ADE9153A_REG_APERIOD 0x418
174 #define ADE9153A_REG_ACT_NL_LVL 0x41C
175 #define ADE9153A_REG_REACT_NL_LVL 0x41D
176 #define ADE9153A_REG_APP_NL_LVL 0x41E
177 #define ADE9153A_REG_PHNOLOAD 0x41F
178 #define ADE9153A_REG_WTHR 0x420
179 #define ADE9153A_REG_VARTHR 0x421
180 #define ADE9153A_REG_VATHR 0x422
181 #define ADE9153A_REG_LAST_DATA_32 0x423
182 #define ADE9153A_REG_CT_PHASE_MEAS 0x424
183 #define ADE9153A_REG_CF_LCFG 0x425
184 #define ADE9153A_REG_TEMP_TRIM 0x471
185 #define ADE9153A_REG_CHIP_ID_HI 0x472
186 #define ADE9153A_REG_CHIP_ID_LO 0x473
187 #define ADE9153A_REG_RUN 0x480
188 #define ADE9153A_REG_CONFIG1 0x481
189 #define ADE9153A_REG_ANGL_AV_AI 0x485
190 #define ADE9153A_REG_ANGL_AI_BI 0x488
191 #define ADE9153A_REG_DIP_CYC 0x48B
192 #define ADE9153A_REG_SWELL_CYC 0x48C
193 #define ADE9153A_REG_CFMODE 0x490
194 #define ADE9153A_REG_COMPMODE 0x491
195 #define ADE9153A_REG_ACCMODE 0x492
196 #define ADE9153A_REG_CONFIG3 0x493
197 #define ADE9153A_REG_CF1DEN 0x494
198 #define ADE9153A_REG_CF2DEN 0x495
199 #define ADE9153A_REG_ZXTOUT 0x498
200 #define ADE9153A_REG_ZXTHRSH 0x499
201 #define ADE9153A_REG_ZX_CFG 0x49A
202 #define ADE9153A_REG_PHSIGN 0x49D
203 #define ADE9153A_REG_CRC_RSLT 0x4A8
204 #define ADE9153A_REG_CRC_SPI 0x4A9
205 #define ADE9153A_REG_LAST_DATA_16 0x4AC
206 #define ADE9153A_REG_LAST_CMD 0x4AE
207 #define ADE9153A_REG_CONFIG2 0x4AF
208 #define ADE9153A_REG_EP_CFG 0x4B0
209 #define ADE9153A_REG_PWR_TIME 0x4B1
210 #define ADE9153A_REG_EGY_TIME 0x4B2
211 #define ADE9153A_REG_CRC_FORCE 0x4B4
212 #define ADE9153A_REG_TEMP_CFG 0x4B6
213 #define ADE9153A_REG_TEMP_RSLT 0x4B7
214 #define ADE9153A_REG_AI_PGAGAIN 0x4B9
215 #define ADE9153A_REG_WR_LOCK 0x4BF
216 #define ADE9153A_REG_MS_STATUS_IRQ 0x4C0
217 #define ADE9153A_REG_EVENT_STATUS 0x4C1
218 #define ADE9153A_REG_CHIP_STATUS 0x4C2
219 #define ADE9153A_REG_UART_BAUD_SWITCH 0x4DC
220 #define ADE9153A_REG_VERSION 0x4FE
221 #define ADE9153A_REG_AI_WAV_1 0x600
222 #define ADE9153A_REG_AV_WAV_1 0x601
223 #define ADE9153A_REG_BI_WAV_1 0x602
224 #define ADE9153A_REG_AIRMS_1 0x604
225 #define ADE9153A_REG_BIRMS_1 0x605
226 #define ADE9153A_REG_AVRMS_1 0x606
227 #define ADE9153A_REG_AWATT_1 0x608
228 #define ADE9153A_REG_AFVAR_1 0x60A
229 #define ADE9153A_REG_AVA_1 0x60C
230 #define ADE9153A_REG_APF_1 0x60E
231 #define ADE9153A_REG_ AI_WAV_2 0x610
232 #define ADE9153A_REG_AV_WAV_2 0x611
233 #define ADE9153A_REG_AIRMS_2 0x612
234 #define ADE9153A_REG_AVRMS_2 0x613
235 #define ADE9153A_REG_AWATT_2 0x614
236 #define ADE9153A_REG_AVA_2 0x615
237 #define ADE9153A_REG_AFVAR_2 0x616
238 #define ADE9153A_REG_APF_2 0x617
239 #define ADE9153A_REG_BI_WAV_2 0x618
240 #define ADE9153A_REG_BIRMS_2 0x61A
241 
242 /* ADE9153A_REG_CONFIG0 Bit Definition */
243 #define ADE9153A_DISRPLPF_MSK NO_OS_BIT(8)
244 #define ADE9153A_DISAPLPF_MSK NO_OS_BIT(7)
245 #define ADE9153A_VNOMA_EN_MSK NO_OS_BIT(5)
246 #define ADE9153A_RMS_OC_SRC_MSK NO_OS_BIT(4)
247 #define ADE9153A_ZX_SRC_SEL_MSK NO_OS_BIT(3)
248 #define ADE9153A_INTEN_BI_MSK NO_OS_BIT(2)
249 #define ADE9153A_HPFDIS_MSK NO_OS_BIT(0)
250 
251 /* ADE9153A_REG_BI_PGAGAIN Bit Definition */
252 #define ADE9153A_BI_PGAGAIN_MSK NO_OS_GENMASK(31, 0)
253 
254 /* ADE9153A_REG_MS_ACAL_CFG Bit Definition */
255 #define ADE9153A_AUTOCAL_AV_MSK NO_OS_BIT(6)
256 #define ADE9153A_AUTOCAL_BI_MSK NO_OS_BIT(5)
257 #define ADE9153A_AUTOCAL_AI_MSK NO_OS_BIT(4)
258 #define ADE9153A_ACALMODE_BI_MSK NO_OS_BIT(3)
259 #define ADE9153A_ACALMODE_AI_MSK NO_OS_BIT(2)
260 #define ADE9153A_ACAL_RUN_MSK NO_OS_BIT(1)
261 #define ADE9153A_ACAL_MODE_MSK NO_OS_BIT(0)
262 
263 /* ADE9153A_REG_MS_STATUS_CURRENT Bit Definition */
264 #define ADE9153A_MS_SYSRDYP_MSK NO_OS_BIT(0)
265 
266 /* ADE9153A_REG_IPEAK Bit Definition */
267 #define ADE9153A_IPPHASE_MSK NO_OS_GENMASK(26, 24)
268 #define ADE9153A_IPEAKVAL_MSK NO_OS_GENMASK(23, 0)
269 
270 /* ADE9153A_REG_VPEAK Bit Definition */
271 #define ADE9153A_VPEAKVAL_MSK NO_OS_GENMASK(23, 0)
272 
273 /* ADE9153A_REG_STATUS / ADE9153A_REG_MASK Bit Definition */
274 #define ADE9153A_CHIP_STAT_MSK NO_OS_BIT(31)
275 #define ADE9153A_EVENT_STAT_MSK NO_OS_BIT(30)
276 #define ADE9153A_MS_STAT_MSK NO_OS_BIT(29)
277 #define ADE9153A_PF_RDY_MSK NO_OS_BIT(25)
278 #define ADE9153A_CRC_CHG_MSK NO_OS_BIT(24)
279 #define ADE9153A_CRC_DONE_MSK NO_OS_BIT(23)
280 #define ADE9153A_ZXTOAV_MSK NO_OS_BIT(21)
281 #define ADE9153A_ZXBI_MSK NO_OS_BIT(20)
282 #define ADE9153A_ZXAI_MSK NO_OS_BIT(19)
283 #define ADE9153A_ZXAV_MSK NO_OS_BIT(17)
284 #define ADE9153A_RSTDONE_MSK NO_OS_BIT(16)
285 #define ADE9153A_FVARNL_MSK NO_OS_BIT(15)
286 #define ADE9153A_VANL_MSK NO_OS_BIT(14)
287 #define ADE9153A_WATTNL_MSK NO_OS_BIT(13)
288 #define ADE9153A_TEMP_RDY_MSK NO_OS_BIT(12)
289 #define ADE9153A_RMS_OC_RDY_MSK NO_OS_BIT(11)
290 #define ADE9153A_PWRRDY_MSK NO_OS_BIT(10)
291 #define ADE9153A_DREADY_MSK NO_OS_BIT(9)
292 #define ADE9153A_EGYRDY_MSK NO_OS_BIT(8)
293 #define ADE9153A_CF2_MSK NO_OS_BIT(7)
294 #define ADE9153A_CF1_MSK NO_OS_BIT(6)
295 #define ADE9153A_REVPCF2_MSK NO_OS_BIT(5)
296 #define ADE9153A_REVPCF1_MSK NO_OS_BIT(4)
297 #define ADE9153A_REVRPA_MSK NO_OS_BIT(2)
298 #define ADE9153A_REVAPA_MSK NO_OS_BIT(0)
299 
300 /* ADE9153A_REG_OI_LVL Bit Definition */
301 #define ADE9153A_OILVL_VAL_MSK NO_OS_GENMASK(23, 0)
302 
303 /* ADE9153A_REG_OIA Bit Definition */
304 #define ADE9153A_OIA_VAL_MSK NO_OS_GENMASK(23, 0)
305 
306 /* ADE9153A_REG_OIB Bit Definition */
307 #define ADE9153A_OIB_VAL_MSK NO_OS_GENMASK(23, 0)
308 
309 /* ADE9153A_REG_VLEVEL Bit Definition */
310 #define ADE9153A_VLEVEL_VAL_MSK NO_OS_GENMASK(23, 0)
311 
312 /* ADE9153A_REG_DIPA Bit Definition */
313 #define ADE9153A_DIPA_VAL_MSK NO_OS_GENMASK(23, 0)
314 
315 /* ADE9153A_REG_SWELLA Bit Definition */
316 #define ADE9153A_SWELLA_VAL_MSK NO_OS_GENMASK(23, 0)
317 
318 /* ADE9153A_REG_PHNOLOAD Bit Definition */
319 #define ADE9153A_AFVARNL_MSK NO_OS_BIT(2)
320 #define ADE9153A_AVANL_MSK NO_OS_BIT(1)
321 #define ADE9153A_AWATTNL_MSK NO_OS_BIT(0)
322 
323 /* ADE9153A_REG_CF_LCFG Bit Definition */
324 #define ADE9153A_CF2_LT_MSK NO_OS_BIT(20)
325 #define ADE9153A_CF1_LT_MSK NO_OS_BIT(19)
326 #define ADE9153A_CF_LTMR_MSK NO_OS_GENMASK(18, 0)
327 
328 /* ADE9153A_REG_TEMP_TRIM Bit Definition */
329 #define ADE9153A_TEMP_OFFSET_MSK NO_OS_GENMASK(31, 16)
330 #define ADE9153A_TEMP_GAIN_MSK NO_OS_GENMASK(15, 0)
331 
332 /* ADE9153A_REG_CONFIG1 Bit Definition */
333 #define ADE9153A_EXT_REF_MSK NO_OS_BIT(15)
334 #define ADE9153A_DIP_SWELL_IRQ_MODE_MSK NO_OS_BIT(14)
335 #define ADE9153A_BURST_EN_MSK NO_OS_BIT(11)
336 #define ADE9153A_PWR_SETTLE_MSK NO_OS_GENMASK(9, 8)
337 #define ADE9153A_CF_ACC_CLR_MSK NO_OS_BIT(5)
338 #define ADE9153A_ZX_OUT_OE_MSK NO_OS_BIT(2)
339 #define ADE9153A_DREADY_OE_MSK NO_OS_BIT(1)
340 #define ADE9153A_SWRST_MSK NO_OS_BIT(0)
341 
342 /* ADE9153A_REG_CFMODE Bit Definition */
343 #define ADE9153A_CF2DIS_MSK NO_OS_BIT(7)
344 #define ADE9153A_CF1DIS_MSK NO_OS_BIT(6)
345 #define ADE9153A_CF2SEL_MSK NO_OS_GENMASK(5, 3)
346 #define ADE9153A_CF1SEL_MSK NO_OS_GENMASK(2, 0)
347 
348 /* ADE9153A_REG_ACCMODE Bit Definition */
349 #define ADE9153A_SELFREQ_MSK NO_OS_BIT(4)
350 #define ADE9153A_VARACC_MSK NO_OS_GENMASK(3, 2)
351 #define ADE9153A_WATTACC_MSK NO_OS_GENMASK(1, 0)
352 
353 /* ADE9153A_REG_CONFIG3 Bit Definition */
354 #define ADE9153A_PEAK_SEL_MSK NO_OS_GENMASK(3, 2)
355 #define ADE9153A_OIB_EN_MSK NO_OS_BIT(1)
356 #define ADE9153A_OIA_EN_MSK NO_OS_BIT(0)
357 
358 /* ADE9153A_REG_ZX_CFG Bit Definition */
359 #define ADE9153A_DISZXLPF_MSK NO_OS_BIT(0)
360 
361 /* ADE9153A_REG_PHSIGN Bit Definition */
362 #define ADE9153A_CF2SIGN_MSK NO_OS_BIT(7)
363 #define ADE9153A_CF1SIGN_MSK NO_OS_BIT(6)
364 #define ADE9153A_AVARSIGN_MSK NO_OS_BIT(1)
365 #define ADE9153A_AWSIGN_MSK NO_OS_BIT(0)
366 
367 /* ADE9153A_REG_CONFIG2 Bit Definition */
368 #define ADE9153A_UPERIOD_SEL_MSK NO_OS_BIT(12)
369 #define ADE9153A_HPF_CRN_MSK NO_OS_GENMASK(11, 9)
370 
371 /* ADE9153A_REG_EP_CFG Bit Definition */
372 #define ADE9153A_NOLOAD_TMR_MSK NO_OS_GENMASK(7, 5)
373 #define ADE9153A_RD_RST_EN_MSK NO_OS_BIT(3)
374 #define ADE9153A_EGY_LD_ACCUM_MSK NO_OS_BIT(2)
375 #define ADE9153A_EGY_TMR_MODE_MSK NO_OS_BIT(1)
376 #define ADE9153A_EGY_PWR_EN_MSK NO_OS_BIT(0)
377 
378 /* ADE9153A_REG_CRC_FORCE Bit Definition */
379 #define ADE9153A_FORCE_CRC_UPDATE_MSK NO_OS_BIT(0)
380 
381 /* ADE9153A_REG_TEMP_CFG Bit Definition */
382 #define ADE9153A_TEMP_START_MSK NO_OS_BIT(3)
383 #define ADE9153A_TEMP_EN_MSK NO_OS_BIT(2)
384 #define ADE9153A_TEMP_TIME_MSK NO_OS_GENMASK(1, 0)
385 
386 /* ADE9153A_REG_TEMP_RSLT Bit Definition */
387 #define ADE9153A_TEMP_RESULT_MSK NO_OS_GENMASK(11, 0)
388 
389 /* ADE9153A_REG_AI_PGAGAIN Bit Definition */
390 #define ADE9153A_AI_SWAP_MSK NO_OS_BIT(4)
391 #define ADE9153A_AI_GAIN_MSK NO_OS_GENMASK(2, 0)
392 
393 /* ADE9153A_REG_MS_STATUS_IRQ Bit Definition */
394 #define ADE9153A_MS_SYSRDY_MSK NO_OS_BIT(14)
395 #define ADE9153A_MS_CONFERR_MSK NO_OS_BIT(13)
396 #define ADE9153A_MS_ABSENT_MSK NO_OS_BIT(12)
397 #define ADE9153A_MS_TIMEOUT_MSK NO_OS_BIT(3)
398 #define ADE9153A_MS_READY_MSK NO_OS_BIT(1)
399 #define ADE9153A_MS_SHIFT_MSK NO_OS_BIT(0)
400 
401 /* ADE9153A_REG_EVENT_STATUS Bit Definition */
402 #define ADE9153A_OIB_MSK NO_OS_BIT(5)
403 #define ADE9153A_OIA_MSK NO_OS_BIT(4)
404 #define ADE9153A_SWELLA_MSK NO_OS_BIT(2)
405 #define ADE9153A_DIPA_MSK NO_OS_BIT(0)
406 
407 /* ADE9153A_REG_CHIP_STATUS Bit Definition */
408 #define ADE9153A_UART_RESET_MSK NO_OS_BIT(7)
409 #define ADE9153A_UART_ERROR2_MSK NO_OS_BIT(6)
410 #define ADE9153A_UART_ERROR1_MSK NO_OS_BIT(5)
411 #define ADE9153A_UART_ERROR0_MSK NO_OS_BIT(4)
412 #define ADE9153A_ERROR3_MSK NO_OS_BIT(3)
413 #define ADE9153A_ERROR2_MSK NO_OS_BIT(2)
414 #define ADE9153A_ERROR1_MSK NO_OS_BIT(1)
415 #define ADE9153A_ERROR0_MSK NO_OS_BIT(0)
416 
417 /******************************************************************************/
418 /*************************** Types Declarations *******************************/
419 /******************************************************************************/
420 
426  /* PGA gain for Current Channel B */
427  /* Gain 1 */
429  /* Gain 2 */
431  /* Gain 4 */
433 };
434 
440  /* Enable autocalibration on the voltage channel. */
442  /* Enable autocalibration on Current Channel B. */
444  /* Enable autocalibration on Current Channel A. */
446 };
447 
453  /* Normal mode. */
455  /* Turbo mode */
457 };
458 
464  /* 50 Hz */
466  /* 60 Hz */
468 };
469 
475  /* Configure the time for the power and filter-based */
476  /* rms measurements to settle before starting the */
477  /* power, energy, and CF accumulations */
478  /* 64 ms settle */
480  /* 128 ms settle */
482  /* 256 ms settle */
484  /* 0 ms settle */
486 };
487 
493  /* Configure the time for the power and filter-based */
494  /* rms measurements to settle before starting the */
495  /* power, energy, and CF accumulations */
496  /* Total active power */
498  /* Total apparent power */
500  /* Fundamental reactive power */
502 };
503 
509  /* Fundamental reactive power / total active power accumulation mode */
510  /* for energy registers and CFx pulses */
511  /* Signed accumulation mode */
513  /* Absolute value accumulation mode */
515  /* Positive accumulation mode */
517  /* Negative accumulation mode */
519 };
520 
526  /* Peak detection phase selection */
527  /* Phase A and Phase B disabled from voltage and current peak detection */
529  /* Phase A Voltage and current peak detection enabled, */
530  /* Phase B current peak detection disabled. */
532  /* Phase A Voltage and current peak detection disabled */
533  /* Phase B current peak detection enabled. */
535  /* Phase A & Phase B peak detection enabled. */
537 };
538 
544  /* Enabled when the HPFDIS bit in the CONFIG0 register is equal to zero */
545  /* 38.695 Hz */
547  /* 19.6375 Hz */
549  /* 9.895 Hz */
551  /* 4.9675 Hz */
553  /* 2.49 Hz */
555  /* 1.2475 Hz */
557  /* 0.625 Hz */
559  /* 0.3125 Hz */
561 };
562 
568  /* Configures how many 4 kSPS samples over which to evaluate */
569  /* the no load condition */
570  /* 64 samples */
572  /* 128 samples */
574  /* 256 samples */
576  /* 512 samples */
578  /* 1024 samples */
580  /* 2048 samples */
582  /* 4096 samples */
584  /* Disable no load threshold */
586 };
587 
593  /* Select the number of temperature readings to average*/
594  /* New temperature measurement every 1ms */
596  /* New temperature measurement every 256 ms */
598  /* New temperature measurement every 512 ms */
600  /* New temperature measurement every 1 sec */
602 };
603 
609  /* PGA gain*/
610  /* Gain = 16 */
612  /* Gain = 24 */
614  /* Gain = 32 */
616  /* Gain = 38.4 */
618 };
619 
625  /* Error 0 - SW/HW reset to clear */
627  /* Error 1 - SW/HW reset to clear */
629  /* Error 2 - SW/HW reset to clear */
631  /* Error 3 - SW/HW reset to clear */
633  /* UART Error 0 - UART reset to clear */
635  /* UART Error 1 - UART reset to clear */
637  /* UART Error 2 - UART reset to clear */
639  /* UART interface reset detected */
641 };
642 
648  /* No load */
649  /* Phase A fundamental reactive energy is in no load. */
650  AFVARNL = 1,
651  /* Phase A total apparent energy is in no load */
653  /* Phase A total active energy is in no load */
655 };
656 
662  /* continuous */
664  /* One interrupt when entering cond. another when exiting cond. */
666 };
667 
673  /* Device communication descriptor */
684  uint8_t spi_en;
688  uint8_t ai_swap;
696  uint32_t vlevel;
698  uint32_t rsmall;
700  uint32_t no_samples;
702  uint32_t ai_gain;
705  void (*drdy_callback)(void *context);
706 };
707 
712 struct ade9153a_dev {
716  uint8_t burst_en;
729 };
730 
742 };
743 
755 };
756 
767 };
768 
778 };
779 
788  int32_t period_reg_val;
791 };
792 
801  uint16_t offset_reg_val;
803  uint16_t gain_reg_val;
804 };
805 
812  uint32_t aicc_reg_val;
814  uint32_t aicert_reg_val;
816  uint32_t avcc_reg_val;
818  uint32_t avcert_reg_val;
819 };
820 
821 /******************************************************************************/
822 /************************ Functions Declarations ******************************/
823 /******************************************************************************/
824 
825 // Select comms interface SPI.
827 
828 // Select comms interface Serial.
830 
831 // GPIO interrupt handler for data ready.
832 static void ade9153a_irq_handler(void *dev);
833 
834 // Initialize the device.
835 int ade9153a_init(struct ade9153a_dev **device,
837 
838 // ADE9153A setup.
839 int ade9153a_setup(void *dev, struct ade9153a_init_param init_param);
840 
841 // Read device register.
842 int ade9153a_read(struct ade9153a_dev *dev, uint16_t reg_addr,
843  uint32_t *reg_data);
844 
845 // Write device register.
846 int ade9153a_write(struct ade9153a_dev *dev, uint16_t reg_addr,
847  uint32_t reg_data);
848 
849 // Update specific register bits.
850 static int ade9153a_update_bits(struct ade9153a_dev *dev, uint16_t reg_addr,
851  uint32_t mask, uint32_t reg_data);
852 
853 // Remove the device and release resources.
854 int ade9153a_remove(struct ade9153a_dev *dev);
855 
856 // Reset the device using SW reset.
857 int ade9153a_sw_reset(struct ade9153a_dev *dev);
858 
859 // Reset the device using HW reset.
860 int ade9153a_hw_reset(struct ade9153a_dev *dev);
861 
862 // Lock device.
863 int ade9153a_wr_lock(struct ade9153a_dev *dev);
864 
865 // Unlock device.
866 int ade9153a_wr_unlock(struct ade9153a_dev *dev);
867 
868 // Version product
869 int ade9153a_version_product(struct ade9153a_dev *dev, uint32_t *data_read);
870 
871 // Disable the low pass filter in the fundamental reactive power datapath.
872 int ade9153a_lpf_rp_disable(struct ade9153a_dev *dev);
873 
874 // Disable the low-pass filter in the total active power datapath.
875 int ade9153a_lpf_ap_disable(struct ade9153a_dev *dev);
876 
877 // Use the nominal phase voltage rms, VNOM, in the computation
878 // of the Phase A total apparent power.
879 int ade9153a_vnoma_enable(struct ade9153a_dev *dev);
880 
881 // Use x_WAV waveforms after the high-pass filter and phase
882 //compensation for the RMS_OC calculation.
884 
885 // Use ADC samples, before the high-pass filter for
886 // the RMS_OC calculation.
888 
889 // ZX data source after hpf and phase compensation
891 
892 // ZX data source before hpf and phase compensation
894 
895 // Current channel B integrator enable
897 
898 // Disable hpf for all channels
899 int ade9153a_hpf_disable(struct ade9153a_dev *dev);
900 
901 // Set PGA gain for current channel B
902 int ade9153a_bi_pgagain_set(struct ade9153a_dev *dev,
903  enum ade9153a_bi_gain_e gain);
904 
905 // Auto calibration config
907  enum ade9153a_acal_ch_e ch, enum ade9153a_acalmode_e mode);
908 
909 // Auto calibration run
911 
912 // Auto calibration stop
914 
915 // mSure status
916 int ade9153a_msure_status(struct ade9153a_dev *dev, uint8_t *status);
917 
918 // Ipeak channel phase
919 int ade9153a_ip_phase(struct ade9153a_dev *dev, uint8_t *ch);
920 
921 // Ipeak val
922 int ade9153a_ipk_val(struct ade9153a_dev *dev, uint32_t *val);
923 
924 // Vpeak val
925 int ade9153a_vpk_val(struct ade9153a_dev *dev, uint32_t *val);
926 
927 // Get interrupt indicator from STATUS register.
928 int ade9153a_get_int_status(struct ade9153a_dev *dev, uint32_t msk,
929  uint8_t *status);
930 
931 // Get PF ready indicator.
932 int ade9153a_get_pf_rdy(struct ade9153a_dev *dev, uint8_t *status);
933 
934 // Get CRC change indicator.
935 int ade9153a_get_crc_chg(struct ade9153a_dev *dev, uint8_t *status);
936 
937 // Get CRC done indicator.
938 int ade9153a_get_crc_done(struct ade9153a_dev *dev, uint8_t *status);
939 
940 // Get zero crossing timout on V ch indicator.
941 int ade9153a_get_zxtoav(struct ade9153a_dev *dev, uint8_t *status);
942 
943 // Get zero crossing detect on I ch B indicator.
944 int ade9153a_get_zxbi(struct ade9153a_dev *dev, uint8_t *status);
945 
946 // Get zero crossing detect on I ch A indicator.
947 int ade9153a_get_zxai(struct ade9153a_dev *dev, uint8_t *status);
948 
949 // Get zero crossing detect on V ch indicator.
950 ade9153a_get_zxav(struct ade9153a_dev *dev, uint8_t *status);
951 
952 // Get reset done indicator.
953 int ade9153a_get_rstdone(struct ade9153a_dev *dev, uint8_t *status);
954 
955 // Get fundamental reactive energy no load condition indicator.
956 int ade9153a_get_fvarnl(struct ade9153a_dev *dev, uint8_t *status);
957 
958 // Get total apparent energy no load condition indicator.
959 int ade9153a_get_vanl(struct ade9153a_dev *dev, uint8_t *status);
960 
961 // Get total active energy no load condition indicator.
962 int ade9153a_get_wattnl(struct ade9153a_dev *dev, uint8_t *status);
963 
964 // Get new temperature reading ready indicator.
965 int ade9153a_get_temp_rdy(struct ade9153a_dev *dev, uint8_t *status);
966 
967 // Get RMS_OC values update indicator.
968 int ade9153a_get_rms_oc_rdy(struct ade9153a_dev *dev, uint8_t *status);
969 
970 // Get power values registers update indicator.
971 int ade9153a_get_pwrrdy(struct ade9153a_dev *dev, uint8_t *status);
972 
973 // Get new waveform samples ready indicator.
974 int ade9153a_get_dready(struct ade9153a_dev *dev, uint8_t *status);
975 
976 // Get power values egy ready indicator.
977 int ade9153a_get_egyrdy(struct ade9153a_dev *dev, uint8_t *status);
978 
979 // Get CF2 pulse issued indicator.
980 int ade9153a_get_cf2(struct ade9153a_dev *dev, uint8_t *status);
981 
982 // Get CF1 pulse issued indicator.
983 int ade9153a_get_cf1(struct ade9153a_dev *dev, uint8_t *status);
984 
985 // Get CF2 polarity change indicator.
986 int ade9153a_get_cf2_chg(struct ade9153a_dev *dev, uint8_t *status);
987 
988 // Get CF1 polarity change indicator.
989 int ade9153a_get_cf1_chg(struct ade9153a_dev *dev, uint8_t *status);
990 
991 // Get RPA (reactive power) sign change indicator.
992 int ade9153a_get_rpa_chg_sgn(struct ade9153a_dev *dev, uint8_t *status);
993 
994 // Get APA (active power) sign change indicator.
995 int ade9153a_get_apa_chg_sgn(struct ade9153a_dev *dev, uint8_t *status);
996 
997 // Clear PF ready int mask.
998 int ade9153a_clear_pf_rdy(struct ade9153a_dev *dev);
999 
1000 // Clear CRC change int mask.
1001 int ade9153a_clear_crc_chg(struct ade9153a_dev *dev);
1002 
1003 // Clear CRC done int mask.
1004 int ade9153a_clear_crc_done(struct ade9153a_dev *dev);
1005 
1006 // Clear zero crossing timout on V ch int mask.
1007 int ade9153a_clear_zxtoav(struct ade9153a_dev *dev);
1008 
1009 // Clear zero crossing detect on I ch B int mask.
1010 int ade9153a_clear_zxbi(struct ade9153a_dev *dev);
1011 
1012 // Clear zero crossing detect on I ch A int mask.
1013 int ade9153a_clear_zxai(struct ade9153a_dev *dev);
1014 
1015 // Clear zero crossing detect on V ch int mask.
1016 int ade9153a_clear_zxav(struct ade9153a_dev *dev);
1017 
1018 // Clear reset done int mask.
1019 int ade9153a_clear_rstdone(struct ade9153a_dev *dev);
1020 
1021 // Clear fundamental reactive energy no load condition int mask.
1022 int ade9153a_clear_fvarnl(struct ade9153a_dev *dev);
1023 
1024 // Clear total apparent energy no load condition int mask.
1025 int ade9153a_clear_vanl(struct ade9153a_dev *dev);
1026 
1027 // Clear total active energy no load condition int mask.
1028 int ade9153a_clear_wattnl(struct ade9153a_dev *dev);
1029 
1030 // Clear new temperature reading ready int mask.
1031 int ade9153a_clear_temp_rdy(struct ade9153a_dev *dev);
1032 
1033 // Clear RMS_OC values update int mask.
1034 int ade9153a_clear_rms_oc_rdy(struct ade9153a_dev *dev);
1035 
1036 // Clear power values registers update int mask.
1037 int ade9153a_clear_pwrrdy(struct ade9153a_dev *dev);
1038 
1039 // Clear new waveform samples ready int mask.
1040 int ade9153a_clear_dready(struct ade9153a_dev *dev);
1041 
1042 // Clear power values egy ready int mask.
1043 int ade9153a_clear_egyrdy(struct ade9153a_dev *dev);
1044 
1045 // Clear CF2 pulse issued int mask.
1046 int ade9153a_clear_cf2(struct ade9153a_dev *dev);
1047 
1048 // Clear CF1 pulse issued int mask.
1049 ade9153a_clear_cf1(struct ade9153a_dev *dev);
1050 
1051 // Clear CF2 polarity change int mask.
1052 int ade9153a_clear_cf2_chg(struct ade9153a_dev *dev);
1053 
1054 // Clear CF1 polarity change int mask.
1055 int ade9153a_clear_cf1_chg(struct ade9153a_dev *dev);
1056 
1057 // Clear RPA (reactive power) sign change int mask.
1058 int ade9153a_clear_rpa_chg_sgn(struct ade9153a_dev *dev);
1059 
1060 // Clear APA (active power) sign change int mask.
1061 int ade9153a_clear_apa_chg_sgn(struct ade9153a_dev *dev);
1062 
1063 // Get chip status indicator.
1064 int ade9153a_get_chip_stat(struct ade9153a_dev *dev, uint8_t *status);
1065 
1066 // Clear chip status int.
1067 int ade9153a_clear_chip_stat(struct ade9153a_dev *dev, uint32_t *reg_val);
1068 
1069 // Get event status indicator.
1070 int ade9153a_get_event_stat(struct ade9153a_dev *dev, uint8_t *status);
1071 
1072 // Clear event status int.
1073 int ade9153a_clear_event_stat(struct ade9153a_dev *dev, uint32_t *reg_val);
1074 
1075 // Get MS status indicator.
1076 int ade9153a_get_ms_stat(struct ade9153a_dev *dev, uint8_t *status);
1077 
1078 // Clear MS status int.
1079 int ade9153a_clear_ms_stat(struct ade9153a_dev *dev, uint32_t *reg_val);
1080 
1081 // Enable/disable interrupt.
1082 int ade9153a_control_interrupt(struct ade9153a_dev *dev, uint16_t reg_addr,
1083  uint32_t int_msk, uint8_t en);
1084 
1085 // Enable an interrupt when any bit in CHIP_STATUS reg is set
1087 
1088 // Disable CHIP_STAT interrupt.
1090 
1091 // Enable an interrupt when any bit in EVENT_STATUS reg is set
1093 
1094 // Disable EVENT_STAT interrupt.
1096 
1097 // Enable an interrupt when any bit in MS_STATUS_IRQ reg is set
1098 int ade9153a_enable_ms_stat_int(struct ade9153a_dev *dev);
1099 
1100 // Disable MS_STAT interrupt.
1102 
1103 // Enable pf ready interrupt
1104 int ade9153a_enable_pf_rdy_int(struct ade9153a_dev *dev);
1105 
1106 // Disable pf ready interrupt.
1107 int ade9153a_disable_pf_rdy_int(struct ade9153a_dev *dev);
1108 
1109 // Enable crc change interrupt
1110 int ade9153a_enable_crc_chg_int(struct ade9153a_dev *dev);
1111 
1112 // Disable crc change interrupt.
1114 
1115 // Enable crc done interrupt
1117 
1118 // Disable crc done interrupt.
1120 
1121 // Enable zero corssing timeout on voltage ch interrupt
1122 int ade9153a_enable_zxtoav_int(struct ade9153a_dev *dev);
1123 
1124 // Disable zero corssing timeout on voltage ch interrupt.
1125 int ade9153a_disable_zxtoav_int(struct ade9153a_dev *dev);
1126 
1127 // Enable zero corssing detected on I ch B interrupt
1128 int ade9153a_enable_zxbi_int(struct ade9153a_dev *dev);
1129 
1130 // Disable zero corssing detected on I ch B interrupt.
1131 int ade9153a_disable_zxbi_int(struct ade9153a_dev *dev);
1132 
1133 // Enable zero corssing detected on I ch A interrupt
1134 int ade9153a_enable_zxai_int(struct ade9153a_dev *dev);
1135 
1136 // Disable zero corssing detected on I ch A interrupt.
1137 int ade9153a_disable_zxai_int(struct ade9153a_dev *dev);
1138 
1139 // Enable zero corssing detected on V ch interrupt
1140 int ade9153a_enable_zxav_int(struct ade9153a_dev *dev);
1141 
1142 // Disable zero corssing detected on V ch interrupt.
1143 int ade9153a_disable_zxav_int(struct ade9153a_dev *dev);
1144 
1145 // Enable fundamental reactive energy no load condition interrupt.
1146 int ade9153a_enable_fvarnl_int(struct ade9153a_dev *dev);
1147 
1148 // Disable fundamental reactive energy no load condition interrupt.
1149 int ade9153a_disable_fvarnl_int(struct ade9153a_dev *dev);
1150 
1151 // Enable total apparent energy no load condition interrupt.
1152 int ade9153a_enable_vanl_int(struct ade9153a_dev *dev);
1153 
1154 // Disable total apparent energy no load condition interrupt.
1155 int ade9153a_disable_vanl_int(struct ade9153a_dev *dev);
1156 
1157 // Enable total active energy no load condition interrupt.
1158 int ade9153a_enable_wattnl_int(struct ade9153a_dev *dev);
1159 
1160 // Disable total active energy no load condition interrupt.
1161 int ade9153a_disable_wattnl_int(struct ade9153a_dev *dev);
1162 
1163 // Enable new temperature reading interrupt.
1165 
1166 // Disable new temperature reading interrupt.
1168 
1169 // Enable RMS_OC values update interrupt.
1171 
1172 // Disable RMS_OC values update interrupt.
1174 
1175 // Enable PWRRDY interrupt.
1176 int ade9153a_enable_pwrrdy_int(struct ade9153a_dev *dev);
1177 
1178 // Disable PWRRDY interrupt.
1179 int ade9153a_disable_pwrrdy_int(struct ade9153a_dev *dev);
1180 
1181 // Enable data ready interrupt.
1182 int ade9153a_enable_dready_int(struct ade9153a_dev *dev);
1183 
1184 // Disable data ready interrupt.
1185 int ade9153a_disable_dready_int(struct ade9153a_dev *dev);
1186 
1187 // Enable EGYRDY interrupt.
1188 int ade9153a_enable_egyrdy_int(struct ade9153a_dev *dev);
1189 
1190 // Disable EGYRDY interrupt.
1191 int ade9153a_disable_egyrdy_int(struct ade9153a_dev *dev);
1192 
1193 // Enable CF2 interrupt.
1194 int ade9153a_enable_cf2_int(struct ade9153a_dev *dev);
1195 
1196 // Disable CF2 interrupt.
1197 int ade9153a_disable_cf2_int(struct ade9153a_dev *dev);
1198 
1199 // Enable CF1 interrupt.
1200 int ade9153a_enable_cf1_int(struct ade9153a_dev *dev);
1201 
1202 // Disable CF1 interrupt.
1203 int ade9153a_disable_cf1_int(struct ade9153a_dev *dev);
1204 
1205 // Enable CF2 polarity change sign interrupt.
1206 int ade9153a_enable_revpcf2_int(struct ade9153a_dev *dev);
1207 
1208 // Disable CF2 polarity change sign interrupt.
1210 
1211 // Enable CF1 polarity change sign interrupt.
1212 int ade9153a_enable_revpcf1_int(struct ade9153a_dev *dev);
1213 
1214 // Disable CF1 polarity change sign interrupt.
1216 
1217 // Enable Phase A fundamental reactive power changed sign interrupt.
1218 int ade9153a_enable_revrpa_int(struct ade9153a_dev *dev);
1219 
1220 // Disable Phase A fundamental reactive power changed sign interrupt.
1221 int ade9153a_disable_revrpa_int(struct ade9153a_dev *dev);
1222 
1223 // Enable Phase A total active power changed sign interrupt.
1224 int ade9153a_enable_revapa_int(struct ade9153a_dev *dev);
1225 
1226 // Disable Phase A total active power changed sign interrupt.
1227 int ade9153a_disable_revapa_int(struct ade9153a_dev *dev);
1228 
1229 // Overcurrent detection threshold level val
1230 int ade9153a_oi_lvl_val(struct ade9153a_dev *dev, uint32_t *val);
1231 
1232 // Ch A overcurrent val
1233 int ade9153a_oia_val(struct ade9153a_dev *dev, uint32_t *val);
1234 
1235 // Ch B overcurrent val
1236 int ade9153a_oib_val(struct ade9153a_dev *dev, uint32_t *val);
1237 
1238 // Vlevel val
1239 int ade9153a_vlevel_val(struct ade9153a_dev *dev, uint32_t *val);
1240 
1241 // Voltage value during dip condition
1242 int ade9153a_dipa_val(struct ade9153a_dev *dev, uint32_t *val);
1243 
1244 // Voltage value during swell condition
1245 int ade9153a_swella_val(struct ade9153a_dev *dev, uint32_t *val);
1246 
1247 // Get phnoload status.
1248 int ade9153a_get_phnoload_status(struct ade9153a_dev *dev, uint8_t *status);
1249 
1250 // CF2_LT status
1251 int ade9153a_cf2_lt_status(struct ade9153a_dev *dev, uint8_t *status);
1252 
1253 // CF1_LT status
1254 int ade9153a_cf1_lt_status(struct ade9153a_dev *dev, uint8_t *status);
1255 
1256 // cf_ltmr write value.
1257 int ade9153a_cf_ltmr_write(struct ade9153a_dev *dev, uint32_t reg_data);
1258 
1259 // cf_ltmr read value.
1260 int ade9153a_cf_ltmr_val(struct ade9153a_dev *dev, uint32_t *val);
1261 
1262 // temperature sensor offset.
1263 int ade9153a_temp_offset_val(struct ade9153a_dev *dev, uint32_t *val);
1264 
1265 // temperature sensor gain.
1266 int ade9153a_temp_gain_val(struct ade9153a_dev *dev, uint32_t *val);
1267 
1268 // External voltage reference enable/disable.
1269 int ade9153a_ext_ref(struct ade9153a_dev *dev, uint8_t en);
1270 
1271 // External_reference status
1272 int ade9153a_ext_ref_status(struct ade9153a_dev *dev, uint8_t *status);
1273 
1274 // Dip swell interrupt mode.
1276  enum dip_swell_irq_mode_en mode);
1277 
1278 // Burst read enable/disable.
1279 int ade9153a_burst_en(struct ade9153a_dev *dev);
1280 
1281 // Set PWR_SETTLE
1282 int ade9153a_pwr_settle_set(struct ade9153a_dev *dev,
1283  enum ade9153a_pwr_settle_e time);
1284 
1285 // Clear accumulation in the digital freq conv.
1286 int ade9153a_cf_acc_clr(struct ade9153a_dev *dev);
1287 
1288 // ZX driven to CF2 pin.
1289 int ade9153a_zx_out_oe(struct ade9153a_dev *dev);
1290 
1291 // DREADY driven to CF2 pin.
1292 int ade9153a_dready_oe(struct ade9153a_dev *dev);
1293 
1294 // CF2 output disable.
1295 int ade9153a_cf2dis(struct ade9153a_dev *dev);
1296 
1297 // CF1 output disable.
1298 int ade9153a_cf1dis(struct ade9153a_dev *dev);
1299 
1300 // Set type of energy output on CF2 pin
1301 int ade9153a_cf2sel(struct ade9153a_dev *dev,
1302  enum ade9153a_cf2sel_e energy_type);
1303 
1304 // Set type of energy output on CF1 pin
1305 int ade9153a_cf1sel(struct ade9153a_dev *dev,
1306  enum ade9153a_cf2sel_e energy_type);
1307 
1308 // Frequency select.
1309 int ade9153a_selfreq(struct ade9153a_dev *dev, enum ade9153a_selfreq_e freq);
1310 
1311 // Frequency setting
1312 int ade9153a_freq_s_status(struct ade9153a_dev *dev, uint8_t *status);
1313 
1314 // Select fundamental reactive power accumulation mode
1315 int ade9153a_varacc(struct ade9153a_dev *dev,
1316  enum ade9153a_accmode_e varacc_type);
1317 
1318 // Select total active power accumulation mode
1319 int ade9153a_wattacc(struct ade9153a_dev *dev,
1320  enum ade9153a_accmode_e wattacc_type);
1321 
1322 // Select peak detection channels
1323 int ade9153a_peak_sel(struct ade9153a_dev *dev,
1324  enum ade9153a_peak_sel_e peak_sel);
1325 
1326 // Ch B overcurretn detection enable.
1327 int ade9153a_oib_en(struct ade9153a_dev *dev);
1328 
1329 // Ch A overcurretn detection enable.
1330 int ade9153a_oia_en(struct ade9153a_dev *dev);
1331 
1332 // Zero crossing lpf disable.
1333 int ade9153a_diszxlpf(struct ade9153a_dev *dev);
1334 
1335 // Sign of CF2 power
1336 int ade9153a_cf2sign_status(struct ade9153a_dev *dev, uint8_t *status);
1337 
1338 // Sign of CF1 power
1339 int ade9153a_cf1sign_status(struct ade9153a_dev *dev, uint8_t *status);
1340 
1341 // Sign of reactive power
1342 int ade9153a_avarsign_status(struct ade9153a_dev *dev, uint8_t *status);
1343 
1344 // Sign of active power
1345 int ade9153a_awsign_status(struct ade9153a_dev *dev, uint8_t *status);
1346 
1347 // User period select.
1348 int ade9153a_uperiod_sel(struct ade9153a_dev *dev, uint8_t en);
1349 
1350 // Hpf corner freq
1351 int ade9153a_hpf_crn(struct ade9153a_dev *dev,
1352  enum ade9153a_hpf_crn_e hpf_corner_freq);
1353 
1354 // Set no. of samples for no load condition
1355 int ade9153a_noload_tmr(struct ade9153a_dev *dev,
1356  enum ade9153a_noload_tmr_e noload_samples);
1357 
1358 // Energy register read with value reset.
1359 int ade9153a_rd_rst_en(struct ade9153a_dev *dev);
1360 
1361 // Internal energy register accum.
1362 int ade9153a_egy_ld_accum(struct ade9153a_dev *dev, uint8_t en);
1363 
1364 // Energy accumulated based on the number of
1365 // 4 kSPS samples or zero-crossing events
1366 int ade9153a_egy_tmr_mode(struct ade9153a_dev *dev, uint8_t en);
1367 
1368 // Enable the energy and power accumulator when
1369 // the run bit is also set.
1370 int ade9153a_egy_pwr_en(struct ade9153a_dev *dev);
1371 
1372 // Force CRC calculation to start (update).
1373 int ade9153a_force_crc_update(struct ade9153a_dev *dev);
1374 
1375 // Manually request a new temperature sensor reading.
1376 int ade9153a_temp_start(struct ade9153a_dev *dev);
1377 
1378 // Enable the temperature sensor.
1379 int ade9153a_temp_en(struct ade9153a_dev *dev);
1380 
1381 // Select the number of temperature readings to average.
1382 int ade9153a_temp_time(struct ade9153a_dev *dev,
1383  enum ade9153a_temp_time_e temp_no_samples);
1384 
1385 // Temperature result
1386 int ade9153a_temp_result(struct ade9153a_dev *dev, uint16_t *val);
1387 
1388 // COMPMODE
1389 int ade9153a_compmode(struct ade9153a_dev *dev);
1390 
1391 // Start measurements.
1392 int ade9153a_run(struct ade9153a_dev *dev);
1393 
1394 // Stop measurements.
1395 int ade9153a_stop(struct ade9153a_dev *dev);
1396 
1397 // Set the signal side of the PGA.
1398 int ade9153a_ai_swap(struct ade9153a_dev *dev, uint8_t set);
1399 
1400 // Set the PGA gain for I chA.
1401 int ade9153a_ai_gain(struct ade9153a_dev *dev, enum ade9153a_ai_gain_e gain);
1402 
1403 // New run of mSure ready
1404 int ade9153a_ms_sysrdy(struct ade9153a_dev *dev, uint8_t *status);
1405 
1406 // Invalid config of mSure status
1407 int ade9153a_ms_conferr(struct ade9153a_dev *dev, uint8_t *status);
1408 
1409 // mSure not detected on the last enabled ch
1410 int ade9153a_ms_absent(struct ade9153a_dev *dev, uint8_t *status);
1411 
1412 // mSure timed out (600s)
1413 int ade9153a_ms_timeout(struct ade9153a_dev *dev, uint8_t *status);
1414 
1415 // mSure ready
1416 int ade9153a_ms_ready(struct ade9153a_dev *dev, uint8_t *status);
1417 
1418 // mSure shift detected in CC val
1419 int ade9153a_ms_shift(struct ade9153a_dev *dev, uint8_t *status);
1420 
1421 // Chip status
1422 int ade9153a_chip_status(struct ade9153a_dev *dev, uint8_t *status);
1423 
1424 // Temperature value in deg C
1425 int ade9153a_temp_val(struct ade9153a_dev *dev,
1426  struct ade9153a_temperature_value *data);
1427 
1428 // Read energy values
1429 int ade9153a_energy_vals(struct ade9153a_dev *dev,
1430  struct ade9153a_energy_values *data);
1431 
1432 // Read power values
1433 int ade9153a_power_vals(struct ade9153a_dev *dev,
1434  struct ade9153a_power_values *data);
1435 
1436 // Read rms values
1437 int ade9153a_rms_vals(struct ade9153a_dev *dev,
1438  struct ade9153a_rms_values *data);
1439 
1440 // Read half rms values
1441 int ade9153a_half_rms_vals(struct ade9153a_dev *dev,
1442  struct ade9153a_half_rms_values *data);
1443 
1444 // Read power quaility values
1446  struct ade9153a_pq_values *data);
1447 
1448 // Start autocalibration AI channel
1449 int ade9153a_start_autocal_ai(struct ade9153a_dev *dev,
1450  enum ade9153a_acalmode_e mode);
1451 
1452 // Start autocalibration BI channel
1453 int ade9153a_start_autocal_bi(struct ade9153a_dev *dev,
1454  enum ade9153a_acalmode_e mode);
1455 
1456 // Start autocalibration AV channel
1457 int ade9153a_start_autocal_av(struct ade9153a_dev *dev,
1458  enum ade9153a_acalmode_e mode);
1459 
1460 // Read autocalibration values
1462  struct ade9153a_autocal_vals *data);
1463 
1464 #endif // __ADE9153A_H__
ADE9153A_REVPCF2_MSK
#define ADE9153A_REVPCF2_MSK
Definition: ade9153a.h:295
ade9153a_disable_crc_done_int
int ade9153a_disable_crc_done_int(struct ade9153a_dev *dev)
Disable crc done interrupt.
Definition: ade9153a.c:2016
ade9153a_enable_zxai_int
int ade9153a_enable_zxai_int(struct ade9153a_dev *dev)
Enable zero corssing detected on I ch A interrupt.
Definition: ade9153a.c:2086
ade9153a_disable_cf1_int
int ade9153a_disable_cf1_int(struct ade9153a_dev *dev)
Disable CF1 interrupt.
Definition: ade9153a.c:2408
ade9153a_get_temp_rdy
int ade9153a_get_temp_rdy(struct ade9153a_dev *dev, uint8_t *status)
Get new temperature reading ready indicator.
Definition: ade9153a.c:1259
ADE9153A_REVPCF1_MSK
#define ADE9153A_REVPCF1_MSK
Definition: ade9153a.h:296
ADE9153A_REG_AWATTHR_HI
#define ADE9153A_REG_AWATTHR_HI
Definition: ade9153a.h:149
ADE9153A_TEMP_TIME_SAMPLES_512
@ ADE9153A_TEMP_TIME_SAMPLES_512
Definition: ade9153a.h:599
ade9153a_temp_time
int ade9153a_temp_time(struct ade9153a_dev *dev, enum ade9153a_temp_time_e temp_no_samples)
Select the number of temperature readings to average.
Definition: ade9153a.c:3658
ADE9153A_EGY_PWR_EN_MSK
#define ADE9153A_EGY_PWR_EN_MSK
Definition: ade9153a.h:376
ADE9153A_ZX_SRC_SEL_MSK
#define ADE9153A_ZX_SRC_SEL_MSK
Definition: ade9153a.h:247
ade9153a_clear_cf1_chg
int ade9153a_clear_cf1_chg(struct ade9153a_dev *dev)
Clear CF1 polarity change int mask.
Definition: ade9153a.c:1718
ade9153a_temp_en
int ade9153a_temp_en(struct ade9153a_dev *dev)
Enable the temperature sensor.
Definition: ade9153a.c:3643
ade9153a_cf2sel
int ade9153a_cf2sel(struct ade9153a_dev *dev, enum ade9153a_cf2sel_e energy_type)
Set type of energy output on CF2 pin.
Definition: ade9153a.c:3056
ade9153a_enable_temp_rdy_int
int ade9153a_enable_temp_rdy_int(struct ade9153a_dev *dev)
Enable new temperature reading interrupt.
Definition: ade9153a.c:2226
no_os_put_unaligned_be16
void no_os_put_unaligned_be16(uint16_t val, uint8_t *buf)
ade9153a_wr_lock
int ade9153a_wr_lock(struct ade9153a_dev *dev)
Lock device.
Definition: ade9153a.c:608
ADE9153A_UART_ERROR0_MSK
#define ADE9153A_UART_ERROR0_MSK
Definition: ade9153a.h:411
ade9153a_power_quality_vals
int ade9153a_power_quality_vals(struct ade9153a_dev *dev, struct ade9153a_pq_values *data)
Read power quaility values.
Definition: ade9153a.c:4242
ade9153a_half_rms_values::voltage_h_rms_reg_val
int32_t voltage_h_rms_reg_val
Definition: ade9153a.h:777
ade9153a_temp_result
int ade9153a_temp_result(struct ade9153a_dev *dev, uint16_t *val)
Temperature result.
Definition: ade9153a.c:3694
ade9153a_get_wattnl
int ade9153a_get_wattnl(struct ade9153a_dev *dev, uint8_t *status)
Get total active energy no load condition indicator.
Definition: ade9153a.c:1243
ade9153a_zx_out_oe
int ade9153a_zx_out_oe(struct ade9153a_dev *dev)
ZX driven to CF2 pin.
Definition: ade9153a.c:2999
ADE9153A_AUTOCAL_AV_MSK
#define ADE9153A_AUTOCAL_AV_MSK
Definition: ade9153a.h:255
ADE9153A_SWELLA_VAL_MSK
#define ADE9153A_SWELLA_VAL_MSK
Definition: ade9153a.h:316
timeout
uint32_t timeout
Definition: ad413x.c:49
ADE9153A_AI_GAIN_24
@ ADE9153A_AI_GAIN_24
Definition: ade9153a.h:613
ade9153a_get_zxav
ade9153a_get_zxav(struct ade9153a_dev *dev, uint8_t *status)
Get zero crossing detect on V ch indicator.
Definition: ade9153a.c:1179
no_os_alloc.h
ade9153a_get_cf1_chg
int ade9153a_get_cf1_chg(struct ade9153a_dev *dev, uint8_t *status)
Get CF1 polarity change indicator.
Definition: ade9153a.c:1387
no_os_gpio_init_param
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
ade9153a_lpf_ap_disable
int ade9153a_lpf_ap_disable(struct ade9153a_dev *dev)
Disable the low-pass filter in the total active power datapath.
Definition: ade9153a.c:683
AUTOCAL_BI
@ AUTOCAL_BI
Definition: ade9153a.h:443
ADE9153A_CF1SIGN_MSK
#define ADE9153A_CF1SIGN_MSK
Definition: ade9153a.h:363
ADE9153A_START_16ADDR
#define ADE9153A_START_16ADDR
Definition: ade9153a.h:82
ADE9153A_REG_CONFIG3
#define ADE9153A_REG_CONFIG3
Definition: ade9153a.h:196
ADE9153A_MS_SHIFT_MSK
#define ADE9153A_MS_SHIFT_MSK
Definition: ade9153a.h:399
ade9153a_energy_values::apparent_energy_reg_val
int32_t apparent_energy_reg_val
Definition: ade9153a.h:741
ADE9153A_CF2SEL_MSK
#define ADE9153A_CF2SEL_MSK
Definition: ade9153a.h:345
ade9153a_peak_sel_e
ade9153a_peak_sel_e
ADE9153A Peak sel.
Definition: ade9153a.h:525
ade9153a_get_rms_oc_rdy
int ade9153a_get_rms_oc_rdy(struct ade9153a_dev *dev, uint8_t *status)
Get RMS_OC values update indicator.
Definition: ade9153a.c:1275
ADE9153A_REG_EP_CFG
#define ADE9153A_REG_EP_CFG
Definition: ade9153a.h:208
ade9153a_clear_zxbi
int ade9153a_clear_zxbi(struct ade9153a_dev *dev)
Clear zero crossing detect on I ch B int mask.
Definition: ade9153a.c:1494
ade9153a_auto_calibration_cfg
int ade9153a_auto_calibration_cfg(struct ade9153a_dev *dev, enum ade9153a_acal_ch_e ch, enum ade9153a_acalmode_e mode)
Auto calibration config.
Definition: ade9153a.c:852
ADE9153A_VARACC_MSK
#define ADE9153A_VARACC_MSK
Definition: ade9153a.h:350
ade9153a_temp_start
int ade9153a_temp_start(struct ade9153a_dev *dev)
Manually request a new temperature sensor reading.
Definition: ade9153a.c:3629
ade9153a_sw_reset
int ade9153a_sw_reset(struct ade9153a_dev *dev)
Reset the device using SW reset.
Definition: ade9153a.c:555
ade9153a_enable_crc_chg_int
int ade9153a_enable_crc_chg_int(struct ade9153a_dev *dev)
Enable crc change interrupt.
Definition: ade9153a.c:1974
ADE9153A_REG_TEMP_CFG
#define ADE9153A_REG_TEMP_CFG
Definition: ade9153a.h:212
ade9153a_autocal_vals::aicert_reg_val
uint32_t aicert_reg_val
Definition: ade9153a.h:814
ade9153a_ms_ready
int ade9153a_ms_ready(struct ade9153a_dev *dev, uint8_t *status)
mSure ready
Definition: ade9153a.c:3922
ade9153a_power_quality_vals
int ade9153a_power_quality_vals(struct ade9153a_dev *dev, struct ade9153a_pq_values *data)
Read power quaility values.
Definition: ade9153a.c:4242
ADE9153A_HPF_CORNER_9_895_HZ
@ ADE9153A_HPF_CORNER_9_895_HZ
Definition: ade9153a.h:550
ade9153a_energy_values::fundamental_reactive_energy_reg_val
int32_t fundamental_reactive_energy_reg_val
Definition: ade9153a.h:739
ADE9153A_CF1_MSK
#define ADE9153A_CF1_MSK
Definition: ade9153a.h:294
ade9153a_wattacc
int ade9153a_wattacc(struct ade9153a_dev *dev, enum ade9153a_accmode_e wattacc_type)
Select Total active power accumulation mode.
Definition: ade9153a.c:3211
ade9153a_disable_egyrdy_int
int ade9153a_disable_egyrdy_int(struct ade9153a_dev *dev)
Disable EGYRDY interrupt.
Definition: ade9153a.c:2352
ade9153a_hpf_crn
int ade9153a_hpf_crn(struct ade9153a_dev *dev, enum ade9153a_hpf_crn_e hpf_corner_freq)
Hpf corner freq.
Definition: ade9153a.c:3451
ADE9153A_REG_MS_STATUS_IRQ
#define ADE9153A_REG_MS_STATUS_IRQ
Definition: ade9153a.h:216
ade9153a_disable_wattnl_int
int ade9153a_disable_wattnl_int(struct ade9153a_dev *dev)
Disable total active energy no load condition interrupt.
Definition: ade9153a.c:2212
ade9153a_enable_egyrdy_int
int ade9153a_enable_egyrdy_int(struct ade9153a_dev *dev)
Enable EGYRDY interrupt.
Definition: ade9153a.c:2338
ade9153a_zx_src_before_hpf_enable
int ade9153a_zx_src_before_hpf_enable(struct ade9153a_dev *dev)
ZX data source before hpf and phase compensation.
Definition: ade9153a.c:771
ade9153a_get_phnoload_status
int ade9153a_get_phnoload_status(struct ade9153a_dev *dev, uint8_t *status)
Get phnoload status.
Definition: ade9153a.c:2685
ade9153a_get_rstdone
int ade9153a_get_rstdone(struct ade9153a_dev *dev, uint8_t *status)
Get reset done indicator.
Definition: ade9153a.c:1195
ade9153a_rms_oc_src_x_wav_enable
int ade9153a_rms_oc_src_x_wav_enable(struct ade9153a_dev *dev)
Use x_WAV waveforms after the high-pass filter and phase compensation for the RMS_OC calculation.
Definition: ade9153a.c:719
ade9153a_clear_egyrdy
int ade9153a_clear_egyrdy(struct ade9153a_dev *dev)
Clear power values egy ready int mask.
Definition: ade9153a.c:1659
ade9153a_awsign_status
int ade9153a_awsign_status(struct ade9153a_dev *dev, uint8_t *status)
Sign of active power.
Definition: ade9153a.c:3409
ADE9153A_POSITIVE_ACC_MODE
@ ADE9153A_POSITIVE_ACC_MODE
Definition: ade9153a.h:516
ADE9153A_IPPHASE_MSK
#define ADE9153A_IPPHASE_MSK
Definition: ade9153a.h:267
ade9153a_get_pf_rdy
int ade9153a_get_pf_rdy(struct ade9153a_dev *dev, uint8_t *status)
Get PF ready indicator.
Definition: ade9153a.c:1083
ade9153a_disable_cf2_int
int ade9153a_disable_cf2_int(struct ade9153a_dev *dev)
Disable CF2 interrupt.
Definition: ade9153a.c:2380
ade9153a_enable_zxbi_int
int ade9153a_enable_zxbi_int(struct ade9153a_dev *dev)
Enable zero corssing detected on I ch B interrupt.
Definition: ade9153a.c:2058
ade9153a_temp_en
int ade9153a_temp_en(struct ade9153a_dev *dev)
Enable the temperature sensor.
Definition: ade9153a.c:3643
ADE9153A_REVAPA_MSK
#define ADE9153A_REVAPA_MSK
Definition: ade9153a.h:298
ade9153a_enable_crc_done_int
int ade9153a_enable_crc_done_int(struct ade9153a_dev *dev)
Enable crc done interrupt.
Definition: ade9153a.c:2002
ade9153a_clear_rpa_chg_sgn
int ade9153a_clear_rpa_chg_sgn(struct ade9153a_dev *dev)
Clear RPA (reactive power) sign change int mask.
Definition: ade9153a.c:1732
ade9153a_init_param::vlevel
uint32_t vlevel
Definition: ade9153a.h:696
ade9153a_ext_ref
int ade9153a_ext_ref(struct ade9153a_dev *dev, uint8_t en)
External voltage reference enable/disable.
Definition: ade9153a.c:2864
ADE9153A_UART_ERROR2_MSK
#define ADE9153A_UART_ERROR2_MSK
Definition: ade9153a.h:409
ade9153a_get_egyrdy
int ade9153a_get_egyrdy(struct ade9153a_dev *dev, uint8_t *status)
Get power values egy ready indicator.
Definition: ade9153a.c:1323
ade9153a_cf_acc_clr
int ade9153a_cf_acc_clr(struct ade9153a_dev *dev)
Clear accumulation in the digital freq conv.
Definition: ade9153a.c:2985
NO_OS_GENMASK
#define NO_OS_GENMASK(h, l)
Definition: no_os_util.h:82
ADE9153A_SETTLE_0_MS
@ ADE9153A_SETTLE_0_MS
Definition: ade9153a.h:485
ADE9153A_UART_ERROR1
@ ADE9153A_UART_ERROR1
Definition: ade9153a.h:636
ADE9153A_PGA_CHB_GAIN_4
@ ADE9153A_PGA_CHB_GAIN_4
Definition: ade9153a.h:432
ade9153a_clear_rms_oc_rdy
int ade9153a_clear_rms_oc_rdy(struct ade9153a_dev *dev)
Clear RMS_OC values update int mask.
Definition: ade9153a.c:1614
no_os_spi_write_and_read
int32_t no_os_spi_write_and_read(struct no_os_spi_desc *desc, uint8_t *data, uint16_t bytes_number)
Write and read data to/from SPI.
Definition: no_os_spi.c:159
ade9153a_auto_calibration_stop
int ade9153a_auto_calibration_stop(struct ade9153a_dev *dev)
Auto calibration stop.
Definition: ade9153a.c:926
ADE9153A_VERSION
#define ADE9153A_VERSION
Definition: ade9153a.h:76
ade9153a_enable_zxav_int
int ade9153a_enable_zxav_int(struct ade9153a_dev *dev)
Enable zero corssing detected on V ch interrupt.
Definition: ade9153a.c:2114
ADE9153A_END_16ADDR
#define ADE9153A_END_16ADDR
Definition: ade9153a.h:83
ADE9153A_PEAK_DETECTION_ENABLE_V_I_PHA
@ ADE9153A_PEAK_DETECTION_ENABLE_V_I_PHA
Definition: ade9153a.h:531
ADE9153A_REG_APF
#define ADE9153A_REG_APF
Definition: ade9153a.h:132
ade9153a_clear_crc_chg
int ade9153a_clear_crc_chg(struct ade9153a_dev *dev)
Clear CRC change int mask.
Definition: ade9153a.c:1449
ade9153a_disable_zxbi_int
int ade9153a_disable_zxbi_int(struct ade9153a_dev *dev)
Disable zero corssing detected on I ch B interrupt.
Definition: ade9153a.c:2072
ade9153a_temp_start
int ade9153a_temp_start(struct ade9153a_dev *dev)
Manually request a new temperature sensor reading.
Definition: ade9153a.c:3629
ADE9153A_REG_AVA
#define ADE9153A_REG_AVA
Definition: ade9153a.h:130
no_os_callback_desc
Structure describing a callback to be registered.
Definition: no_os_irq.h:142
ADE9153A_HPF_CORNER_2_49_HZ
@ ADE9153A_HPF_CORNER_2_49_HZ
Definition: ade9153a.h:554
ade9153a_msure_status
int ade9153a_msure_status(struct ade9153a_dev *dev, uint8_t *status)
mSure status
Definition: ade9153a.c:945
ade9153a_pq_values::angle_ai_av_reg_val
int32_t angle_ai_av_reg_val
Definition: ade9153a.h:790
ade9153a_lpf_rp_disable
int ade9153a_lpf_rp_disable(struct ade9153a_dev *dev)
Disable the low pass filter in the fundamental reactive power datapath.
Definition: ade9153a.c:666
ADE9153A_REG_CONFIG0
#define ADE9153A_REG_CONFIG0
Definition: ade9153a.h:114
ade9153a_get_crc_chg
int ade9153a_get_crc_chg(struct ade9153a_dev *dev, uint8_t *status)
Get CRC change indicator.
Definition: ade9153a.c:1099
ade9153a_get_cf2_chg
int ade9153a_get_cf2_chg(struct ade9153a_dev *dev, uint8_t *status)
Get CF2 polarity change indicator.
Definition: ade9153a.c:1371
ade9153a_zx_src_after_hpf_enable
int ade9153a_zx_src_after_hpf_enable(struct ade9153a_dev *dev)
ZX data source after hpf and phase compensation.
Definition: ade9153a.c:754
ade9153a_get_zxtoav
int ade9153a_get_zxtoav(struct ade9153a_dev *dev, uint8_t *status)
Get zero crossing timout on V ch indicator.
Definition: ade9153a.c:1131
ade9153a_read
int ade9153a_read(struct ade9153a_dev *dev, uint16_t reg_addr, uint32_t *reg_data)
Read device register.
Definition: ade9153a.c:365
ADE9153A_TEMP_RESULT_MSK
#define ADE9153A_TEMP_RESULT_MSK
Definition: ade9153a.h:387
ade9153a_disable_revrpa_int
int ade9153a_disable_revrpa_int(struct ade9153a_dev *dev)
Disable Phase A fundamental reactive power changed sign interrupt.
Definition: ade9153a.c:2492
ADE9153A_REG_AVRMS_OC
#define ADE9153A_REG_AVRMS_OC
Definition: ade9153a.h:134
ADE9153A_ZXTOAV_MSK
#define ADE9153A_ZXTOAV_MSK
Definition: ade9153a.h:280
ade9153a_disable_rms_oc_rdy_int
int ade9153a_disable_rms_oc_rdy_int(struct ade9153a_dev *dev)
Disable RMS_OC values update interrupt.
Definition: ade9153a.c:2268
ade9153a_get_zxbi
int ade9153a_get_zxbi(struct ade9153a_dev *dev, uint8_t *status)
Get zero crossing detect on I ch B indicator.
Definition: ade9153a.c:1147
ADE9153A_CF_LTMR_MSK
#define ADE9153A_CF_LTMR_MSK
Definition: ade9153a.h:326
ADE9153A_REG_SWELLA
#define ADE9153A_REG_SWELLA
Definition: ade9153a.h:172
ade9153a_disable_zxtoav_int
int ade9153a_disable_zxtoav_int(struct ade9153a_dev *dev)
Disable zero corssing timeout on voltage ch interrupt.
Definition: ade9153a.c:2044
no_os_spi.h
Header file of SPI Interface.
ade9153a_cf_ltmr_val
int ade9153a_cf_ltmr_val(struct ade9153a_dev *dev, uint32_t *val)
cf_ltmr read value.
Definition: ade9153a.c:2788
ade9153a_hpf_disable
int ade9153a_hpf_disable(struct ade9153a_dev *dev)
Disable hpf for all channels.
Definition: ade9153a.c:805
ade9153a_autocal_vals::avcert_reg_val
uint32_t avcert_reg_val
Definition: ade9153a.h:818
ade9153a_bi_pgagain_set
int ade9153a_bi_pgagain_set(struct ade9153a_dev *dev, enum ade9153a_bi_gain_e gain)
Set PGA gain for current channel B.
Definition: ade9153a.c:823
ADE9153A_OIA_VAL_MSK
#define ADE9153A_OIA_VAL_MSK
Definition: ade9153a.h:304
ade9153a_ms_sysrdy
int ade9153a_ms_sysrdy(struct ade9153a_dev *dev, uint8_t *status)
New run of mSure ready.
Definition: ade9153a.c:3814
no_os_irq.h
Header file of IRQ interface.
AUTOCAL_AI
@ AUTOCAL_AI
Definition: ade9153a.h:445
no_os_irq_register_callback
int32_t no_os_irq_register_callback(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, struct no_os_callback_desc *callback_desc)
Register a callback to handle the irq events.
Definition: no_os_irq.c:92
ADE9153A_WATTACC_MSK
#define ADE9153A_WATTACC_MSK
Definition: ade9153a.h:351
ade9153a_start_autocal_ai
int ade9153a_start_autocal_ai(struct ade9153a_dev *dev, enum ade9153a_acalmode_e mode)
Start autocalibration AI channel.
Definition: ade9153a.c:4281
ADE9153A_STOP
#define ADE9153A_STOP
Definition: ade9153a.h:73
ADE9153A_REG_OIB
#define ADE9153A_REG_OIB
Definition: ade9153a.h:166
ade9153a_init_param::ai_swap
uint8_t ai_swap
Definition: ade9153a.h:688
ade9153a_egy_pwr_en
int ade9153a_egy_pwr_en(struct ade9153a_dev *dev)
Enable the energy and power accumulator when the run bit is also set.
Definition: ade9153a.c:3600
ade9153a_start_autocal_bi
int ade9153a_start_autocal_bi(struct ade9153a_dev *dev, enum ade9153a_acalmode_e mode)
Start autocalibration BI channel.
Definition: ade9153a.c:4313
ade9153a_disable_pwrrdy_int
int ade9153a_disable_pwrrdy_int(struct ade9153a_dev *dev)
Disable PWRRDY interrupt.
Definition: ade9153a.c:2296
ade9153a_enable_pf_rdy_int
int ade9153a_enable_pf_rdy_int(struct ade9153a_dev *dev)
Enable pf ready interrupt.
Definition: ade9153a.c:1946
ade9153a_clear_zxav
int ade9153a_clear_zxav(struct ade9153a_dev *dev)
Clear zero crossing detect on V ch int mask.
Definition: ade9153a.c:1524
ade9153a_run
int ade9153a_run(struct ade9153a_dev *dev)
Start measurements.
Definition: ade9153a.c:3733
ade9153a_enable_vanl_int
int ade9153a_enable_vanl_int(struct ade9153a_dev *dev)
Enable total apparent energy no load condition interrupt.
Definition: ade9153a.c:2170
ade9153a_init_param::freq
enum ade9153a_selfreq_e freq
Definition: ade9153a.h:694
no_os_units.h
Header file of Units.
ade9153a_start_autocal_av
int ade9153a_start_autocal_av(struct ade9153a_dev *dev, enum ade9153a_acalmode_e mode)
Start autocalibration AV channel.
Definition: ade9153a.c:4345
ade9153a_enable_pf_rdy_int
int ade9153a_enable_pf_rdy_int(struct ade9153a_dev *dev)
Enable pf ready interrupt.
Definition: ade9153a.c:1946
ADE9153A_NOLOAD_TMR_MSK
#define ADE9153A_NOLOAD_TMR_MSK
Definition: ade9153a.h:372
ade9153a_disable_revapa_int
int ade9153a_disable_revapa_int(struct ade9153a_dev *dev)
Disable Phase A total active power changed sign interrupt.
Definition: ade9153a.c:2520
ade9153a_power_values
ADE9153A power registers values.
Definition: ade9153a.h:748
ade9153a_peak_sel
int ade9153a_peak_sel(struct ade9153a_dev *dev, enum ade9153a_peak_sel_e peak_sel)
Select peak detection channels.
Definition: ade9153a.c:3247
ADE9153A_UPERIOD_SEL_MSK
#define ADE9153A_UPERIOD_SEL_MSK
Definition: ade9153a.h:368
ADE9153A_CRC_CHG_MSK
#define ADE9153A_CRC_CHG_MSK
Definition: ade9153a.h:278
ade9153a_clear_rstdone
int ade9153a_clear_rstdone(struct ade9153a_dev *dev)
Clear reset done int mask.
Definition: ade9153a.c:1539
ADE9153A_REG_CRC_FORCE
#define ADE9153A_REG_CRC_FORCE
Definition: ade9153a.h:211
ADE9153A_REG_VDIV_RSMALL
#define ADE9153A_REG_VDIV_RSMALL
Definition: ade9153a.h:124
ade9153a_cf2dis
int ade9153a_cf2dis(struct ade9153a_dev *dev)
CF2 output disable.
Definition: ade9153a.c:3027
ade9153a_set_interface_spi
int ade9153a_set_interface_spi(struct ade9153a_dev *dev)
Select comms interface SPI.
Definition: ade9153a.c:65
ADE9153A_REG_ACCMODE
#define ADE9153A_REG_ACCMODE
Definition: ade9153a.h:195
ade9153a_half_rms_vals
int ade9153a_half_rms_vals(struct ade9153a_dev *dev, struct ade9153a_half_rms_values *data)
Read half rms values.
Definition: ade9153a.c:4209
ade9153a_init_param::ai_pga_gain
enum ade9153a_ai_gain_e ai_pga_gain
Definition: ade9153a.h:690
ade9153a_stop
int ade9153a_stop(struct ade9153a_dev *dev)
Stop measurements.
Definition: ade9153a.c:3748
ADE9153A_AUTOCAL_AI_MSK
#define ADE9153A_AUTOCAL_AI_MSK
Definition: ade9153a.h:257
ADE9153A_OIA_EN_MSK
#define ADE9153A_OIA_EN_MSK
Definition: ade9153a.h:356
ade9153a_ai_swap
int ade9153a_ai_swap(struct ade9153a_dev *dev, uint8_t set)
Set the signal side of the PGA.
Definition: ade9153a.c:3764
ADE9153A_CF_ACC_CLR_MSK
#define ADE9153A_CF_ACC_CLR_MSK
Definition: ade9153a.h:337
no_os_delay.h
Header file of Delay functions.
ade9153a_get_cf1_chg
int ade9153a_get_cf1_chg(struct ade9153a_dev *dev, uint8_t *status)
Get CF1 polarity change indicator.
Definition: ade9153a.c:1387
ade9153a_disable_zxav_int
int ade9153a_disable_zxav_int(struct ade9153a_dev *dev)
Disable zero corssing detected on V ch interrupt.
Definition: ade9153a.c:2128
ade9153a_disable_zxai_int
int ade9153a_disable_zxai_int(struct ade9153a_dev *dev)
Disable zero corssing detected on I ch A interrupt.
Definition: ade9153a.c:2100
ade9153a_init_param
ADE9153a Device initialization parameters.
Definition: ade9153a.h:672
ade9153a_oib_en
int ade9153a_oib_en(struct ade9153a_dev *dev)
Ch B overcurretn detection enable.
Definition: ade9153a.c:3285
ADE9153A_MS_ABSENT_MSK
#define ADE9153A_MS_ABSENT_MSK
Definition: ade9153a.h:396
pr_info
#define pr_info(fmt, args...)
Definition: no_os_print_log.h:115
ADE9153A_DISRPLPF_MSK
#define ADE9153A_DISRPLPF_MSK
Definition: ade9153a.h:243
ade9153a_get_cf2
int ade9153a_get_cf2(struct ade9153a_dev *dev, uint8_t *status)
Get CF2 pulse issued indicator.
Definition: ade9153a.c:1339
ade9153a_cf1_lt_status
int ade9153a_cf1_lt_status(struct ade9153a_dev *dev, uint8_t *status)
CF1_LT status.
Definition: ade9153a.c:2746
ADE9153A_REVRPA_MSK
#define ADE9153A_REVRPA_MSK
Definition: ade9153a.h:297
ade9153a_auto_calibration_stop
int ade9153a_auto_calibration_stop(struct ade9153a_dev *dev)
Auto calibration stop.
Definition: ade9153a.c:926
ade9153a_disable_egyrdy_int
int ade9153a_disable_egyrdy_int(struct ade9153a_dev *dev)
Disable EGYRDY interrupt.
Definition: ade9153a.c:2352
ADE9153A_RMS_OC_SRC_MSK
#define ADE9153A_RMS_OC_SRC_MSK
Definition: ade9153a.h:246
ADE9153A_ZXAV_MSK
#define ADE9153A_ZXAV_MSK
Definition: ade9153a.h:283
ade9153a_dev::irq_ctrl
struct no_os_irq_ctrl_desc * irq_ctrl
Definition: ade9153a.h:726
ade9153a_disable_revapa_int
int ade9153a_disable_revapa_int(struct ade9153a_dev *dev)
Disable Phase A total active power changed sign interrupt.
Definition: ade9153a.c:2520
ADE9153A_NOLOAD_TMR_SAMPLES_128
@ ADE9153A_NOLOAD_TMR_SAMPLES_128
Definition: ade9153a.h:573
ADE9153A_OILVL_VAL_MSK
#define ADE9153A_OILVL_VAL_MSK
Definition: ade9153a.h:301
ade9153a_clear_crc_chg
int ade9153a_clear_crc_chg(struct ade9153a_dev *dev)
Clear CRC change int mask.
Definition: ade9153a.c:1449
ade9153a_init_param::drdy_callback
void(* drdy_callback)(void *context)
Definition: ade9153a.h:705
ADE9153A_TEMP_TIME_SAMPLES_1024
@ ADE9153A_TEMP_TIME_SAMPLES_1024
Definition: ade9153a.h:601
ade9153a_clear_vanl
int ade9153a_clear_vanl(struct ade9153a_dev *dev)
Clear total apparent energy no load condition int mask.
Definition: ade9153a.c:1569
ADE9153A_TOTAL_FUNDAMENTAL_REACTIVE_POWER
@ ADE9153A_TOTAL_FUNDAMENTAL_REACTIVE_POWER
Definition: ade9153a.h:501
ade9153a_get_rpa_chg_sgn
int ade9153a_get_rpa_chg_sgn(struct ade9153a_dev *dev, uint8_t *status)
Get RPA (reactive power) sign change indicator.
Definition: ade9153a.c:1403
ENABLE
#define ENABLE
Definition: ad77681.h:339
ade9153a_get_zxav
int ade9153a_get_zxav(struct ade9153a_dev *dev, uint8_t *status)
Get zero crossing detect on V ch indicator.
Definition: ade9153a.c:1179
ade9153a_clear_rpa_chg_sgn
int ade9153a_clear_rpa_chg_sgn(struct ade9153a_dev *dev)
Clear RPA (reactive power) sign change int mask.
Definition: ade9153a.c:1732
ade9153a_temp_val
int ade9153a_temp_val(struct ade9153a_dev *dev, struct ade9153a_temperature_value *data)
Temperature value in deg C.
Definition: ade9153a.c:4025
ADE9153A_OIB_EN_MSK
#define ADE9153A_OIB_EN_MSK
Definition: ade9153a.h:355
ADE9153A_NOLOAD_TMR_SAMPLES_4096
@ ADE9153A_NOLOAD_TMR_SAMPLES_4096
Definition: ade9153a.h:583
device
Definition: ad9361_util.h:69
ade9153a_dev::gpio_reset
struct no_os_gpio_desc * gpio_reset
Definition: ade9153a.h:720
ade9153a_clear_dready
int ade9153a_clear_dready(struct ade9153a_dev *dev)
Clear new waveform samples ready int mask.
Definition: ade9153a.c:1644
ade9153a_init_param::gpio_rdy
struct no_os_gpio_init_param * gpio_rdy
Definition: ade9153a.h:676
ADE9153A_REG_VERSION_PRODUCT
#define ADE9153A_REG_VERSION_PRODUCT
Definition: ade9153a.h:146
NO_OS_GPIO_HIGH
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:117
ade9153a_read_autocal_vals
int ade9153a_read_autocal_vals(struct ade9153a_dev *dev, struct ade9153a_autocal_vals *data)
Read autocalibration values.
Definition: ade9153a.c:4377
ade9153a_disable_zxai_int
int ade9153a_disable_zxai_int(struct ade9153a_dev *dev)
Disable zero corssing detected on I ch A interrupt.
Definition: ade9153a.c:2100
ade9153a_disable_dready_int
int ade9153a_disable_dready_int(struct ade9153a_dev *dev)
Disable data ready interrupt.
Definition: ade9153a.c:2324
no_os_print_log.h
Print messages helpers.
ade9153a_noload_tmr
int ade9153a_noload_tmr(struct ade9153a_dev *dev, enum ade9153a_noload_tmr_e noload_samples)
Set no. of samples for no load condition.
Definition: ade9153a.c:3503
ade9153a_egy_pwr_en
int ade9153a_egy_pwr_en(struct ade9153a_dev *dev)
Enable the energy and power accumulator when the run bit is also set.
Definition: ade9153a.c:3600
ade9153a_get_zxtoav
int ade9153a_get_zxtoav(struct ade9153a_dev *dev, uint8_t *status)
Get zero crossing timout on V ch indicator.
Definition: ade9153a.c:1131
NO_OS_DECLARE_CRC16_TABLE
NO_OS_DECLARE_CRC16_TABLE(ade9153a_crc16)
ade9153a_enable_revpcf2_int
int ade9153a_enable_revpcf2_int(struct ade9153a_dev *dev)
Enable CF2 polarity change sign interrupt.
Definition: ade9153a.c:2422
ade9153a_disable_fvarnl_int
int ade9153a_disable_fvarnl_int(struct ade9153a_dev *dev)
Disable fundamental reactive energy no load condition interrupt.
Definition: ade9153a.c:2156
ade9153a_clear_crc_done
int ade9153a_clear_crc_done(struct ade9153a_dev *dev)
Clear CRC done int mask.
Definition: ade9153a.c:1464
ADE9153A_HPF_CRN_MSK
#define ADE9153A_HPF_CRN_MSK
Definition: ade9153a.h:369
ADE9153A_REG_CF_LCFG
#define ADE9153A_REG_CF_LCFG
Definition: ade9153a.h:183
ade9153a_clear_ms_stat
int ade9153a_clear_ms_stat(struct ade9153a_dev *dev, uint32_t *reg_val)
Clear MS status int.
Definition: ade9153a.c:1831
ADE9153A_REG_OI_LVL
#define ADE9153A_REG_OI_LVL
Definition: ade9153a.h:164
ADE9153A_CRC_DONE_MSK
#define ADE9153A_CRC_DONE_MSK
Definition: ade9153a.h:279
ade9153a_temp_offset_val
int ade9153a_temp_offset_val(struct ade9153a_dev *dev, uint32_t *val)
temperature sensor offset.
Definition: ade9153a.c:2813
ADE9153A_SELFREQ_MSK
#define ADE9153A_SELFREQ_MSK
Definition: ade9153a.h:349
ade9153a_write
int ade9153a_write(struct ade9153a_dev *dev, uint16_t reg_addr, uint32_t reg_data)
Write device register.
Definition: ade9153a.c:445
ADE9153A_REG_AI_PGAGAIN
#define ADE9153A_REG_AI_PGAGAIN
Definition: ade9153a.h:214
ADE9153A_FVARNL_MSK
#define ADE9153A_FVARNL_MSK
Definition: ade9153a.h:285
ade9153a_clear_zxai
int ade9153a_clear_zxai(struct ade9153a_dev *dev)
Clear zero crossing detect on I ch A int mask.
Definition: ade9153a.c:1509
ADE9153A_EGY_LD_ACCUM_MSK
#define ADE9153A_EGY_LD_ACCUM_MSK
Definition: ade9153a.h:374
ade9153a_version_product
int ade9153a_version_product(struct ade9153a_dev *dev, uint32_t *data_read)
Version product.
Definition: ade9153a.c:641
ade9153a_power_vals
int ade9153a_power_vals(struct ade9153a_dev *dev, struct ade9153a_power_values *data)
Read power values.
Definition: ade9153a.c:4137
ade9153a_wattacc
int ade9153a_wattacc(struct ade9153a_dev *dev, enum ade9153a_accmode_e wattacc_type)
Select Total active power accumulation mode.
Definition: ade9153a.c:3211
ade9153a_enable_vanl_int
int ade9153a_enable_vanl_int(struct ade9153a_dev *dev)
Enable total apparent energy no load condition interrupt.
Definition: ade9153a.c:2170
ade9153a_hpf_crn
int ade9153a_hpf_crn(struct ade9153a_dev *dev, enum ade9153a_hpf_crn_e hpf_corner_freq)
Hpf corner freq.
Definition: ade9153a.c:3451
ADE9153A_REG_VPEAK
#define ADE9153A_REG_VPEAK
Definition: ade9153a.h:161
ade9153a_enable_chip_stat_int
int ade9153a_enable_chip_stat_int(struct ade9153a_dev *dev)
Enable an interrupt when any bit in CHIP_STATUS reg is set.
Definition: ade9153a.c:1862
ade9153a_selfreq
int ade9153a_selfreq(struct ade9153a_dev *dev, enum ade9153a_selfreq_e freq)
Frequency select.
Definition: ade9153a.c:3122
ADE9153A_AI_GAIN_MSK
#define ADE9153A_AI_GAIN_MSK
Definition: ade9153a.h:391
no_os_calloc
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:54
ade9153a_clear_fvarnl
int ade9153a_clear_fvarnl(struct ade9153a_dev *dev)
Clear fundamental reactive energy no load condition int mask.
Definition: ade9153a.c:1554
ade9153a_chip_status
int ade9153a_chip_status(struct ade9153a_dev *dev, uint8_t *status)
Chip status.
Definition: ade9153a.c:3976
ade9153a_rms_oc_src_adc_samples_enable
int ade9153a_rms_oc_src_adc_samples_enable(struct ade9153a_dev *dev)
Use ADC samples, before the high-pass filter for the RMS_OC calculation.
Definition: ade9153a.c:737
ADE9153A_REG_IPEAK
#define ADE9153A_REG_IPEAK
Definition: ade9153a.h:160
ade9153a_bi_gain_e
ade9153a_bi_gain_e
ADE9153A Bi Gain.
Definition: ade9153a.h:425
ADE9153A_SWRST_MSK
#define ADE9153A_SWRST_MSK
Definition: ade9153a.h:340
no_os_gpio_direction_input
int32_t no_os_gpio_direction_input(struct no_os_gpio_desc *desc)
Enable the input direction of the specified GPIO.
Definition: no_os_gpio.c:124
ade9153a_dipa_val
int ade9153a_dipa_val(struct ade9153a_dev *dev, uint32_t *val)
Voltage value during dip condition.
Definition: ade9153a.c:2635
NO_OS_IRQ_EDGE_FALLING
@ NO_OS_IRQ_EDGE_FALLING
Definition: no_os_irq.h:79
ADE9153A_MS_SYSRDY_MSK
#define ADE9153A_MS_SYSRDY_MSK
Definition: ade9153a.h:394
ade9153a_ipk_val
int ade9153a_ipk_val(struct ade9153a_dev *dev, uint32_t *val)
Ipeak val.
Definition: ade9153a.c:1005
ADE9153A_REG_EGY_TIME
#define ADE9153A_REG_EGY_TIME
Definition: ade9153a.h:210
ade9153a_disable_cf2_int
int ade9153a_disable_cf2_int(struct ade9153a_dev *dev)
Disable CF2 interrupt.
Definition: ade9153a.c:2380
ade9153a_clear_rms_oc_rdy
int ade9153a_clear_rms_oc_rdy(struct ade9153a_dev *dev)
Clear RMS_OC values update int mask.
Definition: ade9153a.c:1614
ade9153a_cf_acc_clr
int ade9153a_cf_acc_clr(struct ade9153a_dev *dev)
Clear accumulation in the digital freq conv.
Definition: ade9153a.c:2985
ade9153a_get_vanl
int ade9153a_get_vanl(struct ade9153a_dev *dev, uint8_t *status)
Get total apparent energy no load condition indicator.
Definition: ade9153a.c:1227
ade9153a_get_apa_chg_sgn
int ade9153a_get_apa_chg_sgn(struct ade9153a_dev *dev, uint8_t *status)
Get APA (active power) sign change indicator.
Definition: ade9153a.c:1419
ADE9153A_CF2_MSK
#define ADE9153A_CF2_MSK
Definition: ade9153a.h:293
ade9153a_get_pwrrdy
int ade9153a_get_pwrrdy(struct ade9153a_dev *dev, uint8_t *status)
Get power values registers update indicator.
Definition: ade9153a.c:1291
ade9153a_auto_calibration_run
int ade9153a_auto_calibration_run(struct ade9153a_dev *dev)
Auto calibration run.
Definition: ade9153a.c:901
ADE9153A_DREADY_MSK
#define ADE9153A_DREADY_MSK
Definition: ade9153a.h:291
ade9153a_get_dready
int ade9153a_get_dready(struct ade9153a_dev *dev, uint8_t *status)
Get new waveform samples ready indicator.
Definition: ade9153a.c:1307
ade9153a_power_values::fundamental_reactive_power_reg_val
int32_t fundamental_reactive_power_reg_val
Definition: ade9153a.h:752
ade9153a_ext_ref_status
int ade9153a_ext_ref_status(struct ade9153a_dev *dev, uint8_t *status)
External_reference status.
Definition: ade9153a.c:2876
ade9153a_pq_values
ADE9153A power quality registers values.
Definition: ade9153a.h:784
ade9153a_hw_reset
int ade9153a_hw_reset(struct ade9153a_dev *dev)
Reset the device using HW reset.
Definition: ade9153a.c:578
ade9153a_power_values::apparent_power_reg_val
int32_t apparent_power_reg_val
Definition: ade9153a.h:754
ade9153a_zx_out_oe
int ade9153a_zx_out_oe(struct ade9153a_dev *dev)
ZX driven to CF2 pin.
Definition: ade9153a.c:2999
ADE9153A_TEMP_OFFSET_MSK
#define ADE9153A_TEMP_OFFSET_MSK
Definition: ade9153a.h:329
ADE9153A_ABSOLUTE_VAL_ACC_MODE
@ ADE9153A_ABSOLUTE_VAL_ACC_MODE
Definition: ade9153a.h:514
ade9153a_enable_chip_stat_int
int ade9153a_enable_chip_stat_int(struct ade9153a_dev *dev)
Enable an interrupt when any bit in CHIP_STATUS reg is set.
Definition: ade9153a.c:1862
ade9153a_ip_phase
int ade9153a_ip_phase(struct ade9153a_dev *dev, uint8_t *ch)
Ipeak channel phase.
Definition: ade9153a.c:972
ADE9153A_TEMP_TIME_MSK
#define ADE9153A_TEMP_TIME_MSK
Definition: ade9153a.h:384
ade9153a_egy_tmr_mode
int ade9153a_egy_tmr_mode(struct ade9153a_dev *dev, uint8_t en)
Energy accumulated based on the number of 4 kSPS samples or zero-crossing events.
Definition: ade9153a.c:3586
ADE9153A_ERROR1_MSK
#define ADE9153A_ERROR1_MSK
Definition: ade9153a.h:414
ADE9153A_REG_AIRMS_OC
#define ADE9153A_REG_AIRMS_OC
Definition: ade9153a.h:133
ADE9153A_CRC16_POLY
#define ADE9153A_CRC16_POLY
Definition: ade9153a.h:86
ADE9153A_REG_TEMP_RSLT
#define ADE9153A_REG_TEMP_RSLT
Definition: ade9153a.h:213
NO_OS_GPIO_LOW
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:115
ade9153a_cf2_lt_status
int ade9153a_cf2_lt_status(struct ade9153a_dev *dev, uint8_t *status)
CF2_LT status.
Definition: ade9153a.c:2719
ade9153a_avarsign_status
int ade9153a_avarsign_status(struct ade9153a_dev *dev, uint8_t *status)
Sign of reactive power.
Definition: ade9153a.c:3382
ade9153a_clear_event_stat
int ade9153a_clear_event_stat(struct ade9153a_dev *dev, uint32_t *reg_val)
Clear event status int.
Definition: ade9153a.c:1803
ADE9153A_AFVARNL_MSK
#define ADE9153A_AFVARNL_MSK
Definition: ade9153a.h:319
ade9153a_enable_rms_oc_rdy_int
int ade9153a_enable_rms_oc_rdy_int(struct ade9153a_dev *dev)
Enable RMS_OC values update interrupt.
Definition: ade9153a.c:2254
ade9153a_get_zxai
int ade9153a_get_zxai(struct ade9153a_dev *dev, uint8_t *status)
Get zero crossing detect on I ch A indicator.
Definition: ade9153a.c:1163
ade9153a_get_dready
int ade9153a_get_dready(struct ade9153a_dev *dev, uint8_t *status)
Get new waveform samples ready indicator.
Definition: ade9153a.c:1307
ADE9153A_REG_APERIOD
#define ADE9153A_REG_APERIOD
Definition: ade9153a.h:173
ade9153a_enable_zxai_int
int ade9153a_enable_zxai_int(struct ade9153a_dev *dev)
Enable zero corssing detected on I ch A interrupt.
Definition: ade9153a.c:2086
ade9153a_disable_event_stat_int
int ade9153a_disable_event_stat_int(struct ade9153a_dev *dev)
Disable EVENT_STAT interrupt.
Definition: ade9153a.c:1904
ade9153a_get_temp_rdy
int ade9153a_get_temp_rdy(struct ade9153a_dev *dev, uint8_t *status)
Get new temperature reading ready indicator.
Definition: ade9153a.c:1259
ade9153a_oib_en
int ade9153a_oib_en(struct ade9153a_dev *dev)
Ch B overcurretn detection enable.
Definition: ade9153a.c:3285
ADE9153A_REG_AFVAR
#define ADE9153A_REG_AFVAR
Definition: ade9153a.h:131
ade9153a_set_interface_serial
int ade9153a_set_interface_serial(struct ade9153a_dev *dev)
Select comms interface Serial.
Definition: ade9153a.c:97
ade9153a_init
int ade9153a_init(struct ade9153a_dev **device, struct ade9153a_init_param init_param)
Initialize the device.
Definition: ade9153a.c:157
ade9153a_force_crc_update
int ade9153a_force_crc_update(struct ade9153a_dev *dev)
Force CRC calculation to start (update).
Definition: ade9153a.c:3614
TURBO
@ TURBO
Definition: ade9153a.h:456
ADE9153A_CF2_LT_MSK
#define ADE9153A_CF2_LT_MSK
Definition: ade9153a.h:324
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
ade9153a_disable_revpcf1_int
int ade9153a_disable_revpcf1_int(struct ade9153a_dev *dev)
Disable CF1 polarity change sign interrupt.
Definition: ade9153a.c:2464
ade9153a_ms_timeout
int ade9153a_ms_timeout(struct ade9153a_dev *dev, uint8_t *status)
mSure timed out (600s)
Definition: ade9153a.c:3895
ade9153a_get_ms_stat
int ade9153a_get_ms_stat(struct ade9153a_dev *dev, uint8_t *status)
Get MS status indicator.
Definition: ade9153a.c:1817
no_os_field_prep
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
ade9153a_get_cf2
int ade9153a_get_cf2(struct ade9153a_dev *dev, uint8_t *status)
Get CF2 pulse issued indicator.
Definition: ade9153a.c:1339
ade9153a_auto_calibration_cfg
int ade9153a_auto_calibration_cfg(struct ade9153a_dev *dev, enum ade9153a_acal_ch_e ch, enum ade9153a_acalmode_e mode)
Auto calibration config.
Definition: ade9153a.c:852
ADE9153A_TEMP_TIME_SAMPLES_1
@ ADE9153A_TEMP_TIME_SAMPLES_1
Definition: ade9153a.h:595
ADE9153A_NO_BYTES_W_32
#define ADE9153A_NO_BYTES_W_32
Definition: ade9153a.h:90
ade9153a_cf1sel
int ade9153a_cf1sel(struct ade9153a_dev *dev, enum ade9153a_cf2sel_e energy_type)
Set type of energy output on CF1 pin.
Definition: ade9153a.c:3089
no_os_irq_set_priority
int32_t no_os_irq_set_priority(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, uint32_t priority_level)
Set the priority for an interrupt.
Definition: no_os_irq.c:216
ade9153a_disable_revpcf2_int
int ade9153a_disable_revpcf2_int(struct ade9153a_dev *dev)
Disable CF2 polarity change sign interrupt.
Definition: ade9153a.c:2436
ade9153a_start_autocal_ai
int ade9153a_start_autocal_ai(struct ade9153a_dev *dev, enum ade9153a_acalmode_e mode)
Start autocalibration AI channel.
Definition: ade9153a.c:4281
ade9153a_enable_revapa_int
int ade9153a_enable_revapa_int(struct ade9153a_dev *dev)
Enable Phase A total active power changed sign interrupt.
Definition: ade9153a.c:2506
ade9153a_compmode
int ade9153a_compmode(struct ade9153a_dev *dev)
COMPMODE.
Definition: ade9153a.c:3718
ade9153a_rd_rst_en
int ade9153a_rd_rst_en(struct ade9153a_dev *dev)
Energy register read with value reset.
Definition: ade9153a.c:3554
ade9153a_wr_unlock
int ade9153a_wr_unlock(struct ade9153a_dev *dev)
Unlock device.
Definition: ade9153a.c:624
ade9153a_lpf_ap_disable
int ade9153a_lpf_ap_disable(struct ade9153a_dev *dev)
Disable the low-pass filter in the total active power datapath.
Definition: ade9153a.c:683
ADE9153A_UART_RESET_MSK
#define ADE9153A_UART_RESET_MSK
Definition: ade9153a.h:408
ade9153a_energy_values
ADE9153A energy registers values.
Definition: ade9153a.h:735
ade9153a_read_autocal_vals
int ade9153a_read_autocal_vals(struct ade9153a_dev *dev, struct ade9153a_autocal_vals *data)
Read autocalibration values.
Definition: ade9153a.c:4377
ade9153a_freq_s_status
int ade9153a_freq_s_status(struct ade9153a_dev *dev, uint8_t *status)
Frequency setting.
Definition: ade9153a.c:3148
ADE9153A_AI_GAIN_16
@ ADE9153A_AI_GAIN_16
Definition: ade9153a.h:611
ade9153a_cf1dis
int ade9153a_cf1dis(struct ade9153a_dev *dev)
CF1 output disable.
Definition: ade9153a.c:3041
ADE9153A_ACALMODE_AI_MSK
#define ADE9153A_ACALMODE_AI_MSK
Definition: ade9153a.h:259
ade9153a_enable_revpcf2_int
int ade9153a_enable_revpcf2_int(struct ade9153a_dev *dev)
Enable CF2 polarity change sign interrupt.
Definition: ade9153a.c:2422
ADE9153A_NO_BYTES_R_32
#define ADE9153A_NO_BYTES_R_32
Definition: ade9153a.h:92
ADE9153A_MS_READY_MSK
#define ADE9153A_MS_READY_MSK
Definition: ade9153a.h:398
ade9153a_cf2sign_status
int ade9153a_cf2sign_status(struct ade9153a_dev *dev, uint8_t *status)
Sign of CF2 power.
Definition: ade9153a.c:3328
ADE9153A_AWATTNL_MSK
#define ADE9153A_AWATTNL_MSK
Definition: ade9153a.h:321
ade9153a_disable_vanl_int
int ade9153a_disable_vanl_int(struct ade9153a_dev *dev)
Disable total apparent energy no load condition interrupt.
Definition: ade9153a.c:2184
ADE9153A_DREADY_OE_MSK
#define ADE9153A_DREADY_OE_MSK
Definition: ade9153a.h:339
ade9153a_enable_crc_chg_int
int ade9153a_enable_crc_chg_int(struct ade9153a_dev *dev)
Enable crc change interrupt.
Definition: ade9153a.c:1974
ade9153a_enable_crc_done_int
int ade9153a_enable_crc_done_int(struct ade9153a_dev *dev)
Enable crc done interrupt.
Definition: ade9153a.c:2002
ade9153a_energy_vals
int ade9153a_energy_vals(struct ade9153a_dev *dev, struct ade9153a_energy_values *data)
Read energy values.
Definition: ade9153a.c:4098
ade9153a_enable_cf1_int
int ade9153a_enable_cf1_int(struct ade9153a_dev *dev)
Enable CF1 interrupt.
Definition: ade9153a.c:2394
ADE9153A_CF1_LT_MSK
#define ADE9153A_CF1_LT_MSK
Definition: ade9153a.h:325
ade9153a_disable_zxav_int
int ade9153a_disable_zxav_int(struct ade9153a_dev *dev)
Disable zero corssing detected on V ch interrupt.
Definition: ade9153a.c:2128
ade9153a_clear_cf2_chg
int ade9153a_clear_cf2_chg(struct ade9153a_dev *dev)
Clear CF2 polarity change int mask.
Definition: ade9153a.c:1704
ade9153a_enable_pwrrdy_int
int ade9153a_enable_pwrrdy_int(struct ade9153a_dev *dev)
Enable PWRRDY interrupt.
Definition: ade9153a.c:2282
ade9153a_autocal_vals::aicc_reg_val
uint32_t aicc_reg_val
Definition: ade9153a.h:812
ade9153a_disable_wattnl_int
int ade9153a_disable_wattnl_int(struct ade9153a_dev *dev)
Disable total active energy no load condition interrupt.
Definition: ade9153a.c:2212
ade9153a_clear_apa_chg_sgn
int ade9153a_clear_apa_chg_sgn(struct ade9153a_dev *dev)
Clear APA (active power) sign change int mask.
Definition: ade9153a.c:1746
ADE9153A_ZXBI_MSK
#define ADE9153A_ZXBI_MSK
Definition: ade9153a.h:281
ADE9153A_UART_ERROR2
@ ADE9153A_UART_ERROR2
Definition: ade9153a.h:638
ade9153a_ms_conferr
int ade9153a_ms_conferr(struct ade9153a_dev *dev, uint8_t *status)
Invalid config of mSure status.
Definition: ade9153a.c:3841
ade9153a_rd_rst_en
int ade9153a_rd_rst_en(struct ade9153a_dev *dev)
Energy register read with value reset.
Definition: ade9153a.c:3554
ade9153a_peak_sel
int ade9153a_peak_sel(struct ade9153a_dev *dev, enum ade9153a_peak_sel_e peak_sel)
Select peak detection channels.
Definition: ade9153a.c:3247
AWATTNL
@ AWATTNL
Definition: ade9153a.h:654
ade9153a_hpf_crn_e
ade9153a_hpf_crn_e
ADE9153A Hpf crn high pass filter corner freq.
Definition: ade9153a.h:543
ADE9153A_UART_ERROR1_MSK
#define ADE9153A_UART_ERROR1_MSK
Definition: ade9153a.h:410
ade9153a_i_ch_b_int_enable
int ade9153a_i_ch_b_int_enable(struct ade9153a_dev *dev)
Current channel B integrator enable.
Definition: ade9153a.c:788
F_50_HZ
@ F_50_HZ
Definition: ade9153a.h:465
ade9153a_disable_pf_rdy_int
int ade9153a_disable_pf_rdy_int(struct ade9153a_dev *dev)
Disable pf ready interrupt.
Definition: ade9153a.c:1960
ADE9153A_REG_PHNOLOAD
#define ADE9153A_REG_PHNOLOAD
Definition: ade9153a.h:177
ade9153a_disable_temp_rdy_int
int ade9153a_disable_temp_rdy_int(struct ade9153a_dev *dev)
Disable new temperature reading interrupt.
Definition: ade9153a.c:2240
ade9153a_dready_oe
int ade9153a_dready_oe(struct ade9153a_dev *dev)
DREADY driven to CF2 pin.
Definition: ade9153a.c:3013
ade9153a_ms_shift
int ade9153a_ms_shift(struct ade9153a_dev *dev, uint8_t *status)
mSure shift detected in CC val
Definition: ade9153a.c:3949
ade9153a_vpk_val
int ade9153a_vpk_val(struct ade9153a_dev *dev, uint32_t *val)
Vpeak val.
Definition: ade9153a.c:1030
ade9153a_set_interface_spi
int ade9153a_set_interface_spi(struct ade9153a_dev *dev)
Select comms interface SPI.
Definition: ade9153a.c:65
ade9153a_clear_fvarnl
int ade9153a_clear_fvarnl(struct ade9153a_dev *dev)
Clear fundamental reactive energy no load condition int mask.
Definition: ade9153a.c:1554
ade9153a_get_event_stat
int ade9153a_get_event_stat(struct ade9153a_dev *dev, uint8_t *status)
Get event status indicator.
Definition: ade9153a.c:1789
ade9153a_disable_crc_chg_int
int ade9153a_disable_crc_chg_int(struct ade9153a_dev *dev)
Disable crc change interrupt.
Definition: ade9153a.c:1988
ade9153a_cf1sign_status
int ade9153a_cf1sign_status(struct ade9153a_dev *dev, uint8_t *status)
Sign of CF1 power.
Definition: ade9153a.c:3355
ade9153a_enable_event_stat_int
int ade9153a_enable_event_stat_int(struct ade9153a_dev *dev)
Enable an interrupt when any bit in EVENT_STATUS reg is set.
Definition: ade9153a.c:1890
ade9153a_get_rms_oc_rdy
int ade9153a_get_rms_oc_rdy(struct ade9153a_dev *dev, uint8_t *status)
Get RMS_OC values update indicator.
Definition: ade9153a.c:1275
ade9153a_clear_cf2
int ade9153a_clear_cf2(struct ade9153a_dev *dev)
Clear CF2 pulse issued int mask.
Definition: ade9153a.c:1674
ade9153a_vlevel_val
int ade9153a_vlevel_val(struct ade9153a_dev *dev, uint32_t *val)
Vlevel val.
Definition: ade9153a.c:2610
ADE9153A_SETTLE_256_MS
@ ADE9153A_SETTLE_256_MS
Definition: ade9153a.h:483
ade9153a_egy_tmr_mode
int ade9153a_egy_tmr_mode(struct ade9153a_dev *dev, uint8_t en)
Energy accumulated based on the number of 4 kSPS samples or zero-crossing events.
Definition: ade9153a.c:3586
ade9153a_enable_revapa_int
int ade9153a_enable_revapa_int(struct ade9153a_dev *dev)
Enable Phase A total active power changed sign interrupt.
Definition: ade9153a.c:2506
ADE9153A_ERROR3_MSK
#define ADE9153A_ERROR3_MSK
Definition: ade9153a.h:412
ade9153a_autocal_vals
ADE9153A temperature value.
Definition: ade9153a.h:810
ADE9153A_UART_RESET
@ ADE9153A_UART_RESET
Definition: ade9153a.h:640
ade9153a_swella_val
int ade9153a_swella_val(struct ade9153a_dev *dev, uint32_t *val)
Voltage value during swell condition.
Definition: ade9153a.c:2660
ADE9153A_NOLOAD_TMR_SAMPLES_64
@ ADE9153A_NOLOAD_TMR_SAMPLES_64
Definition: ade9153a.h:571
ade9153a_freq_s_status
int ade9153a_freq_s_status(struct ade9153a_dev *dev, uint8_t *status)
Frequency setting.
Definition: ade9153a.c:3148
ade9153a_dev::irq_cb
struct no_os_callback_desc irq_cb
Definition: ade9153a.h:728
no_os_put_unaligned_be32
void no_os_put_unaligned_be32(uint32_t val, uint8_t *buf)
ade9153a_enable_zxtoav_int
int ade9153a_enable_zxtoav_int(struct ade9153a_dev *dev)
Enable zero corssing timeout on voltage ch interrupt.
Definition: ade9153a.c:2030
ade9153a_msure_status
int ade9153a_msure_status(struct ade9153a_dev *dev, uint8_t *status)
mSure status
Definition: ade9153a.c:945
ade9153a_ms_ready
int ade9153a_ms_ready(struct ade9153a_dev *dev, uint8_t *status)
mSure ready
Definition: ade9153a.c:3922
ade9153a_enable_ms_stat_int
int ade9153a_enable_ms_stat_int(struct ade9153a_dev *dev)
Enable an interrupt when any bit in MS_STATUS_IRQ reg is set.
Definition: ade9153a.c:1918
ADE9153A_HPF_CORNER_4_9675_HZ
@ ADE9153A_HPF_CORNER_4_9675_HZ
Definition: ade9153a.h:552
ade9153a_get_cf1
int ade9153a_get_cf1(struct ade9153a_dev *dev, uint8_t *status)
Get CF1 pulse issued indicator.
Definition: ade9153a.c:1355
ade9153a_init_param::hpf_crn
enum ade9153a_hpf_crn_e hpf_crn
Definition: ade9153a.h:692
no_os_crc16.h
Header file of CRC-16 computation.
ade9153a_phnoload_e
ade9153a_phnoload_e
Type of energy that is in no load condition.
Definition: ade9153a.h:647
ade9153a_get_crc_chg
int ade9153a_get_crc_chg(struct ade9153a_dev *dev, uint8_t *status)
Get CRC change indicator.
Definition: ade9153a.c:1099
ade9153a_bi_pgagain_set
int ade9153a_bi_pgagain_set(struct ade9153a_dev *dev, enum ade9153a_bi_gain_e gain)
Set PGA gain for current channel B.
Definition: ade9153a.c:823
ADE9153A_RSTDONE_MSK
#define ADE9153A_RSTDONE_MSK
Definition: ade9153a.h:284
ade9153a_energy_vals
int ade9153a_energy_vals(struct ade9153a_dev *dev, struct ade9153a_energy_values *data)
Read energy values.
Definition: ade9153a.c:4098
dip_swell_irq_mode_en
dip_swell_irq_mode_en
Dip swell irq mode.
Definition: ade9153a.h:661
ade9153a_force_crc_update
int ade9153a_force_crc_update(struct ade9153a_dev *dev)
Force CRC calculation to start (update).
Definition: ade9153a.c:3614
ade9153a_enable_revrpa_int
int ade9153a_enable_revrpa_int(struct ade9153a_dev *dev)
Enable Phase A fundamental reactive power changed sign interrupt.
Definition: ade9153a.c:2478
ade9153a_cf1sign_status
int ade9153a_cf1sign_status(struct ade9153a_dev *dev, uint8_t *status)
Sign of CF1 power.
Definition: ade9153a.c:3355
ade9153a_dev::gpio_ss
struct no_os_gpio_desc * gpio_ss
Definition: ade9153a.h:722
ADE9153A_HPF_CORNER_1_2475_HZ
@ ADE9153A_HPF_CORNER_1_2475_HZ
Definition: ade9153a.h:556
ade9153a_pq_values::power_factor_reg_val
int32_t power_factor_reg_val
Definition: ade9153a.h:786
ade9153a_temp_time_e
ade9153a_temp_time_e
ADE9153A Temperature readings.
Definition: ade9153a.h:592
ADE9153A_REG_AFVARHR_HI
#define ADE9153A_REG_AFVARHR_HI
Definition: ade9153a.h:155
ade9153a_temp_val
int ade9153a_temp_val(struct ade9153a_dev *dev, struct ade9153a_temperature_value *data)
Temperature value in deg C.
Definition: ade9153a.c:4025
ade9153a_i_ch_b_int_enable
int ade9153a_i_ch_b_int_enable(struct ade9153a_dev *dev)
Current channel B integrator enable.
Definition: ade9153a.c:788
ade9153a_init_param::spi_init
struct no_os_spi_init_param * spi_init
Definition: ade9153a.h:674
ade9153a_avarsign_status
int ade9153a_avarsign_status(struct ade9153a_dev *dev, uint8_t *status)
Sign of reactive power.
Definition: ade9153a.c:3382
DISABLE
#define DISABLE
Definition: ad77681.h:340
no_os_irq_unregister_callback
int32_t no_os_irq_unregister_callback(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, struct no_os_callback_desc *callback_desc)
Unregisters a generic IRQ handling function.
Definition: no_os_irq.c:112
ade9153a_get_ms_stat
int ade9153a_get_ms_stat(struct ade9153a_dev *dev, uint8_t *status)
Get MS status indicator.
Definition: ade9153a.c:1817
ade9153a_cf_ltmr_write
int ade9153a_cf_ltmr_write(struct ade9153a_dev *dev, uint32_t reg_data)
cf_ltmr write value.
Definition: ade9153a.c:2773
ade9153a_rms_values
ADE9153A rms registers values.
Definition: ade9153a.h:761
no_os_get_unaligned_be24
uint32_t no_os_get_unaligned_be24(uint8_t *buf)
ade9153a_get_crc_done
int ade9153a_get_crc_done(struct ade9153a_dev *dev, uint8_t *status)
Get CRC done indicator.
Definition: ade9153a.c:1115
ade9153a_oia_en
int ade9153a_oia_en(struct ade9153a_dev *dev)
Ch A overcurretn detection enable.
Definition: ade9153a.c:3299
ade9153a_get_event_stat
int ade9153a_get_event_stat(struct ade9153a_dev *dev, uint8_t *status)
Get event status indicator.
Definition: ade9153a.c:1789
ade9153a_ai_gain
int ade9153a_ai_gain(struct ade9153a_dev *dev, enum ade9153a_ai_gain_e gain)
Set the PGA gain for I chA.
Definition: ade9153a.c:3779
ade9153a_remove
int ade9153a_remove(struct ade9153a_dev *dev)
Remove the device and release resources.
Definition: ade9153a.c:513
ade9153a_setup
int ade9153a_setup(void *dev, struct ade9153a_init_param init_param)
ADE9153A setup.
Definition: ade9153a.c:295
ade9153a_dipa_val
int ade9153a_dipa_val(struct ade9153a_dev *dev, uint32_t *val)
Voltage value during dip condition.
Definition: ade9153a.c:2635
ade9153a_selfreq
int ade9153a_selfreq(struct ade9153a_dev *dev, enum ade9153a_selfreq_e freq)
Frequency select.
Definition: ade9153a.c:3122
ade9153a_clear_cf2
int ade9153a_clear_cf2(struct ade9153a_dev *dev)
Clear CF2 pulse issued int mask.
Definition: ade9153a.c:1674
ADE9153A_EXT_REF_MSK
#define ADE9153A_EXT_REF_MSK
Definition: ade9153a.h:333
ADE9153A_EGYRDY_MSK
#define ADE9153A_EGYRDY_MSK
Definition: ade9153a.h:292
ade9153a_dip_swell_irq_mode
int ade9153a_dip_swell_irq_mode(struct ade9153a_dev *dev, enum dip_swell_irq_mode_en mode)
Dip swell interrupt mode.
Definition: ade9153a.c:2903
ADE9153A_PWRRDY_MSK
#define ADE9153A_PWRRDY_MSK
Definition: ade9153a.h:290
ADE9153A_HPFDIS_MSK
#define ADE9153A_HPFDIS_MSK
Definition: ade9153a.h:249
ADE9153A_REG_AVRMS
#define ADE9153A_REG_AVRMS
Definition: ade9153a.h:128
ade9153a_dev::gpio_sck
struct no_os_gpio_desc * gpio_sck
Definition: ade9153a.h:724
ADE9153A_ZX_OUT_OE_MSK
#define ADE9153A_ZX_OUT_OE_MSK
Definition: ade9153a.h:338
ade9153a_rms_oc_src_x_wav_enable
int ade9153a_rms_oc_src_x_wav_enable(struct ade9153a_dev *dev)
Use x_WAV waveforms after the high-pass filter and phase compensation for the RMS_OC calculation.
Definition: ade9153a.c:719
ADE9153A_PEAK_DETECTION_DISABLE_PHA_PHB
@ ADE9153A_PEAK_DETECTION_DISABLE_PHA_PHB
Definition: ade9153a.h:528
ade9153a_enable_revpcf1_int
int ade9153a_enable_revpcf1_int(struct ade9153a_dev *dev)
Enable CF1 polarity change sign interrupt.
Definition: ade9153a.c:2450
ade9153a_dev::spi_desc
struct no_os_spi_desc * spi_desc
Definition: ade9153a.h:714
ADE9153A_REG_PHSIGN
#define ADE9153A_REG_PHSIGN
Definition: ade9153a.h:202
ade9153a_temp_gain_val
int ade9153a_temp_gain_val(struct ade9153a_dev *dev, uint32_t *val)
temperature sensor gain.
Definition: ade9153a.c:2839
ADE9153A_ZXAI_MSK
#define ADE9153A_ZXAI_MSK
Definition: ade9153a.h:282
ade9153a_dev::gpio_rdy
struct no_os_gpio_desc * gpio_rdy
Definition: ade9153a.h:718
ADE9153A_VLEVEL_VAL_MSK
#define ADE9153A_VLEVEL_VAL_MSK
Definition: ade9153a.h:310
ADE9153A_REG_BI_PGAGAIN
#define ADE9153A_REG_BI_PGAGAIN
Definition: ade9153a.h:117
ade9153a_disable_ms_stat_int
int ade9153a_disable_ms_stat_int(struct ade9153a_dev *dev)
Disable MS_STAT interrupt.
Definition: ade9153a.c:1932
ADE9153A_VANL_MSK
#define ADE9153A_VANL_MSK
Definition: ade9153a.h:286
ade9153a_disable_crc_done_int
int ade9153a_disable_crc_done_int(struct ade9153a_dev *dev)
Disable crc done interrupt.
Definition: ade9153a.c:2016
ade9153a_get_cf1
int ade9153a_get_cf1(struct ade9153a_dev *dev, uint8_t *status)
Get CF1 pulse issued indicator.
Definition: ade9153a.c:1355
ade9153a_stop
int ade9153a_stop(struct ade9153a_dev *dev)
Stop measurements.
Definition: ade9153a.c:3748
ade9153a_clear_cf1_chg
int ade9153a_clear_cf1_chg(struct ade9153a_dev *dev)
Clear CF1 polarity change int mask.
Definition: ade9153a.c:1718
ADE9153A_UNLOCK_KEY
#define ADE9153A_UNLOCK_KEY
Definition: ade9153a.h:66
ADE9153A_ERROR1
@ ADE9153A_ERROR1
Definition: ade9153a.h:628
ADE9153A_UART_ERROR0
@ ADE9153A_UART_ERROR0
Definition: ade9153a.h:634
ade9153a_enable_revrpa_int
int ade9153a_enable_revrpa_int(struct ade9153a_dev *dev)
Enable Phase A fundamental reactive power changed sign interrupt.
Definition: ade9153a.c:2478
ADE9153A_REG_ANGL_AV_AI
#define ADE9153A_REG_ANGL_AV_AI
Definition: ade9153a.h:189
ade9153a_dip_swell_irq_mode
int ade9153a_dip_swell_irq_mode(struct ade9153a_dev *dev, enum dip_swell_irq_mode_en mode)
Dip swell interrupt mode.
Definition: ade9153a.c:2903
ade9153a_init_param::gpio_ss
struct no_os_spi_init_param * gpio_ss
Definition: ade9153a.h:680
AFVARNL
@ AFVARNL
Definition: ade9153a.h:650
ADE9153A_COMPMODEVAL
#define ADE9153A_COMPMODEVAL
Definition: ade9153a.h:69
ade9153a_autocal_vals::avcc_reg_val
uint32_t avcc_reg_val
Definition: ade9153a.h:816
ADE9153A_REG_MS_STATUS_CURRENT
#define ADE9153A_REG_MS_STATUS_CURRENT
Definition: ade9153a.h:144
ade9153a_uperiod_sel
int ade9153a_uperiod_sel(struct ade9153a_dev *dev, uint8_t en)
User period select.
Definition: ade9153a.c:3436
ADE9153A_EVENT_STAT_MSK
#define ADE9153A_EVENT_STAT_MSK
Definition: ade9153a.h:275
ade9153a_disable_chip_stat_int
int ade9153a_disable_chip_stat_int(struct ade9153a_dev *dev)
Disable CHIP_STAT interrupt.
Definition: ade9153a.c:1876
no_os_gpio_remove
int32_t no_os_gpio_remove(struct no_os_gpio_desc *desc)
Free the resources allocated by no_os_gpio_get().
Definition: no_os_gpio.c:104
ADE9153A_DISAPLPF_MSK
#define ADE9153A_DISAPLPF_MSK
Definition: ade9153a.h:244
ade9153a_disable_event_stat_int
int ade9153a_disable_event_stat_int(struct ade9153a_dev *dev)
Disable EVENT_STAT interrupt.
Definition: ade9153a.c:1904
ade9153a_init_param::spi_en
uint8_t spi_en
Definition: ade9153a.h:684
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
ADE9153A_REG_RUN
#define ADE9153A_REG_RUN
Definition: ade9153a.h:187
ade9153a_clear_apa_chg_sgn
int ade9153a_clear_apa_chg_sgn(struct ade9153a_dev *dev)
Clear APA (active power) sign change int mask.
Definition: ade9153a.c:1746
ADE9153A_CHIP_STAT_MSK
#define ADE9153A_CHIP_STAT_MSK
Definition: ade9153a.h:274
ADE9153A_PGA_CHB_GAIN_1
@ ADE9153A_PGA_CHB_GAIN_1
Definition: ade9153a.h:428
ade9153a_cf1_lt_status
int ade9153a_cf1_lt_status(struct ade9153a_dev *dev, uint8_t *status)
CF1_LT status.
Definition: ade9153a.c:2746
ade9153a_hw_reset
int ade9153a_hw_reset(struct ade9153a_dev *dev)
Reset the device using HW reset.
Definition: ade9153a.c:578
ade9153a_clear_ms_stat
int ade9153a_clear_ms_stat(struct ade9153a_dev *dev, uint32_t *reg_val)
Clear MS status int.
Definition: ade9153a.c:1831
ONE_INT
@ ONE_INT
Definition: ade9153a.h:665
ade9153a_disable_ms_stat_int
int ade9153a_disable_ms_stat_int(struct ade9153a_dev *dev)
Disable MS_STAT interrupt.
Definition: ade9153a.c:1932
ade9153a_awsign_status
int ade9153a_awsign_status(struct ade9153a_dev *dev, uint8_t *status)
Sign of active power.
Definition: ade9153a.c:3409
ADE9153A_WATTNL_MSK
#define ADE9153A_WATTNL_MSK
Definition: ade9153a.h:287
ade9153a_get_fvarnl
int ade9153a_get_fvarnl(struct ade9153a_dev *dev, uint8_t *status)
Get fundamental reactive energy no load condition indicator.
Definition: ade9153a.c:1211
ADE9153A_HPF_CORNER_0_625_HZ
@ ADE9153A_HPF_CORNER_0_625_HZ
Definition: ade9153a.h:558
ade9153a_get_int_status
int ade9153a_get_int_status(struct ade9153a_dev *dev, uint32_t msk, uint8_t *status)
Get interrupt indicator from STATUS register.
Definition: ade9153a.c:1056
ade9153a_enable_egyrdy_int
int ade9153a_enable_egyrdy_int(struct ade9153a_dev *dev)
Enable EGYRDY interrupt.
Definition: ade9153a.c:2338
ade9153a_start_autocal_bi
int ade9153a_start_autocal_bi(struct ade9153a_dev *dev, enum ade9153a_acalmode_e mode)
Start autocalibration BI channel.
Definition: ade9153a.c:4313
ade9153a_burst_en
int ade9153a_burst_en(struct ade9153a_dev *dev)
Burst read enable/disable.
Definition: ade9153a.c:2932
ADE9153A_LOCK_KEY
#define ADE9153A_LOCK_KEY
Definition: ade9153a.h:63
ade9153a_noload_tmr_e
ade9153a_noload_tmr_e
ADE9153A Hpf no load tmr.
Definition: ade9153a.h:567
ade9153a_diszxlpf
int ade9153a_diszxlpf(struct ade9153a_dev *dev)
Zero crossing lpf disable.
Definition: ade9153a.c:3313
no_os_callback_desc::callback
void(* callback)(void *context)
Definition: no_os_irq.h:144
ADE9153A_NOLOAD_TMR_SAMPLES_256
@ ADE9153A_NOLOAD_TMR_SAMPLES_256
Definition: ade9153a.h:575
ade9153a_compmode
int ade9153a_compmode(struct ade9153a_dev *dev)
COMPMODE.
Definition: ade9153a.c:3718
ade9153a_temp_time
int ade9153a_temp_time(struct ade9153a_dev *dev, enum ade9153a_temp_time_e temp_no_samples)
Select the number of temperature readings to average.
Definition: ade9153a.c:3658
ADE9153A_REG_ZX_CFG
#define ADE9153A_REG_ZX_CFG
Definition: ade9153a.h:201
ADE9153A_REG_CONFIG1
#define ADE9153A_REG_CONFIG1
Definition: ade9153a.h:188
ade9153a_init_param::irq_ctrl
struct no_os_irq_ctrl_desc * irq_ctrl
Definition: ade9153a.h:686
ade9153a_start_autocal_av
int ade9153a_start_autocal_av(struct ade9153a_dev *dev, enum ade9153a_acalmode_e mode)
Start autocalibration AV channel.
Definition: ade9153a.c:4345
no_os_gpio_desc
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
ade9153a_cf1dis
int ade9153a_cf1dis(struct ade9153a_dev *dev)
CF1 output disable.
Definition: ade9153a.c:3041
ade9153a_get_crc_done
int ade9153a_get_crc_done(struct ade9153a_dev *dev, uint8_t *status)
Get CRC done indicator.
Definition: ade9153a.c:1115
ADE9153A_TEMP_EN_MSK
#define ADE9153A_TEMP_EN_MSK
Definition: ade9153a.h:383
ade9153a_ai_swap
int ade9153a_ai_swap(struct ade9153a_dev *dev, uint8_t set)
Set the signal side of the PGA.
Definition: ade9153a.c:3764
ade9153a_rms_vals
int ade9153a_rms_vals(struct ade9153a_dev *dev, struct ade9153a_rms_values *data)
Read rms values.
Definition: ade9153a.c:4176
ADE9153A_RUN
#define ADE9153A_RUN
Definition: ade9153a.h:72
ade9153a_pwr_settle_set
int ade9153a_pwr_settle_set(struct ade9153a_dev *dev, enum ade9153a_pwr_settle_e time)
Set PWR_SETTLE.
Definition: ade9153a.c:2950
ade9153a_clear_pwrrdy
int ade9153a_clear_pwrrdy(struct ade9153a_dev *dev)
Clear power values registers update int mask.
Definition: ade9153a.c:1629
AVANL
@ AVANL
Definition: ade9153a.h:652
ade9153a_get_pwrrdy
int ade9153a_get_pwrrdy(struct ade9153a_dev *dev, uint8_t *status)
Get power values registers update indicator.
Definition: ade9153a.c:1291
ade9153a_oi_lvl_val
int ade9153a_oi_lvl_val(struct ade9153a_dev *dev, uint32_t *val)
Overcurrent detection threshold level val.
Definition: ade9153a.c:2535
ade9153a_cf2sel_e
ade9153a_cf2sel_e
ADE9153A CF2SEL type of energy output at CF2 Pin.
Definition: ade9153a.h:492
ade9153a_zx_src_after_hpf_enable
int ade9153a_zx_src_after_hpf_enable(struct ade9153a_dev *dev)
ZX data source after hpf and phase compensation.
Definition: ade9153a.c:754
ade9153a_hpf_disable
int ade9153a_hpf_disable(struct ade9153a_dev *dev)
Disable hpf for all channels.
Definition: ade9153a.c:805
ade9153a_cf_ltmr_write
int ade9153a_cf_ltmr_write(struct ade9153a_dev *dev, uint32_t reg_data)
cf_ltmr write value.
Definition: ade9153a.c:2773
ade9153a_cf2sign_status
int ade9153a_cf2sign_status(struct ade9153a_dev *dev, uint8_t *status)
Sign of CF2 power.
Definition: ade9153a.c:3328
ADE9153A_ERROR2
@ ADE9153A_ERROR2
Definition: ade9153a.h:630
ADE9153A_EGY_TMR_MODE_MSK
#define ADE9153A_EGY_TMR_MODE_MSK
Definition: ade9153a.h:375
ade9153a_temperature_value
ADE9153A temperature value.
Definition: ade9153a.h:797
ade9153a_enable_cf2_int
int ade9153a_enable_cf2_int(struct ade9153a_dev *dev)
Enable CF2 interrupt.
Definition: ade9153a.c:2366
ade9153a_enable_temp_rdy_int
int ade9153a_enable_temp_rdy_int(struct ade9153a_dev *dev)
Enable new temperature reading interrupt.
Definition: ade9153a.c:2226
ade9153a_init_param::ai_gain
uint32_t ai_gain
Definition: ade9153a.h:702
NORMAL
@ NORMAL
Definition: ade9153a.h:454
ade9153a_diszxlpf
int ade9153a_diszxlpf(struct ade9153a_dev *dev)
Zero crossing lpf disable.
Definition: ade9153a.c:3313
ADE9153A_HPF_CORNER_0_3125_HZ
@ ADE9153A_HPF_CORNER_0_3125_HZ
Definition: ade9153a.h:560
ade9153a_clear_zxav
int ade9153a_clear_zxav(struct ade9153a_dev *dev)
Clear zero crossing detect on V ch int mask.
Definition: ade9153a.c:1524
ade9153a_disable_dready_int
int ade9153a_disable_dready_int(struct ade9153a_dev *dev)
Disable data ready interrupt.
Definition: ade9153a.c:2324
ade9153a_disable_vanl_int
int ade9153a_disable_vanl_int(struct ade9153a_dev *dev)
Disable total apparent energy no load condition interrupt.
Definition: ade9153a.c:2184
ade9153a_enable_event_stat_int
int ade9153a_enable_event_stat_int(struct ade9153a_dev *dev)
Enable an interrupt when any bit in EVENT_STATUS reg is set.
Definition: ade9153a.c:1890
ade9153a_enable_fvarnl_int
int ade9153a_enable_fvarnl_int(struct ade9153a_dev *dev)
Enable fundamental reactive energy no load condition interrupt.
Definition: ade9153a.c:2142
ADE9153A_NO_BYTES_R_16
#define ADE9153A_NO_BYTES_R_16
Definition: ade9153a.h:91
ade9153a_clear_wattnl
int ade9153a_clear_wattnl(struct ade9153a_dev *dev)
Clear total active energy no load condition int mask.
Definition: ade9153a.c:1584
ADE9153A_RMS_OC_RDY_MSK
#define ADE9153A_RMS_OC_RDY_MSK
Definition: ade9153a.h:289
ADE9153A_BURST_EN_MSK
#define ADE9153A_BURST_EN_MSK
Definition: ade9153a.h:335
ade9153a_oia_en
int ade9153a_oia_en(struct ade9153a_dev *dev)
Ch A overcurretn detection enable.
Definition: ade9153a.c:3299
ade9153a_get_chip_stat
int ade9153a_get_chip_stat(struct ade9153a_dev *dev, uint8_t *status)
Get chip status indicator.
Definition: ade9153a.c:1761
ADE9153A_CF1SEL_MSK
#define ADE9153A_CF1SEL_MSK
Definition: ade9153a.h:346
ADE9153A_REG_VLEVEL
#define ADE9153A_REG_VLEVEL
Definition: ade9153a.h:168
ADE9153A_REG_AIRMS
#define ADE9153A_REG_AIRMS
Definition: ade9153a.h:127
ADE9153A_NOLOAD_TMR_SAMPLES_512
@ ADE9153A_NOLOAD_TMR_SAMPLES_512
Definition: ade9153a.h:577
ade9153a_oib_val
int ade9153a_oib_val(struct ade9153a_dev *dev, uint32_t *val)
Ch B overcurrent val.
Definition: ade9153a.c:2585
CONTINUOUSE
@ CONTINUOUSE
Definition: ade9153a.h:663
ade9153a_acal_ch_e
ade9153a_acal_ch_e
select channels for autocalibration
Definition: ade9153a.h:439
ADE9153A_NOLOAD_TMR_SAMPLES_2048
@ ADE9153A_NOLOAD_TMR_SAMPLES_2048
Definition: ade9153a.h:581
ade9153a_vlevel_val
int ade9153a_vlevel_val(struct ade9153a_dev *dev, uint32_t *val)
Vlevel val.
Definition: ade9153a.c:2610
ADE9153A_REG_MS_ACAL_AVCERT
#define ADE9153A_REG_MS_ACAL_AVCERT
Definition: ade9153a.h:143
ADE9153A_MS_SYSRDYP_MSK
#define ADE9153A_MS_SYSRDYP_MSK
Definition: ade9153a.h:264
ADE9153A_REG_AVAHR_HI
#define ADE9153A_REG_AVAHR_HI
Definition: ade9153a.h:152
ADE9153A_HPF_CORNER_19_6375_HZ
@ ADE9153A_HPF_CORNER_19_6375_HZ
Definition: ade9153a.h:548
ADE9153A_HPF_CORNER_38_695_HZ
@ ADE9153A_HPF_CORNER_38_695_HZ
Definition: ade9153a.h:546
ADE9153A_RD_RST_EN_MSK
#define ADE9153A_RD_RST_EN_MSK
Definition: ade9153a.h:373
ade9153a_power_values::active_power_reg_val
int32_t active_power_reg_val
Definition: ade9153a.h:750
ADE9153A_AI_GAIN_32
@ ADE9153A_AI_GAIN_32
Definition: ade9153a.h:615
ade9153a_clear_event_stat
int ade9153a_clear_event_stat(struct ade9153a_dev *dev, uint32_t *reg_val)
Clear event status int.
Definition: ade9153a.c:1803
ade9153a_power_vals
int ade9153a_power_vals(struct ade9153a_dev *dev, struct ade9153a_power_values *data)
Read power values.
Definition: ade9153a.c:4137
ade9153a_enable_zxtoav_int
int ade9153a_enable_zxtoav_int(struct ade9153a_dev *dev)
Enable zero corssing timeout on voltage ch interrupt.
Definition: ade9153a.c:2030
ade9153a_cf2sel
int ade9153a_cf2sel(struct ade9153a_dev *dev, enum ade9153a_cf2sel_e energy_type)
Set type of energy output on CF2 pin.
Definition: ade9153a.c:3056
ade9153a_enable_wattnl_int
int ade9153a_enable_wattnl_int(struct ade9153a_dev *dev)
Enable total active energy no load condition interrupt.
Definition: ade9153a.c:2198
ade9153a_zx_src_before_hpf_enable
int ade9153a_zx_src_before_hpf_enable(struct ade9153a_dev *dev)
ZX data source before hpf and phase compensation.
Definition: ade9153a.c:771
ade9153a_enable_ms_stat_int
int ade9153a_enable_ms_stat_int(struct ade9153a_dev *dev)
Enable an interrupt when any bit in MS_STATUS_IRQ reg is set.
Definition: ade9153a.c:1918
ade9153a_clear_rstdone
int ade9153a_clear_rstdone(struct ade9153a_dev *dev)
Clear reset done int mask.
Definition: ade9153a.c:1539
ADE9153A_DISZXLPF_MSK
#define ADE9153A_DISZXLPF_MSK
Definition: ade9153a.h:359
ADE9153A_PEAK_DETECTION_ENABLE_V_I_PHA_PHB
@ ADE9153A_PEAK_DETECTION_ENABLE_V_I_PHA_PHB
Definition: ade9153a.h:536
ade9153a_get_pf_rdy
int ade9153a_get_pf_rdy(struct ade9153a_dev *dev, uint8_t *status)
Get PF ready indicator.
Definition: ade9153a.c:1083
ade9153a_chip_stat_err_e
ade9153a_chip_stat_err_e
ADE9153A chip status errors.
Definition: ade9153a.h:624
ADE9153A_AI_GAIN_38_4
@ ADE9153A_AI_GAIN_38_4
Definition: ade9153a.h:617
ade9153a_set_interface_serial
int ade9153a_set_interface_serial(struct ade9153a_dev *dev)
Select comms interface Serial.
Definition: ade9153a.c:97
ade9153a_oia_val
int ade9153a_oia_val(struct ade9153a_dev *dev, uint32_t *val)
Ch A overcurrent val.
Definition: ade9153a.c:2560
ADE9153A_TEMP_RDY_MSK
#define ADE9153A_TEMP_RDY_MSK
Definition: ade9153a.h:288
no_os_crc16
uint16_t no_os_crc16(const uint16_t *table, const uint8_t *pdata, size_t nbytes, uint16_t crc)
no_os_free
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:69
ADE9153A_MS_STAT_MSK
#define ADE9153A_MS_STAT_MSK
Definition: ade9153a.h:276
ADE9153A_REG_DIPA
#define ADE9153A_REG_DIPA
Definition: ade9153a.h:170
ADE9153A_INTEN_BI_MSK
#define ADE9153A_INTEN_BI_MSK
Definition: ade9153a.h:248
ADE9153A_REG_STATUS
#define ADE9153A_REG_STATUS
Definition: ade9153a.h:162
ADE9153A_RESET_DEL
#define ADE9153A_RESET_DEL
Definition: ade9153a.h:79
ade9153a_ms_timeout
int ade9153a_ms_timeout(struct ade9153a_dev *dev, uint8_t *status)
mSure timed out (600s)
Definition: ade9153a.c:3895
ADE9153A_REG_CONFIG2
#define ADE9153A_REG_CONFIG2
Definition: ade9153a.h:207
ade9153a_cf_ltmr_val
int ade9153a_cf_ltmr_val(struct ade9153a_dev *dev, uint32_t *val)
cf_ltmr read value.
Definition: ade9153a.c:2788
ade9153a_disable_revpcf2_int
int ade9153a_disable_revpcf2_int(struct ade9153a_dev *dev)
Disable CF2 polarity change sign interrupt.
Definition: ade9153a.c:2436
ADE9153A_SETTLE_128_MS
@ ADE9153A_SETTLE_128_MS
Definition: ade9153a.h:481
ade9153a_ext_ref_status
int ade9153a_ext_ref_status(struct ade9153a_dev *dev, uint8_t *status)
External_reference status.
Definition: ade9153a.c:2876
ade9153a_ipk_val
int ade9153a_ipk_val(struct ade9153a_dev *dev, uint32_t *val)
Ipeak val.
Definition: ade9153a.c:1005
ADE9153A_REG_MS_ACAL_AVCC
#define ADE9153A_REG_MS_ACAL_AVCC
Definition: ade9153a.h:142
ADE9153A_REG_MS_ACAL_AICC
#define ADE9153A_REG_MS_ACAL_AICC
Definition: ade9153a.h:138
ade9153a_dready_oe
int ade9153a_dready_oe(struct ade9153a_dev *dev)
DREADY driven to CF2 pin.
Definition: ade9153a.c:3013
ade9153a_temp_gain_val
int ade9153a_temp_gain_val(struct ade9153a_dev *dev, uint32_t *val)
temperature sensor gain.
Definition: ade9153a.c:2839
ade9153a_clear_zxtoav
int ade9153a_clear_zxtoav(struct ade9153a_dev *dev)
Clear zero crossing timout on V ch int mask.
Definition: ade9153a.c:1479
ADE9153A_MS_TIMEOUT_MSK
#define ADE9153A_MS_TIMEOUT_MSK
Definition: ade9153a.h:397
ade9153a_setup
int ade9153a_setup(void *dev, struct ade9153a_init_param init_param)
ADE9153A setup.
Definition: ade9153a.c:295
ade9153a_disable_temp_rdy_int
int ade9153a_disable_temp_rdy_int(struct ade9153a_dev *dev)
Disable new temperature reading interrupt.
Definition: ade9153a.c:2240
ade9153a_init_param::gpio_sck
struct no_os_spi_init_param * gpio_sck
Definition: ade9153a.h:682
ade9153a_disable_rms_oc_rdy_int
int ade9153a_disable_rms_oc_rdy_int(struct ade9153a_dev *dev)
Disable RMS_OC values update interrupt.
Definition: ade9153a.c:2268
ade9153a_swella_val
int ade9153a_swella_val(struct ade9153a_dev *dev, uint32_t *val)
Voltage value during swell condition.
Definition: ade9153a.c:2660
ADE9153A_REG_MS_ACAL_CFG
#define ADE9153A_REG_MS_ACAL_CFG
Definition: ade9153a.h:118
ade9153a_half_rms_values::current_h_rms_reg_val
int32_t current_h_rms_reg_val
Definition: ade9153a.h:775
ADE9153A_TOTAL_APPARENT_POWER
@ ADE9153A_TOTAL_APPARENT_POWER
Definition: ade9153a.h:499
ADE9153A_AUTOCAL_BI_MSK
#define ADE9153A_AUTOCAL_BI_MSK
Definition: ade9153a.h:256
ade9153a_clear_temp_rdy
int ade9153a_clear_temp_rdy(struct ade9153a_dev *dev)
Clear new temperature reading ready int mask.
Definition: ade9153a.c:1599
ADE9153A_NO_BYTES_W_16
#define ADE9153A_NO_BYTES_W_16
Definition: ade9153a.h:89
ADE9153A_NOLOAD_TMR_DISABLE
@ ADE9153A_NOLOAD_TMR_DISABLE
Definition: ade9153a.h:585
ADE9153A_REG_AIGAIN
#define ADE9153A_REG_AIGAIN
Definition: ade9153a.h:100
ade9153a_noload_tmr
int ade9153a_noload_tmr(struct ade9153a_dev *dev, enum ade9153a_noload_tmr_e noload_samples)
Set no. of samples for no load condition.
Definition: ade9153a.c:3503
ade9153a_disable_pf_rdy_int
int ade9153a_disable_pf_rdy_int(struct ade9153a_dev *dev)
Disable pf ready interrupt.
Definition: ade9153a.c:1960
ADE9153A_REG_TEMP_TRIM
#define ADE9153A_REG_TEMP_TRIM
Definition: ade9153a.h:184
ADE9153A_REG_AWATT
#define ADE9153A_REG_AWATT
Definition: ade9153a.h:129
ADE9153A_TEMP_START_MSK
#define ADE9153A_TEMP_START_MSK
Definition: ade9153a.h:382
ade9153a_enable_zxav_int
int ade9153a_enable_zxav_int(struct ade9153a_dev *dev)
Enable zero corssing detected on V ch interrupt.
Definition: ade9153a.c:2114
ADE9153A_NEGATIVE_ACC_MODE
@ ADE9153A_NEGATIVE_ACC_MODE
Definition: ade9153a.h:518
ade9153a_ai_gain_e
ade9153a_ai_gain_e
ADE9153A PGA gain for current CH A.
Definition: ade9153a.h:608
no_os_gpio_set_value
int32_t no_os_gpio_set_value(struct no_os_gpio_desc *desc, uint8_t value)
Set the value of the specified GPIO.
Definition: no_os_gpio.c:197
no_os_get_unaligned_be32
uint32_t no_os_get_unaligned_be32(uint8_t *buf)
ADE9153A_PWR_SETTLE_MSK
#define ADE9153A_PWR_SETTLE_MSK
Definition: ade9153a.h:336
F_60_HZ
@ F_60_HZ
Definition: ade9153a.h:467
ADE9153A_REG_MS_ACAL_AICERT
#define ADE9153A_REG_MS_ACAL_AICERT
Definition: ade9153a.h:139
ade9153a_clear_crc_done
int ade9153a_clear_crc_done(struct ade9153a_dev *dev)
Clear CRC done int mask.
Definition: ade9153a.c:1464
ade9153a.h
Header file of ADE9153A Driver.
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
ade9153a_clear_wattnl
int ade9153a_clear_wattnl(struct ade9153a_dev *dev)
Clear total active energy no load condition int mask.
Definition: ade9153a.c:1584
ADE9153A_ACALMODE_BI_MSK
#define ADE9153A_ACALMODE_BI_MSK
Definition: ade9153a.h:258
ADE9153A_REG_COMPMODE
#define ADE9153A_REG_COMPMODE
Definition: ade9153a.h:194
NO_OS_EVT_GPIO
@ NO_OS_EVT_GPIO
Definition: no_os_irq.h:62
ade9153a_enable_cf2_int
int ade9153a_enable_cf2_int(struct ade9153a_dev *dev)
Enable CF2 interrupt.
Definition: ade9153a.c:2366
ade9153a_egy_ld_accum
int ade9153a_egy_ld_accum(struct ade9153a_dev *dev, uint8_t en)
Internal energy register accum.
Definition: ade9153a.c:3570
ade9153a_chip_status
int ade9153a_chip_status(struct ade9153a_dev *dev, uint8_t *status)
Chip status.
Definition: ade9153a.c:3976
ade9153a_get_int_status
int ade9153a_get_int_status(struct ade9153a_dev *dev, uint32_t msk, uint8_t *status)
Get interrupt indicator from STATUS register.
Definition: ade9153a.c:1056
ade9153a_get_wattnl
int ade9153a_get_wattnl(struct ade9153a_dev *dev, uint8_t *status)
Get total active energy no load condition indicator.
Definition: ade9153a.c:1243
ade9153a_wr_unlock
int ade9153a_wr_unlock(struct ade9153a_dev *dev)
Unlock device.
Definition: ade9153a.c:624
ade9153a_acalmode_e
ade9153a_acalmode_e
select power mode for ch B, ch A
Definition: ade9153a.h:452
ADE9153A_NOLOAD_TMR_SAMPLES_1024
@ ADE9153A_NOLOAD_TMR_SAMPLES_1024
Definition: ade9153a.h:579
ade9153a_clear_temp_rdy
int ade9153a_clear_temp_rdy(struct ade9153a_dev *dev)
Clear new temperature reading ready int mask.
Definition: ade9153a.c:1599
ADE9153A_TEMP_TIME_SAMPLES_256
@ ADE9153A_TEMP_TIME_SAMPLES_256
Definition: ade9153a.h:597
ADE9153A_FORCE_CRC_UPDATE_MSK
#define ADE9153A_FORCE_CRC_UPDATE_MSK
Definition: ade9153a.h:379
ade9153a_temp_offset_val
int ade9153a_temp_offset_val(struct ade9153a_dev *dev, uint32_t *val)
temperature sensor offset.
Definition: ade9153a.c:2813
ade9153a_selfreq_e
ade9153a_selfreq_e
select frequency
Definition: ade9153a.h:463
ade9153a_clear_cf1
int ade9153a_clear_cf1(struct ade9153a_dev *dev)
Clear CF1 pulse issued int mask.
Definition: ade9153a.c:1689
ade9153a_rms_values::current_rms_reg_val
int32_t current_rms_reg_val
Definition: ade9153a.h:763
ade9153a_varacc
int ade9153a_varacc(struct ade9153a_dev *dev, enum ade9153a_accmode_e varacc_type)
Select fundamental reactive power accumulation mode.
Definition: ade9153a.c:3175
ade9153a_temperature_value::gain_reg_val
uint16_t gain_reg_val
Definition: ade9153a.h:803
ade9153a_get_chip_stat
int ade9153a_get_chip_stat(struct ade9153a_dev *dev, uint8_t *status)
Get chip status indicator.
Definition: ade9153a.c:1761
ADE9153A_AI_SWAP_MSK
#define ADE9153A_AI_SWAP_MSK
Definition: ade9153a.h:390
ade9153a_auto_calibration_run
int ade9153a_auto_calibration_run(struct ade9153a_dev *dev)
Auto calibration run.
Definition: ade9153a.c:901
ade9153a_enable_fvarnl_int
int ade9153a_enable_fvarnl_int(struct ade9153a_dev *dev)
Enable fundamental reactive energy no load condition interrupt.
Definition: ade9153a.c:2142
ade9153a_clear_pf_rdy
int ade9153a_clear_pf_rdy(struct ade9153a_dev *dev)
Clear PF ready int mask.
Definition: ade9153a.c:1434
ade9153a_pwr_settle_set
int ade9153a_pwr_settle_set(struct ade9153a_dev *dev, enum ade9153a_pwr_settle_e time)
Set PWR_SETTLE.
Definition: ade9153a.c:2950
ade9153a_half_rms_values
ADE9153A half rms registers values.
Definition: ade9153a.h:773
ADE9153A_OIB_VAL_MSK
#define ADE9153A_OIB_VAL_MSK
Definition: ade9153a.h:307
ade9153a_egy_ld_accum
int ade9153a_egy_ld_accum(struct ade9153a_dev *dev, uint8_t en)
Internal energy register accum.
Definition: ade9153a.c:3570
ade9153a_get_zxbi
int ade9153a_get_zxbi(struct ade9153a_dev *dev, uint8_t *status)
Get zero crossing detect on I ch B indicator.
Definition: ade9153a.c:1147
ade9153a_disable_pwrrdy_int
int ade9153a_disable_pwrrdy_int(struct ade9153a_dev *dev)
Disable PWRRDY interrupt.
Definition: ade9153a.c:2296
ade9153a_enable_wattnl_int
int ade9153a_enable_wattnl_int(struct ade9153a_dev *dev)
Enable total active energy no load condition interrupt.
Definition: ade9153a.c:2198
ade9153a_rms_vals
int ade9153a_rms_vals(struct ade9153a_dev *dev, struct ade9153a_rms_values *data)
Read rms values.
Definition: ade9153a.c:4176
ade9153a_ms_conferr
int ade9153a_ms_conferr(struct ade9153a_dev *dev, uint8_t *status)
Invalid config of mSure status.
Definition: ade9153a.c:3841
ade9153a_varacc
int ade9153a_varacc(struct ade9153a_dev *dev, enum ade9153a_accmode_e varacc_type)
Select fundamental reactive power accumulation mode.
Definition: ade9153a.c:3175
ade9153a_vnoma_enable
int ade9153a_vnoma_enable(struct ade9153a_dev *dev)
Use the nominal phase voltage rms, VNOM, in the computation of the Phase A total apparent power.
Definition: ade9153a.c:701
ade9153a_clear_vanl
int ade9153a_clear_vanl(struct ade9153a_dev *dev)
Clear total apparent energy no load condition int mask.
Definition: ade9153a.c:1569
ADE9153A_PEAK_DETECTION_ENABLE_I_PHB
@ ADE9153A_PEAK_DETECTION_ENABLE_I_PHB
Definition: ade9153a.h:534
ade9153a_disable_zxtoav_int
int ade9153a_disable_zxtoav_int(struct ade9153a_dev *dev)
Disable zero corssing timeout on voltage ch interrupt.
Definition: ade9153a.c:2044
ADE9153A_CF2SIGN_MSK
#define ADE9153A_CF2SIGN_MSK
Definition: ade9153a.h:362
ade9153a_remove
int ade9153a_remove(struct ade9153a_dev *dev)
Remove the device and release resources.
Definition: ade9153a.c:513
no_os_spi_remove
int32_t no_os_spi_remove(struct no_os_spi_desc *desc)
Free the resources allocated by no_os_spi_init().
Definition: no_os_spi.c:116
ade9153a_init_param::rsmall
uint32_t rsmall
Definition: ade9153a.h:698
ade9153a_rms_values::voltage_rms_reg_val
int32_t voltage_rms_reg_val
Definition: ade9153a.h:765
no_os_irq_enable
int32_t no_os_irq_enable(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id)
Enable specific interrupt.
Definition: no_os_irq.c:181
ADE9153A_SPI_READ
#define ADE9153A_SPI_READ
Definition: ade9153a.h:60
ADE9153A_REG_OIA
#define ADE9153A_REG_OIA
Definition: ade9153a.h:165
ade9153a_enable_cf1_int
int ade9153a_enable_cf1_int(struct ade9153a_dev *dev)
Enable CF1 interrupt.
Definition: ade9153a.c:2394
no_os_gpio.h
Header file of GPIO Interface.
ade9153a_energy_values::active_energy_reg_val
int32_t active_energy_reg_val
Definition: ade9153a.h:737
ADE9153A_ACAL_MODE_MSK
#define ADE9153A_ACAL_MODE_MSK
Definition: ade9153a.h:261
ade9153a_enable_rms_oc_rdy_int
int ade9153a_enable_rms_oc_rdy_int(struct ade9153a_dev *dev)
Enable RMS_OC values update interrupt.
Definition: ade9153a.c:2254
ade9153a_cf1sel
int ade9153a_cf1sel(struct ade9153a_dev *dev, enum ade9153a_cf2sel_e energy_type)
Set type of energy output on CF1 pin.
Definition: ade9153a.c:3089
ade9153a_version_product
int ade9153a_version_product(struct ade9153a_dev *dev, uint32_t *data_read)
Version product.
Definition: ade9153a.c:641
ade9153a_disable_crc_chg_int
int ade9153a_disable_crc_chg_int(struct ade9153a_dev *dev)
Disable crc change interrupt.
Definition: ade9153a.c:1988
ADE9153A_TEMP_GAIN_MSK
#define ADE9153A_TEMP_GAIN_MSK
Definition: ade9153a.h:330
NO_OS_GPIO_IRQ
@ NO_OS_GPIO_IRQ
Definition: no_os_irq.h:85
ade9153a_clear_zxtoav
int ade9153a_clear_zxtoav(struct ade9153a_dev *dev)
Clear zero crossing timout on V ch int mask.
Definition: ade9153a.c:1479
ade9153a_cf2_lt_status
int ade9153a_cf2_lt_status(struct ade9153a_dev *dev, uint8_t *status)
CF2_LT status.
Definition: ade9153a.c:2719
ade9153a_init_param::gpio_reset
struct no_os_gpio_init_param * gpio_reset
Definition: ade9153a.h:678
ade9153a_enable_zxbi_int
int ade9153a_enable_zxbi_int(struct ade9153a_dev *dev)
Enable zero corssing detected on I ch B interrupt.
Definition: ade9153a.c:2058
ade9153a_get_egyrdy
int ade9153a_get_egyrdy(struct ade9153a_dev *dev, uint8_t *status)
Get power values egy ready indicator.
Definition: ade9153a.c:1323
ade9153a_clear_chip_stat
int ade9153a_clear_chip_stat(struct ade9153a_dev *dev, uint32_t *reg_val)
Clear chip status int.
Definition: ade9153a.c:1775
ade9153a_control_interrupt
int ade9153a_control_interrupt(struct ade9153a_dev *dev, uint16_t reg_addr, uint32_t int_msk, uint8_t en)
Enable/disable interrupt.
Definition: ade9153a.c:1847
ade9153a_rms_oc_src_adc_samples_enable
int ade9153a_rms_oc_src_adc_samples_enable(struct ade9153a_dev *dev)
Use ADC samples, before the high-pass filter for the RMS_OC calculation.
Definition: ade9153a.c:737
ade9153a_clear_pf_rdy
int ade9153a_clear_pf_rdy(struct ade9153a_dev *dev)
Clear PF ready int mask.
Definition: ade9153a.c:1434
ade9153a_pwr_settle_e
ade9153a_pwr_settle_e
ADE9153A Power settle.
Definition: ade9153a.h:474
ADE9153A_SETTLE_64_MS
@ ADE9153A_SETTLE_64_MS
Definition: ade9153a.h:479
ade9153a_vpk_val
int ade9153a_vpk_val(struct ade9153a_dev *dev, uint32_t *val)
Vpeak val.
Definition: ade9153a.c:1030
ADE9153A_MS_CONFERR_MSK
#define ADE9153A_MS_CONFERR_MSK
Definition: ade9153a.h:395
ade9153a_disable_zxbi_int
int ade9153a_disable_zxbi_int(struct ade9153a_dev *dev)
Disable zero corssing detected on I ch B interrupt.
Definition: ade9153a.c:2072
ade9153a_init
int ade9153a_init(struct ade9153a_dev **device, struct ade9153a_init_param init_param)
Initialize the device.
Definition: ade9153a.c:157
no_os_spi_init
int32_t no_os_spi_init(struct no_os_spi_desc **desc, const struct no_os_spi_init_param *param)
Initialize the SPI communication peripheral.
Definition: no_os_spi.c:52
ade9153a_get_rstdone
int ade9153a_get_rstdone(struct ade9153a_dev *dev, uint8_t *status)
Get reset done indicator.
Definition: ade9153a.c:1195
no_os_get_unaligned_be16
uint16_t no_os_get_unaligned_be16(uint8_t *buf)
no_os_crc16_populate_msb
void no_os_crc16_populate_msb(uint16_t *table, const uint16_t polynomial)
ade9153a_half_rms_vals
int ade9153a_half_rms_vals(struct ade9153a_dev *dev, struct ade9153a_half_rms_values *data)
Read half rms values.
Definition: ade9153a.c:4209
ade9153a_control_interrupt
int ade9153a_control_interrupt(struct ade9153a_dev *dev, uint16_t reg_addr, uint32_t int_msk, uint8_t en)
Enable/disable interrupt.
Definition: ade9153a.c:1847
ade9153a_wr_lock
int ade9153a_wr_lock(struct ade9153a_dev *dev)
Lock device.
Definition: ade9153a.c:608
ade9153a_clear_zxai
int ade9153a_clear_zxai(struct ade9153a_dev *dev)
Clear zero crossing detect on I ch A int mask.
Definition: ade9153a.c:1509
ade9153a_ai_gain
int ade9153a_ai_gain(struct ade9153a_dev *dev, enum ade9153a_ai_gain_e gain)
Set the PGA gain for I chA.
Definition: ade9153a.c:3779
ade9153a_ms_sysrdy
int ade9153a_ms_sysrdy(struct ade9153a_dev *dev, uint8_t *status)
New run of mSure ready.
Definition: ade9153a.c:3814
ade9153a_get_fvarnl
int ade9153a_get_fvarnl(struct ade9153a_dev *dev, uint8_t *status)
Get fundamental reactive energy no load condition indicator.
Definition: ade9153a.c:1211
ade9153a_ms_absent
int ade9153a_ms_absent(struct ade9153a_dev *dev, uint8_t *status)
mSure not detected on the last enabled ch
Definition: ade9153a.c:3868
ADE9153A_AVANL_MSK
#define ADE9153A_AVANL_MSK
Definition: ade9153a.h:320
ADE9153A_AWSIGN_MSK
#define ADE9153A_AWSIGN_MSK
Definition: ade9153a.h:365
ADE9153A_PEAK_SEL_MSK
#define ADE9153A_PEAK_SEL_MSK
Definition: ade9153a.h:354
ade9153a_disable_revpcf1_int
int ade9153a_disable_revpcf1_int(struct ade9153a_dev *dev)
Disable CF1 polarity change sign interrupt.
Definition: ade9153a.c:2464
ade9153a_dev
ADE9153A Device structure.
Definition: ade9153a.h:712
no_os_util.h
Header file of utility functions.
ade9153a_lpf_rp_disable
int ade9153a_lpf_rp_disable(struct ade9153a_dev *dev)
Disable the low pass filter in the fundamental reactive power datapath.
Definition: ade9153a.c:666
ade9153a_burst_en
int ade9153a_burst_en(struct ade9153a_dev *dev)
Burst read enable/disable.
Definition: ade9153a.c:2932
no_os_find_first_set_bit
uint32_t no_os_find_first_set_bit(uint32_t word)
ADE9153A_VNOMA_EN_MSK
#define ADE9153A_VNOMA_EN_MSK
Definition: ade9153a.h:245
ADE9153A_DIP_SWELL_IRQ_MODE_MSK
#define ADE9153A_DIP_SWELL_IRQ_MODE_MSK
Definition: ade9153a.h:334
ADE9153A_SIGNED_ACC_MODE
@ ADE9153A_SIGNED_ACC_MODE
Definition: ade9153a.h:512
ADE9153A_CRC16_INIT_VAL
#define ADE9153A_CRC16_INIT_VAL
Definition: ade9153a.h:87
ade9153a_clear_dready
int ade9153a_clear_dready(struct ade9153a_dev *dev)
Clear new waveform samples ready int mask.
Definition: ade9153a.c:1644
ade9153a_ms_shift
int ade9153a_ms_shift(struct ade9153a_dev *dev, uint8_t *status)
mSure shift detected in CC val
Definition: ade9153a.c:3949
AUTOCAL_AV
@ AUTOCAL_AV
Definition: ade9153a.h:441
ade9153a_get_rpa_chg_sgn
int ade9153a_get_rpa_chg_sgn(struct ade9153a_dev *dev, uint8_t *status)
Get RPA (reactive power) sign change indicator.
Definition: ade9153a.c:1403
ADE9153A_PGA_CHB_GAIN_2
@ ADE9153A_PGA_CHB_GAIN_2
Definition: ade9153a.h:430
ADE9153A_CF1DIS_MSK
#define ADE9153A_CF1DIS_MSK
Definition: ade9153a.h:344
ade9153a_clear_pwrrdy
int ade9153a_clear_pwrrdy(struct ade9153a_dev *dev)
Clear power values registers update int mask.
Definition: ade9153a.c:1629
ade9153a_enable_revpcf1_int
int ade9153a_enable_revpcf1_int(struct ade9153a_dev *dev)
Enable CF1 polarity change sign interrupt.
Definition: ade9153a.c:2450
ade9153a_clear_cf2_chg
int ade9153a_clear_cf2_chg(struct ade9153a_dev *dev)
Clear CF2 polarity change int mask.
Definition: ade9153a.c:1704
no_os_irq_trigger_level_set
int32_t no_os_irq_trigger_level_set(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, enum no_os_irq_trig_level trig)
Set interrupt trigger level.
Definition: no_os_irq.c:162
ADE9153A_REG_CFMODE
#define ADE9153A_REG_CFMODE
Definition: ade9153a.h:193
ade9153a_ms_absent
int ade9153a_ms_absent(struct ade9153a_dev *dev, uint8_t *status)
mSure not detected on the last enabled ch
Definition: ade9153a.c:3868
ade9153a_oib_val
int ade9153a_oib_val(struct ade9153a_dev *dev, uint32_t *val)
Ch B overcurrent val.
Definition: ade9153a.c:2585
no_os_irq_disable
int32_t no_os_irq_disable(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id)
Disable specific interrupt.
Definition: no_os_irq.c:198
ade9153a_clear_chip_stat
int ade9153a_clear_chip_stat(struct ade9153a_dev *dev, uint32_t *reg_val)
Clear chip status int.
Definition: ade9153a.c:1775
ade9153a_get_apa_chg_sgn
int ade9153a_get_apa_chg_sgn(struct ade9153a_dev *dev, uint8_t *status)
Get APA (active power) sign change indicator.
Definition: ade9153a.c:1419
ade9153a_disable_fvarnl_int
int ade9153a_disable_fvarnl_int(struct ade9153a_dev *dev)
Disable fundamental reactive energy no load condition interrupt.
Definition: ade9153a.c:2156
ade9153a_enable_dready_int
int ade9153a_enable_dready_int(struct ade9153a_dev *dev)
Enable data ready interrupt.
Definition: ade9153a.c:2310
ADE9153A_ERROR2_MSK
#define ADE9153A_ERROR2_MSK
Definition: ade9153a.h:413
ade9153a_pq_values::period_reg_val
int32_t period_reg_val
Definition: ade9153a.h:788
ADE9153A_REG_MASK
#define ADE9153A_REG_MASK
Definition: ade9153a.h:163
ade9153a_ip_phase
int ade9153a_ip_phase(struct ade9153a_dev *dev, uint8_t *ch)
Ipeak channel phase.
Definition: ade9153a.c:972
ADE9153A_ACAL_RUN_MSK
#define ADE9153A_ACAL_RUN_MSK
Definition: ade9153a.h:260
ade9153a_clear_cf1
ade9153a_clear_cf1(struct ade9153a_dev *dev)
Clear CF1 pulse issued int mask.
Definition: ade9153a.c:1689
ade9153a_get_phnoload_status
int ade9153a_get_phnoload_status(struct ade9153a_dev *dev, uint8_t *status)
Get phnoload status.
Definition: ade9153a.c:2685
ade9153a_clear_zxbi
int ade9153a_clear_zxbi(struct ade9153a_dev *dev)
Clear zero crossing detect on I ch B int mask.
Definition: ade9153a.c:1494
ade9153a_oi_lvl_val
int ade9153a_oi_lvl_val(struct ade9153a_dev *dev, uint32_t *val)
Overcurrent detection threshold level val.
Definition: ade9153a.c:2535
no_os_irq_ctrl_desc
Definition: no_os_irq.h:123
ADE9153A_TOTAL_ACTIVE_POWER
@ ADE9153A_TOTAL_ACTIVE_POWER
Definition: ade9153a.h:497
no_os_gpio_direction_output
int32_t no_os_gpio_direction_output(struct no_os_gpio_desc *desc, uint8_t value)
Enable the output direction of the specified GPIO.
Definition: no_os_gpio.c:147
ADE9153A_PF_RDY_MSK
#define ADE9153A_PF_RDY_MSK
Definition: ade9153a.h:277
ade9153a_cf2dis
int ade9153a_cf2dis(struct ade9153a_dev *dev)
CF2 output disable.
Definition: ade9153a.c:3027
ade9153a_enable_pwrrdy_int
int ade9153a_enable_pwrrdy_int(struct ade9153a_dev *dev)
Enable PWRRDY interrupt.
Definition: ade9153a.c:2282
ade9153a_temperature_value::offset_reg_val
uint16_t offset_reg_val
Definition: ade9153a.h:801
ADE9153A_CF2DIS_MSK
#define ADE9153A_CF2DIS_MSK
Definition: ade9153a.h:343
ade9153a_accmode_e
ade9153a_accmode_e
ADE9153A varacc/watacc acc mode.
Definition: ade9153a.h:508
ade9153a_ext_ref
int ade9153a_ext_ref(struct ade9153a_dev *dev, uint8_t en)
External voltage reference enable/disable.
Definition: ade9153a.c:2864
ade9153a_write
int ade9153a_write(struct ade9153a_dev *dev, uint16_t reg_addr, uint32_t reg_data)
Write device register.
Definition: ade9153a.c:445
ade9153a_vnoma_enable
int ade9153a_vnoma_enable(struct ade9153a_dev *dev)
Use the nominal phase voltage rms, VNOM, in the computation of the Phase A total apparent power.
Definition: ade9153a.c:701
ade9153a_clear_egyrdy
int ade9153a_clear_egyrdy(struct ade9153a_dev *dev)
Clear power values egy ready int mask.
Definition: ade9153a.c:1659
ade9153a_get_zxai
int ade9153a_get_zxai(struct ade9153a_dev *dev, uint8_t *status)
Get zero crossing detect on I ch A indicator.
Definition: ade9153a.c:1163
no_os_gpio_desc::number
int32_t number
Definition: no_os_gpio.h:100
no_os_test_bit
int no_os_test_bit(int pos, const volatile void *addr)
Definition: no_os_util.h:132
ade9153a_run
int ade9153a_run(struct ade9153a_dev *dev)
Start measurements.
Definition: ade9153a.c:3733
ade9153a_dev::burst_en
uint8_t burst_en
Definition: ade9153a.h:716
ade9153a_disable_chip_stat_int
int ade9153a_disable_chip_stat_int(struct ade9153a_dev *dev)
Disable CHIP_STAT interrupt.
Definition: ade9153a.c:1876
ade9153a_enable_dready_int
int ade9153a_enable_dready_int(struct ade9153a_dev *dev)
Enable data ready interrupt.
Definition: ade9153a.c:2310
ade9153a_uperiod_sel
int ade9153a_uperiod_sel(struct ade9153a_dev *dev, uint8_t en)
User period select.
Definition: ade9153a.c:3436
ADE9153A_AVARSIGN_MSK
#define ADE9153A_AVARSIGN_MSK
Definition: ade9153a.h:364
errno.h
Error macro definition for ARM Compiler.
ade9153a_disable_cf1_int
int ade9153a_disable_cf1_int(struct ade9153a_dev *dev)
Disable CF1 interrupt.
Definition: ade9153a.c:2408
ade9153a_get_cf2_chg
int ade9153a_get_cf2_chg(struct ade9153a_dev *dev, uint8_t *status)
Get CF2 polarity change indicator.
Definition: ade9153a.c:1371
ADE9153A_ERROR3
@ ADE9153A_ERROR3
Definition: ade9153a.h:632
ade9153a_disable_revrpa_int
int ade9153a_disable_revrpa_int(struct ade9153a_dev *dev)
Disable Phase A fundamental reactive power changed sign interrupt.
Definition: ade9153a.c:2492
ade9153a_temp_result
int ade9153a_temp_result(struct ade9153a_dev *dev, uint16_t *val)
Temperature result.
Definition: ade9153a.c:3694
ADE9153A_REG_WR_LOCK
#define ADE9153A_REG_WR_LOCK
Definition: ade9153a.h:215
ade9153a_init_param::no_samples
uint32_t no_samples
Definition: ade9153a.h:700
ADE9153A_ERROR0_MSK
#define ADE9153A_ERROR0_MSK
Definition: ade9153a.h:415
ade9153a_read
int ade9153a_read(struct ade9153a_dev *dev, uint16_t reg_addr, uint32_t *reg_data)
Read device register.
Definition: ade9153a.c:365
ade9153a_temperature_value::temperature_reg_val
int16_t temperature_reg_val
Definition: ade9153a.h:799
ADE9153A_DIPA_VAL_MSK
#define ADE9153A_DIPA_VAL_MSK
Definition: ade9153a.h:313
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
ade9153a_sw_reset
int ade9153a_sw_reset(struct ade9153a_dev *dev)
Reset the device using SW reset.
Definition: ade9153a.c:555
ade9153a_get_vanl
int ade9153a_get_vanl(struct ade9153a_dev *dev, uint8_t *status)
Get total apparent energy no load condition indicator.
Definition: ade9153a.c:1227
ADE9153A_ERROR0
@ ADE9153A_ERROR0
Definition: ade9153a.h:626
ade9153a_oia_val
int ade9153a_oia_val(struct ade9153a_dev *dev, uint32_t *val)
Ch A overcurrent val.
Definition: ade9153a.c:2560
no_os_gpio_get_optional
int32_t no_os_gpio_get_optional(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Get the value of an optional GPIO.
Definition: no_os_gpio.c:75