no-OS
ade9113.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef __ADE9113_H__
34 #define __ADE9113_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 
47 /******************************************************************************/
48 /********************** Macros and Constants Definitions **********************/
49 /******************************************************************************/
50 
51 /* SPI commands */
52 #define ADE9113_SPI_READ NO_OS_BIT(7)
53 
54 /* Long/Short operation bit, set for lon read/write */
55 #define ADE9113_OP_MODE_LONG NO_OS_BIT(6)
56 
57 /* ADE9113 CRC constants */
58 #define ADE9113_CRC8_POLY 0x07
59 #define ADE9113_CRC16_POLY 0x1021
60 #define ADE9113_CRC16_INIT_VAL 0xFFFF
61 
62 /* ENABLE and DISABLE */
63 #define ENABLE 1u
64 #define DISABLE 0u
65 
66 /* ADE9113 Register Map */
67 #define ADE9113_REG_SWRST 0x001
68 #define ADE9113_REG_CONFIG0 0x002
69 #define ADE9113_REG_CONFIG_FILT 0x003
70 #define ADE9113_REG_CONFIG_ISO_ACC 0x005
71 #define ADE9113_REG_CRC_RESULT_HI 0x006
72 #define ADE9113_REG_CRC_RESULT_LO 0x007
73 #define ADE9113_REG_EFUSE_REFRESH 0x008
74 #define ADE9113_REG_EMI_CONFIG 0x009
75 #define ADE9113_REG_EMI_HI_MASK 0x00A
76 #define ADE9113_REG_EMI_LO_MASK 0x00B
77 #define ADE9113_REG_EMI_HI_LIMIT 0x00C
78 #define ADE9113_REG_EMI_MID_LIMIT 0x00D
79 #define ADE9113_REG_EMI_LO_LIMIT 0x00E
80 #define ADE9113_REG_MASK0 0x00F
81 #define ADE9113_REG_MASK1 0x010
82 #define ADE9113_REG_MASK2 0x011
83 #define ADE9113_REG_CONFIG_ZX 0x012
84 #define ADE9113_REG_SCRATCH 0x013
85 #define ADE9113_REG_SYNC_SNAP 0x014
86 #define ADE9113_REG_COUNTER_HI 0x015
87 #define ADE9113_REG_COUNTER_LO 0x016
88 #define ADE9113_REG_SNAPSHOT_COUNT_HI 0x017
89 #define ADE9113_REG_SNAPSHOT_COUNT_LO 0x018
90 #define ADE9113_REG_WR_LOCK 0x01F
91 #define ADE9113_REG_STATUS0 0x020
92 #define ADE9113_REG_STATUS1 0x021
93 #define ADE9113_REG_STATUS2 0x022
94 #define ADE9113_REG_COM_FLT_TYPE 0x023
95 #define ADE9113_REG_COM_FLT_COUNT 0x024
96 #define ADE9113_REG_CONFIG_CRC 0x025
97 #define ADE9113_REG_I_WAV_HI 0x026
98 #define ADE9113_REG_I_WAV_MD 0x027
99 #define ADE9113_REG_I_WAV_LO 0x028
100 #define ADE9113_REG_V1_WAV_HI 0x029
101 #define ADE9113_REG_V1_WAV_MD 0x02A
102 #define ADE9113_REG_V1_WAV_LO 0x02B
103 #define ADE9113_REG_V2_WAV_HI 0x02C
104 #define ADE9113_REG_V2_WAV_MD 0x02D
105 #define ADE9113_REG_V2_WAV_LO 0x02E
106 #define ADE9113_REG_UNIQUE_PART_ID_5 0x075
107 #define ADE9113_REG_UNIQUE_PART_ID_4 0x076
108 #define ADE9113_REG_UNIQUE_PART_ID_3 0x077
109 #define ADE9113_REG_UNIQUE_PART_ID_2 0x078
110 #define ADE9113_REG_UNIQUE_PART_ID_1 0x079
111 #define ADE9113_REG_UNIQUE_PART_ID_0 0x07A
112 #define ADE9113_REG_SILICON_REVISION 0x07D
113 #define ADE9113_REG_VERSION_PRODUCT 0x07E
114 
115 /* ADE9113 SWRST command */
116 #define ADE9113_SWRST_CMD 0xD6
117 
118 /* ADE9113_REG_CONFIG0 Bit Definition */
119 #define ADE9113_STREAM_DBG_MSK NO_OS_GENMASK(3, 2)
120 #define ADE9113_CRC_EN_SPI_WRITE_MSK NO_OS_BIT(1)
121 #define ADE9113_CLOUT_EN_MSK NO_OS_BIT(0)
122 
123 /* ADE9113_REG_CONFIG_FILT Bit Definition */
124 #define ADE9113_V2_ADC_INVERT_MSK NO_OS_BIT(6)
125 #define ADE9113_V1_ADC_INVERT_MSK NO_OS_BIT(5)
126 #define ADE9113_I_ADC_INVERT_MSK NO_OS_BIT(4)
127 #define ADE9113_LPF_BW_MSK NO_OS_BIT(3)
128 #define ADE9113_DATAPATH_CONFIG_MSK NO_OS_GENMASK(2, 0)
129 
130 /* ADE9113_REG_CONFIG_ISO_ACC Bit Definition */
131 #define ADE9113_ISO_WR_ACC_EN_MSK NO_OS_BIT(0)
132 
133 /* ADE9113_REG_EFUSE_REFRESH Bit Definition */
134 #define ADE9113_EFUSE_REFRESH_MSK NO_OS_BIT(0)
135 
136 /* ADE9113_REG_EMI_CONFIG Bit Definition */
137 #define ADE9113_EMI_CONFIG_MSK NO_OS_GENMASK(2, 0)
138 
139 /* ADE9113_REG_MASK0/ADE9113_REG_STATUS0 Bit Definition */
140 #define ADE9113_STATUS1X_MSK NO_OS_BIT(7)
141 #define ADE9113_STATUS2X_MSK NO_OS_BIT(6)
142 #define ADE9113_COM_UP_MSK NO_OS_BIT(4)
143 #define ADE9113_CRC_CHG_MSK NO_OS_BIT(3)
144 #define ADE9113_SPI_CRC_ERR_MSK NO_OS_BIT(1)
145 #define ADE9113_COMFLT_ERR_MSK NO_OS_BIT(0)
146 
147 /* ADE9113_REG_MASK1/ADE9113_REG_STATUS1 Bit Definition */
148 #define ADE9113_V2_WAV_OVRNG_MSK NO_OS_BIT(3)
149 #define ADE9113_V1_WAV_OVRNG_MSK NO_OS_BIT(2)
150 #define ADE9113_I_WAV_OVRNG_MSK NO_OS_BIT(1)
151 #define ADE9113_ADC_SYNC_DONE_MSK NO_OS_BIT(0)
152 
153 /* ADE9113_REG_MASK2/ADE9113_REG_STATUS2 Bit Definition */
154 #define ADE9113_ISO_CLK_STBL_ERR_MSK NO_OS_BIT(6)
155 #define ADE9113_ISO_PHY_CRC_ERR_MSK NO_OS_BIT(5)
156 #define ADE9113_ISO_EFUSE_MEM_ERR_MSK NO_OS_BIT(4)
157 #define ADE9113_ISO_DIG_MOD_V2_OVF_MSK NO_OS_BIT(3)
158 #define ADE9113_ISO_DIG_MOD_V1_OVF_MSK NO_OS_BIT(2)
159 #define ADE9113_ISO_DIG_MOD_I_OVF_MSK NO_OS_BIT(1)
160 #define ADE9113_ISO_TEST_MMR_ERR_MSK NO_OS_BIT(0)
161 
162 /* ADE9113_REG_CONFIG_ZX Bit Definition */
163 #define ADE9113_ZX_EDGE_SEL_MSK NO_OS_GENMASK(3, 2)
164 #define ADE9113_ZX_CHANNEL_CONFIG_MSK NO_OS_GENMASK(1, 0)
165 
166 /* ADE9113_REG_SYNC_SNAP Bit Definition */
167 #define ADE9113_PREP_BROADCAST_MSK NO_OS_BIT(2)
168 #define ADE9113_ALIGN_MSK NO_OS_BIT(1)
169 #define ADE9113_SNAPSHOT_MSK NO_OS_BIT(0)
170 
171 /* ADE9113_REG_COUNTER_HI Bit Definition */
172 #define ADE9113_COUNTER_HI_MSK NO_OS_GENMASK(5, 0)
173 
174 /* ADE9113_REG_COUNTER_LO Bit Definition */
175 #define ADE9113_COUNTER_LO_MSK NO_OS_GENMASK(8, 0)
176 
177 /* ADE9113_REG_SNAPSHOT_COUNT_HI Bit Definition */
178 #define ADE9113_SNAPSHOT_COUNT_HI_MSK NO_OS_GENMASK(5, 0)
179 
180 /* ADE9113_REG_SNAPSHOT_COUNT_LO Bit Definition */
181 #define ADE9113_SNAPSHOT_COUNT_LO_MSK NO_OS_GENMASK(7, 0)
182 
183 /* ADE9113_REG_STATUS0 Bit Definition */
184 #define ADE9113_RESET_DONE_MSK NO_OS_BIT(5)
185 #define ADE9113_EFUSE_MEM_ERR_MSK NO_OS_BIT(2)
186 
187 /* ADE9113_REG_COM_FLT_TYPE Bit Definition */
188 #define ADE9113_ISO_STATUS_RD_ECC_ERR_MSK NO_OS_BIT(2)
189 #define ADE9113_ISO_PHY_ERR_MSK NO_OS_BIT(1)
190 #define ADE9113_ISO_ECC_ERR_MSK NO_OS_BIT(1)
191 
192 /* ADE9113_REG_CONFIG_CRC Bit Definition */
193 #define ADE9113_CRC_DONE_MSK NO_OS_BIT(1)
194 #define ADE9113_CRC_FORCE_MSK NO_OS_BIT(0)
195 
196 /* ADE9113_REG_SILICON_REVISION Bit Definition */
197 #define ADE9113_NONISO_CHIP_REV_MSK NO_OS_GENMASK(7, 4)
198 #define ADE9113_ISO_CHIP_REV_MSK NO_OS_GENMASK(3, 0)
199 
200 /* Configuration Register Write Lock */
201 #define ADE9113_LOCK_KEY 0XD4
202 #define ADE9113_UNLOCK_KEY 0X5E
203 
204 /* Version Product */
205 #define ADE9113_3_CHANNEL_ADE9113 0U
206 #define ADE9113_2_CHANNEL_ADE9112 1U
207 #define ADE9113_NONISOLATED_ADE9103 3U
208 
209 /* Nominal reference voltage */
210 #define ADE9113_VREF (1249810)
211 
212 /******************************************************************************/
213 /*************************** Types Declarations *******************************/
214 /******************************************************************************/
215 
221  /* Normal Mode */
223  /* Static Mode */
225  /* Data Increments at ADC Conversion Rate */
227  /* Same as functional mode */
229 };
230 
236  /* Sinc3, 32KHz Sampling */
238  /* Sinc3, Low-Pass Filter (LPF) Enabled, 32kHz Sampling */
240  /* Sinc3, Compensation Enabled, LPF Enabled, 32KHz Sampling */
242  /* Sinc3, LPF Enabled, 8KHz Sampling */
244  /* Sinc3, Compensation Enabled, LPF Enabled, 8KHz Sampling */
246  /* Sinc3, LPF Enabled, 4kHz Sampling. */
248  /* Sinc3, LPF Enabled, 2kHz Sampling. */
250  /* Sinc3, LPF Enabled, 1kHz Sampling. */
252 };
253 
259  /* Sawtooth Frequency Rising */
261  /* Sawtooth Frequency Falling */
263  /* Ramp */
265  /* Random Hopping Frequency */
267 };
268 
274  /* ZX Pin Reflects the Sign of the Input Signal */
276  /* Detect Zero Crossings with Positive Slope */
278  /* Detect Zero Crossings with Negative Slope */
280  /* Detect Zero Crossings with Positive or Negative Slopes */
282 };
283 
289  /* Disable Zero Crossing Output */
291  /* Output Zero Crossing Function from the I Channel on ZX Pin */
293  /* Output Zero Crossing Function from the V1 Channel on ZX Pin */
295  /* Output Zero Crossing Function from the V2 Channel on ZX Pin */
297 };
298 
304  /* Long read/write operations */
306  /* Short read/write operations */
308 };
309 
315  /* I_WAV */
317  /* V1_WAV */
319  /* V1_WAV */
321 };
322 
323 
329  /* Device communication descriptor */
339  void (*drdy_callback)(void *context);
341  uint8_t no_devs;
342 };
343 
348 struct ade9113_dev {
349  /* Device communication descriptor */
351  /* Version product */
352  uint8_t ver_product;
353  /* CRC setting */
354  uint8_t crc_en;
355  /* I_WAV */
356  int32_t *i_wav;
357  /* V1_WAV */
358  int32_t *v1_wav;
359  /* V2_WAV */
360  int32_t *v2_wav;
370  uint8_t no_devs;
371 };
372 
373 /******************************************************************************/
374 /************************ Functions Declarations ******************************/
375 /******************************************************************************/
376 
377 /* Read device register. */
378 int ade9113_read(struct ade9113_dev *dev, uint8_t reg_addr,
379  uint8_t *reg_data, enum ade9113_operation_e op_mode);
380 
381 /* Read device register in a daisy-chain setup. */
382 int ade9113_read_dc(struct ade9113_dev *dev, uint8_t reg_addr,
383  uint8_t *reg_data);
384 
385 /* Write device register. */
386 int ade9113_write(struct ade9113_dev *dev, uint8_t reg_addr,
387  uint8_t reg_data, enum ade9113_operation_e op_mode);
388 
389 /* Write device register in a daisy-chain setup. */
390 int ade9113_write_dc(struct ade9113_dev *dev, uint8_t reg_addr,
391  uint8_t *reg_data);
392 
393 /* Initialize the device. */
394 int ade9113_init(struct ade9113_dev **device,
396 
397 /* Remove the device and release resources. */
398 int ade9113_remove(struct ade9113_dev *dev);
399 
400 /* Reset the device using SW reset. */
401 int ade9113_sw_reset(struct ade9113_dev *dev);
402 
403 /* Reset the device using HW reset. */
404 int ade9113_hw_reset(struct ade9113_dev *dev);
405 
406 /* Convert a 24-bit raw sample to millivolts. */
408  uint8_t dev_no, enum ade9113_wav_e ch, int32_t *mv_val);
409 
410 /* Get STREAM_DBG mode. */
412  enum ade9113_stream_debug_e *stream_dbg);
413 
414 /* Set STREAM_DBG mode. */
416  enum ade9113_stream_debug_e stream_dbg);
417 
418 /* Get CRC enable on SPI write setting. */
419 int ade9113_get_crc_en_state(struct ade9113_dev *dev,
420  uint8_t *crc_en_state);
421 
422 /* Set CRC enable on SPI write setting. */
423 int ade9113_set_crc_en_state(struct ade9113_dev *dev,
424  uint8_t crc_en_state);
425 
426 /* Lock device. */
427 int ade9113_wr_lock(struct ade9113_dev *dev);
428 
429 /* Unlock device. */
430 int ade9113_wr_unlock(struct ade9113_dev *dev);
431 
432 /* Write value in the scratchpad register. */
433 int ade9113_write_scratchpad(struct ade9113_dev *dev,
434  uint8_t val);
435 
436 /* Get the value stired in the scratchpad register. */
437 int ade9113_read_scratchpad(struct ade9113_dev *dev,
438  uint8_t *val);
439 
440 /* Set normal mode of operation. */
441 int ade9113_set_normal_mode(struct ade9113_dev *dev);
442 
443 /* Set static mode of operation. */
444 int ade9113_set_static_mode(struct ade9113_dev *dev);
445 
446 /* Set static mode of operation. */
448 
449 /* Get ECC or PHY Error Count on ISO to NONISO Communications. */
450 int ade9113_get_err_count(struct ade9113_dev *dev,
451  uint8_t *err_count);
452 
453 /* Invert V2 channel inputs. */
454 int ade9113_invert_v2_inputs(struct ade9113_dev *dev);
455 
456 /* Invert V1 channel inputs. */
457 int ade9113_invert_v1_inputs(struct ade9113_dev *dev);
458 
459 /* Invert I channel inputs. */
460 int ade9113_invert_i_inputs(struct ade9113_dev *dev);
461 
462 /* Disable invert V2 channel inputs. */
464 
465 /* Disable invert V1 channel inputs. */
467 
468 /* Disable invert I channel inputs. */
470 
471 /* Set filter bandwidth to 2.7 kHz at 8ksps output data rate. */
472 int ade9113_set_lpf_bw_2_7(struct ade9113_dev *dev);
473 
474 /* Set filter bandwidth to 3.3 kHz at 8ksps output data rate. */
475 int ade9113_set_lpf_bw_3_3(struct ade9113_dev *dev);
476 
477 /* Set digital signal processing configuration. */
478 int ade9113_set_dsp_config(struct ade9113_dev *dev,
479  enum ade9113_datapath_config_e config);
480 
481 /* Enable write access to DC_OFFSET_MODE register. */
483 
484 /* Disable write access to DC_OFFSET_MODE register. */
486 
487 /* Get register map CRC. */
488 int ade9113_get_crc(struct ade9113_dev *dev, uint16_t *crc);
489 
490 /* Refresh EFuse Memory. */
491 int ade9113_efuse_refresh(struct ade9113_dev *dev);
492 
493 /* Select EMI frequency hopping. */
494 int ade9113_set_emi_config(struct ade9113_dev *dev,
495  enum ade9113_emi_config_e config);
496 
497 /* Get EMI HI mask. */
498 int ade9113_get_emi_hi_mask(struct ade9113_dev *dev, uint8_t *msk);
499 
500 /* Get EMI LO mask. */
501 int ade9113_get_emi_lo_mask(struct ade9113_dev *dev, uint8_t *msk);
502 
503 /* Set EMI HI mask. */
504 int ade9113_set_emi_hi_mask(struct ade9113_dev *dev, uint8_t msk);
505 
506 /* Set EMI LO mask. */
507 int ade9113_set_emi_lo_mask(struct ade9113_dev *dev, uint8_t msk);
508 
509 /* Get EMI HI limit. */
510 int ade9113_get_emi_hi_limit(struct ade9113_dev *dev, uint8_t *limit);
511 
512 /* Get EMI MID limit. */
513 int ade9113_get_emi_mid_limit(struct ade9113_dev *dev, uint8_t *limit);
514 
515 /* Get EMI LO limit. */
516 int ade9113_get_emi_lo_limit(struct ade9113_dev *dev, uint8_t *limit);
517 
518 /* Enable/Disable interrupt. */
519 int ade9113_control_interrupt(struct ade9113_dev *dev, uint8_t reg_addr,
520  uint8_t int_msk, uint8_t en);
521 
522 /* Enable STATUS1X interrupt. */
524 
525 /* Disable STATUS1X interrupt. */
527 
528 /* Enable STATUS2X interrupt. */
530 
531 /* Disable STATUS2X interrupt. */
533 
534 /* Enable COM_UP interrupt. */
535 int ade9113_enable_com_up_int(struct ade9113_dev *dev);
536 
537 /* Disable COM_UP interrupt. */
538 int ade9113_disable_com_up_int(struct ade9113_dev *dev);
539 
540 /* Enable CRC_CHG interrupt. */
541 int ade9113_enable_crc_chg_int(struct ade9113_dev *dev);
542 
543 /* Disable CRC_CHG interrupt. */
545 
546 /* Enable SPI_CRC_ERR interrupt. */
548 
549 /* Disable SPI_CRC_ERR interrupt. */
551 
552 /* Enable COMFLT_ERR interrupt. */
554 
555 /* Disable COMFLT_ERR interrupt. */
557 
558 /* Enable V2_WAV_OVRNG interrupt. */
560 
561 /* Disable V2_WAV_OVRNG interrupt. */
563 
564 /* Enable V1_WAV_OVRNG interrupt. */
566 
567 /* Disable V1_WAV_OVRNG interrupt. */
569 
570 /* Enable I_WAV_OVRNG interrupt. */
572 
573 /* Disable I_WAV_OVRNG interrupt. */
575 
576 /* Enable ADC_SYNC_DONE interrupt. */
578 
579 /* Disable ADC_SYNC_DONE interrupt. */
581 
582 /* Enable ISO_CLK_STBL_ERR interrupt. */
584 
585 /* Disable ISO_CLK_STBL_ERR interrupt. */
587 
588 /* Enable ISO_PHY_CRC_ERR interrupt. */
590 
591 /* Disable ISO_PHY_CRC_ERR interrupt. */
593 
594 /* Enable ISO_EFUSE_MEM_ERR interrupt. */
596 
597 /* Disable ISO_EFUSE_MEM_ERR interrupt. */
599 
600 /* Enable ISO_DIG_MOD_V2_OVF interrupt. */
602 
603 /* Disable ISO_DIG_MOD_V2_OVF interrupt. */
605 
606 /* Enable ISO_DIG_MOD_V1_OVF interrupt. */
608 
609 /* Disable ISO_DIG_MOD_V1_OVF interrupt. */
611 
612 /* Enable ISO_DIG_MOD_I_OVF interrupt. */
614 
615 /* Disable ISO_DIG_MOD_I_OVF interrupt. */
617 
618 /* Enable ISO_TEST_MMR_ERR interrupt. */
620 
621 /* Disable ISO_TEST_MMR_ERR interrupt. */
623 
624 /* Select zero crossing edge. */
626  enum ade9113_zx_edge_sel_e sel);
627 
628 /* Select zero crossing channel. */
630  enum ade9113_zx_channel_cfg_e cfg);
631 
632 /* ADC prepare broadcast. */
634 
635 /* ADC align. */
636 int ade9113_adc_align(struct ade9113_dev *dev);
637 
638 /* ADC snapshot. */
639 int ade9113_adc_snapshot(struct ade9113_dev *dev);
640 
641 /* Get interrupt indicator from STATUS register. */
642 int ade9113_get_int_status(struct ade9113_dev *dev, uint8_t addr, uint8_t msk,
643  uint8_t *status);
644 
645 /* Get STATUSx register value. */
646 int ade9113_get_statusx_val(struct ade9113_dev *dev, uint8_t addr,
647  uint8_t *status);
648 
649 /* Get STATUS1X Indicator. */
650 int ade9113_get_status1x(struct ade9113_dev *dev, uint8_t *status);
651 
652 /* Get STATUS2 indicator. */
653 int ade9113_get_status2x(struct ade9113_dev *dev, uint8_t *status);
654 
655 /* Get RESET_DONE indicator. */
656 int ade9113_get_reset_done(struct ade9113_dev *dev, uint8_t *status);
657 
658 /* Get COM_UP indicator. */
659 int ade9113_get_com_up(struct ade9113_dev *dev, uint8_t *status);
660 
661 /* Get CRC_CHG indicator. */
662 int ade9113_get_crc_chg(struct ade9113_dev *dev, uint8_t *status);
663 
664 /* Get EFUSE_MEM_ERR indicator. */
665 int ade9113_get_efuse_mem_err(struct ade9113_dev *dev, uint8_t *status);
666 
667 /* Get SPI_CRC_ERR indicator. */
668 int ade9113_get_spi_crc_err(struct ade9113_dev *dev, uint8_t *status);
669 
670 /* Get COMFLT_ERR indicator. */
671 int ade9113_get_comflt_err(struct ade9113_dev *dev, uint8_t *status);
672 
673 /* Clear the RESET_DONE int mask. */
675 
676 /* Clear the COM_UP int mask. */
677 int ade9113_clear_com_up_int(struct ade9113_dev *dev);
678 
679 /* Clear the CRC_CHG int mask. */
680 int ade9113_clear_crc_chg_int(struct ade9113_dev *dev);
681 
682 /* Clear the SPI_CRC_ERR int mask. */
684 
685 /* Clear the COMFLT_ERR int mask. */
687 
688 /* Get V2_WAV_OVRNG indicator. */
689 int ade9113_get_v2_wav_ovrng(struct ade9113_dev *dev, uint8_t *status);
690 
691 /* Clear the V2_WAV_OVRNG int mask. */
693 
694 /* Get V1_WAV_OVRNG indicator. */
695 int ade9113_get_v1_wav_ovrng(struct ade9113_dev *dev, uint8_t *status);
696 
697 /* Clear the V1_WAV_OVRNG int mask. */
699 
700 /* Get I_WAV_OVRNG indicator. */
701 int ade9113_get_i_wav_ovrng(struct ade9113_dev *dev, uint8_t *status);
702 
703 /* Clear the I_WAV_OVRNG int mask. */
705 
706 /* Get ADC_SYNC_DONE indicator. */
707 int ade9113_get_adc_sync_done(struct ade9113_dev *dev, uint8_t *status);
708 
709 /* Clear the ADC_SYNC_DONE int mask. */
711 
712 /* Get ISO_CLK_STBL_ERR indicator. */
713 int ade9113_get_iso_clk_stbl_err(struct ade9113_dev *dev, uint8_t *status);
714 
715 /* Clear the ISO_CLK_STBL_ERR int mask. */
717 
718 /* Get ISO_PHY_CRC_ERR indicator. */
719 int ade9113_get_iso_phy_crc_err(struct ade9113_dev *dev, uint8_t *status);
720 
721 /* Clear the ISO_PHY_CRC_ERR int mask. */
723 
724 /* Get ISO_EFUSE_MEM_ERR indicator. */
725 int ade9113_get_iso_efuse_mem_err_err(struct ade9113_dev *dev, uint8_t *status);
726 
727 /* Clear the ISO_EFUSE_MEM_ERR int mask. */
729 
730 /* Get ISO_DIG_MOD_V2_OVF indicator. */
731 int ade9113_get_iso_dig_mod_v2_ovf(struct ade9113_dev *dev, uint8_t *status);
732 
733 /* Clear the ISO_DIG_MOD_V2_OVF int mask. */
735 
736 /* Get ISO_DIG_MOD_V1_OVF indicator. */
737 int ade9113_get_iso_dig_mod_v1_ovf(struct ade9113_dev *dev, uint8_t *status);
738 
739 /* Clear the ISO_DIG_MOD_V1_OVF int mask. */
741 
742 /* Get ISO_DIG_MOD_I_OVF indicator. */
743 int ade9113_get_iso_dig_mod_i_ovf(struct ade9113_dev *dev, uint8_t *status);
744 
745 /* Clear the ISO_DIG_MOD_I_OVF int mask. */
747 
748 /* Get ISO_TEST_MMR_ERR indicator. */
749 int ade9113_get_iso_test_mmr_err(struct ade9113_dev *dev, uint8_t *status);
750 
751 /* Clear the ISO_TEST_MMR_ERR int mask. */
753 
754 /* Get ISO_STATUS_RD_ECC_ERR indicator. */
755 int ade9113_get_iso_status_rd_ecc_err(struct ade9113_dev *dev, uint8_t *status);
756 
757 /* Get ISO_PHY_ERR indicator. */
758 int ade9113_get_iso_phy_err(struct ade9113_dev *dev, uint8_t *status);
759 
760 /* Get ISO_ECC_ERR indicator. */
761 int ade9113_get_iso_ecc_err(struct ade9113_dev *dev, uint8_t *status);
762 
763 /* Get CRC_DONE indicator. */
764 int ade9113_get_crc_done_flag(struct ade9113_dev *dev, uint8_t *status);
765 
766 /* Clear the CRC_DONE int mask. */
767 int ade9113_clear_crc_done_int(struct ade9113_dev *dev);
768 
769 /* Force background register map CRC recalculation. */
771 
772 /* Get SILICON_REVISION value. */
773 int ade9113_get_silicon_revision(struct ade9113_dev *dev, uint8_t *silicon_rev);
774 
775 /* Get VERSION_PRODUCT value. */
776 int ade9113_get_version_product(struct ade9113_dev *dev, uint8_t *ver_product);
777 
778 /* Get wave value. */
779 int ade9113_get_wav(struct ade9113_dev *dev, enum ade9113_wav_e selection,
780  uint32_t *val);
781 
782 /* DRDY inerrupt enable. */
783 int ade9113_drdy_int_enable(struct ade9113_dev *dev);
784 
785 /* DRDY inerrupt disable. */
786 int ade9113_drdy_int_disable(struct ade9113_dev *dev);
787 
788 #endif // __ADE9113_H__
ade9113_stream_debug_e
ade9113_stream_debug_e
ADE9113 Stream Debug.
Definition: ade9113.h:220
ade9113_get_comflt_err
int ade9113_get_comflt_err(struct ade9113_dev *dev, uint8_t *status)
Get COMFLT_ERR indicator.
Definition: ade9113.c:2013
ade9113_enable_wa_dc_offset_mode
int ade9113_enable_wa_dc_offset_mode(struct ade9113_dev *dev)
Enable write access to DC_OFFSET_MODE register.
Definition: ade9113.c:1115
ade9113_wr_lock
int ade9113_wr_lock(struct ade9113_dev *dev)
Lock device.
Definition: ade9113.c:861
ADE9113_STATUS1X_MSK
#define ADE9113_STATUS1X_MSK
Definition: ade9113.h:140
ade9113_get_emi_mid_limit
int ade9113_get_emi_mid_limit(struct ade9113_dev *dev, uint8_t *limit)
Get EMI MID limit.
Definition: ade9113.c:1271
ADE9113_SWRST_CMD
#define ADE9113_SWRST_CMD
Definition: ade9113.h:116
ADE9113_REG_EFUSE_REFRESH
#define ADE9113_REG_EFUSE_REFRESH
Definition: ade9113.h:73
ADE9113_REG_COM_FLT_TYPE
#define ADE9113_REG_COM_FLT_TYPE
Definition: ade9113.h:94
ade9113_disable_iso_test_mmr_err_int
int ade9113_disable_iso_test_mmr_err_int(struct ade9113_dev *dev)
Disable ISO_TEST_MMR_ERR interrupt.
Definition: ade9113.c:1778
ade9113_convert_to_millivolts
int ade9113_convert_to_millivolts(struct ade9113_dev *dev, uint8_t dev_no, enum ade9113_wav_e ch, int32_t *mv_val)
Convert a 24-bit raw sample to millivolts.
Definition: ade9113.c:719
ade9113_disable_status2x_int
int ade9113_disable_status2x_int(struct ade9113_dev *dev)
Disable STATUS2X interrupt.
Definition: ade9113.c:1358
ADE9113_CRC_DONE_MSK
#define ADE9113_CRC_DONE_MSK
Definition: ade9113.h:193
ade9113_enable_status2x_int
int ade9113_enable_status2x_int(struct ade9113_dev *dev)
Enable STATUS2X interrupt.
Definition: ade9113.c:1344
ADE9113_REG_EMI_CONFIG
#define ADE9113_REG_EMI_CONFIG
Definition: ade9113.h:74
ade9113_get_statusx_val
int ade9113_get_statusx_val(struct ade9113_dev *dev, uint8_t addr, uint8_t *status)
Get STATUSx register value.
Definition: ade9113.c:1904
ade9113_get_iso_efuse_mem_err_err
int ade9113_get_iso_efuse_mem_err_err(struct ade9113_dev *dev, uint8_t *status)
Get ISO_EFUSE_MEM_ERR indicator.
Definition: ade9113.c:2223
timeout
uint32_t timeout
Definition: ad413x.c:49
ade9113_clear_crc_done_int
int ade9113_clear_crc_done_int(struct ade9113_dev *dev)
Clear the CRC_DONE int mask.
Definition: ade9113.c:2394
no_os_alloc.h
no_os_gpio_init_param
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
ade9113_invert_v1_inputs
int ade9113_invert_v1_inputs(struct ade9113_dev *dev)
Invert V1 channel inputs.
Definition: ade9113.c:995
ade9113_disable_iso_efuse_mem_err_int
int ade9113_disable_iso_efuse_mem_err_int(struct ade9113_dev *dev)
Disable ISO_EFUSE_MEM_ERR interrupt.
Definition: ade9113.c:1666
ADE9113_SINC3_LPF_EN_4_KHZ_SAMPLING
@ ADE9113_SINC3_LPF_EN_4_KHZ_SAMPLING
Definition: ade9113.h:247
ADE9113_SAWTOOTH_FREQUENCY_RISING
@ ADE9113_SAWTOOTH_FREQUENCY_RISING
Definition: ade9113.h:260
ade9113_get_adc_sync_done
int ade9113_get_adc_sync_done(struct ade9113_dev *dev, uint8_t *status)
Get ADC_SYNC_DONE indicator.
Definition: ade9113.c:2151
ade9113_get_v2_wav_ovrng
int ade9113_get_v2_wav_ovrng(struct ade9113_dev *dev, uint8_t *status)
Get V2_WAV_OVRNG indicator.
Definition: ade9113.c:2080
ade9113_get_efuse_mem_err
int ade9113_get_efuse_mem_err(struct ade9113_dev *dev, uint8_t *status)
Get EFUSE_MEM_ERR indicator.
Definition: ade9113.c:1988
ade9113_enable_comflt_err_int
int ade9113_enable_comflt_err_int(struct ade9113_dev *dev)
Enable COMFLT_ERR interrupt.
Definition: ade9113.c:1456
ADE9113_CRC16_INIT_VAL
#define ADE9113_CRC16_INIT_VAL
Definition: ade9113.h:60
ade9113_enable_iso_dig_mod_v1_ovf_int
int ade9113_enable_iso_dig_mod_v1_ovf_int(struct ade9113_dev *dev)
Enable ISO_DIG_MOD_V1_OVF interrupt.
Definition: ade9113.c:1708
ade9113_init_param::no_devs
uint8_t no_devs
Definition: ade9113.h:341
ADE9113_REG_SYNC_SNAP
#define ADE9113_REG_SYNC_SNAP
Definition: ade9113.h:85
ade9113_enable_crc_chg_int
int ade9113_enable_crc_chg_int(struct ade9113_dev *dev)
Enable CRC_CHG interrupt.
Definition: ade9113.c:1400
ADE9113_ZX_V2_SEL
@ ADE9113_ZX_V2_SEL
Definition: ade9113.h:296
ade9113_disable_status2x_int
int ade9113_disable_status2x_int(struct ade9113_dev *dev)
Disable STATUS2X interrupt.
Definition: ade9113.c:1358
ADE9113_STREAM_DBG_MSK
#define ADE9113_STREAM_DBG_MSK
Definition: ade9113.h:119
ade9113_dev::gpio_reset
struct no_os_gpio_desc * gpio_reset
Definition: ade9113.h:364
ade9113_get_iso_efuse_mem_err_err
int ade9113_get_iso_efuse_mem_err_err(struct ade9113_dev *dev, uint8_t *status)
Get ISO_EFUSE_MEM_ERR indicator.
Definition: ade9113.c:2223
ADE9113_ZX_I_SEL
@ ADE9113_ZX_I_SEL
Definition: ade9113.h:292
ade9113_clear_spi_crc_err_int
int ade9113_clear_spi_crc_err_int(struct ade9113_dev *dev)
Clear the SPI_CRC_ERR int mask.
Definition: ade9113.c:2057
ade9113_get_iso_phy_err
int ade9113_get_iso_phy_err(struct ade9113_dev *dev, uint8_t *status)
Get ISO_PHY_ERR indicator.
Definition: ade9113.c:2356
ADE9113_SINC3_LPF_EN_32_KHZ_SAMPLING
@ ADE9113_SINC3_LPF_EN_32_KHZ_SAMPLING
Definition: ade9113.h:239
ade9113_set_emi_lo_mask
int ade9113_set_emi_lo_mask(struct ade9113_dev *dev, uint8_t msk)
Set EMI LO mask.
Definition: ade9113.c:1243
ade9113_invert_v2_inputs
int ade9113_invert_v2_inputs(struct ade9113_dev *dev)
Invert V2 channel inputs.
Definition: ade9113.c:981
ADE9113_ISO_DIG_MOD_I_OVF_MSK
#define ADE9113_ISO_DIG_MOD_I_OVF_MSK
Definition: ade9113.h:159
ADE9113_I_WAV_OVRNG_MSK
#define ADE9113_I_WAV_OVRNG_MSK
Definition: ade9113.h:150
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
ade9113_enable_adc_sync_done_int
int ade9113_enable_adc_sync_done_int(struct ade9113_dev *dev)
Enable ADC_SYNC_DONE interrupt.
Definition: ade9113.c:1568
ade9113_force_crc_recalculation
int ade9113_force_crc_recalculation(struct ade9113_dev *dev)
Force background register map CRC recalculation.
Definition: ade9113.c:2408
no_os_callback_desc
Structure describing a callback to be registered.
Definition: no_os_irq.h:142
ADE9113_SNAPSHOT_MSK
#define ADE9113_SNAPSHOT_MSK
Definition: ade9113.h:169
ade9113_init_param::drdy_callback
void(* drdy_callback)(void *context)
Definition: ade9113.h:339
ADE9113_ISO_ECC_ERR_MSK
#define ADE9113_ISO_ECC_ERR_MSK
Definition: ade9113.h:190
ade9113_datapath_config_e
ade9113_datapath_config_e
ADE9113 digital signal processing configuration.
Definition: ade9113.h:235
ade9113_get_emi_hi_mask
int ade9113_get_emi_hi_mask(struct ade9113_dev *dev, uint8_t *msk)
Get EMI HI mask.
Definition: ade9113.c:1201
ADE9113_REG_COM_FLT_COUNT
#define ADE9113_REG_COM_FLT_COUNT
Definition: ade9113.h:95
ade9113_get_emi_lo_mask
int ade9113_get_emi_lo_mask(struct ade9113_dev *dev, uint8_t *msk)
Get EMI LO mask.
Definition: ade9113.c:1215
ade9113_set_normal_mode
int ade9113_set_normal_mode(struct ade9113_dev *dev)
Set normal mode of operation.
Definition: ade9113.c:927
ade9113_set_dsp_config
int ade9113_set_dsp_config(struct ade9113_dev *dev, enum ade9113_datapath_config_e config)
Set digital signal processing configuration.
Definition: ade9113.c:1096
ade9113_clear_v1_wav_ovrng_int
int ade9113_clear_v1_wav_ovrng_int(struct ade9113_dev *dev)
Clear the V1_WAV_OVRNG int mask.
Definition: ade9113.c:2116
no_os_spi.h
Header file of SPI Interface.
ade9113_set_emi_config
int ade9113_set_emi_config(struct ade9113_dev *dev, enum ade9113_emi_config_e config)
Select EMI frequency hopping.
Definition: ade9113.c:1185
ADE9113_REG_I_WAV_MD
#define ADE9113_REG_I_WAV_MD
Definition: ade9113.h:98
no_os_irq.h
Header file of IRQ interface.
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
ade9113_init_param::gpio_reset
struct no_os_gpio_init_param * gpio_reset
Definition: ade9113.h:334
ade9113_disable_iso_clk_stbl_err_int
int ade9113_disable_iso_clk_stbl_err_int(struct ade9113_dev *dev)
Disable ISO_CLK_STBL_ERR interrupt.
Definition: ade9113.c:1610
ade9113_get_err_count
int ade9113_get_err_count(struct ade9113_dev *dev, uint8_t *err_count)
Get ECC or PHY Error Count on ISO to NONISO Communications.
Definition: ade9113.c:967
ade9113_adc_prepare_broadcast
int ade9113_adc_prepare_broadcast(struct ade9113_dev *dev)
ADC prepare broadcast.
Definition: ade9113.c:1831
ade9113_dev::ver_product
uint8_t ver_product
Definition: ade9113.h:352
ade9113_set_data_increments_mode
int ade9113_set_data_increments_mode(struct ade9113_dev *dev)
Set data increments mode of operation.
Definition: ade9113.c:953
ade9113_enable_adc_sync_done_int
int ade9113_enable_adc_sync_done_int(struct ade9113_dev *dev)
Enable ADC_SYNC_DONE interrupt.
Definition: ade9113.c:1568
ade9113_get_crc_chg
int ade9113_get_crc_chg(struct ade9113_dev *dev, uint8_t *status)
Get CRC_CHG indicator.
Definition: ade9113.c:1976
ade9113_disable_v1_wav_ovrng_int
int ade9113_disable_v1_wav_ovrng_int(struct ade9113_dev *dev)
Disable V1_WAV_OVRNG interrupt.
Definition: ade9113.c:1526
ADE9113_REG_CRC_RESULT_LO
#define ADE9113_REG_CRC_RESULT_LO
Definition: ade9113.h:72
ade9113_enable_iso_phy_crc_err_int
int ade9113_enable_iso_phy_crc_err_int(struct ade9113_dev *dev)
Enable ISO_PHY_CRC_ERR interrupt.
Definition: ade9113.c:1624
no_os_units.h
Header file of Units.
ade9113_dev::no_devs
uint8_t no_devs
Definition: ade9113.h:370
ade9113_clear_iso_dig_mod_i_ovf_int
int ade9113_clear_iso_dig_mod_i_ovf_int(struct ade9113_dev *dev)
Clear the ISO_DIG_MOD_I_OVF int mask.
Definition: ade9113.c:2307
ade9113_read
int ade9113_read(struct ade9113_dev *dev, uint8_t reg_addr, uint8_t *reg_data, enum ade9113_operation_e op_mode)
Read device register.
Definition: ade9113.c:63
ade9113_disable_i_wav_ovrng_int
int ade9113_disable_i_wav_ovrng_int(struct ade9113_dev *dev)
Disable I_WAV_OVRNG interrupt.
Definition: ade9113.c:1554
ADE9113_SINC3_32_KHZ_SAMPLING
@ ADE9113_SINC3_32_KHZ_SAMPLING
Definition: ade9113.h:237
ade9113_set_normal_mode
int ade9113_set_normal_mode(struct ade9113_dev *dev)
Set normal mode of operation.
Definition: ade9113.c:927
ade9113_clear_iso_dig_mod_v2_ovf_int
int ade9113_clear_iso_dig_mod_v2_ovf_int(struct ade9113_dev *dev)
Clear the ISO_DIG_MOD_V2_OVF int mask.
Definition: ade9113.c:2259
ADE9113_ZX_DETECT_NEGATIVE_SLOPE
@ ADE9113_ZX_DETECT_NEGATIVE_SLOPE
Definition: ade9113.h:279
ade9113_get_status2x
int ade9113_get_status2x(struct ade9113_dev *dev, uint8_t *status)
Get STATUS2 indicator.
Definition: ade9113.c:1940
ade9113_invert_i_inputs
int ade9113_invert_i_inputs(struct ade9113_dev *dev)
Invert I channel inputs.
Definition: ade9113.c:1009
ade9113_enable_iso_efuse_mem_err_int
int ade9113_enable_iso_efuse_mem_err_int(struct ade9113_dev *dev)
Enable ISO_EFUSE_MEM_ERR interrupt.
Definition: ade9113.c:1652
ADE9113_ZX_INPUT_SIGNAL_SIGN
@ ADE9113_ZX_INPUT_SIGNAL_SIGN
Definition: ade9113.h:275
ADE9113_CRC_CHG_MSK
#define ADE9113_CRC_CHG_MSK
Definition: ade9113.h:143
ade9113_set_stream_dbg_mode
int ade9113_set_stream_dbg_mode(struct ade9113_dev *dev, enum ade9113_stream_debug_e stream_dbg)
Set STREAM_DBG mode.
Definition: ade9113.c:791
ade9113_get_com_up
int ade9113_get_com_up(struct ade9113_dev *dev, uint8_t *status)
Get COM_UP indicator.
Definition: ade9113.c:1964
ade9113_get_v2_wav_ovrng
int ade9113_get_v2_wav_ovrng(struct ade9113_dev *dev, uint8_t *status)
Get V2_WAV_OVRNG indicator.
Definition: ade9113.c:2080
ade9113_get_iso_dig_mod_v1_ovf
int ade9113_get_iso_dig_mod_v1_ovf(struct ade9113_dev *dev, uint8_t *status)
Get ISO_DIG_MOD_V1_OVF indicator.
Definition: ade9113.c:2271
ADE9113_STREAM_FUNCTIONAL_MODE
@ ADE9113_STREAM_FUNCTIONAL_MODE
Definition: ade9113.h:228
no_os_delay.h
Header file of Delay functions.
ade9113_select_zero_crossing_edge
int ade9113_select_zero_crossing_edge(struct ade9113_dev *dev, enum ade9113_zx_edge_sel_e sel)
Select zero crossing edge.
Definition: ade9113.c:1793
ade9113_clear_iso_dig_mod_i_ovf_int
int ade9113_clear_iso_dig_mod_i_ovf_int(struct ade9113_dev *dev)
Clear the ISO_DIG_MOD_I_OVF int mask.
Definition: ade9113.c:2307
ade9113_get_iso_phy_err
int ade9113_get_iso_phy_err(struct ade9113_dev *dev, uint8_t *status)
Get ISO_PHY_ERR indicator.
Definition: ade9113.c:2356
ade9113_clear_iso_dig_mod_v2_ovf_int
int ade9113_clear_iso_dig_mod_v2_ovf_int(struct ade9113_dev *dev)
Clear the ISO_DIG_MOD_V2_OVF int mask.
Definition: ade9113.c:2259
ade9113_set_emi_lo_mask
int ade9113_set_emi_lo_mask(struct ade9113_dev *dev, uint8_t msk)
Set EMI LO mask.
Definition: ade9113.c:1243
ade9113_dev::i_wav
int32_t * i_wav
Definition: ade9113.h:356
ade9113_get_status2x
int ade9113_get_status2x(struct ade9113_dev *dev, uint8_t *status)
Get STATUS2 indicator.
Definition: ade9113.c:1940
ADE9113_RANDOM_HOPPING_FREQUENCY
@ ADE9113_RANDOM_HOPPING_FREQUENCY
Definition: ade9113.h:266
ade9113_invert_v2_inputs
int ade9113_invert_v2_inputs(struct ade9113_dev *dev)
Invert V2 channel inputs.
Definition: ade9113.c:981
ade9113_enable_v2_wav_ovrng_int
int ade9113_enable_v2_wav_ovrng_int(struct ade9113_dev *dev)
Enable V2_WAV_OVRNG interrupt.
Definition: ade9113.c:1484
ade9113_disable_iso_dig_mod_v2_ovf_int
int ade9113_disable_iso_dig_mod_v2_ovf_int(struct ade9113_dev *dev)
Disable ISO_DIG_MOD_V2_OVF interrupt.
Definition: ade9113.c:1694
ade9113_init_param
ADE9113 Device initialization parameters.
Definition: ade9113.h:328
ade9113_set_lpf_bw_3_3
int ade9113_set_lpf_bw_3_3(struct ade9113_dev *dev)
Set filter bandwidth to 3.3 kHz at 8ksps output data rate.
Definition: ade9113.c:1081
ade9113_clear_adc_sync_done_int
int ade9113_clear_adc_sync_done_int(struct ade9113_dev *dev)
Clear the ADC_SYNC_DONE int mask.
Definition: ade9113.c:2163
ENABLE
#define ENABLE
Definition: ad77681.h:339
ade9113_enable_spi_crc_err_int
int ade9113_enable_spi_crc_err_int(struct ade9113_dev *dev)
Enable SPI_CRC_ERR interrupt.
Definition: ade9113.c:1428
NO_OS_DECLARE_CRC16_TABLE
NO_OS_DECLARE_CRC16_TABLE(ade9113_crc16)
ade9113_get_emi_mid_limit
int ade9113_get_emi_mid_limit(struct ade9113_dev *dev, uint8_t *limit)
Get EMI MID limit.
Definition: ade9113.c:1271
device
Definition: ad9361_util.h:69
ade9113_init
int ade9113_init(struct ade9113_dev **device, struct ade9113_init_param init_param)
Initialize the device.
Definition: ade9113.c:395
ade9113_disable_com_up_int
int ade9113_disable_com_up_int(struct ade9113_dev *dev)
Disable COM_UP interrupt.
Definition: ade9113.c:1386
ade9113_clear_iso_phy_crc_err_int
int ade9113_clear_iso_phy_crc_err_int(struct ade9113_dev *dev)
Clear the ISO_PHY_CRC_ERR int mask.
Definition: ade9113.c:2211
ADE9113_ISO_WR_ACC_EN_MSK
#define ADE9113_ISO_WR_ACC_EN_MSK
Definition: ade9113.h:131
ade9113_select_zero_crossing_channel
int ade9113_select_zero_crossing_channel(struct ade9113_dev *dev, enum ade9113_zx_channel_cfg_e cfg)
Select zero crossing channel.
Definition: ade9113.c:1812
NO_OS_GPIO_HIGH
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:117
ADE9113_V1_WAV
@ ADE9113_V1_WAV
Definition: ade9113.h:318
no_os_print_log.h
Print messages helpers.
ade9113_disable_crc_chg_int
int ade9113_disable_crc_chg_int(struct ade9113_dev *dev)
Disable CRC_CHG interrupt.
Definition: ade9113.c:1414
ade9113_disable_v2_wav_ovrng_int
int ade9113_disable_v2_wav_ovrng_int(struct ade9113_dev *dev)
Disable V2_WAV_OVRNG interrupt.
Definition: ade9113.c:1498
ADE9113_REG_CONFIG0
#define ADE9113_REG_CONFIG0
Definition: ade9113.h:68
ADE9113_CRC16_POLY
#define ADE9113_CRC16_POLY
Definition: ade9113.h:59
ADE9113_V1_ADC_INVERT_MSK
#define ADE9113_V1_ADC_INVERT_MSK
Definition: ade9113.h:125
ade9113_dev::gpio_rdy
struct no_os_gpio_desc * gpio_rdy
Definition: ade9113.h:362
ade9113_dev::crc_en
uint8_t crc_en
Definition: ade9113.h:354
ade9113_get_silicon_revision
int ade9113_get_silicon_revision(struct ade9113_dev *dev, uint8_t *silicon_rev)
Get SILICON_REVISION value.
Definition: ade9113.c:2423
ade9113_enable_iso_dig_mod_v2_ovf_int
int ade9113_enable_iso_dig_mod_v2_ovf_int(struct ade9113_dev *dev)
Enable ISO_DIG_MOD_V2_OVF interrupt.
Definition: ade9113.c:1680
ade9113_get_crc_en_state
int ade9113_get_crc_en_state(struct ade9113_dev *dev, uint8_t *crc_en_state)
Get CRC enable on SPI write setting.
Definition: ade9113.c:807
NO_OS_DECLARE_CRC8_TABLE
NO_OS_DECLARE_CRC8_TABLE(ade9113_crc8)
ade9113_disable_iso_clk_stbl_err_int
int ade9113_disable_iso_clk_stbl_err_int(struct ade9113_dev *dev)
Disable ISO_CLK_STBL_ERR interrupt.
Definition: ade9113.c:1610
ade9113_clear_iso_test_mmr_err_int
int ade9113_clear_iso_test_mmr_err_int(struct ade9113_dev *dev)
Clear the ISO_TEST_MMR_ERR int mask.
Definition: ade9113.c:2331
ade9113_enable_i_wav_ovrng_int
int ade9113_enable_i_wav_ovrng_int(struct ade9113_dev *dev)
Enable I_WAV_OVRNG interrupt.
Definition: ade9113.c:1540
ade9113_set_lpf_bw_3_3
int ade9113_set_lpf_bw_3_3(struct ade9113_dev *dev)
Set filter bandwidth to 3.3 kHz at 8ksps output data rate.
Definition: ade9113.c:1081
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
ADE9113_STREAM_STATIC_MODE
@ ADE9113_STREAM_STATIC_MODE
Definition: ade9113.h:224
ade9113_get_crc_done_flag
int ade9113_get_crc_done_flag(struct ade9113_dev *dev, uint8_t *status)
Get CRC_DONE indicator.
Definition: ade9113.c:2382
ade9113_read_scratchpad
int ade9113_read_scratchpad(struct ade9113_dev *dev, uint8_t *val)
Get the value stired in the scratchpad register.
Definition: ade9113.c:904
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
ade9113_disable_com_up_int
int ade9113_disable_com_up_int(struct ade9113_dev *dev)
Disable COM_UP interrupt.
Definition: ade9113.c:1386
ade9113_disable_v1_wav_ovrng_int
int ade9113_disable_v1_wav_ovrng_int(struct ade9113_dev *dev)
Disable V1_WAV_OVRNG interrupt.
Definition: ade9113.c:1526
ADE9113_ZX_V1_SEL
@ ADE9113_ZX_V1_SEL
Definition: ade9113.h:294
ade9113_enable_iso_clk_stbl_err_int
int ade9113_enable_iso_clk_stbl_err_int(struct ade9113_dev *dev)
Enable ISO_CLK_STBL_ERR interrupt.
Definition: ade9113.c:1596
NO_OS_IRQ_EDGE_FALLING
@ NO_OS_IRQ_EDGE_FALLING
Definition: no_os_irq.h:79
ADE9113_REG_SILICON_REVISION
#define ADE9113_REG_SILICON_REVISION
Definition: ade9113.h:112
ade9113_write
int ade9113_write(struct ade9113_dev *dev, uint8_t reg_addr, uint8_t reg_data, enum ade9113_operation_e op_mode)
Write device register.
Definition: ade9113.c:281
ade9113_set_static_mode
int ade9113_set_static_mode(struct ade9113_dev *dev)
Set static mode of operation.
Definition: ade9113.c:940
ade9113_invert_v2_inputs_disable
int ade9113_invert_v2_inputs_disable(struct ade9113_dev *dev)
Disable invert V2 channel inputs.
Definition: ade9113.c:1023
ade9113_efuse_refresh
int ade9113_efuse_refresh(struct ade9113_dev *dev)
Refresh EFuse Memory.
Definition: ade9113.c:1170
ade9113_get_silicon_revision
int ade9113_get_silicon_revision(struct ade9113_dev *dev, uint8_t *silicon_rev)
Get SILICON_REVISION value.
Definition: ade9113.c:2423
ade9113_invert_i_inputs
int ade9113_invert_i_inputs(struct ade9113_dev *dev)
Invert I channel inputs.
Definition: ade9113.c:1009
ade9113_enable_iso_efuse_mem_err_int
int ade9113_enable_iso_efuse_mem_err_int(struct ade9113_dev *dev)
Enable ISO_EFUSE_MEM_ERR interrupt.
Definition: ade9113.c:1652
ade9113_init_param::irq_ctrl
struct no_os_irq_ctrl_desc * irq_ctrl
Definition: ade9113.h:336
ADE9113_S_OP
@ ADE9113_S_OP
Definition: ade9113.h:307
ade9113_set_stream_dbg_mode
int ade9113_set_stream_dbg_mode(struct ade9113_dev *dev, enum ade9113_stream_debug_e stream_dbg)
Set STREAM_DBG mode.
Definition: ade9113.c:791
ade9113_clear_reset_done_int
int ade9113_clear_reset_done_int(struct ade9113_dev *dev)
Clear the RESET_DONE int mask.
Definition: ade9113.c:2024
ade9113_disable_adc_sync_done_int
int ade9113_disable_adc_sync_done_int(struct ade9113_dev *dev)
Disable ADC_SYNC_DONE interrupt.
Definition: ade9113.c:1582
ade9113_get_iso_dig_mod_v1_ovf
int ade9113_get_iso_dig_mod_v1_ovf(struct ade9113_dev *dev, uint8_t *status)
Get ISO_DIG_MOD_V1_OVF indicator.
Definition: ade9113.c:2271
ade9113_hw_reset
int ade9113_hw_reset(struct ade9113_dev *dev)
Reset the device using SW reset.
Definition: ade9113.c:681
ade9113_get_reset_done
int ade9113_get_reset_done(struct ade9113_dev *dev, uint8_t *status)
Get RESET_DONE indicator.
Definition: ade9113.c:1952
ade9113_invert_i_inputs_disable
int ade9113_invert_i_inputs_disable(struct ade9113_dev *dev)
Disable invert I channel inputs.
Definition: ade9113.c:1053
ade9113_get_crc_done_flag
int ade9113_get_crc_done_flag(struct ade9113_dev *dev, uint8_t *status)
Get CRC_DONE indicator.
Definition: ade9113.c:2382
ade9113_enable_v1_wav_ovrng_int
int ade9113_enable_v1_wav_ovrng_int(struct ade9113_dev *dev)
Enable V1_WAV_OVRNG interrupt.
Definition: ade9113.c:1512
NO_OS_GPIO_LOW
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:115
ade9113_enable_iso_clk_stbl_err_int
int ade9113_enable_iso_clk_stbl_err_int(struct ade9113_dev *dev)
Enable ISO_CLK_STBL_ERR interrupt.
Definition: ade9113.c:1596
ADE9113_SINC3_COMP_EN_LPF_EN_8_KHZ_SAMPLING
@ ADE9113_SINC3_COMP_EN_LPF_EN_8_KHZ_SAMPLING
Definition: ade9113.h:245
ade9113_disable_comflt_err_int
int ade9113_disable_comflt_err_int(struct ade9113_dev *dev)
Disable COMFLT_ERR interrupt.
Definition: ade9113.c:1470
ade9113_dev::spi_desc
struct no_os_spi_desc * spi_desc
Definition: ade9113.h:350
ade9113_set_lpf_bw_2_7
int ade9113_set_lpf_bw_2_7(struct ade9113_dev *dev)
Set filter bandwidth to 2.7 kHz at 8ksps output data rate.
Definition: ade9113.c:1067
ade9113_clear_iso_dig_mod_v1_ovf_int
int ade9113_clear_iso_dig_mod_v1_ovf_int(struct ade9113_dev *dev)
Clear the ISO_DIG_MOD_V1_OVF int mask.
Definition: ade9113.c:2283
ADE9113_ISO_CLK_STBL_ERR_MSK
#define ADE9113_ISO_CLK_STBL_ERR_MSK
Definition: ade9113.h:154
ade9113_set_dsp_config
int ade9113_set_dsp_config(struct ade9113_dev *dev, enum ade9113_datapath_config_e config)
Set digital signal processing configuration.
Definition: ade9113.c:1096
ade9113_clear_v1_wav_ovrng_int
int ade9113_clear_v1_wav_ovrng_int(struct ade9113_dev *dev)
Clear the V1_WAV_OVRNG int mask.
Definition: ade9113.c:2116
ade9113_efuse_refresh
int ade9113_efuse_refresh(struct ade9113_dev *dev)
Refresh EFuse Memory.
Definition: ade9113.c:1170
ade9113_zx_edge_sel_e
ade9113_zx_edge_sel_e
ADE9113 Zero Crossing Edge Select.
Definition: ade9113.h:273
ADE9113_REG_SCRATCH
#define ADE9113_REG_SCRATCH
Definition: ade9113.h:84
ade9113_get_iso_ecc_err
int ade9113_get_iso_ecc_err(struct ade9113_dev *dev, uint8_t *status)
Get ISO_ECC_ERR indicator.
Definition: ade9113.c:2369
ade9113_enable_v2_wav_ovrng_int
int ade9113_enable_v2_wav_ovrng_int(struct ade9113_dev *dev)
Enable V2_WAV_OVRNG interrupt.
Definition: ade9113.c:1484
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
ade9113_get_wav
int ade9113_get_wav(struct ade9113_dev *dev, enum ade9113_wav_e selection, uint32_t *val)
Get wave value.
Definition: ade9113.c:2477
no_os_field_prep
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
ade9113_get_i_wav_ovrng
int ade9113_get_i_wav_ovrng(struct ade9113_dev *dev, uint8_t *status)
Get I_WAV_OVRNG indicator.
Definition: ade9113.c:2128
ade9113_disable_adc_sync_done_int
int ade9113_disable_adc_sync_done_int(struct ade9113_dev *dev)
Disable ADC_SYNC_DONE interrupt.
Definition: ade9113.c:1582
ade9113_adc_prepare_broadcast
int ade9113_adc_prepare_broadcast(struct ade9113_dev *dev)
ADC prepare broadcast.
Definition: ade9113.c:1831
ADE9113_UNLOCK_KEY
#define ADE9113_UNLOCK_KEY
Definition: ade9113.h:202
ade9113_enable_spi_crc_err_int
int ade9113_enable_spi_crc_err_int(struct ade9113_dev *dev)
Enable SPI_CRC_ERR interrupt.
Definition: ade9113.c:1428
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
ade9113_invert_i_inputs_disable
int ade9113_invert_i_inputs_disable(struct ade9113_dev *dev)
Disable invert I channel inputs.
Definition: ade9113.c:1053
ade9113_enable_v1_wav_ovrng_int
int ade9113_enable_v1_wav_ovrng_int(struct ade9113_dev *dev)
Enable V1_WAV_OVRNG interrupt.
Definition: ade9113.c:1512
ade9113_clear_iso_phy_crc_err_int
int ade9113_clear_iso_phy_crc_err_int(struct ade9113_dev *dev)
Clear the ISO_PHY_CRC_ERR int mask.
Definition: ade9113.c:2211
ade9113_select_zero_crossing_channel
int ade9113_select_zero_crossing_channel(struct ade9113_dev *dev, enum ade9113_zx_channel_cfg_e cfg)
Select zero crossing channel.
Definition: ade9113.c:1812
ade9113_disable_iso_phy_crc_err_int
int ade9113_disable_iso_phy_crc_err_int(struct ade9113_dev *dev)
Disable ISO_PHY_CRC_ERR interrupt.
Definition: ade9113.c:1638
ADE9113_L_OP
@ ADE9113_L_OP
Definition: ade9113.h:305
ade9113_read
int ade9113_read(struct ade9113_dev *dev, uint8_t reg_addr, uint8_t *reg_data, enum ade9113_operation_e op_mode)
Read device register.
Definition: ade9113.c:63
ADE9113_REG_STATUS1
#define ADE9113_REG_STATUS1
Definition: ade9113.h:92
ade9113_disable_i_wav_ovrng_int
int ade9113_disable_i_wav_ovrng_int(struct ade9113_dev *dev)
Disable I_WAV_OVRNG interrupt.
Definition: ade9113.c:1554
ade9113_enable_iso_dig_mod_v2_ovf_int
int ade9113_enable_iso_dig_mod_v2_ovf_int(struct ade9113_dev *dev)
Enable ISO_DIG_MOD_V2_OVF interrupt.
Definition: ade9113.c:1680
ade9113_get_crc_en_state
int ade9113_get_crc_en_state(struct ade9113_dev *dev, uint8_t *crc_en_state)
Get CRC enable on SPI write setting.
Definition: ade9113.c:807
ade9113_wr_unlock
int ade9113_wr_unlock(struct ade9113_dev *dev)
Unlock device.
Definition: ade9113.c:874
ADE9113_REG_SWRST
#define ADE9113_REG_SWRST
Definition: ade9113.h:67
ADE9113_REG_EMI_HI_LIMIT
#define ADE9113_REG_EMI_HI_LIMIT
Definition: ade9113.h:77
ade9113_get_int_status
int ade9113_get_int_status(struct ade9113_dev *dev, uint8_t addr, uint8_t msk, uint8_t *status)
Get interrupt indicator from STATUS register.
Definition: ade9113.c:1879
ade9113_wav_e
ade9113_wav_e
ADE9113 waveorm data.
Definition: ade9113.h:314
ADE9113_LOCK_KEY
#define ADE9113_LOCK_KEY
Definition: ade9113.h:201
ADE9113_I_WAV
@ ADE9113_I_WAV
Definition: ade9113.h:316
ade9113_enable_wa_dc_offset_mode
int ade9113_enable_wa_dc_offset_mode(struct ade9113_dev *dev)
Enable write access to DC_OFFSET_MODE register.
Definition: ade9113.c:1115
ADE9113_V2_WAV_OVRNG_MSK
#define ADE9113_V2_WAV_OVRNG_MSK
Definition: ade9113.h:148
ADE9113_ZX_CHANNEL_CONFIG_MSK
#define ADE9113_ZX_CHANNEL_CONFIG_MSK
Definition: ade9113.h:164
ade9113_sw_reset
int ade9113_sw_reset(struct ade9113_dev *dev)
Reset the device using SW reset.
Definition: ade9113.c:652
no_os_get_unaligned_le24
uint32_t no_os_get_unaligned_le24(uint8_t *buf)
ade9113_get_emi_hi_limit
int ade9113_get_emi_hi_limit(struct ade9113_dev *dev, uint8_t *limit)
Get EMI HI limit.
Definition: ade9113.c:1257
no_os_crc8_populate_msb
void no_os_crc8_populate_msb(uint8_t *table, const uint8_t polynomial)
ade9113_disable_iso_test_mmr_err_int
int ade9113_disable_iso_test_mmr_err_int(struct ade9113_dev *dev)
Disable ISO_TEST_MMR_ERR interrupt.
Definition: ade9113.c:1778
ade9113_get_version_product
int ade9113_get_version_product(struct ade9113_dev *dev, uint8_t *ver_product)
Get VERSION_PRODUCT value.
Definition: ade9113.c:2438
ade9113_select_zero_crossing_edge
int ade9113_select_zero_crossing_edge(struct ade9113_dev *dev, enum ade9113_zx_edge_sel_e sel)
Select zero crossing edge.
Definition: ade9113.c:1793
ade9113_get_stream_dbg_mode
int ade9113_get_stream_dbg_mode(struct ade9113_dev *dev, enum ade9113_stream_debug_e *stream_dbg)
Get STREAM_DBG mode.
Definition: ade9113.c:754
ADE9113_STREAM_NORMAL_MODE
@ ADE9113_STREAM_NORMAL_MODE
Definition: ade9113.h:222
ADE9113_ZX_DETECT_POSITIVE_SLOPE
@ ADE9113_ZX_DETECT_POSITIVE_SLOPE
Definition: ade9113.h:277
ade9113_clear_v2_wav_ovrng_int
int ade9113_clear_v2_wav_ovrng_int(struct ade9113_dev *dev)
Clear the V2_WAV_OVRNG int mask.
Definition: ade9113.c:2092
no_os_crc16.h
Header file of CRC-16 computation.
ade9113_clear_reset_done_int
int ade9113_clear_reset_done_int(struct ade9113_dev *dev)
Clear the RESET_DONE int mask.
Definition: ade9113.c:2024
ADE9113_ADC_SYNC_DONE_MSK
#define ADE9113_ADC_SYNC_DONE_MSK
Definition: ade9113.h:151
ADE9113_V2_WAV
@ ADE9113_V2_WAV
Definition: ade9113.h:320
ade9113_emi_config_e
ade9113_emi_config_e
ADE9113 EMI Frequency Hopping Selection.
Definition: ade9113.h:258
ADE9113_V1_WAV_OVRNG_MSK
#define ADE9113_V1_WAV_OVRNG_MSK
Definition: ade9113.h:149
ADE9113_REG_MASK1
#define ADE9113_REG_MASK1
Definition: ade9113.h:81
ade9113_clear_adc_sync_done_int
int ade9113_clear_adc_sync_done_int(struct ade9113_dev *dev)
Clear the ADC_SYNC_DONE int mask.
Definition: ade9113.c:2163
ade9113_get_int_status
int ade9113_get_int_status(struct ade9113_dev *dev, uint8_t addr, uint8_t msk, uint8_t *status)
Get interrupt indicator from STATUS register.
Definition: ade9113.c:1879
ade9113_get_adc_sync_done
int ade9113_get_adc_sync_done(struct ade9113_dev *dev, uint8_t *status)
Get ADC_SYNC_DONE indicator.
Definition: ade9113.c:2151
ade9113_clear_iso_efuse_mem_err_int
int ade9113_clear_iso_efuse_mem_err_int(struct ade9113_dev *dev)
Clear the ISO_EFUSE_MEM_ERR int mask.
Definition: ade9113.c:2235
ade9113_get_emi_hi_limit
int ade9113_get_emi_hi_limit(struct ade9113_dev *dev, uint8_t *limit)
Get EMI HI limit.
Definition: ade9113.c:1257
ade9113_disable_iso_dig_mod_v1_ovf_int
int ade9113_disable_iso_dig_mod_v1_ovf_int(struct ade9113_dev *dev)
Disable ISO_DIG_MOD_V1_OVF interrupt.
Definition: ade9113.c:1722
ADE9113_REG_STATUS2
#define ADE9113_REG_STATUS2
Definition: ade9113.h:93
ADE9113_V2_ADC_INVERT_MSK
#define ADE9113_V2_ADC_INVERT_MSK
Definition: ade9113.h:124
ade9113_get_iso_dig_mod_v2_ovf
int ade9113_get_iso_dig_mod_v2_ovf(struct ade9113_dev *dev, uint8_t *status)
Get ISO_DIG_MOD_V2_OVF indicator.
Definition: ade9113.c:2247
ade9113_set_lpf_bw_2_7
int ade9113_set_lpf_bw_2_7(struct ade9113_dev *dev)
Set filter bandwidth to 2.7 kHz at 8ksps output data rate.
Definition: ade9113.c:1067
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
ade9113_disable_v2_wav_ovrng_int
int ade9113_disable_v2_wav_ovrng_int(struct ade9113_dev *dev)
Disable V2_WAV_OVRNG interrupt.
Definition: ade9113.c:1498
ade9113_clear_iso_dig_mod_v1_ovf_int
int ade9113_clear_iso_dig_mod_v1_ovf_int(struct ade9113_dev *dev)
Clear the ISO_DIG_MOD_V1_OVF int mask.
Definition: ade9113.c:2283
ADE9113_PREP_BROADCAST_MSK
#define ADE9113_PREP_BROADCAST_MSK
Definition: ade9113.h:167
ADE9113_ISO_PHY_ERR_MSK
#define ADE9113_ISO_PHY_ERR_MSK
Definition: ade9113.h:189
ADE9113_ISO_DIG_MOD_V1_OVF_MSK
#define ADE9113_ISO_DIG_MOD_V1_OVF_MSK
Definition: ade9113.h:158
ade9113_clear_v2_wav_ovrng_int
int ade9113_clear_v2_wav_ovrng_int(struct ade9113_dev *dev)
Clear the V2_WAV_OVRNG int mask.
Definition: ade9113.c:2092
ade9113_get_wav
int ade9113_get_wav(struct ade9113_dev *dev, enum ade9113_wav_e selection, uint32_t *val)
Get wave value.
Definition: ade9113.c:2477
ade9113.h
Header file of ADE9113 Driver.
ade9113_enable_i_wav_ovrng_int
int ade9113_enable_i_wav_ovrng_int(struct ade9113_dev *dev)
Enable I_WAV_OVRNG interrupt.
Definition: ade9113.c:1540
ade9113_get_crc
int ade9113_get_crc(struct ade9113_dev *dev, uint16_t *crc)
Get register map CRC.
Definition: ade9113.c:1145
ADE9113_STATUS2X_MSK
#define ADE9113_STATUS2X_MSK
Definition: ade9113.h:141
ade9113_write
int ade9113_write(struct ade9113_dev *dev, uint8_t reg_addr, uint8_t reg_data, enum ade9113_operation_e op_mode)
Write device register.
Definition: ade9113.c:281
ade9113_control_interrupt
int ade9113_control_interrupt(struct ade9113_dev *dev, uint8_t reg_addr, uint8_t int_msk, uint8_t en)
Enable/disable interrupt.
Definition: ade9113.c:1301
ade9113_get_emi_hi_mask
int ade9113_get_emi_hi_mask(struct ade9113_dev *dev, uint8_t *msk)
Get EMI HI mask.
Definition: ade9113.c:1201
ade9113_get_iso_dig_mod_v2_ovf
int ade9113_get_iso_dig_mod_v2_ovf(struct ade9113_dev *dev, uint8_t *status)
Get ISO_DIG_MOD_V2_OVF indicator.
Definition: ade9113.c:2247
ADE9113_DATAPATH_CONFIG_MSK
#define ADE9113_DATAPATH_CONFIG_MSK
Definition: ade9113.h:128
ADE9113_ZX_EDGE_SEL_MSK
#define ADE9113_ZX_EDGE_SEL_MSK
Definition: ade9113.h:163
ade9113_write_dc
int ade9113_write_dc(struct ade9113_dev *dev, uint8_t reg_addr, uint8_t *reg_data)
Write device register in a daisy-chain setup.
Definition: ade9113.c:306
ade9113_drdy_int_enable
int ade9113_drdy_int_enable(struct ade9113_dev *dev)
DRDY inerrupt enable.
Definition: ade9113.c:2523
ade9113_wr_unlock
int ade9113_wr_unlock(struct ade9113_dev *dev)
Unlock device.
Definition: ade9113.c:874
ade9113_get_v1_wav_ovrng
int ade9113_get_v1_wav_ovrng(struct ade9113_dev *dev, uint8_t *status)
Get V1_WAV_OVRNG indicator.
Definition: ade9113.c:2104
ade9113_remove
int ade9113_remove(struct ade9113_dev *dev)
Remove the device and release resources.
Definition: ade9113.c:621
ADE9113_ISO_EFUSE_MEM_ERR_MSK
#define ADE9113_ISO_EFUSE_MEM_ERR_MSK
Definition: ade9113.h:156
ADE9113_REG_CRC_RESULT_HI
#define ADE9113_REG_CRC_RESULT_HI
Definition: ade9113.h:71
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
ade9113_get_reset_done
int ade9113_get_reset_done(struct ade9113_dev *dev, uint8_t *status)
Get RESET_DONE indicator.
Definition: ade9113.c:1952
ADE9113_EMI_CONFIG_MSK
#define ADE9113_EMI_CONFIG_MSK
Definition: ade9113.h:137
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
ade9113_set_data_increments_mode
int ade9113_set_data_increments_mode(struct ade9113_dev *dev)
Set data increments mode of operation.
Definition: ade9113.c:953
ADE9113_I_ADC_INVERT_MSK
#define ADE9113_I_ADC_INVERT_MSK
Definition: ade9113.h:126
ade9113_get_crc
int ade9113_get_crc(struct ade9113_dev *dev, uint16_t *crc)
Get register map CRC.
Definition: ade9113.c:1145
ADE9113_REG_WR_LOCK
#define ADE9113_REG_WR_LOCK
Definition: ade9113.h:90
ADE9113_STREAM_INCREMENTS_MODE
@ ADE9113_STREAM_INCREMENTS_MODE
Definition: ade9113.h:226
ade9113_adc_align
int ade9113_adc_align(struct ade9113_dev *dev)
ADC align.
Definition: ade9113.c:1846
ade9113_enable_iso_test_mmr_err_int
int ade9113_enable_iso_test_mmr_err_int(struct ade9113_dev *dev)
Enable ISO_TEST_MMR_ERR interrupt.
Definition: ade9113.c:1764
ade9113_enable_iso_phy_crc_err_int
int ade9113_enable_iso_phy_crc_err_int(struct ade9113_dev *dev)
Enable ISO_PHY_CRC_ERR interrupt.
Definition: ade9113.c:1624
ade9113_set_crc_en_state
int ade9113_set_crc_en_state(struct ade9113_dev *dev, uint8_t crc_en_state)
Set CRC enable on SPI write setting.
Definition: ade9113.c:836
ade9113_dev::irq_ctrl
struct no_os_irq_ctrl_desc * irq_ctrl
Definition: ade9113.h:366
ade9113_clear_com_up_int
int ade9113_clear_com_up_int(struct ade9113_dev *dev)
Clear the COM_UP int mask.
Definition: ade9113.c:2035
ADE9113_REG_MASK2
#define ADE9113_REG_MASK2
Definition: ade9113.h:82
ade9113_remove
int ade9113_remove(struct ade9113_dev *dev)
Remove the device and release resources.
Definition: ade9113.c:621
no_os_callback_desc::callback
void(* callback)(void *context)
Definition: no_os_irq.h:144
ADE9113_LPF_BW_MSK
#define ADE9113_LPF_BW_MSK
Definition: ade9113.h:127
no_os_gpio_desc
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
ade9113_get_com_up
int ade9113_get_com_up(struct ade9113_dev *dev, uint8_t *status)
Get COM_UP indicator.
Definition: ade9113.c:1964
ade9113_enable_com_up_int
int ade9113_enable_com_up_int(struct ade9113_dev *dev)
Enable COM_UP interrupt.
Definition: ade9113.c:1372
ADE9113_SINC3_LPF_EN_8_KHZ_SAMPLING
@ ADE9113_SINC3_LPF_EN_8_KHZ_SAMPLING
Definition: ade9113.h:243
ade9113_get_iso_status_rd_ecc_err
int ade9113_get_iso_status_rd_ecc_err(struct ade9113_dev *dev, uint8_t *status)
Get ISO_STATUS_RD_ECC_ERR indicator.
Definition: ade9113.c:2343
ade9113_adc_align
int ade9113_adc_align(struct ade9113_dev *dev)
ADC align.
Definition: ade9113.c:1846
ADE9113_REG_EMI_LO_MASK
#define ADE9113_REG_EMI_LO_MASK
Definition: ade9113.h:76
ade9113_invert_v1_inputs_disable
int ade9113_invert_v1_inputs_disable(struct ade9113_dev *dev)
Disable invert V1 channel inputs.
Definition: ade9113.c:1038
ade9113_dev::v1_wav
int32_t * v1_wav
Definition: ade9113.h:358
ade9113_get_iso_clk_stbl_err
int ade9113_get_iso_clk_stbl_err(struct ade9113_dev *dev, uint8_t *status)
Get ISO_CLK_STBL_ERR indicator.
Definition: ade9113.c:2175
ade9113_get_emi_lo_limit
int ade9113_get_emi_lo_limit(struct ade9113_dev *dev, uint8_t *limit)
Get EMI LO limit.
Definition: ade9113.c:1285
ade9113_enable_comflt_err_int
int ade9113_enable_comflt_err_int(struct ade9113_dev *dev)
Enable COMFLT_ERR interrupt.
Definition: ade9113.c:1456
ade9113_sw_reset
int ade9113_sw_reset(struct ade9113_dev *dev)
Reset the device using SW reset.
Definition: ade9113.c:652
ade9113_enable_com_up_int
int ade9113_enable_com_up_int(struct ade9113_dev *dev)
Enable COM_UP interrupt.
Definition: ade9113.c:1372
ade9113_init
int ade9113_init(struct ade9113_dev **device, struct ade9113_init_param init_param)
Initialize the device.
Definition: ade9113.c:395
ADE9113_COMFLT_ERR_MSK
#define ADE9113_COMFLT_ERR_MSK
Definition: ade9113.h:145
ade9113_clear_comflt_err_int
int ade9113_clear_comflt_err_int(struct ade9113_dev *dev)
Clear the COMFLT_ERR int mask.
Definition: ade9113.c:2068
ADE9113_3_CHANNEL_ADE9113
#define ADE9113_3_CHANNEL_ADE9113
Definition: ade9113.h:205
ade9113_set_emi_hi_mask
int ade9113_set_emi_hi_mask(struct ade9113_dev *dev, uint8_t msk)
Set EMI HI mask.
Definition: ade9113.c:1229
ADE9113_RAMP
@ ADE9113_RAMP
Definition: ade9113.h:264
ade9113_enable_crc_chg_int
int ade9113_enable_crc_chg_int(struct ade9113_dev *dev)
Enable CRC_CHG interrupt.
Definition: ade9113.c:1400
ade9113_write_dc
int ade9113_write_dc(struct ade9113_dev *dev, uint8_t reg_addr, uint8_t *reg_data)
Write device register in a daisy-chain setup.
Definition: ade9113.c:306
ade9113_disable_crc_chg_int
int ade9113_disable_crc_chg_int(struct ade9113_dev *dev)
Disable CRC_CHG interrupt.
Definition: ade9113.c:1414
ade9113_drdy_int_enable
int ade9113_drdy_int_enable(struct ade9113_dev *dev)
DRDY inerrupt enable.
Definition: ade9113.c:2523
ade9113_disable_iso_dig_mod_i_ovf_int
int ade9113_disable_iso_dig_mod_i_ovf_int(struct ade9113_dev *dev)
Disable ISO_DIG_MOD_I_OVF interrupt.
Definition: ade9113.c:1750
ADE9113_CRC_EN_SPI_WRITE_MSK
#define ADE9113_CRC_EN_SPI_WRITE_MSK
Definition: ade9113.h:120
ade9113_clear_spi_crc_err_int
int ade9113_clear_spi_crc_err_int(struct ade9113_dev *dev)
Clear the SPI_CRC_ERR int mask.
Definition: ade9113.c:2057
ade9113_get_v1_wav_ovrng
int ade9113_get_v1_wav_ovrng(struct ade9113_dev *dev, uint8_t *status)
Get V1_WAV_OVRNG indicator.
Definition: ade9113.c:2104
ade9113_get_iso_test_mmr_err
int ade9113_get_iso_test_mmr_err(struct ade9113_dev *dev, uint8_t *status)
Get ISO_TEST_MMR_ERR indicator.
Definition: ade9113.c:2319
ADE9113_ALIGN_MSK
#define ADE9113_ALIGN_MSK
Definition: ade9113.h:168
ade9113_get_iso_clk_stbl_err
int ade9113_get_iso_clk_stbl_err(struct ade9113_dev *dev, uint8_t *status)
Get ISO_CLK_STBL_ERR indicator.
Definition: ade9113.c:2175
ade9113_clear_iso_test_mmr_err_int
int ade9113_clear_iso_test_mmr_err_int(struct ade9113_dev *dev)
Clear the ISO_TEST_MMR_ERR int mask.
Definition: ade9113.c:2331
ADE9113_SPI_CRC_ERR_MSK
#define ADE9113_SPI_CRC_ERR_MSK
Definition: ade9113.h:144
ade9113_get_emi_lo_limit
int ade9113_get_emi_lo_limit(struct ade9113_dev *dev, uint8_t *limit)
Get EMI LO limit.
Definition: ade9113.c:1285
ade9113_write_scratchpad
int ade9113_write_scratchpad(struct ade9113_dev *dev, uint8_t val)
Write value in the scratchpad register.
Definition: ade9113.c:889
ade9113_disable_wa_dc_offset_mode
int ade9113_disable_wa_dc_offset_mode(struct ade9113_dev *dev)
Disable write access to DC_OFFSET_MODE register.
Definition: ade9113.c:1129
ade9113_clear_iso_efuse_mem_err_int
int ade9113_clear_iso_efuse_mem_err_int(struct ade9113_dev *dev)
Clear the ISO_EFUSE_MEM_ERR int mask.
Definition: ade9113.c:2235
no_os_crc8
uint8_t no_os_crc8(const uint8_t *table, const uint8_t *pdata, size_t nbytes, uint8_t crc)
ADE9113_REG_CONFIG_CRC
#define ADE9113_REG_CONFIG_CRC
Definition: ade9113.h:96
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
no_os_crc16
uint16_t no_os_crc16(const uint16_t *table, const uint8_t *pdata, size_t nbytes, uint16_t crc)
ade9113_operation_e
ade9113_operation_e
ADE9113 long/short operation mode.
Definition: ade9113.h:303
ade9113_clear_comflt_err_int
int ade9113_clear_comflt_err_int(struct ade9113_dev *dev)
Clear the COMFLT_ERR int mask.
Definition: ade9113.c:2068
ade9113_disable_iso_dig_mod_v1_ovf_int
int ade9113_disable_iso_dig_mod_v1_ovf_int(struct ade9113_dev *dev)
Disable ISO_DIG_MOD_V1_OVF interrupt.
Definition: ade9113.c:1722
ADE9113_SINC3_COMP_EN_LPF_EN_32_KHZ_SAMPLING
@ ADE9113_SINC3_COMP_EN_LPF_EN_32_KHZ_SAMPLING
Definition: ade9113.h:241
ade9113_set_crc_en_state
int ade9113_set_crc_en_state(struct ade9113_dev *dev, uint8_t crc_en_state)
Set CRC enable on SPI write setting.
Definition: ade9113.c:836
no_os_get_unaligned_le16
uint16_t no_os_get_unaligned_le16(uint8_t *buf)
ade9113_clear_com_up_int
int ade9113_clear_com_up_int(struct ade9113_dev *dev)
Clear the COM_UP int mask.
Definition: ade9113.c:2035
ade9113_read_dc
int ade9113_read_dc(struct ade9113_dev *dev, uint8_t reg_addr, uint8_t *reg_data)
Read device register in a daisy-chain setup.
Definition: ade9113.c:166
ade9113_set_static_mode
int ade9113_set_static_mode(struct ade9113_dev *dev)
Set static mode of operation.
Definition: ade9113.c:940
ADE9113_COM_UP_MSK
#define ADE9113_COM_UP_MSK
Definition: ade9113.h:142
ade9113_get_emi_lo_mask
int ade9113_get_emi_lo_mask(struct ade9113_dev *dev, uint8_t *msk)
Get EMI LO mask.
Definition: ade9113.c:1215
ade9113_get_iso_test_mmr_err
int ade9113_get_iso_test_mmr_err(struct ade9113_dev *dev, uint8_t *status)
Get ISO_TEST_MMR_ERR indicator.
Definition: ade9113.c:2319
ade9113_clear_iso_clk_stbl_err_int
int ade9113_clear_iso_clk_stbl_err_int(struct ade9113_dev *dev)
Clear the ISO_CLK_STBL_ERR int mask.
Definition: ade9113.c:2187
ade9113_adc_snapshot
int ade9113_adc_snapshot(struct ade9113_dev *dev)
ADC snapshot.
Definition: ade9113.c:1861
ade9113_get_iso_dig_mod_i_ovf
int ade9113_get_iso_dig_mod_i_ovf(struct ade9113_dev *dev, uint8_t *status)
Get ISO_DIG_MOD_I_OVF indicator.
Definition: ade9113.c:2295
ADE9113_2_CHANNEL_ADE9112
#define ADE9113_2_CHANNEL_ADE9112
Definition: ade9113.h:206
ade9113_hw_reset
int ade9113_hw_reset(struct ade9113_dev *dev)
Reset the device using SW reset.
Definition: ade9113.c:681
ade9113_get_status1x
int ade9113_get_status1x(struct ade9113_dev *dev, uint8_t *status)
Get STATUS1 indicator.
Definition: ade9113.c:1928
ADE9113_OP_MODE_LONG
#define ADE9113_OP_MODE_LONG
Definition: ade9113.h:55
ade9113_get_iso_status_rd_ecc_err
int ade9113_get_iso_status_rd_ecc_err(struct ade9113_dev *dev, uint8_t *status)
Get ISO_STATUS_RD_ECC_ERR indicator.
Definition: ade9113.c:2343
ade9113_enable_iso_dig_mod_i_ovf_int
int ade9113_enable_iso_dig_mod_i_ovf_int(struct ade9113_dev *dev)
Enable ISO_DIG_MOD_I_OVF interrupt.
Definition: ade9113.c:1736
ade9113_control_interrupt
int ade9113_control_interrupt(struct ade9113_dev *dev, uint8_t reg_addr, uint8_t int_msk, uint8_t en)
Enable/disable interrupt.
Definition: ade9113.c:1301
ade9113_clear_i_wav_ovrng_int
int ade9113_clear_i_wav_ovrng_int(struct ade9113_dev *dev)
Clear the I_WAV_OVRNG int mask.
Definition: ade9113.c:2139
ade9113_disable_status1x_int
int ade9113_disable_status1x_int(struct ade9113_dev *dev)
Disable STATUS1X interrupt.
Definition: ade9113.c:1330
ADE9113_REG_I_WAV_LO
#define ADE9113_REG_I_WAV_LO
Definition: ade9113.h:99
ade9113_disable_comflt_err_int
int ade9113_disable_comflt_err_int(struct ade9113_dev *dev)
Disable COMFLT_ERR interrupt.
Definition: ade9113.c:1470
ade9113_invert_v1_inputs_disable
int ade9113_invert_v1_inputs_disable(struct ade9113_dev *dev)
Disable invert V1 channel inputs.
Definition: ade9113.c:1038
ADE9113_CRC8_POLY
#define ADE9113_CRC8_POLY
Definition: ade9113.h:58
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
ADE9113_REG_CONFIG_ZX
#define ADE9113_REG_CONFIG_ZX
Definition: ade9113.h:83
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
NO_OS_EVT_GPIO
@ NO_OS_EVT_GPIO
Definition: no_os_irq.h:62
ADE9113_REG_MASK0
#define ADE9113_REG_MASK0
Definition: ade9113.h:80
ade9113_disable_spi_crc_err_int
int ade9113_disable_spi_crc_err_int(struct ade9113_dev *dev)
Disable SPI_CRC_ERR interrupt.
Definition: ade9113.c:1442
ade9113_enable_iso_test_mmr_err_int
int ade9113_enable_iso_test_mmr_err_int(struct ade9113_dev *dev)
Enable ISO_TEST_MMR_ERR interrupt.
Definition: ade9113.c:1764
ade9113_clear_i_wav_ovrng_int
int ade9113_clear_i_wav_ovrng_int(struct ade9113_dev *dev)
Clear the I_WAV_OVRNG int mask.
Definition: ade9113.c:2139
ADE9113_ISO_DIG_MOD_V2_OVF_MSK
#define ADE9113_ISO_DIG_MOD_V2_OVF_MSK
Definition: ade9113.h:157
ade9113_disable_status1x_int
int ade9113_disable_status1x_int(struct ade9113_dev *dev)
Disable STATUS1X interrupt.
Definition: ade9113.c:1330
ADE9113_REG_VERSION_PRODUCT
#define ADE9113_REG_VERSION_PRODUCT
Definition: ade9113.h:113
ADE9113_REG_CONFIG_ISO_ACC
#define ADE9113_REG_CONFIG_ISO_ACC
Definition: ade9113.h:70
ade9113_invert_v1_inputs
int ade9113_invert_v1_inputs(struct ade9113_dev *dev)
Invert V1 channel inputs.
Definition: ade9113.c:995
ade9113_clear_crc_chg_int
int ade9113_clear_crc_chg_int(struct ade9113_dev *dev)
Clear the CRC_CHG int mask.
Definition: ade9113.c:2046
ADE9113_ZX_DETECT_BOTH_SLOPES
@ ADE9113_ZX_DETECT_BOTH_SLOPES
Definition: ade9113.h:281
ade9113_disable_iso_dig_mod_v2_ovf_int
int ade9113_disable_iso_dig_mod_v2_ovf_int(struct ade9113_dev *dev)
Disable ISO_DIG_MOD_V2_OVF interrupt.
Definition: ade9113.c:1694
ADE9113_ISO_STATUS_RD_ECC_ERR_MSK
#define ADE9113_ISO_STATUS_RD_ECC_ERR_MSK
Definition: ade9113.h:188
ade9113_disable_iso_efuse_mem_err_int
int ade9113_disable_iso_efuse_mem_err_int(struct ade9113_dev *dev)
Disable ISO_EFUSE_MEM_ERR interrupt.
Definition: ade9113.c:1666
ADE9113_EFUSE_REFRESH_MSK
#define ADE9113_EFUSE_REFRESH_MSK
Definition: ade9113.h:134
ade9113_get_iso_phy_crc_err
int ade9113_get_iso_phy_crc_err(struct ade9113_dev *dev, uint8_t *status)
Get ISO_PHY_CRC_ERR indicator.
Definition: ade9113.c:2199
ade9113_disable_spi_crc_err_int
int ade9113_disable_spi_crc_err_int(struct ade9113_dev *dev)
Disable SPI_CRC_ERR interrupt.
Definition: ade9113.c:1442
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
ADE9113_REG_CONFIG_FILT
#define ADE9113_REG_CONFIG_FILT
Definition: ade9113.h:69
ADE9113_ISO_TEST_MMR_ERR_MSK
#define ADE9113_ISO_TEST_MMR_ERR_MSK
Definition: ade9113.h:160
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
ade9113_disable_wa_dc_offset_mode
int ade9113_disable_wa_dc_offset_mode(struct ade9113_dev *dev)
Disable write access to DC_OFFSET_MODE register.
Definition: ade9113.c:1129
no_os_gpio.h
Header file of GPIO Interface.
ADE9113_REG_EMI_LO_LIMIT
#define ADE9113_REG_EMI_LO_LIMIT
Definition: ade9113.h:79
ade9113_read_dc
int ade9113_read_dc(struct ade9113_dev *dev, uint8_t reg_addr, uint8_t *reg_data)
Read device register in a daisy-chain setup.
Definition: ade9113.c:166
ade9113_get_version_product
int ade9113_get_version_product(struct ade9113_dev *dev, uint8_t *ver_product)
Get VERSION_PRODUCT value.
Definition: ade9113.c:2438
NO_OS_GPIO_IRQ
@ NO_OS_GPIO_IRQ
Definition: no_os_irq.h:85
ade9113_get_stream_dbg_mode
int ade9113_get_stream_dbg_mode(struct ade9113_dev *dev, enum ade9113_stream_debug_e *stream_dbg)
Get STREAM_DBG mode.
Definition: ade9113.c:754
ADE9113_SINC3_LPF_EN_1_KHZ_SAMPLING
@ ADE9113_SINC3_LPF_EN_1_KHZ_SAMPLING
Definition: ade9113.h:251
ade9113_zx_channel_cfg_e
ade9113_zx_channel_cfg_e
ADE9113 Zero Crossing Channel Select.
Definition: ade9113.h:288
ade9113_enable_status1x_int
int ade9113_enable_status1x_int(struct ade9113_dev *dev)
Enable STATUS1X interrupt.
Definition: ade9113.c:1316
ade9113_clear_crc_chg_int
int ade9113_clear_crc_chg_int(struct ade9113_dev *dev)
Clear the CRC_CHG int mask.
Definition: ade9113.c:2046
ADE9113_CRC_FORCE_MSK
#define ADE9113_CRC_FORCE_MSK
Definition: ade9113.h:194
ade9113_clear_iso_clk_stbl_err_int
int ade9113_clear_iso_clk_stbl_err_int(struct ade9113_dev *dev)
Clear the ISO_CLK_STBL_ERR int mask.
Definition: ade9113.c:2187
ade9113_dev::v2_wav
int32_t * v2_wav
Definition: ade9113.h:360
ADE9113_SPI_READ
#define ADE9113_SPI_READ
Definition: ade9113.h:52
ade9113_adc_snapshot
int ade9113_adc_snapshot(struct ade9113_dev *dev)
ADC snapshot.
Definition: ade9113.c:1861
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
ade9113_get_status1x
int ade9113_get_status1x(struct ade9113_dev *dev, uint8_t *status)
Get STATUS1 indicator.
Definition: ade9113.c:1928
ade9113_get_comflt_err
int ade9113_get_comflt_err(struct ade9113_dev *dev, uint8_t *status)
Get COMFLT_ERR indicator.
Definition: ade9113.c:2013
no_os_crc16_populate_msb
void no_os_crc16_populate_msb(uint16_t *table, const uint16_t polynomial)
ade9113_wr_lock
int ade9113_wr_lock(struct ade9113_dev *dev)
Lock device.
Definition: ade9113.c:861
ade9113_read_scratchpad
int ade9113_read_scratchpad(struct ade9113_dev *dev, uint8_t *val)
Get the value stired in the scratchpad register.
Definition: ade9113.c:904
ade9113_force_crc_recalculation
int ade9113_force_crc_recalculation(struct ade9113_dev *dev)
Force background register map CRC recalculation.
Definition: ade9113.c:2408
ade9113_get_spi_crc_err
int ade9113_get_spi_crc_err(struct ade9113_dev *dev, uint8_t *status)
Get SPI_CRC_ERR indicator.
Definition: ade9113.c:2001
ade9113_drdy_int_disable
int ade9113_drdy_int_disable(struct ade9113_dev *dev)
DRDY inerrupt disable.
Definition: ade9113.c:2533
ade9113_set_emi_hi_mask
int ade9113_set_emi_hi_mask(struct ade9113_dev *dev, uint8_t msk)
Set EMI HI mask.
Definition: ade9113.c:1229
no_os_util.h
Header file of utility functions.
no_os_find_first_set_bit
uint32_t no_os_find_first_set_bit(uint32_t word)
ade9113_invert_v2_inputs_disable
int ade9113_invert_v2_inputs_disable(struct ade9113_dev *dev)
Disable invert V2 channel inputs.
Definition: ade9113.c:1023
ADE9113_REG_EMI_MID_LIMIT
#define ADE9113_REG_EMI_MID_LIMIT
Definition: ade9113.h:78
ade9113_enable_status2x_int
int ade9113_enable_status2x_int(struct ade9113_dev *dev)
Enable STATUS2X interrupt.
Definition: ade9113.c:1344
ade9113_disable_iso_dig_mod_i_ovf_int
int ade9113_disable_iso_dig_mod_i_ovf_int(struct ade9113_dev *dev)
Disable ISO_DIG_MOD_I_OVF interrupt.
Definition: ade9113.c:1750
ade9113_set_emi_config
int ade9113_set_emi_config(struct ade9113_dev *dev, enum ade9113_emi_config_e config)
Select EMI frequency hopping.
Definition: ade9113.c:1185
no_os_sign_extend32
int32_t no_os_sign_extend32(uint32_t value, int index)
ADE9113_SINC3_LPF_EN_2_KHZ_SAMPLING
@ ADE9113_SINC3_LPF_EN_2_KHZ_SAMPLING
Definition: ade9113.h:249
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
ade9113_dev
ADE9113 Device structure.
Definition: ade9113.h:348
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
ade9113_dev::irq_cb
struct no_os_callback_desc irq_cb
Definition: ade9113.h:368
ade9113_get_err_count
int ade9113_get_err_count(struct ade9113_dev *dev, uint8_t *err_count)
Get ECC or PHY Error Count on ISO to NONISO Communications.
Definition: ade9113.c:967
ade9113_write_scratchpad
int ade9113_write_scratchpad(struct ade9113_dev *dev, uint8_t val)
Write value in the scratchpad register.
Definition: ade9113.c:889
ade9113_get_efuse_mem_err
int ade9113_get_efuse_mem_err(struct ade9113_dev *dev, uint8_t *status)
Get EFUSE_MEM_ERR indicator.
Definition: ade9113.c:1988
ade9113_get_crc_chg
int ade9113_get_crc_chg(struct ade9113_dev *dev, uint8_t *status)
Get CRC_CHG indicator.
Definition: ade9113.c:1976
ADE9113_NONISOLATED_ADE9103
#define ADE9113_NONISOLATED_ADE9103
Definition: ade9113.h:207
ade9113_get_spi_crc_err
int ade9113_get_spi_crc_err(struct ade9113_dev *dev, uint8_t *status)
Get SPI_CRC_ERR indicator.
Definition: ade9113.c:2001
no_os_irq_ctrl_desc
Definition: no_os_irq.h:123
ade9113_enable_iso_dig_mod_v1_ovf_int
int ade9113_enable_iso_dig_mod_v1_ovf_int(struct ade9113_dev *dev)
Enable ISO_DIG_MOD_V1_OVF interrupt.
Definition: ade9113.c:1708
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
ade9113_drdy_int_disable
int ade9113_drdy_int_disable(struct ade9113_dev *dev)
DRDY inerrupt disable.
Definition: ade9113.c:2533
ade9113_init_param::gpio_rdy
struct no_os_gpio_init_param * gpio_rdy
Definition: ade9113.h:332
no_os_gpio_desc::number
int32_t number
Definition: no_os_gpio.h:100
ADE9113_SAWTOOTH_FREQUENCY_FALLING
@ ADE9113_SAWTOOTH_FREQUENCY_FALLING
Definition: ade9113.h:262
ADE9113_REG_EMI_HI_MASK
#define ADE9113_REG_EMI_HI_MASK
Definition: ade9113.h:75
no_os_test_bit
int no_os_test_bit(int pos, const volatile void *addr)
Definition: no_os_util.h:132
ade9113_get_iso_ecc_err
int ade9113_get_iso_ecc_err(struct ade9113_dev *dev, uint8_t *status)
Get ISO_ECC_ERR indicator.
Definition: ade9113.c:2369
ade9113_get_iso_phy_crc_err
int ade9113_get_iso_phy_crc_err(struct ade9113_dev *dev, uint8_t *status)
Get ISO_PHY_CRC_ERR indicator.
Definition: ade9113.c:2199
ADE9113_RESET_DONE_MSK
#define ADE9113_RESET_DONE_MSK
Definition: ade9113.h:184
no_os_crc8.h
Header file of CRC-8 computation.
ade9113_get_i_wav_ovrng
int ade9113_get_i_wav_ovrng(struct ade9113_dev *dev, uint8_t *status)
Get I_WAV_OVRNG indicator.
Definition: ade9113.c:2128
ade9113_get_iso_dig_mod_i_ovf
int ade9113_get_iso_dig_mod_i_ovf(struct ade9113_dev *dev, uint8_t *status)
Get ISO_DIG_MOD_I_OVF indicator.
Definition: ade9113.c:2295
ADE9113_ISO_PHY_CRC_ERR_MSK
#define ADE9113_ISO_PHY_CRC_ERR_MSK
Definition: ade9113.h:155
errno.h
Error macro definition for ARM Compiler.
ADE9113_EFUSE_MEM_ERR_MSK
#define ADE9113_EFUSE_MEM_ERR_MSK
Definition: ade9113.h:185
ade9113_enable_iso_dig_mod_i_ovf_int
int ade9113_enable_iso_dig_mod_i_ovf_int(struct ade9113_dev *dev)
Enable ISO_DIG_MOD_I_OVF interrupt.
Definition: ade9113.c:1736
ade9113_convert_to_millivolts
int ade9113_convert_to_millivolts(struct ade9113_dev *dev, uint8_t dev_no, enum ade9113_wav_e ch, int32_t *mv_val)
Convert a 24-bit raw sample to millivolts.
Definition: ade9113.c:719
ade9113_disable_iso_phy_crc_err_int
int ade9113_disable_iso_phy_crc_err_int(struct ade9113_dev *dev)
Disable ISO_PHY_CRC_ERR interrupt.
Definition: ade9113.c:1638
ADE9113_ZX_DISABLE
@ ADE9113_ZX_DISABLE
Definition: ade9113.h:290
ade9113_get_statusx_val
int ade9113_get_statusx_val(struct ade9113_dev *dev, uint8_t addr, uint8_t *status)
Get STATUSx register value.
Definition: ade9113.c:1904
ade9113_clear_crc_done_int
int ade9113_clear_crc_done_int(struct ade9113_dev *dev)
Clear the CRC_DONE int mask.
Definition: ade9113.c:2394
ade9113_init_param::spi_init
struct no_os_spi_init_param * spi_init
Definition: ade9113.h:330
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
ADE9113_REG_STATUS0
#define ADE9113_REG_STATUS0
Definition: ade9113.h:91
ade9113_enable_status1x_int
int ade9113_enable_status1x_int(struct ade9113_dev *dev)
Enable STATUS1X interrupt.
Definition: ade9113.c:1316
ADE9113_REG_I_WAV_HI
#define ADE9113_REG_I_WAV_HI
Definition: ade9113.h:97
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