no-OS
Classes | Macros | Enumerations | Functions
ade9113.h File Reference

Header file of ADE9113 Driver. More...

#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include "no_os_util.h"
#include "no_os_spi.h"
#include "no_os_gpio.h"
#include "no_os_irq.h"
Include dependency graph for ade9113.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ade9113_init_param
 ADE9113 Device initialization parameters. More...
 
struct  ade9113_dev
 ADE9113 Device structure. More...
 

Macros

#define ADE9113_SPI_READ   NO_OS_BIT(7)
 
#define ADE9113_OP_MODE_LONG   NO_OS_BIT(6)
 
#define ADE9113_CRC8_POLY   0x07
 
#define ADE9113_CRC16_POLY   0x1021
 
#define ADE9113_CRC16_INIT_VAL   0xFFFF
 
#define ENABLE   1u
 
#define DISABLE   0u
 
#define ADE9113_REG_SWRST   0x001
 
#define ADE9113_REG_CONFIG0   0x002
 
#define ADE9113_REG_CONFIG_FILT   0x003
 
#define ADE9113_REG_CONFIG_ISO_ACC   0x005
 
#define ADE9113_REG_CRC_RESULT_HI   0x006
 
#define ADE9113_REG_CRC_RESULT_LO   0x007
 
#define ADE9113_REG_EFUSE_REFRESH   0x008
 
#define ADE9113_REG_EMI_CONFIG   0x009
 
#define ADE9113_REG_EMI_HI_MASK   0x00A
 
#define ADE9113_REG_EMI_LO_MASK   0x00B
 
#define ADE9113_REG_EMI_HI_LIMIT   0x00C
 
#define ADE9113_REG_EMI_MID_LIMIT   0x00D
 
#define ADE9113_REG_EMI_LO_LIMIT   0x00E
 
#define ADE9113_REG_MASK0   0x00F
 
#define ADE9113_REG_MASK1   0x010
 
#define ADE9113_REG_MASK2   0x011
 
#define ADE9113_REG_CONFIG_ZX   0x012
 
#define ADE9113_REG_SCRATCH   0x013
 
#define ADE9113_REG_SYNC_SNAP   0x014
 
#define ADE9113_REG_COUNTER_HI   0x015
 
#define ADE9113_REG_COUNTER_LO   0x016
 
#define ADE9113_REG_SNAPSHOT_COUNT_HI   0x017
 
#define ADE9113_REG_SNAPSHOT_COUNT_LO   0x018
 
#define ADE9113_REG_WR_LOCK   0x01F
 
#define ADE9113_REG_STATUS0   0x020
 
#define ADE9113_REG_STATUS1   0x021
 
#define ADE9113_REG_STATUS2   0x022
 
#define ADE9113_REG_COM_FLT_TYPE   0x023
 
#define ADE9113_REG_COM_FLT_COUNT   0x024
 
#define ADE9113_REG_CONFIG_CRC   0x025
 
#define ADE9113_REG_I_WAV_HI   0x026
 
#define ADE9113_REG_I_WAV_MD   0x027
 
#define ADE9113_REG_I_WAV_LO   0x028
 
#define ADE9113_REG_V1_WAV_HI   0x029
 
#define ADE9113_REG_V1_WAV_MD   0x02A
 
#define ADE9113_REG_V1_WAV_LO   0x02B
 
#define ADE9113_REG_V2_WAV_HI   0x02C
 
#define ADE9113_REG_V2_WAV_MD   0x02D
 
#define ADE9113_REG_V2_WAV_LO   0x02E
 
#define ADE9113_REG_UNIQUE_PART_ID_5   0x075
 
#define ADE9113_REG_UNIQUE_PART_ID_4   0x076
 
#define ADE9113_REG_UNIQUE_PART_ID_3   0x077
 
#define ADE9113_REG_UNIQUE_PART_ID_2   0x078
 
#define ADE9113_REG_UNIQUE_PART_ID_1   0x079
 
#define ADE9113_REG_UNIQUE_PART_ID_0   0x07A
 
#define ADE9113_REG_SILICON_REVISION   0x07D
 
#define ADE9113_REG_VERSION_PRODUCT   0x07E
 
#define ADE9113_SWRST_CMD   0xD6
 
#define ADE9113_STREAM_DBG_MSK   NO_OS_GENMASK(3, 2)
 
#define ADE9113_CRC_EN_SPI_WRITE_MSK   NO_OS_BIT(1)
 
#define ADE9113_CLOUT_EN_MSK   NO_OS_BIT(0)
 
#define ADE9113_V2_ADC_INVERT_MSK   NO_OS_BIT(6)
 
#define ADE9113_V1_ADC_INVERT_MSK   NO_OS_BIT(5)
 
#define ADE9113_I_ADC_INVERT_MSK   NO_OS_BIT(4)
 
#define ADE9113_LPF_BW_MSK   NO_OS_BIT(3)
 
#define ADE9113_DATAPATH_CONFIG_MSK   NO_OS_GENMASK(2, 0)
 
#define ADE9113_ISO_WR_ACC_EN_MSK   NO_OS_BIT(0)
 
#define ADE9113_EFUSE_REFRESH_MSK   NO_OS_BIT(0)
 
#define ADE9113_EMI_CONFIG_MSK   NO_OS_GENMASK(2, 0)
 
#define ADE9113_STATUS1X_MSK   NO_OS_BIT(7)
 
#define ADE9113_STATUS2X_MSK   NO_OS_BIT(6)
 
#define ADE9113_COM_UP_MSK   NO_OS_BIT(4)
 
#define ADE9113_CRC_CHG_MSK   NO_OS_BIT(3)
 
#define ADE9113_SPI_CRC_ERR_MSK   NO_OS_BIT(1)
 
#define ADE9113_COMFLT_ERR_MSK   NO_OS_BIT(0)
 
#define ADE9113_V2_WAV_OVRNG_MSK   NO_OS_BIT(3)
 
#define ADE9113_V1_WAV_OVRNG_MSK   NO_OS_BIT(2)
 
#define ADE9113_I_WAV_OVRNG_MSK   NO_OS_BIT(1)
 
#define ADE9113_ADC_SYNC_DONE_MSK   NO_OS_BIT(0)
 
#define ADE9113_ISO_CLK_STBL_ERR_MSK   NO_OS_BIT(6)
 
#define ADE9113_ISO_PHY_CRC_ERR_MSK   NO_OS_BIT(5)
 
#define ADE9113_ISO_EFUSE_MEM_ERR_MSK   NO_OS_BIT(4)
 
#define ADE9113_ISO_DIG_MOD_V2_OVF_MSK   NO_OS_BIT(3)
 
#define ADE9113_ISO_DIG_MOD_V1_OVF_MSK   NO_OS_BIT(2)
 
#define ADE9113_ISO_DIG_MOD_I_OVF_MSK   NO_OS_BIT(1)
 
#define ADE9113_ISO_TEST_MMR_ERR_MSK   NO_OS_BIT(0)
 
#define ADE9113_ZX_EDGE_SEL_MSK   NO_OS_GENMASK(3, 2)
 
#define ADE9113_ZX_CHANNEL_CONFIG_MSK   NO_OS_GENMASK(1, 0)
 
#define ADE9113_PREP_BROADCAST_MSK   NO_OS_BIT(2)
 
#define ADE9113_ALIGN_MSK   NO_OS_BIT(1)
 
#define ADE9113_SNAPSHOT_MSK   NO_OS_BIT(0)
 
#define ADE9113_COUNTER_HI_MSK   NO_OS_GENMASK(5, 0)
 
#define ADE9113_COUNTER_LO_MSK   NO_OS_GENMASK(8, 0)
 
#define ADE9113_SNAPSHOT_COUNT_HI_MSK   NO_OS_GENMASK(5, 0)
 
#define ADE9113_SNAPSHOT_COUNT_LO_MSK   NO_OS_GENMASK(7, 0)
 
#define ADE9113_RESET_DONE_MSK   NO_OS_BIT(5)
 
#define ADE9113_EFUSE_MEM_ERR_MSK   NO_OS_BIT(2)
 
#define ADE9113_ISO_STATUS_RD_ECC_ERR_MSK   NO_OS_BIT(2)
 
#define ADE9113_ISO_PHY_ERR_MSK   NO_OS_BIT(1)
 
#define ADE9113_ISO_ECC_ERR_MSK   NO_OS_BIT(1)
 
#define ADE9113_CRC_DONE_MSK   NO_OS_BIT(1)
 
#define ADE9113_CRC_FORCE_MSK   NO_OS_BIT(0)
 
#define ADE9113_NONISO_CHIP_REV_MSK   NO_OS_GENMASK(7, 4)
 
#define ADE9113_ISO_CHIP_REV_MSK   NO_OS_GENMASK(3, 0)
 
#define ADE9113_LOCK_KEY   0XD4
 
#define ADE9113_UNLOCK_KEY   0X5E
 
#define ADE9113_3_CHANNEL_ADE9113   0U
 
#define ADE9113_2_CHANNEL_ADE9112   1U
 
#define ADE9113_NONISOLATED_ADE9103   3U
 
#define ADE9113_VREF   (1249810)
 

Enumerations

enum  ade9113_stream_debug_e {
  ADE9113_STREAM_NORMAL_MODE = 0,
  ADE9113_STREAM_STATIC_MODE,
  ADE9113_STREAM_INCREMENTS_MODE,
  ADE9113_STREAM_FUNCTIONAL_MODE
}
 ADE9113 Stream Debug. More...
 
enum  ade9113_datapath_config_e {
  ADE9113_SINC3_32_KHZ_SAMPLING = 0,
  ADE9113_SINC3_LPF_EN_32_KHZ_SAMPLING,
  ADE9113_SINC3_COMP_EN_LPF_EN_32_KHZ_SAMPLING,
  ADE9113_SINC3_LPF_EN_8_KHZ_SAMPLING,
  ADE9113_SINC3_COMP_EN_LPF_EN_8_KHZ_SAMPLING,
  ADE9113_SINC3_LPF_EN_4_KHZ_SAMPLING,
  ADE9113_SINC3_LPF_EN_2_KHZ_SAMPLING,
  ADE9113_SINC3_LPF_EN_1_KHZ_SAMPLING
}
 ADE9113 digital signal processing configuration. More...
 
enum  ade9113_emi_config_e {
  ADE9113_SAWTOOTH_FREQUENCY_RISING = 0,
  ADE9113_SAWTOOTH_FREQUENCY_FALLING,
  ADE9113_RAMP,
  ADE9113_RANDOM_HOPPING_FREQUENCY
}
 ADE9113 EMI Frequency Hopping Selection. More...
 
enum  ade9113_zx_edge_sel_e {
  ADE9113_ZX_INPUT_SIGNAL_SIGN = 0,
  ADE9113_ZX_DETECT_POSITIVE_SLOPE,
  ADE9113_ZX_DETECT_NEGATIVE_SLOPE,
  ADE9113_ZX_DETECT_BOTH_SLOPES
}
 ADE9113 Zero Crossing Edge Select. More...
 
enum  ade9113_zx_channel_cfg_e {
  ADE9113_ZX_DISABLE = 0,
  ADE9113_ZX_I_SEL,
  ADE9113_ZX_V1_SEL,
  ADE9113_ZX_V2_SEL
}
 ADE9113 Zero Crossing Channel Select. More...
 
enum  ade9113_operation_e {
  ADE9113_L_OP = 0,
  ADE9113_S_OP
}
 ADE9113 long/short operation mode. More...
 
enum  ade9113_wav_e {
  ADE9113_I_WAV = 0,
  ADE9113_V1_WAV,
  ADE9113_V2_WAV
}
 ADE9113 waveorm data. More...
 

Functions

int ade9113_read (struct ade9113_dev *dev, uint8_t reg_addr, uint8_t *reg_data, enum ade9113_operation_e op_mode)
 Read device register. More...
 
int ade9113_read_dc (struct ade9113_dev *dev, uint8_t reg_addr, uint8_t *reg_data)
 Read device register in a daisy-chain setup. More...
 
int ade9113_write (struct ade9113_dev *dev, uint8_t reg_addr, uint8_t reg_data, enum ade9113_operation_e op_mode)
 Write device register. More...
 
int ade9113_write_dc (struct ade9113_dev *dev, uint8_t reg_addr, uint8_t *reg_data)
 Write device register in a daisy-chain setup. More...
 
int ade9113_init (struct ade9113_dev **device, struct ade9113_init_param init_param)
 Initialize the device. More...
 
int ade9113_remove (struct ade9113_dev *dev)
 Remove the device and release resources. More...
 
int ade9113_sw_reset (struct ade9113_dev *dev)
 Reset the device using SW reset. More...
 
int ade9113_hw_reset (struct ade9113_dev *dev)
 Reset the device using SW reset. More...
 
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. More...
 
int ade9113_get_stream_dbg_mode (struct ade9113_dev *dev, enum ade9113_stream_debug_e *stream_dbg)
 Get STREAM_DBG mode. More...
 
int ade9113_set_stream_dbg_mode (struct ade9113_dev *dev, enum ade9113_stream_debug_e stream_dbg)
 Set STREAM_DBG mode. More...
 
int ade9113_get_crc_en_state (struct ade9113_dev *dev, uint8_t *crc_en_state)
 Get CRC enable on SPI write setting. More...
 
int ade9113_set_crc_en_state (struct ade9113_dev *dev, uint8_t crc_en_state)
 Set CRC enable on SPI write setting. More...
 
int ade9113_wr_lock (struct ade9113_dev *dev)
 Lock device. More...
 
int ade9113_wr_unlock (struct ade9113_dev *dev)
 Unlock device. More...
 
int ade9113_write_scratchpad (struct ade9113_dev *dev, uint8_t val)
 Write value in the scratchpad register. More...
 
int ade9113_read_scratchpad (struct ade9113_dev *dev, uint8_t *val)
 Get the value stired in the scratchpad register. More...
 
int ade9113_set_normal_mode (struct ade9113_dev *dev)
 Set normal mode of operation. More...
 
int ade9113_set_static_mode (struct ade9113_dev *dev)
 Set static mode of operation. More...
 
int ade9113_set_data_increments_mode (struct ade9113_dev *dev)
 Set data increments mode of operation. More...
 
int ade9113_get_err_count (struct ade9113_dev *dev, uint8_t *err_count)
 Get ECC or PHY Error Count on ISO to NONISO Communications. More...
 
int ade9113_invert_v2_inputs (struct ade9113_dev *dev)
 Invert V2 channel inputs. More...
 
int ade9113_invert_v1_inputs (struct ade9113_dev *dev)
 Invert V1 channel inputs. More...
 
int ade9113_invert_i_inputs (struct ade9113_dev *dev)
 Invert I channel inputs. More...
 
int ade9113_invert_v2_inputs_disable (struct ade9113_dev *dev)
 Disable invert V2 channel inputs. More...
 
int ade9113_invert_v1_inputs_disable (struct ade9113_dev *dev)
 Disable invert V1 channel inputs. More...
 
int ade9113_invert_i_inputs_disable (struct ade9113_dev *dev)
 Disable invert I channel inputs. More...
 
int ade9113_set_lpf_bw_2_7 (struct ade9113_dev *dev)
 Set filter bandwidth to 2.7 kHz at 8ksps output data rate. More...
 
int ade9113_set_lpf_bw_3_3 (struct ade9113_dev *dev)
 Set filter bandwidth to 3.3 kHz at 8ksps output data rate. More...
 
int ade9113_set_dsp_config (struct ade9113_dev *dev, enum ade9113_datapath_config_e config)
 Set digital signal processing configuration. More...
 
int ade9113_enable_wa_dc_offset_mode (struct ade9113_dev *dev)
 Enable write access to DC_OFFSET_MODE register. More...
 
int ade9113_disable_wa_dc_offset_mode (struct ade9113_dev *dev)
 Disable write access to DC_OFFSET_MODE register. More...
 
int ade9113_get_crc (struct ade9113_dev *dev, uint16_t *crc)
 Get register map CRC. More...
 
int ade9113_efuse_refresh (struct ade9113_dev *dev)
 Refresh EFuse Memory. More...
 
int ade9113_set_emi_config (struct ade9113_dev *dev, enum ade9113_emi_config_e config)
 Select EMI frequency hopping. More...
 
int ade9113_get_emi_hi_mask (struct ade9113_dev *dev, uint8_t *msk)
 Get EMI HI mask. More...
 
int ade9113_get_emi_lo_mask (struct ade9113_dev *dev, uint8_t *msk)
 Get EMI LO mask. More...
 
int ade9113_set_emi_hi_mask (struct ade9113_dev *dev, uint8_t msk)
 Set EMI HI mask. More...
 
int ade9113_set_emi_lo_mask (struct ade9113_dev *dev, uint8_t msk)
 Set EMI LO mask. More...
 
int ade9113_get_emi_hi_limit (struct ade9113_dev *dev, uint8_t *limit)
 Get EMI HI limit. More...
 
int ade9113_get_emi_mid_limit (struct ade9113_dev *dev, uint8_t *limit)
 Get EMI MID limit. More...
 
int ade9113_get_emi_lo_limit (struct ade9113_dev *dev, uint8_t *limit)
 Get EMI LO limit. More...
 
int ade9113_control_interrupt (struct ade9113_dev *dev, uint8_t reg_addr, uint8_t int_msk, uint8_t en)
 Enable/disable interrupt. More...
 
int ade9113_enable_status1x_int (struct ade9113_dev *dev)
 Enable STATUS1X interrupt. More...
 
int ade9113_disable_status1x_int (struct ade9113_dev *dev)
 Disable STATUS1X interrupt. More...
 
int ade9113_enable_status2x_int (struct ade9113_dev *dev)
 Enable STATUS2X interrupt. More...
 
int ade9113_disable_status2x_int (struct ade9113_dev *dev)
 Disable STATUS2X interrupt. More...
 
int ade9113_enable_com_up_int (struct ade9113_dev *dev)
 Enable COM_UP interrupt. More...
 
int ade9113_disable_com_up_int (struct ade9113_dev *dev)
 Disable COM_UP interrupt. More...
 
int ade9113_enable_crc_chg_int (struct ade9113_dev *dev)
 Enable CRC_CHG interrupt. More...
 
int ade9113_disable_crc_chg_int (struct ade9113_dev *dev)
 Disable CRC_CHG interrupt. More...
 
int ade9113_enable_spi_crc_err_int (struct ade9113_dev *dev)
 Enable SPI_CRC_ERR interrupt. More...
 
int ade9113_disable_spi_crc_err_int (struct ade9113_dev *dev)
 Disable SPI_CRC_ERR interrupt. More...
 
int ade9113_enable_comflt_err_int (struct ade9113_dev *dev)
 Enable COMFLT_ERR interrupt. More...
 
int ade9113_disable_comflt_err_int (struct ade9113_dev *dev)
 Disable COMFLT_ERR interrupt. More...
 
int ade9113_enable_v2_wav_ovrng_int (struct ade9113_dev *dev)
 Enable V2_WAV_OVRNG interrupt. More...
 
int ade9113_disable_v2_wav_ovrng_int (struct ade9113_dev *dev)
 Disable V2_WAV_OVRNG interrupt. More...
 
int ade9113_enable_v1_wav_ovrng_int (struct ade9113_dev *dev)
 Enable V1_WAV_OVRNG interrupt. More...
 
int ade9113_disable_v1_wav_ovrng_int (struct ade9113_dev *dev)
 Disable V1_WAV_OVRNG interrupt. More...
 
int ade9113_enable_i_wav_ovrng_int (struct ade9113_dev *dev)
 Enable I_WAV_OVRNG interrupt. More...
 
int ade9113_disable_i_wav_ovrng_int (struct ade9113_dev *dev)
 Disable I_WAV_OVRNG interrupt. More...
 
int ade9113_enable_adc_sync_done_int (struct ade9113_dev *dev)
 Enable ADC_SYNC_DONE interrupt. More...
 
int ade9113_disable_adc_sync_done_int (struct ade9113_dev *dev)
 Disable ADC_SYNC_DONE interrupt. More...
 
int ade9113_enable_iso_clk_stbl_err_int (struct ade9113_dev *dev)
 Enable ISO_CLK_STBL_ERR interrupt. More...
 
int ade9113_disable_iso_clk_stbl_err_int (struct ade9113_dev *dev)
 Disable ISO_CLK_STBL_ERR interrupt. More...
 
int ade9113_enable_iso_phy_crc_err_int (struct ade9113_dev *dev)
 Enable ISO_PHY_CRC_ERR interrupt. More...
 
int ade9113_disable_iso_phy_crc_err_int (struct ade9113_dev *dev)
 Disable ISO_PHY_CRC_ERR interrupt. More...
 
int ade9113_enable_iso_efuse_mem_err_int (struct ade9113_dev *dev)
 Enable ISO_EFUSE_MEM_ERR interrupt. More...
 
int ade9113_disable_iso_efuse_mem_err_int (struct ade9113_dev *dev)
 Disable ISO_EFUSE_MEM_ERR interrupt. More...
 
int ade9113_enable_iso_dig_mod_v2_ovf_int (struct ade9113_dev *dev)
 Enable ISO_DIG_MOD_V2_OVF interrupt. More...
 
int ade9113_disable_iso_dig_mod_v2_ovf_int (struct ade9113_dev *dev)
 Disable ISO_DIG_MOD_V2_OVF interrupt. More...
 
int ade9113_enable_iso_dig_mod_v1_ovf_int (struct ade9113_dev *dev)
 Enable ISO_DIG_MOD_V1_OVF interrupt. More...
 
int ade9113_disable_iso_dig_mod_v1_ovf_int (struct ade9113_dev *dev)
 Disable ISO_DIG_MOD_V1_OVF interrupt. More...
 
int ade9113_enable_iso_dig_mod_i_ovf_int (struct ade9113_dev *dev)
 Enable ISO_DIG_MOD_I_OVF interrupt. More...
 
int ade9113_disable_iso_dig_mod_i_ovf_int (struct ade9113_dev *dev)
 Disable ISO_DIG_MOD_I_OVF interrupt. More...
 
int ade9113_enable_iso_test_mmr_err_int (struct ade9113_dev *dev)
 Enable ISO_TEST_MMR_ERR interrupt. More...
 
int ade9113_disable_iso_test_mmr_err_int (struct ade9113_dev *dev)
 Disable ISO_TEST_MMR_ERR interrupt. More...
 
int ade9113_select_zero_crossing_edge (struct ade9113_dev *dev, enum ade9113_zx_edge_sel_e sel)
 Select zero crossing edge. More...
 
int ade9113_select_zero_crossing_channel (struct ade9113_dev *dev, enum ade9113_zx_channel_cfg_e cfg)
 Select zero crossing channel. More...
 
int ade9113_adc_prepare_broadcast (struct ade9113_dev *dev)
 ADC prepare broadcast. More...
 
int ade9113_adc_align (struct ade9113_dev *dev)
 ADC align. More...
 
int ade9113_adc_snapshot (struct ade9113_dev *dev)
 ADC snapshot. More...
 
int ade9113_get_int_status (struct ade9113_dev *dev, uint8_t addr, uint8_t msk, uint8_t *status)
 Get interrupt indicator from STATUS register. More...
 
int ade9113_get_statusx_val (struct ade9113_dev *dev, uint8_t addr, uint8_t *status)
 Get STATUSx register value. More...
 
int ade9113_get_status1x (struct ade9113_dev *dev, uint8_t *status)
 Get STATUS1 indicator. More...
 
int ade9113_get_status2x (struct ade9113_dev *dev, uint8_t *status)
 Get STATUS2 indicator. More...
 
int ade9113_get_reset_done (struct ade9113_dev *dev, uint8_t *status)
 Get RESET_DONE indicator. More...
 
int ade9113_get_com_up (struct ade9113_dev *dev, uint8_t *status)
 Get COM_UP indicator. More...
 
int ade9113_get_crc_chg (struct ade9113_dev *dev, uint8_t *status)
 Get CRC_CHG indicator. More...
 
int ade9113_get_efuse_mem_err (struct ade9113_dev *dev, uint8_t *status)
 Get EFUSE_MEM_ERR indicator. More...
 
int ade9113_get_spi_crc_err (struct ade9113_dev *dev, uint8_t *status)
 Get SPI_CRC_ERR indicator. More...
 
int ade9113_get_comflt_err (struct ade9113_dev *dev, uint8_t *status)
 Get COMFLT_ERR indicator. More...
 
int ade9113_clear_reset_done_int (struct ade9113_dev *dev)
 Clear the RESET_DONE int mask. More...
 
int ade9113_clear_com_up_int (struct ade9113_dev *dev)
 Clear the COM_UP int mask. More...
 
int ade9113_clear_crc_chg_int (struct ade9113_dev *dev)
 Clear the CRC_CHG int mask. More...
 
int ade9113_clear_spi_crc_err_int (struct ade9113_dev *dev)
 Clear the SPI_CRC_ERR int mask. More...
 
int ade9113_clear_comflt_err_int (struct ade9113_dev *dev)
 Clear the COMFLT_ERR int mask. More...
 
int ade9113_get_v2_wav_ovrng (struct ade9113_dev *dev, uint8_t *status)
 Get V2_WAV_OVRNG indicator. More...
 
int ade9113_clear_v2_wav_ovrng_int (struct ade9113_dev *dev)
 Clear the V2_WAV_OVRNG int mask. More...
 
int ade9113_get_v1_wav_ovrng (struct ade9113_dev *dev, uint8_t *status)
 Get V1_WAV_OVRNG indicator. More...
 
int ade9113_clear_v1_wav_ovrng_int (struct ade9113_dev *dev)
 Clear the V1_WAV_OVRNG int mask. More...
 
int ade9113_get_i_wav_ovrng (struct ade9113_dev *dev, uint8_t *status)
 Get I_WAV_OVRNG indicator. More...
 
int ade9113_clear_i_wav_ovrng_int (struct ade9113_dev *dev)
 Clear the I_WAV_OVRNG int mask. More...
 
int ade9113_get_adc_sync_done (struct ade9113_dev *dev, uint8_t *status)
 Get ADC_SYNC_DONE indicator. More...
 
int ade9113_clear_adc_sync_done_int (struct ade9113_dev *dev)
 Clear the ADC_SYNC_DONE int mask. More...
 
int ade9113_get_iso_clk_stbl_err (struct ade9113_dev *dev, uint8_t *status)
 Get ISO_CLK_STBL_ERR indicator. More...
 
int ade9113_clear_iso_clk_stbl_err_int (struct ade9113_dev *dev)
 Clear the ISO_CLK_STBL_ERR int mask. More...
 
int ade9113_get_iso_phy_crc_err (struct ade9113_dev *dev, uint8_t *status)
 Get ISO_PHY_CRC_ERR indicator. More...
 
int ade9113_clear_iso_phy_crc_err_int (struct ade9113_dev *dev)
 Clear the ISO_PHY_CRC_ERR int mask. More...
 
int ade9113_get_iso_efuse_mem_err_err (struct ade9113_dev *dev, uint8_t *status)
 Get ISO_EFUSE_MEM_ERR indicator. More...
 
int ade9113_clear_iso_efuse_mem_err_int (struct ade9113_dev *dev)
 Clear the ISO_EFUSE_MEM_ERR int mask. More...
 
int ade9113_get_iso_dig_mod_v2_ovf (struct ade9113_dev *dev, uint8_t *status)
 Get ISO_DIG_MOD_V2_OVF indicator. More...
 
int ade9113_clear_iso_dig_mod_v2_ovf_int (struct ade9113_dev *dev)
 Clear the ISO_DIG_MOD_V2_OVF int mask. More...
 
int ade9113_get_iso_dig_mod_v1_ovf (struct ade9113_dev *dev, uint8_t *status)
 Get ISO_DIG_MOD_V1_OVF indicator. More...
 
int ade9113_clear_iso_dig_mod_v1_ovf_int (struct ade9113_dev *dev)
 Clear the ISO_DIG_MOD_V1_OVF int mask. More...
 
int ade9113_get_iso_dig_mod_i_ovf (struct ade9113_dev *dev, uint8_t *status)
 Get ISO_DIG_MOD_I_OVF indicator. More...
 
int ade9113_clear_iso_dig_mod_i_ovf_int (struct ade9113_dev *dev)
 Clear the ISO_DIG_MOD_I_OVF int mask. More...
 
int ade9113_get_iso_test_mmr_err (struct ade9113_dev *dev, uint8_t *status)
 Get ISO_TEST_MMR_ERR indicator. More...
 
int ade9113_clear_iso_test_mmr_err_int (struct ade9113_dev *dev)
 Clear the ISO_TEST_MMR_ERR int mask. More...
 
int ade9113_get_iso_status_rd_ecc_err (struct ade9113_dev *dev, uint8_t *status)
 Get ISO_STATUS_RD_ECC_ERR indicator. More...
 
int ade9113_get_iso_phy_err (struct ade9113_dev *dev, uint8_t *status)
 Get ISO_PHY_ERR indicator. More...
 
int ade9113_get_iso_ecc_err (struct ade9113_dev *dev, uint8_t *status)
 Get ISO_ECC_ERR indicator. More...
 
int ade9113_get_crc_done_flag (struct ade9113_dev *dev, uint8_t *status)
 Get CRC_DONE indicator. More...
 
int ade9113_clear_crc_done_int (struct ade9113_dev *dev)
 Clear the CRC_DONE int mask. More...
 
int ade9113_force_crc_recalculation (struct ade9113_dev *dev)
 Force background register map CRC recalculation. More...
 
int ade9113_get_silicon_revision (struct ade9113_dev *dev, uint8_t *silicon_rev)
 Get SILICON_REVISION value. More...
 
int ade9113_get_version_product (struct ade9113_dev *dev, uint8_t *ver_product)
 Get VERSION_PRODUCT value. More...
 
int ade9113_get_wav (struct ade9113_dev *dev, enum ade9113_wav_e selection, uint32_t *val)
 Get wave value. More...
 
int ade9113_drdy_int_enable (struct ade9113_dev *dev)
 DRDY inerrupt enable. More...
 
int ade9113_drdy_int_disable (struct ade9113_dev *dev)
 DRDY inerrupt disable. More...
 

Detailed Description

Header file of ADE9113 Driver.

Author
George Mois (georg.nosp@m.e.mo.nosp@m.is@an.nosp@m.alog.nosp@m..com)

Copyright 2023(c) Analog Devices, Inc.

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Macro Definition Documentation

◆ ADE9113_2_CHANNEL_ADE9112

#define ADE9113_2_CHANNEL_ADE9112   1U

◆ ADE9113_3_CHANNEL_ADE9113

#define ADE9113_3_CHANNEL_ADE9113   0U

◆ ADE9113_ADC_SYNC_DONE_MSK

#define ADE9113_ADC_SYNC_DONE_MSK   NO_OS_BIT(0)

◆ ADE9113_ALIGN_MSK

#define ADE9113_ALIGN_MSK   NO_OS_BIT(1)

◆ ADE9113_CLOUT_EN_MSK

#define ADE9113_CLOUT_EN_MSK   NO_OS_BIT(0)

◆ ADE9113_COM_UP_MSK

#define ADE9113_COM_UP_MSK   NO_OS_BIT(4)

◆ ADE9113_COMFLT_ERR_MSK

#define ADE9113_COMFLT_ERR_MSK   NO_OS_BIT(0)

◆ ADE9113_COUNTER_HI_MSK

#define ADE9113_COUNTER_HI_MSK   NO_OS_GENMASK(5, 0)

◆ ADE9113_COUNTER_LO_MSK

#define ADE9113_COUNTER_LO_MSK   NO_OS_GENMASK(8, 0)

◆ ADE9113_CRC16_INIT_VAL

#define ADE9113_CRC16_INIT_VAL   0xFFFF

◆ ADE9113_CRC16_POLY

#define ADE9113_CRC16_POLY   0x1021

◆ ADE9113_CRC8_POLY

#define ADE9113_CRC8_POLY   0x07

◆ ADE9113_CRC_CHG_MSK

#define ADE9113_CRC_CHG_MSK   NO_OS_BIT(3)

◆ ADE9113_CRC_DONE_MSK

#define ADE9113_CRC_DONE_MSK   NO_OS_BIT(1)

◆ ADE9113_CRC_EN_SPI_WRITE_MSK

#define ADE9113_CRC_EN_SPI_WRITE_MSK   NO_OS_BIT(1)

◆ ADE9113_CRC_FORCE_MSK

#define ADE9113_CRC_FORCE_MSK   NO_OS_BIT(0)

◆ ADE9113_DATAPATH_CONFIG_MSK

#define ADE9113_DATAPATH_CONFIG_MSK   NO_OS_GENMASK(2, 0)

◆ ADE9113_EFUSE_MEM_ERR_MSK

#define ADE9113_EFUSE_MEM_ERR_MSK   NO_OS_BIT(2)

◆ ADE9113_EFUSE_REFRESH_MSK

#define ADE9113_EFUSE_REFRESH_MSK   NO_OS_BIT(0)

◆ ADE9113_EMI_CONFIG_MSK

#define ADE9113_EMI_CONFIG_MSK   NO_OS_GENMASK(2, 0)

◆ ADE9113_I_ADC_INVERT_MSK

#define ADE9113_I_ADC_INVERT_MSK   NO_OS_BIT(4)

◆ ADE9113_I_WAV_OVRNG_MSK

#define ADE9113_I_WAV_OVRNG_MSK   NO_OS_BIT(1)

◆ ADE9113_ISO_CHIP_REV_MSK

#define ADE9113_ISO_CHIP_REV_MSK   NO_OS_GENMASK(3, 0)

◆ ADE9113_ISO_CLK_STBL_ERR_MSK

#define ADE9113_ISO_CLK_STBL_ERR_MSK   NO_OS_BIT(6)

◆ ADE9113_ISO_DIG_MOD_I_OVF_MSK

#define ADE9113_ISO_DIG_MOD_I_OVF_MSK   NO_OS_BIT(1)

◆ ADE9113_ISO_DIG_MOD_V1_OVF_MSK

#define ADE9113_ISO_DIG_MOD_V1_OVF_MSK   NO_OS_BIT(2)

◆ ADE9113_ISO_DIG_MOD_V2_OVF_MSK

#define ADE9113_ISO_DIG_MOD_V2_OVF_MSK   NO_OS_BIT(3)

◆ ADE9113_ISO_ECC_ERR_MSK

#define ADE9113_ISO_ECC_ERR_MSK   NO_OS_BIT(1)

◆ ADE9113_ISO_EFUSE_MEM_ERR_MSK

#define ADE9113_ISO_EFUSE_MEM_ERR_MSK   NO_OS_BIT(4)

◆ ADE9113_ISO_PHY_CRC_ERR_MSK

#define ADE9113_ISO_PHY_CRC_ERR_MSK   NO_OS_BIT(5)

◆ ADE9113_ISO_PHY_ERR_MSK

#define ADE9113_ISO_PHY_ERR_MSK   NO_OS_BIT(1)

◆ ADE9113_ISO_STATUS_RD_ECC_ERR_MSK

#define ADE9113_ISO_STATUS_RD_ECC_ERR_MSK   NO_OS_BIT(2)

◆ ADE9113_ISO_TEST_MMR_ERR_MSK

#define ADE9113_ISO_TEST_MMR_ERR_MSK   NO_OS_BIT(0)

◆ ADE9113_ISO_WR_ACC_EN_MSK

#define ADE9113_ISO_WR_ACC_EN_MSK   NO_OS_BIT(0)

◆ ADE9113_LOCK_KEY

#define ADE9113_LOCK_KEY   0XD4

◆ ADE9113_LPF_BW_MSK

#define ADE9113_LPF_BW_MSK   NO_OS_BIT(3)

◆ ADE9113_NONISO_CHIP_REV_MSK

#define ADE9113_NONISO_CHIP_REV_MSK   NO_OS_GENMASK(7, 4)

◆ ADE9113_NONISOLATED_ADE9103

#define ADE9113_NONISOLATED_ADE9103   3U

◆ ADE9113_OP_MODE_LONG

#define ADE9113_OP_MODE_LONG   NO_OS_BIT(6)

◆ ADE9113_PREP_BROADCAST_MSK

#define ADE9113_PREP_BROADCAST_MSK   NO_OS_BIT(2)

◆ ADE9113_REG_COM_FLT_COUNT

#define ADE9113_REG_COM_FLT_COUNT   0x024

◆ ADE9113_REG_COM_FLT_TYPE

#define ADE9113_REG_COM_FLT_TYPE   0x023

◆ ADE9113_REG_CONFIG0

#define ADE9113_REG_CONFIG0   0x002

◆ ADE9113_REG_CONFIG_CRC

#define ADE9113_REG_CONFIG_CRC   0x025

◆ ADE9113_REG_CONFIG_FILT

#define ADE9113_REG_CONFIG_FILT   0x003

◆ ADE9113_REG_CONFIG_ISO_ACC

#define ADE9113_REG_CONFIG_ISO_ACC   0x005

◆ ADE9113_REG_CONFIG_ZX

#define ADE9113_REG_CONFIG_ZX   0x012

◆ ADE9113_REG_COUNTER_HI

#define ADE9113_REG_COUNTER_HI   0x015

◆ ADE9113_REG_COUNTER_LO

#define ADE9113_REG_COUNTER_LO   0x016

◆ ADE9113_REG_CRC_RESULT_HI

#define ADE9113_REG_CRC_RESULT_HI   0x006

◆ ADE9113_REG_CRC_RESULT_LO

#define ADE9113_REG_CRC_RESULT_LO   0x007

◆ ADE9113_REG_EFUSE_REFRESH

#define ADE9113_REG_EFUSE_REFRESH   0x008

◆ ADE9113_REG_EMI_CONFIG

#define ADE9113_REG_EMI_CONFIG   0x009

◆ ADE9113_REG_EMI_HI_LIMIT

#define ADE9113_REG_EMI_HI_LIMIT   0x00C

◆ ADE9113_REG_EMI_HI_MASK

#define ADE9113_REG_EMI_HI_MASK   0x00A

◆ ADE9113_REG_EMI_LO_LIMIT

#define ADE9113_REG_EMI_LO_LIMIT   0x00E

◆ ADE9113_REG_EMI_LO_MASK

#define ADE9113_REG_EMI_LO_MASK   0x00B

◆ ADE9113_REG_EMI_MID_LIMIT

#define ADE9113_REG_EMI_MID_LIMIT   0x00D

◆ ADE9113_REG_I_WAV_HI

#define ADE9113_REG_I_WAV_HI   0x026

◆ ADE9113_REG_I_WAV_LO

#define ADE9113_REG_I_WAV_LO   0x028

◆ ADE9113_REG_I_WAV_MD

#define ADE9113_REG_I_WAV_MD   0x027

◆ ADE9113_REG_MASK0

#define ADE9113_REG_MASK0   0x00F

◆ ADE9113_REG_MASK1

#define ADE9113_REG_MASK1   0x010

◆ ADE9113_REG_MASK2

#define ADE9113_REG_MASK2   0x011

◆ ADE9113_REG_SCRATCH

#define ADE9113_REG_SCRATCH   0x013

◆ ADE9113_REG_SILICON_REVISION

#define ADE9113_REG_SILICON_REVISION   0x07D

◆ ADE9113_REG_SNAPSHOT_COUNT_HI

#define ADE9113_REG_SNAPSHOT_COUNT_HI   0x017

◆ ADE9113_REG_SNAPSHOT_COUNT_LO

#define ADE9113_REG_SNAPSHOT_COUNT_LO   0x018

◆ ADE9113_REG_STATUS0

#define ADE9113_REG_STATUS0   0x020

◆ ADE9113_REG_STATUS1

#define ADE9113_REG_STATUS1   0x021

◆ ADE9113_REG_STATUS2

#define ADE9113_REG_STATUS2   0x022

◆ ADE9113_REG_SWRST

#define ADE9113_REG_SWRST   0x001

◆ ADE9113_REG_SYNC_SNAP

#define ADE9113_REG_SYNC_SNAP   0x014

◆ ADE9113_REG_UNIQUE_PART_ID_0

#define ADE9113_REG_UNIQUE_PART_ID_0   0x07A

◆ ADE9113_REG_UNIQUE_PART_ID_1

#define ADE9113_REG_UNIQUE_PART_ID_1   0x079

◆ ADE9113_REG_UNIQUE_PART_ID_2

#define ADE9113_REG_UNIQUE_PART_ID_2   0x078

◆ ADE9113_REG_UNIQUE_PART_ID_3

#define ADE9113_REG_UNIQUE_PART_ID_3   0x077

◆ ADE9113_REG_UNIQUE_PART_ID_4

#define ADE9113_REG_UNIQUE_PART_ID_4   0x076

◆ ADE9113_REG_UNIQUE_PART_ID_5

#define ADE9113_REG_UNIQUE_PART_ID_5   0x075

◆ ADE9113_REG_V1_WAV_HI

#define ADE9113_REG_V1_WAV_HI   0x029

◆ ADE9113_REG_V1_WAV_LO

#define ADE9113_REG_V1_WAV_LO   0x02B

◆ ADE9113_REG_V1_WAV_MD

#define ADE9113_REG_V1_WAV_MD   0x02A

◆ ADE9113_REG_V2_WAV_HI

#define ADE9113_REG_V2_WAV_HI   0x02C

◆ ADE9113_REG_V2_WAV_LO

#define ADE9113_REG_V2_WAV_LO   0x02E

◆ ADE9113_REG_V2_WAV_MD

#define ADE9113_REG_V2_WAV_MD   0x02D

◆ ADE9113_REG_VERSION_PRODUCT

#define ADE9113_REG_VERSION_PRODUCT   0x07E

◆ ADE9113_REG_WR_LOCK

#define ADE9113_REG_WR_LOCK   0x01F

◆ ADE9113_RESET_DONE_MSK

#define ADE9113_RESET_DONE_MSK   NO_OS_BIT(5)

◆ ADE9113_SNAPSHOT_COUNT_HI_MSK

#define ADE9113_SNAPSHOT_COUNT_HI_MSK   NO_OS_GENMASK(5, 0)

◆ ADE9113_SNAPSHOT_COUNT_LO_MSK

#define ADE9113_SNAPSHOT_COUNT_LO_MSK   NO_OS_GENMASK(7, 0)

◆ ADE9113_SNAPSHOT_MSK

#define ADE9113_SNAPSHOT_MSK   NO_OS_BIT(0)

◆ ADE9113_SPI_CRC_ERR_MSK

#define ADE9113_SPI_CRC_ERR_MSK   NO_OS_BIT(1)

◆ ADE9113_SPI_READ

#define ADE9113_SPI_READ   NO_OS_BIT(7)

◆ ADE9113_STATUS1X_MSK

#define ADE9113_STATUS1X_MSK   NO_OS_BIT(7)

◆ ADE9113_STATUS2X_MSK

#define ADE9113_STATUS2X_MSK   NO_OS_BIT(6)

◆ ADE9113_STREAM_DBG_MSK

#define ADE9113_STREAM_DBG_MSK   NO_OS_GENMASK(3, 2)

◆ ADE9113_SWRST_CMD

#define ADE9113_SWRST_CMD   0xD6

◆ ADE9113_UNLOCK_KEY

#define ADE9113_UNLOCK_KEY   0X5E

◆ ADE9113_V1_ADC_INVERT_MSK

#define ADE9113_V1_ADC_INVERT_MSK   NO_OS_BIT(5)

◆ ADE9113_V1_WAV_OVRNG_MSK

#define ADE9113_V1_WAV_OVRNG_MSK   NO_OS_BIT(2)

◆ ADE9113_V2_ADC_INVERT_MSK

#define ADE9113_V2_ADC_INVERT_MSK   NO_OS_BIT(6)

◆ ADE9113_V2_WAV_OVRNG_MSK

#define ADE9113_V2_WAV_OVRNG_MSK   NO_OS_BIT(3)

◆ ADE9113_VREF

#define ADE9113_VREF   (1249810)

◆ ADE9113_ZX_CHANNEL_CONFIG_MSK

#define ADE9113_ZX_CHANNEL_CONFIG_MSK   NO_OS_GENMASK(1, 0)

◆ ADE9113_ZX_EDGE_SEL_MSK

#define ADE9113_ZX_EDGE_SEL_MSK   NO_OS_GENMASK(3, 2)

◆ DISABLE

#define DISABLE   0u

◆ ENABLE

#define ENABLE   1u

Enumeration Type Documentation

◆ ade9113_datapath_config_e

ADE9113 digital signal processing configuration.

Enumerator
ADE9113_SINC3_32_KHZ_SAMPLING 
ADE9113_SINC3_LPF_EN_32_KHZ_SAMPLING 
ADE9113_SINC3_COMP_EN_LPF_EN_32_KHZ_SAMPLING 
ADE9113_SINC3_LPF_EN_8_KHZ_SAMPLING 
ADE9113_SINC3_COMP_EN_LPF_EN_8_KHZ_SAMPLING 
ADE9113_SINC3_LPF_EN_4_KHZ_SAMPLING 
ADE9113_SINC3_LPF_EN_2_KHZ_SAMPLING 
ADE9113_SINC3_LPF_EN_1_KHZ_SAMPLING 

◆ ade9113_emi_config_e

ADE9113 EMI Frequency Hopping Selection.

Enumerator
ADE9113_SAWTOOTH_FREQUENCY_RISING 
ADE9113_SAWTOOTH_FREQUENCY_FALLING 
ADE9113_RAMP 
ADE9113_RANDOM_HOPPING_FREQUENCY 

◆ ade9113_operation_e

ADE9113 long/short operation mode.

Enumerator
ADE9113_L_OP 
ADE9113_S_OP 

◆ ade9113_stream_debug_e

ADE9113 Stream Debug.

Enumerator
ADE9113_STREAM_NORMAL_MODE 
ADE9113_STREAM_STATIC_MODE 
ADE9113_STREAM_INCREMENTS_MODE 
ADE9113_STREAM_FUNCTIONAL_MODE 

◆ ade9113_wav_e

ADE9113 waveorm data.

Enumerator
ADE9113_I_WAV 
ADE9113_V1_WAV 
ADE9113_V2_WAV 

◆ ade9113_zx_channel_cfg_e

ADE9113 Zero Crossing Channel Select.

Enumerator
ADE9113_ZX_DISABLE 
ADE9113_ZX_I_SEL 
ADE9113_ZX_V1_SEL 
ADE9113_ZX_V2_SEL 

◆ ade9113_zx_edge_sel_e

ADE9113 Zero Crossing Edge Select.

Enumerator
ADE9113_ZX_INPUT_SIGNAL_SIGN 
ADE9113_ZX_DETECT_POSITIVE_SLOPE 
ADE9113_ZX_DETECT_NEGATIVE_SLOPE 
ADE9113_ZX_DETECT_BOTH_SLOPES 

Function Documentation

◆ ade9113_adc_align()

int ade9113_adc_align ( struct ade9113_dev dev)

ADC align.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_adc_prepare_broadcast()

int ade9113_adc_prepare_broadcast ( struct ade9113_dev dev)

ADC prepare broadcast.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_adc_snapshot()

int ade9113_adc_snapshot ( struct ade9113_dev dev)

ADC snapshot.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_clear_adc_sync_done_int()

int ade9113_clear_adc_sync_done_int ( struct ade9113_dev dev)

Clear the ADC_SYNC_DONE int mask.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_clear_com_up_int()

int ade9113_clear_com_up_int ( struct ade9113_dev dev)

Clear the COM_UP int mask.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_clear_comflt_err_int()

int ade9113_clear_comflt_err_int ( struct ade9113_dev dev)

Clear the COMFLT_ERR int mask.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_clear_crc_chg_int()

int ade9113_clear_crc_chg_int ( struct ade9113_dev dev)

Clear the CRC_CHG int mask.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_clear_crc_done_int()

int ade9113_clear_crc_done_int ( struct ade9113_dev dev)

Clear the CRC_DONE int mask.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_clear_i_wav_ovrng_int()

int ade9113_clear_i_wav_ovrng_int ( struct ade9113_dev dev)

Clear the I_WAV_OVRNG int mask.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_clear_reset_done_int()

int ade9113_clear_reset_done_int ( struct ade9113_dev dev)

Clear the RESET_DONE int mask.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_clear_spi_crc_err_int()

int ade9113_clear_spi_crc_err_int ( struct ade9113_dev dev)

Clear the SPI_CRC_ERR int mask.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_clear_v1_wav_ovrng_int()

int ade9113_clear_v1_wav_ovrng_int ( struct ade9113_dev dev)

Clear the V1_WAV_OVRNG int mask.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_clear_v2_wav_ovrng_int()

int ade9113_clear_v2_wav_ovrng_int ( struct ade9113_dev dev)

Clear the V2_WAV_OVRNG int mask.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
reg_addr- MASK register address.
int_msk- Interrupt mask.
en- Enable/Disable.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ 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.

Parameters
dev- The device structure.
dev_no- Device number (0 if in not in daisy-chain setup).
ch- Device channel.
mv_val- Value in millivolts.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ ade9113_disable_adc_sync_done_int()

int ade9113_disable_adc_sync_done_int ( struct ade9113_dev dev)

Disable ADC_SYNC_DONE interrupt.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_disable_com_up_int()

int ade9113_disable_com_up_int ( struct ade9113_dev dev)

Disable COM_UP interrupt.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_disable_comflt_err_int()

int ade9113_disable_comflt_err_int ( struct ade9113_dev dev)

Disable COMFLT_ERR interrupt.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_disable_crc_chg_int()

int ade9113_disable_crc_chg_int ( struct ade9113_dev dev)

Disable CRC_CHG interrupt.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_disable_i_wav_ovrng_int()

int ade9113_disable_i_wav_ovrng_int ( struct ade9113_dev dev)

Disable I_WAV_OVRNG interrupt.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_disable_spi_crc_err_int()

int ade9113_disable_spi_crc_err_int ( struct ade9113_dev dev)

Disable SPI_CRC_ERR interrupt.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_disable_status1x_int()

int ade9113_disable_status1x_int ( struct ade9113_dev dev)

Disable STATUS1X interrupt.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_disable_status2x_int()

int ade9113_disable_status2x_int ( struct ade9113_dev dev)

Disable STATUS2X interrupt.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_disable_v1_wav_ovrng_int()

int ade9113_disable_v1_wav_ovrng_int ( struct ade9113_dev dev)

Disable V1_WAV_OVRNG interrupt.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_disable_v2_wav_ovrng_int()

int ade9113_disable_v2_wav_ovrng_int ( struct ade9113_dev dev)

Disable V2_WAV_OVRNG interrupt.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_drdy_int_disable()

int ade9113_drdy_int_disable ( struct ade9113_dev dev)

DRDY inerrupt disable.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_drdy_int_enable()

int ade9113_drdy_int_enable ( struct ade9113_dev dev)

DRDY inerrupt enable.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ ade9113_efuse_refresh()

int ade9113_efuse_refresh ( struct ade9113_dev dev)

Refresh EFuse Memory.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_enable_adc_sync_done_int()

int ade9113_enable_adc_sync_done_int ( struct ade9113_dev dev)

Enable ADC_SYNC_DONE interrupt.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_enable_com_up_int()

int ade9113_enable_com_up_int ( struct ade9113_dev dev)

Enable COM_UP interrupt.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_enable_comflt_err_int()

int ade9113_enable_comflt_err_int ( struct ade9113_dev dev)

Enable COMFLT_ERR interrupt.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_enable_crc_chg_int()

int ade9113_enable_crc_chg_int ( struct ade9113_dev dev)

Enable CRC_CHG interrupt.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_enable_i_wav_ovrng_int()

int ade9113_enable_i_wav_ovrng_int ( struct ade9113_dev dev)

Enable I_WAV_OVRNG interrupt.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_enable_spi_crc_err_int()

int ade9113_enable_spi_crc_err_int ( struct ade9113_dev dev)

Enable SPI_CRC_ERR interrupt.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_enable_status1x_int()

int ade9113_enable_status1x_int ( struct ade9113_dev dev)

Enable STATUS1X interrupt.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_enable_status2x_int()

int ade9113_enable_status2x_int ( struct ade9113_dev dev)

Enable STATUS2X interrupt.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_enable_v1_wav_ovrng_int()

int ade9113_enable_v1_wav_ovrng_int ( struct ade9113_dev dev)

Enable V1_WAV_OVRNG interrupt.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_enable_v2_wav_ovrng_int()

int ade9113_enable_v2_wav_ovrng_int ( struct ade9113_dev dev)

Enable V2_WAV_OVRNG interrupt.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_force_crc_recalculation()

int ade9113_force_crc_recalculation ( struct ade9113_dev dev)

Force background register map CRC recalculation.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_get_adc_sync_done()

int ade9113_get_adc_sync_done ( struct ade9113_dev dev,
uint8_t *  status 
)

Get ADC_SYNC_DONE indicator.

Parameters
dev- The device structure.
status- Status indicator.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_get_com_up()

int ade9113_get_com_up ( struct ade9113_dev dev,
uint8_t *  status 
)

Get COM_UP indicator.

Parameters
dev- The device structure.
status- Status indicator.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_get_comflt_err()

int ade9113_get_comflt_err ( struct ade9113_dev dev,
uint8_t *  status 
)

Get COMFLT_ERR indicator.

Parameters
dev- The device structure.
status- Status indicator.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_get_crc()

int ade9113_get_crc ( struct ade9113_dev dev,
uint16_t *  crc 
)

Get register map CRC.

Parameters
dev- The device structure.
crc- CRC value.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_get_crc_chg()

int ade9113_get_crc_chg ( struct ade9113_dev dev,
uint8_t *  status 
)

Get CRC_CHG indicator.

Parameters
dev- The device structure.
status- Status indicator.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_get_crc_done_flag()

int ade9113_get_crc_done_flag ( struct ade9113_dev dev,
uint8_t *  status 
)

Get CRC_DONE indicator.

Parameters
dev- The device structure.
status- Status indicator.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
crc_en_state- Read CRC setting.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_get_efuse_mem_err()

int ade9113_get_efuse_mem_err ( struct ade9113_dev dev,
uint8_t *  status 
)

Get EFUSE_MEM_ERR indicator.

Parameters
dev- The device structure.
status- Status indicator.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_get_emi_hi_limit()

int ade9113_get_emi_hi_limit ( struct ade9113_dev dev,
uint8_t *  limit 
)

Get EMI HI limit.

Parameters
dev- The device structure.
limit- Read EMI HI limit.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_get_emi_hi_mask()

int ade9113_get_emi_hi_mask ( struct ade9113_dev dev,
uint8_t *  msk 
)

Get EMI HI mask.

Parameters
dev- The device structure.
msk- EMI HI mask.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_get_emi_lo_limit()

int ade9113_get_emi_lo_limit ( struct ade9113_dev dev,
uint8_t *  limit 
)

Get EMI LO limit.

Parameters
dev- The device structure.
limit- Read EMI LO limit.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_get_emi_lo_mask()

int ade9113_get_emi_lo_mask ( struct ade9113_dev dev,
uint8_t *  msk 
)

Get EMI LO mask.

Parameters
dev- The device structure.
msk- EMI LO mask.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_get_emi_mid_limit()

int ade9113_get_emi_mid_limit ( struct ade9113_dev dev,
uint8_t *  limit 
)

Get EMI MID limit.

Parameters
dev- The device structure.
limit- Read EMI MID limit.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
err_count- Read erro count.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_get_i_wav_ovrng()

int ade9113_get_i_wav_ovrng ( struct ade9113_dev dev,
uint8_t *  status 
)

Get I_WAV_OVRNG indicator.

Parameters
dev- The device structure.
status- Status indicator.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
addr- Register address.
msk- Interrupt mask.
status- Status indicator.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ 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.

Parameters
dev- The device structure.
status- Status indicator.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
status- Status indicator.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
status- Status indicator.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
status- Status indicator.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_get_iso_ecc_err()

int ade9113_get_iso_ecc_err ( struct ade9113_dev dev,
uint8_t *  status 
)

Get ISO_ECC_ERR indicator.

Parameters
dev- The device structure.
status- Status indicator.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
status- Status indicator.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
status- Status indicator.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_get_iso_phy_err()

int ade9113_get_iso_phy_err ( struct ade9113_dev dev,
uint8_t *  status 
)

Get ISO_PHY_ERR indicator.

Parameters
dev- The device structure.
status- Status indicator.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
status- Status indicator.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
status- Status indicator.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_get_reset_done()

int ade9113_get_reset_done ( struct ade9113_dev dev,
uint8_t *  status 
)

Get RESET_DONE indicator.

Parameters
dev- The device structure.
status- Status indicator.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_get_silicon_revision()

int ade9113_get_silicon_revision ( struct ade9113_dev dev,
uint8_t *  silicon_rev 
)

Get SILICON_REVISION value.

Parameters
dev- The device structure.
silicon_rev- Read silicon revision value.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_get_spi_crc_err()

int ade9113_get_spi_crc_err ( struct ade9113_dev dev,
uint8_t *  status 
)

Get SPI_CRC_ERR indicator.

Parameters
dev- The device structure.
status- Status indicator.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_get_status1x()

int ade9113_get_status1x ( struct ade9113_dev dev,
uint8_t *  status 
)

Get STATUS1 indicator.

Parameters
dev- The device structure.
status- Status indicator.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_get_status2x()

int ade9113_get_status2x ( struct ade9113_dev dev,
uint8_t *  status 
)

Get STATUS2 indicator.

Parameters
dev- The device structure.
status- Status indicator.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_get_statusx_val()

int ade9113_get_statusx_val ( struct ade9113_dev dev,
uint8_t  addr,
uint8_t *  status 
)

Get STATUSx register value.

Parameters
dev- The device structure.
addr- Register address.
status- 8-bit register value.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
stream_dbg- Read debug mode setting read.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_get_v1_wav_ovrng()

int ade9113_get_v1_wav_ovrng ( struct ade9113_dev dev,
uint8_t *  status 
)

Get V1_WAV_OVRNG indicator.

Parameters
dev- The device structure.
status- Status indicator.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_get_v2_wav_ovrng()

int ade9113_get_v2_wav_ovrng ( struct ade9113_dev dev,
uint8_t *  status 
)

Get V2_WAV_OVRNG indicator.

Parameters
dev- The device structure.
status- Status indicator.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_get_version_product()

int ade9113_get_version_product ( struct ade9113_dev dev,
uint8_t *  ver_product 
)

Get VERSION_PRODUCT value.

Parameters
dev- The device structure.
ver_product- VErsion product value.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ ade9113_get_wav()

int ade9113_get_wav ( struct ade9113_dev dev,
enum ade9113_wav_e  selection,
uint32_t *  val 
)

Get wave value.

Parameters
dev- The device structure.
selection- Wave selection.
val- Read I_WAV value.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_hw_reset()

int ade9113_hw_reset ( struct ade9113_dev dev)

Reset the device using SW reset.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_init()

int ade9113_init ( struct ade9113_dev **  device,
struct ade9113_init_param  init_param 
)

Initialize the device.

Parameters
device- The device structure.
init_param- The structure that contains the device initial parameters.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_invert_i_inputs()

int ade9113_invert_i_inputs ( struct ade9113_dev dev)

Invert I channel inputs.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_invert_i_inputs_disable()

int ade9113_invert_i_inputs_disable ( struct ade9113_dev dev)

Disable invert I channel inputs.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_invert_v1_inputs()

int ade9113_invert_v1_inputs ( struct ade9113_dev dev)

Invert V1 channel inputs.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_invert_v1_inputs_disable()

int ade9113_invert_v1_inputs_disable ( struct ade9113_dev dev)

Disable invert V1 channel inputs.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_invert_v2_inputs()

int ade9113_invert_v2_inputs ( struct ade9113_dev dev)

Invert V2 channel inputs.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_invert_v2_inputs_disable()

int ade9113_invert_v2_inputs_disable ( struct ade9113_dev dev)

Disable invert V2 channel inputs.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
reg_addr- The register address.
reg_data- The data read from the register.
op_mode- Long/short write operation.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ 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.

Parameters
dev- The device structure.
reg_addr- The register address.
reg_data- The data read from the register.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_read_scratchpad()

int ade9113_read_scratchpad ( struct ade9113_dev dev,
uint8_t *  val 
)

Get the value stired in the scratchpad register.

Parameters
dev- The device structure.
val- The read value.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_remove()

int ade9113_remove ( struct ade9113_dev dev)

Remove the device and release resources.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
cfg- Zero crossing channel selection.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
sel- Zero crossing edge selection.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
crc_en_state- Read CRC setting.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_set_data_increments_mode()

int ade9113_set_data_increments_mode ( struct ade9113_dev dev)

Set data increments mode of operation.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_set_dsp_config()

int ade9113_set_dsp_config ( struct ade9113_dev dev,
enum ade9113_datapath_config_e  config 
)

Set digital signal processing configuration.

Parameters
dev- The device structure.
config- The ADE9113 DSP configuration.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_set_emi_config()

int ade9113_set_emi_config ( struct ade9113_dev dev,
enum ade9113_emi_config_e  config 
)

Select EMI frequency hopping.

Parameters
dev- The device structure.
config- EMI frequency hopping selection.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_set_emi_hi_mask()

int ade9113_set_emi_hi_mask ( struct ade9113_dev dev,
uint8_t  msk 
)

Set EMI HI mask.

Parameters
dev- The device structure.
msk- EMI HI mask set.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_set_emi_lo_mask()

int ade9113_set_emi_lo_mask ( struct ade9113_dev dev,
uint8_t  msk 
)

Set EMI LO mask.

Parameters
dev- The device structure.
msk- EMI LO mask set.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_set_normal_mode()

int ade9113_set_normal_mode ( struct ade9113_dev dev)

Set normal mode of operation.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_set_static_mode()

int ade9113_set_static_mode ( struct ade9113_dev dev)

Set static mode of operation.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev- The device structure.
stream_dbg- Stream debug mode setting.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ ade9113_sw_reset()

int ade9113_sw_reset ( struct ade9113_dev dev)

Reset the device using SW reset.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_wr_lock()

int ade9113_wr_lock ( struct ade9113_dev dev)

Lock device.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_wr_unlock()

int ade9113_wr_unlock ( struct ade9113_dev dev)

Unlock device.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
dev-The device structure.
reg_addr- The register address.
reg_data- The data to be written.
op_mode- Long/short write operation.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ 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.

Parameters
dev-The device structure.
reg_addr- The register address.
reg_data- The data to be written (array with data for first device on position 0).
Returns
0 in case of success, negative error code otherwise.

◆ ade9113_write_scratchpad()

int ade9113_write_scratchpad ( struct ade9113_dev dev,
uint8_t  val 
)

Write value in the scratchpad register.

Parameters
dev- The device structure.
val- The value to be written.
Returns
0 in case of success, negative error code otherwise.