no-OS
ade9113.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef __ADE9113_H__
40 #define __ADE9113_H__
41 
42 /******************************************************************************/
43 /***************************** Include Files **********************************/
44 /******************************************************************************/
45 #include <stdbool.h>
46 #include <stdint.h>
47 #include <string.h>
48 #include "no_os_util.h"
49 #include "no_os_spi.h"
50 #include "no_os_gpio.h"
51 #include "no_os_irq.h"
52 
53 /******************************************************************************/
54 /********************** Macros and Constants Definitions **********************/
55 /******************************************************************************/
56 
57 /* SPI commands */
58 #define ADE9113_SPI_READ NO_OS_BIT(7)
59 
60 /* Long/Short operation bit, set for lon read/write */
61 #define ADE9113_OP_MODE_LONG NO_OS_BIT(6)
62 
63 /* ADE9113 CRC constants */
64 #define ADE9113_CRC8_POLY 0x07
65 #define ADE9113_CRC16_POLY 0x1021
66 #define ADE9113_CRC16_INIT_VAL 0xFFFF
67 
68 /* ENABLE and DISABLE */
69 #define ENABLE 1u
70 #define DISABLE 0u
71 
72 /* ADE9113 Register Map */
73 #define ADE9113_REG_SWRST 0x001
74 #define ADE9113_REG_CONFIG0 0x002
75 #define ADE9113_REG_CONFIG_FILT 0x003
76 #define ADE9113_REG_CONFIG_ISO_ACC 0x005
77 #define ADE9113_REG_CRC_RESULT_HI 0x006
78 #define ADE9113_REG_CRC_RESULT_LO 0x007
79 #define ADE9113_REG_EFUSE_REFRESH 0x008
80 #define ADE9113_REG_EMI_CONFIG 0x009
81 #define ADE9113_REG_EMI_HI_MASK 0x00A
82 #define ADE9113_REG_EMI_LO_MASK 0x00B
83 #define ADE9113_REG_EMI_HI_LIMIT 0x00C
84 #define ADE9113_REG_EMI_MID_LIMIT 0x00D
85 #define ADE9113_REG_EMI_LO_LIMIT 0x00E
86 #define ADE9113_REG_MASK0 0x00F
87 #define ADE9113_REG_MASK1 0x010
88 #define ADE9113_REG_MASK2 0x011
89 #define ADE9113_REG_CONFIG_ZX 0x012
90 #define ADE9113_REG_SCRATCH 0x013
91 #define ADE9113_REG_SYNC_SNAP 0x014
92 #define ADE9113_REG_COUNTER_HI 0x015
93 #define ADE9113_REG_COUNTER_LO 0x016
94 #define ADE9113_REG_SNAPSHOT_COUNT_HI 0x017
95 #define ADE9113_REG_SNAPSHOT_COUNT_LO 0x018
96 #define ADE9113_REG_WR_LOCK 0x01F
97 #define ADE9113_REG_STATUS0 0x020
98 #define ADE9113_REG_STATUS1 0x021
99 #define ADE9113_REG_STATUS2 0x022
100 #define ADE9113_REG_COM_FLT_TYPE 0x023
101 #define ADE9113_REG_COM_FLT_COUNT 0x024
102 #define ADE9113_REG_CONFIG_CRC 0x025
103 #define ADE9113_REG_I_WAV_HI 0x026
104 #define ADE9113_REG_I_WAV_MD 0x027
105 #define ADE9113_REG_I_WAV_LO 0x028
106 #define ADE9113_REG_V1_WAV_HI 0x029
107 #define ADE9113_REG_V1_WAV_MD 0x02A
108 #define ADE9113_REG_V1_WAV_LO 0x02B
109 #define ADE9113_REG_V2_WAV_HI 0x02C
110 #define ADE9113_REG_V2_WAV_MD 0x02D
111 #define ADE9113_REG_V2_WAV_LO 0x02E
112 #define ADE9113_REG_UNIQUE_PART_ID_5 0x075
113 #define ADE9113_REG_UNIQUE_PART_ID_4 0x076
114 #define ADE9113_REG_UNIQUE_PART_ID_3 0x077
115 #define ADE9113_REG_UNIQUE_PART_ID_2 0x078
116 #define ADE9113_REG_UNIQUE_PART_ID_1 0x079
117 #define ADE9113_REG_UNIQUE_PART_ID_0 0x07A
118 #define ADE9113_REG_SILICON_REVISION 0x07D
119 #define ADE9113_REG_VERSION_PRODUCT 0x07E
120 
121 /* ADE9113 SWRST command */
122 #define ADE9113_SWRST_CMD 0xD6
123 
124 /* ADE9113_REG_CONFIG0 Bit Definition */
125 #define ADE9113_STREAM_DBG_MSK NO_OS_GENMASK(3, 2)
126 #define ADE9113_CRC_EN_SPI_WRITE_MSK NO_OS_BIT(1)
127 #define ADE9113_CLOUT_EN_MSK NO_OS_BIT(0)
128 
129 /* ADE9113_REG_CONFIG_FILT Bit Definition */
130 #define ADE9113_V2_ADC_INVERT_MSK NO_OS_BIT(6)
131 #define ADE9113_V1_ADC_INVERT_MSK NO_OS_BIT(5)
132 #define ADE9113_I_ADC_INVERT_MSK NO_OS_BIT(4)
133 #define ADE9113_LPF_BW_MSK NO_OS_BIT(3)
134 #define ADE9113_DATAPATH_CONFIG_MSK NO_OS_GENMASK(2, 0)
135 
136 /* ADE9113_REG_CONFIG_ISO_ACC Bit Definition */
137 #define ADE9113_ISO_WR_ACC_EN_MSK NO_OS_BIT(0)
138 
139 /* ADE9113_REG_EFUSE_REFRESH Bit Definition */
140 #define ADE9113_EFUSE_REFRESH_MSK NO_OS_BIT(0)
141 
142 /* ADE9113_REG_EMI_CONFIG Bit Definition */
143 #define ADE9113_EMI_CONFIG_MSK NO_OS_GENMASK(2, 0)
144 
145 /* ADE9113_REG_MASK0/ADE9113_REG_STATUS0 Bit Definition */
146 #define ADE9113_STATUS1X_MSK NO_OS_BIT(7)
147 #define ADE9113_STATUS2X_MSK NO_OS_BIT(6)
148 #define ADE9113_COM_UP_MSK NO_OS_BIT(4)
149 #define ADE9113_CRC_CHG_MSK NO_OS_BIT(3)
150 #define ADE9113_SPI_CRC_ERR_MSK NO_OS_BIT(1)
151 #define ADE9113_COMFLT_ERR_MSK NO_OS_BIT(0)
152 
153 /* ADE9113_REG_MASK1/ADE9113_REG_STATUS1 Bit Definition */
154 #define ADE9113_V2_WAV_OVRNG_MSK NO_OS_BIT(3)
155 #define ADE9113_V1_WAV_OVRNG_MSK NO_OS_BIT(2)
156 #define ADE9113_I_WAV_OVRNG_MSK NO_OS_BIT(1)
157 #define ADE9113_ADC_SYNC_DONE_MSK NO_OS_BIT(0)
158 
159 /* ADE9113_REG_MASK2/ADE9113_REG_STATUS2 Bit Definition */
160 #define ADE9113_ISO_CLK_STBL_ERR_MSK NO_OS_BIT(6)
161 #define ADE9113_ISO_PHY_CRC_ERR_MSK NO_OS_BIT(5)
162 #define ADE9113_ISO_EFUSE_MEM_ERR_MSK NO_OS_BIT(4)
163 #define ADE9113_ISO_DIG_MOD_V2_OVF_MSK NO_OS_BIT(3)
164 #define ADE9113_ISO_DIG_MOD_V1_OVF_MSK NO_OS_BIT(2)
165 #define ADE9113_ISO_DIG_MOD_I_OVF_MSK NO_OS_BIT(1)
166 #define ADE9113_ISO_TEST_MMR_ERR_MSK NO_OS_BIT(0)
167 
168 /* ADE9113_REG_CONFIG_ZX Bit Definition */
169 #define ADE9113_ZX_EDGE_SEL_MSK NO_OS_GENMASK(3, 2)
170 #define ADE9113_ZX_CHANNEL_CONFIG_MSK NO_OS_GENMASK(1, 0)
171 
172 /* ADE9113_REG_SYNC_SNAP Bit Definition */
173 #define ADE9113_PREP_BROADCAST_MSK NO_OS_BIT(2)
174 #define ADE9113_ALIGN_MSK NO_OS_BIT(1)
175 #define ADE9113_SNAPSHOT_MSK NO_OS_BIT(0)
176 
177 /* ADE9113_REG_COUNTER_HI Bit Definition */
178 #define ADE9113_COUNTER_HI_MSK NO_OS_GENMASK(5, 0)
179 
180 /* ADE9113_REG_COUNTER_LO Bit Definition */
181 #define ADE9113_COUNTER_LO_MSK NO_OS_GENMASK(8, 0)
182 
183 /* ADE9113_REG_SNAPSHOT_COUNT_HI Bit Definition */
184 #define ADE9113_SNAPSHOT_COUNT_HI_MSK NO_OS_GENMASK(5, 0)
185 
186 /* ADE9113_REG_SNAPSHOT_COUNT_LO Bit Definition */
187 #define ADE9113_SNAPSHOT_COUNT_LO_MSK NO_OS_GENMASK(7, 0)
188 
189 /* ADE9113_REG_STATUS0 Bit Definition */
190 #define ADE9113_RESET_DONE_MSK NO_OS_BIT(5)
191 #define ADE9113_EFUSE_MEM_ERR_MSK NO_OS_BIT(2)
192 
193 /* ADE9113_REG_COM_FLT_TYPE Bit Definition */
194 #define ADE9113_ISO_STATUS_RD_ECC_ERR_MSK NO_OS_BIT(2)
195 #define ADE9113_ISO_PHY_ERR_MSK NO_OS_BIT(1)
196 #define ADE9113_ISO_ECC_ERR_MSK NO_OS_BIT(1)
197 
198 /* ADE9113_REG_CONFIG_CRC Bit Definition */
199 #define ADE9113_CRC_DONE_MSK NO_OS_BIT(1)
200 #define ADE9113_CRC_FORCE_MSK NO_OS_BIT(0)
201 
202 /* ADE9113_REG_SILICON_REVISION Bit Definition */
203 #define ADE9113_NONISO_CHIP_REV_MSK NO_OS_GENMASK(7, 4)
204 #define ADE9113_ISO_CHIP_REV_MSK NO_OS_GENMASK(3, 0)
205 
206 /* Configuration Register Write Lock */
207 #define ADE9113_LOCK_KEY 0XD4
208 #define ADE9113_UNLOCK_KEY 0X5E
209 
210 /* Version Product */
211 #define ADE9113_3_CHANNEL_ADE9113 0U
212 #define ADE9113_2_CHANNEL_ADE9112 1U
213 #define ADE9113_NONISOLATED_ADE9103 3U
214 
215 /* Nominal reference voltage */
216 #define ADE9113_VREF (1249810)
217 
218 /******************************************************************************/
219 /*************************** Types Declarations *******************************/
220 /******************************************************************************/
221 
227  /* Normal Mode */
229  /* Static Mode */
231  /* Data Increments at ADC Conversion Rate */
233  /* Same as functional mode */
235 };
236 
242  /* Sinc3, 32KHz Sampling */
244  /* Sinc3, Low-Pass Filter (LPF) Enabled, 32kHz Sampling */
246  /* Sinc3, Compensation Enabled, LPF Enabled, 32KHz Sampling */
248  /* Sinc3, LPF Enabled, 8KHz Sampling */
250  /* Sinc3, Compensation Enabled, LPF Enabled, 8KHz Sampling */
252  /* Sinc3, LPF Enabled, 4kHz Sampling. */
254  /* Sinc3, LPF Enabled, 2kHz Sampling. */
256  /* Sinc3, LPF Enabled, 1kHz Sampling. */
258 };
259 
265  /* Sawtooth Frequency Rising */
267  /* Sawtooth Frequency Falling */
269  /* Ramp */
271  /* Random Hopping Frequency */
273 };
274 
280  /* ZX Pin Reflects the Sign of the Input Signal */
282  /* Detect Zero Crossings with Positive Slope */
284  /* Detect Zero Crossings with Negative Slope */
286  /* Detect Zero Crossings with Positive or Negative Slopes */
288 };
289 
295  /* Disable Zero Crossing Output */
297  /* Output Zero Crossing Function from the I Channel on ZX Pin */
299  /* Output Zero Crossing Function from the V1 Channel on ZX Pin */
301  /* Output Zero Crossing Function from the V2 Channel on ZX Pin */
303 };
304 
310  /* Long read/write operations */
312  /* Short read/write operations */
314 };
315 
321  /* I_WAV */
323  /* V1_WAV */
325  /* V1_WAV */
327 };
328 
329 
335  /* Device communication descriptor */
345  void (*drdy_callback)(void *context);
347  uint8_t no_devs;
348 };
349 
354 struct ade9113_dev {
355  /* Device communication descriptor */
357  /* Version product */
358  uint8_t ver_product;
359  /* CRC setting */
360  uint8_t crc_en;
361  /* I_WAV */
362  int32_t *i_wav;
363  /* V1_WAV */
364  int32_t *v1_wav;
365  /* V2_WAV */
366  int32_t *v2_wav;
376  uint8_t no_devs;
377 };
378 
379 /******************************************************************************/
380 /************************ Functions Declarations ******************************/
381 /******************************************************************************/
382 
383 /* Read device register. */
384 int ade9113_read(struct ade9113_dev *dev, uint8_t reg_addr,
385  uint8_t *reg_data, enum ade9113_operation_e op_mode);
386 
387 /* Read device register in a daisy-chain setup. */
388 int ade9113_read_dc(struct ade9113_dev *dev, uint8_t reg_addr,
389  uint8_t *reg_data);
390 
391 /* Write device register. */
392 int ade9113_write(struct ade9113_dev *dev, uint8_t reg_addr,
393  uint8_t reg_data, enum ade9113_operation_e op_mode);
394 
395 /* Write device register in a daisy-chain setup. */
396 int ade9113_write_dc(struct ade9113_dev *dev, uint8_t reg_addr,
397  uint8_t *reg_data);
398 
399 /* Initialize the device. */
400 int ade9113_init(struct ade9113_dev **device,
402 
403 /* Remove the device and release resources. */
404 int ade9113_remove(struct ade9113_dev *dev);
405 
406 /* Reset the device using SW reset. */
407 int ade9113_sw_reset(struct ade9113_dev *dev);
408 
409 /* Reset the device using HW reset. */
410 int ade9113_hw_reset(struct ade9113_dev *dev);
411 
412 /* Convert a 24-bit raw sample to millivolts. */
414  uint8_t dev_no, enum ade9113_wav_e ch, int32_t *mv_val);
415 
416 /* Get STREAM_DBG mode. */
418  enum ade9113_stream_debug_e *stream_dbg);
419 
420 /* Set STREAM_DBG mode. */
422  enum ade9113_stream_debug_e stream_dbg);
423 
424 /* Get CRC enable on SPI write setting. */
425 int ade9113_get_crc_en_state(struct ade9113_dev *dev,
426  uint8_t *crc_en_state);
427 
428 /* Set CRC enable on SPI write setting. */
429 int ade9113_set_crc_en_state(struct ade9113_dev *dev,
430  uint8_t crc_en_state);
431 
432 /* Lock device. */
433 int ade9113_wr_lock(struct ade9113_dev *dev);
434 
435 /* Unlock device. */
436 int ade9113_wr_unlock(struct ade9113_dev *dev);
437 
438 /* Write value in the scratchpad register. */
439 int ade9113_write_scratchpad(struct ade9113_dev *dev,
440  uint8_t val);
441 
442 /* Get the value stired in the scratchpad register. */
443 int ade9113_read_scratchpad(struct ade9113_dev *dev,
444  uint8_t *val);
445 
446 /* Set normal mode of operation. */
447 int ade9113_set_normal_mode(struct ade9113_dev *dev);
448 
449 /* Set static mode of operation. */
450 int ade9113_set_static_mode(struct ade9113_dev *dev);
451 
452 /* Set static mode of operation. */
454 
455 /* Get ECC or PHY Error Count on ISO to NONISO Communications. */
456 int ade9113_get_err_count(struct ade9113_dev *dev,
457  uint8_t *err_count);
458 
459 /* Invert V2 channel inputs. */
460 int ade9113_invert_v2_inputs(struct ade9113_dev *dev);
461 
462 /* Invert V1 channel inputs. */
463 int ade9113_invert_v1_inputs(struct ade9113_dev *dev);
464 
465 /* Invert I channel inputs. */
466 int ade9113_invert_i_inputs(struct ade9113_dev *dev);
467 
468 /* Disable invert V2 channel inputs. */
470 
471 /* Disable invert V1 channel inputs. */
473 
474 /* Disable invert I channel inputs. */
476 
477 /* Set filter bandwidth to 2.7 kHz at 8ksps output data rate. */
478 int ade9113_set_lpf_bw_2_7(struct ade9113_dev *dev);
479 
480 /* Set filter bandwidth to 3.3 kHz at 8ksps output data rate. */
481 int ade9113_set_lpf_bw_3_3(struct ade9113_dev *dev);
482 
483 /* Set digital signal processing configuration. */
484 int ade9113_set_dsp_config(struct ade9113_dev *dev,
485  enum ade9113_datapath_config_e config);
486 
487 /* Enable write access to DC_OFFSET_MODE register. */
489 
490 /* Disable write access to DC_OFFSET_MODE register. */
492 
493 /* Get register map CRC. */
494 int ade9113_get_crc(struct ade9113_dev *dev, uint16_t *crc);
495 
496 /* Refresh EFuse Memory. */
497 int ade9113_efuse_refresh(struct ade9113_dev *dev);
498 
499 /* Select EMI frequency hopping. */
500 int ade9113_set_emi_config(struct ade9113_dev *dev,
501  enum ade9113_emi_config_e config);
502 
503 /* Get EMI HI mask. */
504 int ade9113_get_emi_hi_mask(struct ade9113_dev *dev, uint8_t *msk);
505 
506 /* Get EMI LO mask. */
507 int ade9113_get_emi_lo_mask(struct ade9113_dev *dev, uint8_t *msk);
508 
509 /* Set EMI HI mask. */
510 int ade9113_set_emi_hi_mask(struct ade9113_dev *dev, uint8_t msk);
511 
512 /* Set EMI LO mask. */
513 int ade9113_set_emi_lo_mask(struct ade9113_dev *dev, uint8_t msk);
514 
515 /* Get EMI HI limit. */
516 int ade9113_get_emi_hi_limit(struct ade9113_dev *dev, uint8_t *limit);
517 
518 /* Get EMI MID limit. */
519 int ade9113_get_emi_mid_limit(struct ade9113_dev *dev, uint8_t *limit);
520 
521 /* Get EMI LO limit. */
522 int ade9113_get_emi_lo_limit(struct ade9113_dev *dev, uint8_t *limit);
523 
524 /* Enable/Disable interrupt. */
525 int ade9113_control_interrupt(struct ade9113_dev *dev, uint8_t reg_addr,
526  uint8_t int_msk, uint8_t en);
527 
528 /* Enable STATUS1X interrupt. */
530 
531 /* Disable STATUS1X interrupt. */
533 
534 /* Enable STATUS2X interrupt. */
536 
537 /* Disable STATUS2X interrupt. */
539 
540 /* Enable COM_UP interrupt. */
541 int ade9113_enable_com_up_int(struct ade9113_dev *dev);
542 
543 /* Disable COM_UP interrupt. */
544 int ade9113_disable_com_up_int(struct ade9113_dev *dev);
545 
546 /* Enable CRC_CHG interrupt. */
547 int ade9113_enable_crc_chg_int(struct ade9113_dev *dev);
548 
549 /* Disable CRC_CHG interrupt. */
551 
552 /* Enable SPI_CRC_ERR interrupt. */
554 
555 /* Disable SPI_CRC_ERR interrupt. */
557 
558 /* Enable COMFLT_ERR interrupt. */
560 
561 /* Disable COMFLT_ERR interrupt. */
563 
564 /* Enable V2_WAV_OVRNG interrupt. */
566 
567 /* Disable V2_WAV_OVRNG interrupt. */
569 
570 /* Enable V1_WAV_OVRNG interrupt. */
572 
573 /* Disable V1_WAV_OVRNG interrupt. */
575 
576 /* Enable I_WAV_OVRNG interrupt. */
578 
579 /* Disable I_WAV_OVRNG interrupt. */
581 
582 /* Enable ADC_SYNC_DONE interrupt. */
584 
585 /* Disable ADC_SYNC_DONE interrupt. */
587 
588 /* Enable ISO_CLK_STBL_ERR interrupt. */
590 
591 /* Disable ISO_CLK_STBL_ERR interrupt. */
593 
594 /* Enable ISO_PHY_CRC_ERR interrupt. */
596 
597 /* Disable ISO_PHY_CRC_ERR interrupt. */
599 
600 /* Enable ISO_EFUSE_MEM_ERR interrupt. */
602 
603 /* Disable ISO_EFUSE_MEM_ERR interrupt. */
605 
606 /* Enable ISO_DIG_MOD_V2_OVF interrupt. */
608 
609 /* Disable ISO_DIG_MOD_V2_OVF interrupt. */
611 
612 /* Enable ISO_DIG_MOD_V1_OVF interrupt. */
614 
615 /* Disable ISO_DIG_MOD_V1_OVF interrupt. */
617 
618 /* Enable ISO_DIG_MOD_I_OVF interrupt. */
620 
621 /* Disable ISO_DIG_MOD_I_OVF interrupt. */
623 
624 /* Enable ISO_TEST_MMR_ERR interrupt. */
626 
627 /* Disable ISO_TEST_MMR_ERR interrupt. */
629 
630 /* Select zero crossing edge. */
632  enum ade9113_zx_edge_sel_e sel);
633 
634 /* Select zero crossing channel. */
636  enum ade9113_zx_channel_cfg_e cfg);
637 
638 /* ADC prepare broadcast. */
640 
641 /* ADC align. */
642 int ade9113_adc_align(struct ade9113_dev *dev);
643 
644 /* ADC snapshot. */
645 int ade9113_adc_snapshot(struct ade9113_dev *dev);
646 
647 /* Get interrupt indicator from STATUS register. */
648 int ade9113_get_int_status(struct ade9113_dev *dev, uint8_t addr, uint8_t msk,
649  uint8_t *status);
650 
651 /* Get STATUSx register value. */
652 int ade9113_get_statusx_val(struct ade9113_dev *dev, uint8_t addr,
653  uint8_t *status);
654 
655 /* Get STATUS1X Indicator. */
656 int ade9113_get_status1x(struct ade9113_dev *dev, uint8_t *status);
657 
658 /* Get STATUS2 indicator. */
659 int ade9113_get_status2x(struct ade9113_dev *dev, uint8_t *status);
660 
661 /* Get RESET_DONE indicator. */
662 int ade9113_get_reset_done(struct ade9113_dev *dev, uint8_t *status);
663 
664 /* Get COM_UP indicator. */
665 int ade9113_get_com_up(struct ade9113_dev *dev, uint8_t *status);
666 
667 /* Get CRC_CHG indicator. */
668 int ade9113_get_crc_chg(struct ade9113_dev *dev, uint8_t *status);
669 
670 /* Get EFUSE_MEM_ERR indicator. */
671 int ade9113_get_efuse_mem_err(struct ade9113_dev *dev, uint8_t *status);
672 
673 /* Get SPI_CRC_ERR indicator. */
674 int ade9113_get_spi_crc_err(struct ade9113_dev *dev, uint8_t *status);
675 
676 /* Get COMFLT_ERR indicator. */
677 int ade9113_get_comflt_err(struct ade9113_dev *dev, uint8_t *status);
678 
679 /* Clear the RESET_DONE int mask. */
681 
682 /* Clear the COM_UP int mask. */
683 int ade9113_clear_com_up_int(struct ade9113_dev *dev);
684 
685 /* Clear the CRC_CHG int mask. */
686 int ade9113_clear_crc_chg_int(struct ade9113_dev *dev);
687 
688 /* Clear the SPI_CRC_ERR int mask. */
690 
691 /* Clear the COMFLT_ERR int mask. */
693 
694 /* Get V2_WAV_OVRNG indicator. */
695 int ade9113_get_v2_wav_ovrng(struct ade9113_dev *dev, uint8_t *status);
696 
697 /* Clear the V2_WAV_OVRNG int mask. */
699 
700 /* Get V1_WAV_OVRNG indicator. */
701 int ade9113_get_v1_wav_ovrng(struct ade9113_dev *dev, uint8_t *status);
702 
703 /* Clear the V1_WAV_OVRNG int mask. */
705 
706 /* Get I_WAV_OVRNG indicator. */
707 int ade9113_get_i_wav_ovrng(struct ade9113_dev *dev, uint8_t *status);
708 
709 /* Clear the I_WAV_OVRNG int mask. */
711 
712 /* Get ADC_SYNC_DONE indicator. */
713 int ade9113_get_adc_sync_done(struct ade9113_dev *dev, uint8_t *status);
714 
715 /* Clear the ADC_SYNC_DONE int mask. */
717 
718 /* Get ISO_CLK_STBL_ERR indicator. */
719 int ade9113_get_iso_clk_stbl_err(struct ade9113_dev *dev, uint8_t *status);
720 
721 /* Clear the ISO_CLK_STBL_ERR int mask. */
723 
724 /* Get ISO_PHY_CRC_ERR indicator. */
725 int ade9113_get_iso_phy_crc_err(struct ade9113_dev *dev, uint8_t *status);
726 
727 /* Clear the ISO_PHY_CRC_ERR int mask. */
729 
730 /* Get ISO_EFUSE_MEM_ERR indicator. */
731 int ade9113_get_iso_efuse_mem_err_err(struct ade9113_dev *dev, uint8_t *status);
732 
733 /* Clear the ISO_EFUSE_MEM_ERR int mask. */
735 
736 /* Get ISO_DIG_MOD_V2_OVF indicator. */
737 int ade9113_get_iso_dig_mod_v2_ovf(struct ade9113_dev *dev, uint8_t *status);
738 
739 /* Clear the ISO_DIG_MOD_V2_OVF int mask. */
741 
742 /* Get ISO_DIG_MOD_V1_OVF indicator. */
743 int ade9113_get_iso_dig_mod_v1_ovf(struct ade9113_dev *dev, uint8_t *status);
744 
745 /* Clear the ISO_DIG_MOD_V1_OVF int mask. */
747 
748 /* Get ISO_DIG_MOD_I_OVF indicator. */
749 int ade9113_get_iso_dig_mod_i_ovf(struct ade9113_dev *dev, uint8_t *status);
750 
751 /* Clear the ISO_DIG_MOD_I_OVF int mask. */
753 
754 /* Get ISO_TEST_MMR_ERR indicator. */
755 int ade9113_get_iso_test_mmr_err(struct ade9113_dev *dev, uint8_t *status);
756 
757 /* Clear the ISO_TEST_MMR_ERR int mask. */
759 
760 /* Get ISO_STATUS_RD_ECC_ERR indicator. */
761 int ade9113_get_iso_status_rd_ecc_err(struct ade9113_dev *dev, uint8_t *status);
762 
763 /* Get ISO_PHY_ERR indicator. */
764 int ade9113_get_iso_phy_err(struct ade9113_dev *dev, uint8_t *status);
765 
766 /* Get ISO_ECC_ERR indicator. */
767 int ade9113_get_iso_ecc_err(struct ade9113_dev *dev, uint8_t *status);
768 
769 /* Get CRC_DONE indicator. */
770 int ade9113_get_crc_done_flag(struct ade9113_dev *dev, uint8_t *status);
771 
772 /* Clear the CRC_DONE int mask. */
773 int ade9113_clear_crc_done_int(struct ade9113_dev *dev);
774 
775 /* Force background register map CRC recalculation. */
777 
778 /* Get SILICON_REVISION value. */
779 int ade9113_get_silicon_revision(struct ade9113_dev *dev, uint8_t *silicon_rev);
780 
781 /* Get VERSION_PRODUCT value. */
782 int ade9113_get_version_product(struct ade9113_dev *dev, uint8_t *ver_product);
783 
784 /* Get wave value. */
785 int ade9113_get_wav(struct ade9113_dev *dev, enum ade9113_wav_e selection,
786  uint32_t *val);
787 
788 /* DRDY inerrupt enable. */
789 int ade9113_drdy_int_enable(struct ade9113_dev *dev);
790 
791 /* DRDY inerrupt disable. */
792 int ade9113_drdy_int_disable(struct ade9113_dev *dev);
793 
794 #endif // __ADE9113_H__
ade9113_stream_debug_e
ade9113_stream_debug_e
ADE9113 Stream Debug.
Definition: ade9113.h:226
ade9113_get_comflt_err
int ade9113_get_comflt_err(struct ade9113_dev *dev, uint8_t *status)
Get COMFLT_ERR indicator.
Definition: ade9113.c:2019
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:1121
ade9113_wr_lock
int ade9113_wr_lock(struct ade9113_dev *dev)
Lock device.
Definition: ade9113.c:867
ADE9113_STATUS1X_MSK
#define ADE9113_STATUS1X_MSK
Definition: ade9113.h:146
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:1277
ADE9113_SWRST_CMD
#define ADE9113_SWRST_CMD
Definition: ade9113.h:122
ADE9113_REG_EFUSE_REFRESH
#define ADE9113_REG_EFUSE_REFRESH
Definition: ade9113.h:79
ADE9113_REG_COM_FLT_TYPE
#define ADE9113_REG_COM_FLT_TYPE
Definition: ade9113.h:100
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:1784
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:725
ade9113_disable_status2x_int
int ade9113_disable_status2x_int(struct ade9113_dev *dev)
Disable STATUS2X interrupt.
Definition: ade9113.c:1364
ADE9113_CRC_DONE_MSK
#define ADE9113_CRC_DONE_MSK
Definition: ade9113.h:199
ade9113_enable_status2x_int
int ade9113_enable_status2x_int(struct ade9113_dev *dev)
Enable STATUS2X interrupt.
Definition: ade9113.c:1350
ADE9113_REG_EMI_CONFIG
#define ADE9113_REG_EMI_CONFIG
Definition: ade9113.h:80
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:1910
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:2229
timeout
uint32_t timeout
Definition: ad413x.c:55
ade9113_clear_crc_done_int
int ade9113_clear_crc_done_int(struct ade9113_dev *dev)
Clear the CRC_DONE int mask.
Definition: ade9113.c:2400
no_os_alloc.h
no_os_gpio_init_param
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:85
ade9113_invert_v1_inputs
int ade9113_invert_v1_inputs(struct ade9113_dev *dev)
Invert V1 channel inputs.
Definition: ade9113.c:1001
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:1672
ADE9113_SINC3_LPF_EN_4_KHZ_SAMPLING
@ ADE9113_SINC3_LPF_EN_4_KHZ_SAMPLING
Definition: ade9113.h:253
ADE9113_SAWTOOTH_FREQUENCY_RISING
@ ADE9113_SAWTOOTH_FREQUENCY_RISING
Definition: ade9113.h:266
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:2157
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:2086
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:1994
ade9113_enable_comflt_err_int
int ade9113_enable_comflt_err_int(struct ade9113_dev *dev)
Enable COMFLT_ERR interrupt.
Definition: ade9113.c:1462
ADE9113_CRC16_INIT_VAL
#define ADE9113_CRC16_INIT_VAL
Definition: ade9113.h:66
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:1714
ade9113_init_param::no_devs
uint8_t no_devs
Definition: ade9113.h:347
ADE9113_REG_SYNC_SNAP
#define ADE9113_REG_SYNC_SNAP
Definition: ade9113.h:91
ade9113_enable_crc_chg_int
int ade9113_enable_crc_chg_int(struct ade9113_dev *dev)
Enable CRC_CHG interrupt.
Definition: ade9113.c:1406
ADE9113_ZX_V2_SEL
@ ADE9113_ZX_V2_SEL
Definition: ade9113.h:302
ade9113_disable_status2x_int
int ade9113_disable_status2x_int(struct ade9113_dev *dev)
Disable STATUS2X interrupt.
Definition: ade9113.c:1364
ADE9113_STREAM_DBG_MSK
#define ADE9113_STREAM_DBG_MSK
Definition: ade9113.h:125
ade9113_dev::gpio_reset
struct no_os_gpio_desc * gpio_reset
Definition: ade9113.h:370
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:2229
ADE9113_ZX_I_SEL
@ ADE9113_ZX_I_SEL
Definition: ade9113.h:298
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:2063
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:2362
ADE9113_SINC3_LPF_EN_32_KHZ_SAMPLING
@ ADE9113_SINC3_LPF_EN_32_KHZ_SAMPLING
Definition: ade9113.h:245
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:1249
ade9113_invert_v2_inputs
int ade9113_invert_v2_inputs(struct ade9113_dev *dev)
Invert V2 channel inputs.
Definition: ade9113.c:987
ADE9113_ISO_DIG_MOD_I_OVF_MSK
#define ADE9113_ISO_DIG_MOD_I_OVF_MSK
Definition: ade9113.h:165
ADE9113_I_WAV_OVRNG_MSK
#define ADE9113_I_WAV_OVRNG_MSK
Definition: ade9113.h:156
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:165
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:1574
ade9113_force_crc_recalculation
int ade9113_force_crc_recalculation(struct ade9113_dev *dev)
Force background register map CRC recalculation.
Definition: ade9113.c:2414
no_os_callback_desc
Structure describing a callback to be registered.
Definition: no_os_irq.h:148
ADE9113_SNAPSHOT_MSK
#define ADE9113_SNAPSHOT_MSK
Definition: ade9113.h:175
ade9113_init_param::drdy_callback
void(* drdy_callback)(void *context)
Definition: ade9113.h:345
ADE9113_ISO_ECC_ERR_MSK
#define ADE9113_ISO_ECC_ERR_MSK
Definition: ade9113.h:196
ade9113_datapath_config_e
ade9113_datapath_config_e
ADE9113 digital signal processing configuration.
Definition: ade9113.h:241
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:1207
ADE9113_REG_COM_FLT_COUNT
#define ADE9113_REG_COM_FLT_COUNT
Definition: ade9113.h:101
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:1221
ade9113_set_normal_mode
int ade9113_set_normal_mode(struct ade9113_dev *dev)
Set normal mode of operation.
Definition: ade9113.c:933
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:1102
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:2122
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:1191
ADE9113_REG_I_WAV_MD
#define ADE9113_REG_I_WAV_MD
Definition: ade9113.h:104
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:98
ade9113_init_param::gpio_reset
struct no_os_gpio_init_param * gpio_reset
Definition: ade9113.h:340
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:1616
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:973
ade9113_adc_prepare_broadcast
int ade9113_adc_prepare_broadcast(struct ade9113_dev *dev)
ADC prepare broadcast.
Definition: ade9113.c:1837
ade9113_dev::ver_product
uint8_t ver_product
Definition: ade9113.h:358
ade9113_set_data_increments_mode
int ade9113_set_data_increments_mode(struct ade9113_dev *dev)
Set data increments mode of operation.
Definition: ade9113.c:959
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:1574
ade9113_get_crc_chg
int ade9113_get_crc_chg(struct ade9113_dev *dev, uint8_t *status)
Get CRC_CHG indicator.
Definition: ade9113.c:1982
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:1532
ADE9113_REG_CRC_RESULT_LO
#define ADE9113_REG_CRC_RESULT_LO
Definition: ade9113.h:78
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:1630
no_os_units.h
Header file of Units.
ade9113_dev::no_devs
uint8_t no_devs
Definition: ade9113.h:376
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:2313
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:69
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:1560
ADE9113_SINC3_32_KHZ_SAMPLING
@ ADE9113_SINC3_32_KHZ_SAMPLING
Definition: ade9113.h:243
ade9113_set_normal_mode
int ade9113_set_normal_mode(struct ade9113_dev *dev)
Set normal mode of operation.
Definition: ade9113.c:933
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:2265
ADE9113_ZX_DETECT_NEGATIVE_SLOPE
@ ADE9113_ZX_DETECT_NEGATIVE_SLOPE
Definition: ade9113.h:285
ade9113_get_status2x
int ade9113_get_status2x(struct ade9113_dev *dev, uint8_t *status)
Get STATUS2 indicator.
Definition: ade9113.c:1946
ade9113_invert_i_inputs
int ade9113_invert_i_inputs(struct ade9113_dev *dev)
Invert I channel inputs.
Definition: ade9113.c:1015
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:1658
ADE9113_ZX_INPUT_SIGNAL_SIGN
@ ADE9113_ZX_INPUT_SIGNAL_SIGN
Definition: ade9113.h:281
ADE9113_CRC_CHG_MSK
#define ADE9113_CRC_CHG_MSK
Definition: ade9113.h:149
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:797
ade9113_get_com_up
int ade9113_get_com_up(struct ade9113_dev *dev, uint8_t *status)
Get COM_UP indicator.
Definition: ade9113.c:1970
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:2086
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:2277
ADE9113_STREAM_FUNCTIONAL_MODE
@ ADE9113_STREAM_FUNCTIONAL_MODE
Definition: ade9113.h:234
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:1799
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:2313
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:2362
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:2265
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:1249
ade9113_dev::i_wav
int32_t * i_wav
Definition: ade9113.h:362
ade9113_get_status2x
int ade9113_get_status2x(struct ade9113_dev *dev, uint8_t *status)
Get STATUS2 indicator.
Definition: ade9113.c:1946
ADE9113_RANDOM_HOPPING_FREQUENCY
@ ADE9113_RANDOM_HOPPING_FREQUENCY
Definition: ade9113.h:272
ade9113_invert_v2_inputs
int ade9113_invert_v2_inputs(struct ade9113_dev *dev)
Invert V2 channel inputs.
Definition: ade9113.c:987
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:1490
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:1700
ade9113_init_param
ADE9113 Device initialization parameters.
Definition: ade9113.h:334
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:1087
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:2169
ENABLE
#define ENABLE
Definition: ad77681.h:345
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:1434
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:1277
device
Definition: ad9361_util.h:75
ade9113_init
int ade9113_init(struct ade9113_dev **device, struct ade9113_init_param init_param)
Initialize the device.
Definition: ade9113.c:401
ade9113_disable_com_up_int
int ade9113_disable_com_up_int(struct ade9113_dev *dev)
Disable COM_UP interrupt.
Definition: ade9113.c:1392
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:2217
ADE9113_ISO_WR_ACC_EN_MSK
#define ADE9113_ISO_WR_ACC_EN_MSK
Definition: ade9113.h:137
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:1818
NO_OS_GPIO_HIGH
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:123
ADE9113_V1_WAV
@ ADE9113_V1_WAV
Definition: ade9113.h:324
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:1420
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:1504
ADE9113_REG_CONFIG0
#define ADE9113_REG_CONFIG0
Definition: ade9113.h:74
ADE9113_CRC16_POLY
#define ADE9113_CRC16_POLY
Definition: ade9113.h:65
ADE9113_V1_ADC_INVERT_MSK
#define ADE9113_V1_ADC_INVERT_MSK
Definition: ade9113.h:131
ade9113_dev::gpio_rdy
struct no_os_gpio_desc * gpio_rdy
Definition: ade9113.h:368
ade9113_dev::crc_en
uint8_t crc_en
Definition: ade9113.h:360
ade9113_get_silicon_revision
int ade9113_get_silicon_revision(struct ade9113_dev *dev, uint8_t *silicon_rev)
Get SILICON_REVISION value.
Definition: ade9113.c:2429
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:1686
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:813
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:1616
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:2337
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:1546
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:1087
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:60
ADE9113_STREAM_STATIC_MODE
@ ADE9113_STREAM_STATIC_MODE
Definition: ade9113.h:230
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:2388
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:910
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:130
ade9113_disable_com_up_int
int ade9113_disable_com_up_int(struct ade9113_dev *dev)
Disable COM_UP interrupt.
Definition: ade9113.c:1392
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:1532
ADE9113_ZX_V1_SEL
@ ADE9113_ZX_V1_SEL
Definition: ade9113.h:300
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:1602
NO_OS_IRQ_EDGE_FALLING
@ NO_OS_IRQ_EDGE_FALLING
Definition: no_os_irq.h:85
ADE9113_REG_SILICON_REVISION
#define ADE9113_REG_SILICON_REVISION
Definition: ade9113.h:118
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:287
ade9113_set_static_mode
int ade9113_set_static_mode(struct ade9113_dev *dev)
Set static mode of operation.
Definition: ade9113.c:946
ade9113_invert_v2_inputs_disable
int ade9113_invert_v2_inputs_disable(struct ade9113_dev *dev)
Disable invert V2 channel inputs.
Definition: ade9113.c:1029
ade9113_efuse_refresh
int ade9113_efuse_refresh(struct ade9113_dev *dev)
Refresh EFuse Memory.
Definition: ade9113.c:1176
ade9113_get_silicon_revision
int ade9113_get_silicon_revision(struct ade9113_dev *dev, uint8_t *silicon_rev)
Get SILICON_REVISION value.
Definition: ade9113.c:2429
ade9113_invert_i_inputs
int ade9113_invert_i_inputs(struct ade9113_dev *dev)
Invert I channel inputs.
Definition: ade9113.c:1015
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:1658
ade9113_init_param::irq_ctrl
struct no_os_irq_ctrl_desc * irq_ctrl
Definition: ade9113.h:342
ADE9113_S_OP
@ ADE9113_S_OP
Definition: ade9113.h:313
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:797
ade9113_clear_reset_done_int
int ade9113_clear_reset_done_int(struct ade9113_dev *dev)
Clear the RESET_DONE int mask.
Definition: ade9113.c:2030
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:1588
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:2277
ade9113_hw_reset
int ade9113_hw_reset(struct ade9113_dev *dev)
Reset the device using SW reset.
Definition: ade9113.c:687
ade9113_get_reset_done
int ade9113_get_reset_done(struct ade9113_dev *dev, uint8_t *status)
Get RESET_DONE indicator.
Definition: ade9113.c:1958
ade9113_invert_i_inputs_disable
int ade9113_invert_i_inputs_disable(struct ade9113_dev *dev)
Disable invert I channel inputs.
Definition: ade9113.c:1059
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:2388
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:1518
NO_OS_GPIO_LOW
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:121
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:1602
ADE9113_SINC3_COMP_EN_LPF_EN_8_KHZ_SAMPLING
@ ADE9113_SINC3_COMP_EN_LPF_EN_8_KHZ_SAMPLING
Definition: ade9113.h:251
ade9113_disable_comflt_err_int
int ade9113_disable_comflt_err_int(struct ade9113_dev *dev)
Disable COMFLT_ERR interrupt.
Definition: ade9113.c:1476
ade9113_dev::spi_desc
struct no_os_spi_desc * spi_desc
Definition: ade9113.h:356
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:1073
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:2289
ADE9113_ISO_CLK_STBL_ERR_MSK
#define ADE9113_ISO_CLK_STBL_ERR_MSK
Definition: ade9113.h:160
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:1102
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:2122
ade9113_efuse_refresh
int ade9113_efuse_refresh(struct ade9113_dev *dev)
Refresh EFuse Memory.
Definition: ade9113.c:1176
ade9113_zx_edge_sel_e
ade9113_zx_edge_sel_e
ADE9113 Zero Crossing Edge Select.
Definition: ade9113.h:279
ADE9113_REG_SCRATCH
#define ADE9113_REG_SCRATCH
Definition: ade9113.h:90
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:2375
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:1490
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:132
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:2483
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:2134
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:1588
ade9113_adc_prepare_broadcast
int ade9113_adc_prepare_broadcast(struct ade9113_dev *dev)
ADC prepare broadcast.
Definition: ade9113.c:1837
ADE9113_UNLOCK_KEY
#define ADE9113_UNLOCK_KEY
Definition: ade9113.h:208
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:1434
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:222
ade9113_invert_i_inputs_disable
int ade9113_invert_i_inputs_disable(struct ade9113_dev *dev)
Disable invert I channel inputs.
Definition: ade9113.c:1059
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:1518
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:2217
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:1818
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:1644
ADE9113_L_OP
@ ADE9113_L_OP
Definition: ade9113.h:311
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:69
ADE9113_REG_STATUS1
#define ADE9113_REG_STATUS1
Definition: ade9113.h:98
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:1560
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:1686
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:813
ade9113_wr_unlock
int ade9113_wr_unlock(struct ade9113_dev *dev)
Unlock device.
Definition: ade9113.c:880
ADE9113_REG_SWRST
#define ADE9113_REG_SWRST
Definition: ade9113.h:73
ADE9113_REG_EMI_HI_LIMIT
#define ADE9113_REG_EMI_HI_LIMIT
Definition: ade9113.h:83
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:1885
ade9113_wav_e
ade9113_wav_e
ADE9113 waveorm data.
Definition: ade9113.h:320
ADE9113_LOCK_KEY
#define ADE9113_LOCK_KEY
Definition: ade9113.h:207
ADE9113_I_WAV
@ ADE9113_I_WAV
Definition: ade9113.h:322
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:1121
ADE9113_V2_WAV_OVRNG_MSK
#define ADE9113_V2_WAV_OVRNG_MSK
Definition: ade9113.h:154
ADE9113_ZX_CHANNEL_CONFIG_MSK
#define ADE9113_ZX_CHANNEL_CONFIG_MSK
Definition: ade9113.h:170
ade9113_sw_reset
int ade9113_sw_reset(struct ade9113_dev *dev)
Reset the device using SW reset.
Definition: ade9113.c:658
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:1263
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:1784
ade9113_get_version_product
int ade9113_get_version_product(struct ade9113_dev *dev, uint8_t *ver_product)
Get VERSION_PRODUCT value.
Definition: ade9113.c:2444
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:1799
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:760
ADE9113_STREAM_NORMAL_MODE
@ ADE9113_STREAM_NORMAL_MODE
Definition: ade9113.h:228
ADE9113_ZX_DETECT_POSITIVE_SLOPE
@ ADE9113_ZX_DETECT_POSITIVE_SLOPE
Definition: ade9113.h:283
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:2098
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:2030
ADE9113_ADC_SYNC_DONE_MSK
#define ADE9113_ADC_SYNC_DONE_MSK
Definition: ade9113.h:157
ADE9113_V2_WAV
@ ADE9113_V2_WAV
Definition: ade9113.h:326
ade9113_emi_config_e
ade9113_emi_config_e
ADE9113 EMI Frequency Hopping Selection.
Definition: ade9113.h:264
ADE9113_V1_WAV_OVRNG_MSK
#define ADE9113_V1_WAV_OVRNG_MSK
Definition: ade9113.h:155
ADE9113_REG_MASK1
#define ADE9113_REG_MASK1
Definition: ade9113.h:87
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:2169
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:1885
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:2157
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:2241
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:1263
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:1728
ADE9113_REG_STATUS2
#define ADE9113_REG_STATUS2
Definition: ade9113.h:99
ADE9113_V2_ADC_INVERT_MSK
#define ADE9113_V2_ADC_INVERT_MSK
Definition: ade9113.h:130
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:2253
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:1073
DISABLE
#define DISABLE
Definition: ad77681.h:346
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:118
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:1504
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:2289
ADE9113_PREP_BROADCAST_MSK
#define ADE9113_PREP_BROADCAST_MSK
Definition: ade9113.h:173
ADE9113_ISO_PHY_ERR_MSK
#define ADE9113_ISO_PHY_ERR_MSK
Definition: ade9113.h:195
ADE9113_ISO_DIG_MOD_V1_OVF_MSK
#define ADE9113_ISO_DIG_MOD_V1_OVF_MSK
Definition: ade9113.h:164
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:2098
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:2483
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:1546
ade9113_get_crc
int ade9113_get_crc(struct ade9113_dev *dev, uint16_t *crc)
Get register map CRC.
Definition: ade9113.c:1151
ADE9113_STATUS2X_MSK
#define ADE9113_STATUS2X_MSK
Definition: ade9113.h:147
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:287
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:1307
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:1207
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:2253
ADE9113_DATAPATH_CONFIG_MSK
#define ADE9113_DATAPATH_CONFIG_MSK
Definition: ade9113.h:134
ADE9113_ZX_EDGE_SEL_MSK
#define ADE9113_ZX_EDGE_SEL_MSK
Definition: ade9113.h:169
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:312
ade9113_drdy_int_enable
int ade9113_drdy_int_enable(struct ade9113_dev *dev)
DRDY inerrupt enable.
Definition: ade9113.c:2529
ade9113_wr_unlock
int ade9113_wr_unlock(struct ade9113_dev *dev)
Unlock device.
Definition: ade9113.c:880
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:2110
ade9113_remove
int ade9113_remove(struct ade9113_dev *dev)
Remove the device and release resources.
Definition: ade9113.c:627
ADE9113_ISO_EFUSE_MEM_ERR_MSK
#define ADE9113_ISO_EFUSE_MEM_ERR_MSK
Definition: ade9113.h:162
ADE9113_REG_CRC_RESULT_HI
#define ADE9113_REG_CRC_RESULT_HI
Definition: ade9113.h:77
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:110
ade9113_get_reset_done
int ade9113_get_reset_done(struct ade9113_dev *dev, uint8_t *status)
Get RESET_DONE indicator.
Definition: ade9113.c:1958
ADE9113_EMI_CONFIG_MSK
#define ADE9113_EMI_CONFIG_MSK
Definition: ade9113.h:143
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:177
ade9113_set_data_increments_mode
int ade9113_set_data_increments_mode(struct ade9113_dev *dev)
Set data increments mode of operation.
Definition: ade9113.c:959
ADE9113_I_ADC_INVERT_MSK
#define ADE9113_I_ADC_INVERT_MSK
Definition: ade9113.h:132
ade9113_get_crc
int ade9113_get_crc(struct ade9113_dev *dev, uint16_t *crc)
Get register map CRC.
Definition: ade9113.c:1151
ADE9113_REG_WR_LOCK
#define ADE9113_REG_WR_LOCK
Definition: ade9113.h:96
ADE9113_STREAM_INCREMENTS_MODE
@ ADE9113_STREAM_INCREMENTS_MODE
Definition: ade9113.h:232
ade9113_adc_align
int ade9113_adc_align(struct ade9113_dev *dev)
ADC align.
Definition: ade9113.c:1852
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:1770
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:1630
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:842
ade9113_dev::irq_ctrl
struct no_os_irq_ctrl_desc * irq_ctrl
Definition: ade9113.h:372
ade9113_clear_com_up_int
int ade9113_clear_com_up_int(struct ade9113_dev *dev)
Clear the COM_UP int mask.
Definition: ade9113.c:2041
ADE9113_REG_MASK2
#define ADE9113_REG_MASK2
Definition: ade9113.h:88
ade9113_remove
int ade9113_remove(struct ade9113_dev *dev)
Remove the device and release resources.
Definition: ade9113.c:627
no_os_callback_desc::callback
void(* callback)(void *context)
Definition: no_os_irq.h:150
ADE9113_LPF_BW_MSK
#define ADE9113_LPF_BW_MSK
Definition: ade9113.h:133
no_os_gpio_desc
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:102
ade9113_get_com_up
int ade9113_get_com_up(struct ade9113_dev *dev, uint8_t *status)
Get COM_UP indicator.
Definition: ade9113.c:1970
ade9113_enable_com_up_int
int ade9113_enable_com_up_int(struct ade9113_dev *dev)
Enable COM_UP interrupt.
Definition: ade9113.c:1378
ADE9113_SINC3_LPF_EN_8_KHZ_SAMPLING
@ ADE9113_SINC3_LPF_EN_8_KHZ_SAMPLING
Definition: ade9113.h:249
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:2349
ade9113_adc_align
int ade9113_adc_align(struct ade9113_dev *dev)
ADC align.
Definition: ade9113.c:1852
ADE9113_REG_EMI_LO_MASK
#define ADE9113_REG_EMI_LO_MASK
Definition: ade9113.h:82
ade9113_invert_v1_inputs_disable
int ade9113_invert_v1_inputs_disable(struct ade9113_dev *dev)
Disable invert V1 channel inputs.
Definition: ade9113.c:1044
ade9113_dev::v1_wav
int32_t * v1_wav
Definition: ade9113.h:364
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:2181
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:1291
ade9113_enable_comflt_err_int
int ade9113_enable_comflt_err_int(struct ade9113_dev *dev)
Enable COMFLT_ERR interrupt.
Definition: ade9113.c:1462
ade9113_sw_reset
int ade9113_sw_reset(struct ade9113_dev *dev)
Reset the device using SW reset.
Definition: ade9113.c:658
ade9113_enable_com_up_int
int ade9113_enable_com_up_int(struct ade9113_dev *dev)
Enable COM_UP interrupt.
Definition: ade9113.c:1378
ade9113_init
int ade9113_init(struct ade9113_dev **device, struct ade9113_init_param init_param)
Initialize the device.
Definition: ade9113.c:401
ADE9113_COMFLT_ERR_MSK
#define ADE9113_COMFLT_ERR_MSK
Definition: ade9113.h:151
ade9113_clear_comflt_err_int
int ade9113_clear_comflt_err_int(struct ade9113_dev *dev)
Clear the COMFLT_ERR int mask.
Definition: ade9113.c:2074
ADE9113_3_CHANNEL_ADE9113
#define ADE9113_3_CHANNEL_ADE9113
Definition: ade9113.h:211
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:1235
ADE9113_RAMP
@ ADE9113_RAMP
Definition: ade9113.h:270
ade9113_enable_crc_chg_int
int ade9113_enable_crc_chg_int(struct ade9113_dev *dev)
Enable CRC_CHG interrupt.
Definition: ade9113.c:1406
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:312
ade9113_disable_crc_chg_int
int ade9113_disable_crc_chg_int(struct ade9113_dev *dev)
Disable CRC_CHG interrupt.
Definition: ade9113.c:1420
ade9113_drdy_int_enable
int ade9113_drdy_int_enable(struct ade9113_dev *dev)
DRDY inerrupt enable.
Definition: ade9113.c:2529
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:1756
ADE9113_CRC_EN_SPI_WRITE_MSK
#define ADE9113_CRC_EN_SPI_WRITE_MSK
Definition: ade9113.h:126
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:2063
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:2110
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:2325
ADE9113_ALIGN_MSK
#define ADE9113_ALIGN_MSK
Definition: ade9113.h:174
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:2181
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:2337
ADE9113_SPI_CRC_ERR_MSK
#define ADE9113_SPI_CRC_ERR_MSK
Definition: ade9113.h:150
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:1291
ade9113_write_scratchpad
int ade9113_write_scratchpad(struct ade9113_dev *dev, uint8_t val)
Write value in the scratchpad register.
Definition: ade9113.c:895
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:1135
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:2241
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:102
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:75
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:309
ade9113_clear_comflt_err_int
int ade9113_clear_comflt_err_int(struct ade9113_dev *dev)
Clear the COMFLT_ERR int mask.
Definition: ade9113.c:2074
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:1728
ADE9113_SINC3_COMP_EN_LPF_EN_32_KHZ_SAMPLING
@ ADE9113_SINC3_COMP_EN_LPF_EN_32_KHZ_SAMPLING
Definition: ade9113.h:247
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:842
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:2041
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:172
ade9113_set_static_mode
int ade9113_set_static_mode(struct ade9113_dev *dev)
Set static mode of operation.
Definition: ade9113.c:946
ADE9113_COM_UP_MSK
#define ADE9113_COM_UP_MSK
Definition: ade9113.h:148
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:1221
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:2325
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:2193
ade9113_adc_snapshot
int ade9113_adc_snapshot(struct ade9113_dev *dev)
ADC snapshot.
Definition: ade9113.c:1867
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:2301
ADE9113_2_CHANNEL_ADE9112
#define ADE9113_2_CHANNEL_ADE9112
Definition: ade9113.h:212
ade9113_hw_reset
int ade9113_hw_reset(struct ade9113_dev *dev)
Reset the device using SW reset.
Definition: ade9113.c:687
ade9113_get_status1x
int ade9113_get_status1x(struct ade9113_dev *dev, uint8_t *status)
Get STATUS1 indicator.
Definition: ade9113.c:1934
ADE9113_OP_MODE_LONG
#define ADE9113_OP_MODE_LONG
Definition: ade9113.h:61
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:2349
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:1742
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:1307
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:2145
ade9113_disable_status1x_int
int ade9113_disable_status1x_int(struct ade9113_dev *dev)
Disable STATUS1X interrupt.
Definition: ade9113.c:1336
ADE9113_REG_I_WAV_LO
#define ADE9113_REG_I_WAV_LO
Definition: ade9113.h:105
ade9113_disable_comflt_err_int
int ade9113_disable_comflt_err_int(struct ade9113_dev *dev)
Disable COMFLT_ERR interrupt.
Definition: ade9113.c:1476
ade9113_invert_v1_inputs_disable
int ade9113_invert_v1_inputs_disable(struct ade9113_dev *dev)
Disable invert V1 channel inputs.
Definition: ade9113.c:1044
ADE9113_CRC8_POLY
#define ADE9113_CRC8_POLY
Definition: ade9113.h:64
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:203
ADE9113_REG_CONFIG_ZX
#define ADE9113_REG_CONFIG_ZX
Definition: ade9113.h:89
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:119
NO_OS_EVT_GPIO
@ NO_OS_EVT_GPIO
Definition: no_os_irq.h:68
ADE9113_REG_MASK0
#define ADE9113_REG_MASK0
Definition: ade9113.h:86
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:1448
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:1770
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:2145
ADE9113_ISO_DIG_MOD_V2_OVF_MSK
#define ADE9113_ISO_DIG_MOD_V2_OVF_MSK
Definition: ade9113.h:163
ade9113_disable_status1x_int
int ade9113_disable_status1x_int(struct ade9113_dev *dev)
Disable STATUS1X interrupt.
Definition: ade9113.c:1336
ADE9113_REG_VERSION_PRODUCT
#define ADE9113_REG_VERSION_PRODUCT
Definition: ade9113.h:119
ADE9113_REG_CONFIG_ISO_ACC
#define ADE9113_REG_CONFIG_ISO_ACC
Definition: ade9113.h:76
ade9113_invert_v1_inputs
int ade9113_invert_v1_inputs(struct ade9113_dev *dev)
Invert V1 channel inputs.
Definition: ade9113.c:1001
ade9113_clear_crc_chg_int
int ade9113_clear_crc_chg_int(struct ade9113_dev *dev)
Clear the CRC_CHG int mask.
Definition: ade9113.c:2052
ADE9113_ZX_DETECT_BOTH_SLOPES
@ ADE9113_ZX_DETECT_BOTH_SLOPES
Definition: ade9113.h:287
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:1700
ADE9113_ISO_STATUS_RD_ECC_ERR_MSK
#define ADE9113_ISO_STATUS_RD_ECC_ERR_MSK
Definition: ade9113.h:194
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:1672
ADE9113_EFUSE_REFRESH_MSK
#define ADE9113_EFUSE_REFRESH_MSK
Definition: ade9113.h:140
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:2205
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:1448
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:122
ADE9113_REG_CONFIG_FILT
#define ADE9113_REG_CONFIG_FILT
Definition: ade9113.h:75
ADE9113_ISO_TEST_MMR_ERR_MSK
#define ADE9113_ISO_TEST_MMR_ERR_MSK
Definition: ade9113.h:166
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:187
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:1135
no_os_gpio.h
Header file of GPIO Interface.
ADE9113_REG_EMI_LO_LIMIT
#define ADE9113_REG_EMI_LO_LIMIT
Definition: ade9113.h:85
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:172
ade9113_get_version_product
int ade9113_get_version_product(struct ade9113_dev *dev, uint8_t *ver_product)
Get VERSION_PRODUCT value.
Definition: ade9113.c:2444
NO_OS_GPIO_IRQ
@ NO_OS_GPIO_IRQ
Definition: no_os_irq.h:91
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:760
ADE9113_SINC3_LPF_EN_1_KHZ_SAMPLING
@ ADE9113_SINC3_LPF_EN_1_KHZ_SAMPLING
Definition: ade9113.h:257
ade9113_zx_channel_cfg_e
ade9113_zx_channel_cfg_e
ADE9113 Zero Crossing Channel Select.
Definition: ade9113.h:294
ade9113_enable_status1x_int
int ade9113_enable_status1x_int(struct ade9113_dev *dev)
Enable STATUS1X interrupt.
Definition: ade9113.c:1322
ade9113_clear_crc_chg_int
int ade9113_clear_crc_chg_int(struct ade9113_dev *dev)
Clear the CRC_CHG int mask.
Definition: ade9113.c:2052
ADE9113_CRC_FORCE_MSK
#define ADE9113_CRC_FORCE_MSK
Definition: ade9113.h:200
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:2193
ade9113_dev::v2_wav
int32_t * v2_wav
Definition: ade9113.h:366
ADE9113_SPI_READ
#define ADE9113_SPI_READ
Definition: ade9113.h:58
ade9113_adc_snapshot
int ade9113_adc_snapshot(struct ade9113_dev *dev)
ADC snapshot.
Definition: ade9113.c:1867
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:58
ade9113_get_status1x
int ade9113_get_status1x(struct ade9113_dev *dev, uint8_t *status)
Get STATUS1 indicator.
Definition: ade9113.c:1934
ade9113_get_comflt_err
int ade9113_get_comflt_err(struct ade9113_dev *dev, uint8_t *status)
Get COMFLT_ERR indicator.
Definition: ade9113.c:2019
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:867
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:910
ade9113_force_crc_recalculation
int ade9113_force_crc_recalculation(struct ade9113_dev *dev)
Force background register map CRC recalculation.
Definition: ade9113.c:2414
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:2007
ade9113_drdy_int_disable
int ade9113_drdy_int_disable(struct ade9113_dev *dev)
DRDY inerrupt disable.
Definition: ade9113.c:2539
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:1235
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:1029
ADE9113_REG_EMI_MID_LIMIT
#define ADE9113_REG_EMI_MID_LIMIT
Definition: ade9113.h:84
ade9113_enable_status2x_int
int ade9113_enable_status2x_int(struct ade9113_dev *dev)
Enable STATUS2X interrupt.
Definition: ade9113.c:1350
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:1756
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:1191
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:255
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:168
ade9113_dev
ADE9113 Device structure.
Definition: ade9113.h:354
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:204
ade9113_dev::irq_cb
struct no_os_callback_desc irq_cb
Definition: ade9113.h:374
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:973
ade9113_write_scratchpad
int ade9113_write_scratchpad(struct ade9113_dev *dev, uint8_t val)
Write value in the scratchpad register.
Definition: ade9113.c:895
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:1994
ade9113_get_crc_chg
int ade9113_get_crc_chg(struct ade9113_dev *dev, uint8_t *status)
Get CRC_CHG indicator.
Definition: ade9113.c:1982
ADE9113_NONISOLATED_ADE9103
#define ADE9113_NONISOLATED_ADE9103
Definition: ade9113.h:213
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:2007
no_os_irq_ctrl_desc
Definition: no_os_irq.h:129
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:1714
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:153
ade9113_drdy_int_disable
int ade9113_drdy_int_disable(struct ade9113_dev *dev)
DRDY inerrupt disable.
Definition: ade9113.c:2539
ade9113_init_param::gpio_rdy
struct no_os_gpio_init_param * gpio_rdy
Definition: ade9113.h:338
no_os_gpio_desc::number
int32_t number
Definition: no_os_gpio.h:106
ADE9113_SAWTOOTH_FREQUENCY_FALLING
@ ADE9113_SAWTOOTH_FREQUENCY_FALLING
Definition: ade9113.h:268
ADE9113_REG_EMI_HI_MASK
#define ADE9113_REG_EMI_HI_MASK
Definition: ade9113.h:81
no_os_test_bit
int no_os_test_bit(int pos, const volatile void *addr)
Definition: no_os_util.h:138
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:2375
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:2205
ADE9113_RESET_DONE_MSK
#define ADE9113_RESET_DONE_MSK
Definition: ade9113.h:190
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:2134
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:2301
ADE9113_ISO_PHY_CRC_ERR_MSK
#define ADE9113_ISO_PHY_CRC_ERR_MSK
Definition: ade9113.h:161
errno.h
Error macro definition for ARM Compiler.
ADE9113_EFUSE_MEM_ERR_MSK
#define ADE9113_EFUSE_MEM_ERR_MSK
Definition: ade9113.h:191
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:1742
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:725
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:1644
ADE9113_ZX_DISABLE
@ ADE9113_ZX_DISABLE
Definition: ade9113.h:296
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:1910
ade9113_clear_crc_done_int
int ade9113_clear_crc_done_int(struct ade9113_dev *dev)
Clear the CRC_DONE int mask.
Definition: ade9113.c:2400
ade9113_init_param::spi_init
struct no_os_spi_init_param * spi_init
Definition: ade9113.h:336
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:131
ADE9113_REG_STATUS0
#define ADE9113_REG_STATUS0
Definition: ade9113.h:97
ade9113_enable_status1x_int
int ade9113_enable_status1x_int(struct ade9113_dev *dev)
Enable STATUS1X interrupt.
Definition: ade9113.c:1322
ADE9113_REG_I_WAV_HI
#define ADE9113_REG_I_WAV_HI
Definition: ade9113.h:103
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:81