no-OS
Loading...
Searching...
No Matches
ad4080.h File Reference

Header file of AD4080 Driver. More...

#include <stdint.h>
#include <string.h>
#include "no_os_util.h"
#include "no_os_spi.h"
#include "no_os_gpio.h"
Include dependency graph for ad4080.h:

Classes

struct  ad4080_chip_info
 AD408x part-specific information. More...
 
struct  ad4080_spi_desc
 
struct  ad4080_gp_desc
 
struct  ad4080_dev
 ad4080 Device structure. More...
 
struct  ad4080_spi_init_param
 
struct  ad4080_gp_init_param
 
struct  ad4080_init_param
 ad4080 Device initialization parameters. More...
 

Macros

#define AD4080_REG_INTERFACE_CONFIG_A   0x0000
 
#define AD4080_REG_INTERFACE_CONFIG_B   0x0001
 
#define AD4080_REG_DEVICE_CONFIG   0x0002
 
#define AD4080_REG_CHIP_TYPE   0x0003
 
#define AD4080_REG_PRODUCT_ID_L   0x0004
 
#define AD4080_REG_PRODUCT_ID_H   0x0005
 
#define AD4080_REG_CHIP_GRADE   0x0006
 
#define AD4080_REG_SCRATCH_PAD   0x000A
 
#define AD4080_REG_SPI_REVISION   0x000B
 
#define AD4080_REG_VENDOR_L   0x000C
 
#define AD4080_REG_VENDOR_H   0x000D
 
#define AD4080_REG_STREAM_MODE   0x000E
 
#define AD4080_REG_TRANSFER_CONFIG   0x000F
 
#define AD4080_REG_INTERFACE_CONFIG_C   0x0010
 
#define AD4080_REG_INTERFACE_STATUS_A   0x0011
 
#define AD4080_REG_DEVICE_STATUS   0x0014
 
#define AD4080_REG_DATA_INTF_CONFIG_A   0x0015
 
#define AD4080_REG_DATA_INTF_CONFIG_B   0x0016
 
#define AD4080_REG_DATA_INTF_CONFIG_C   0x0017
 
#define AD4080_REG_PWR_CTRL   0x0018
 
#define AD4080_REG_GPIO_CONFIG_A   0x0019
 
#define AD4080_REG_GPIO_CONFIG_B   0x001A
 
#define AD4080_REG_GPIO_CONFIG_C   0x001B
 
#define AD4080_REG_GENERAL_CONFIG   0x001C
 
#define AD4080_REG_FIFO_WATERMARK   0x001D
 
#define AD4080_REG_EVENT_HYSTERESIS   0x001F
 
#define AD4080_REG_EVENT_DETECTION_HI   0x0021
 
#define AD4080_REG_EVENT_DETECTION_LO   0x0023
 
#define AD4080_REG_OFFSET   0x0025
 
#define AD4080_REG_GAIN   0x0027
 
#define AD4080_REG_FILTER_CONFIG   0x0029
 
#define AD4080_SW_RESET_MSK   NO_OS_BIT(7) | NO_OS_BIT(0)
 
#define AD4080_ADDR_ASC_MSK   NO_OS_BIT(5)
 
#define AD4080_SDO_ENABLE_MSK   NO_OS_BIT(4)
 
#define AD4080_SINGLE_INST_MSK   NO_OS_BIT(7)
 
#define AD4080_SHORT_INST_MSK   NO_OS_BIT(3)
 
#define AD4080_OP_MODE_MSK   NO_OS_GENMASK(1, 0)
 
#define AD4080_KEEP_STREAM_LEN_VAL_MSK   NO_OS_BIT(2)
 
#define AD4080_STRICT_REG_ACCESS_MSK   NO_OS_BIT(5)
 
#define AD4080_FIFO_FULL_MSK   NO_OS_BIT(7)
 
#define AD4080_FIFO_READ_DONE_MSK   NO_OS_BIT(6)
 
#define AD4080_THRESHOLD_STATUS_MSK   NO_OS_GENMASK(5, 4)
 
#define AD4080_INTF_CHK_EN_MSK   NO_OS_BIT(4)
 
#define AD4080_SPI_LVDS_LANES_MSK   NO_OS_BIT(2)
 
#define AD4080_DATA_INTF_MODE_MSK   NO_OS_BIT(0)
 
#define AD4080_LVDS_CNV_CLK_CNT_MSK   NO_OS_GENMASK(7, 4)
 
#define AD4080_LVDS_SELF_CLK_MODE_MSK   NO_OS_BIT(3)
 
#define AD4080_LVDS_CNV_EN   NO_OS_BIT(0)
 
#define AD4080_LVDS_VOD_MSK   NO_OS_GENMASK(6, 4)
 
#define AD4080_ANA_DIG_LDO_PD_MSK   NO_OS_BIT(1)
 
#define AD4080_INTF_LDO_PD_MSK   NO_OS_BIT(0)
 
#define AD4080_GPIO_EN_MSK(x)
 
#define AD4080_GPIO_SEL_MSK(x)
 
#define AD4080_GPIO_DATA_MSK(x)
 
#define AD4080_INT_EVENT_EN_MSK   NO_OS_BIT(7)
 
#define AD4080_LO_HI_ROUTE_MSK   NO_OS_GENMASK(6, 5)
 
#define AD4080_FIFO_MODE_MSK   NO_OS_GENMASK(1, 0)
 
#define AD4080_FILTER_SEL_MSK   NO_OS_GENMASK(1, 0)
 
#define AD4080_SINC_DECIMATION_MSK   NO_OS_GENMASK(6, 3)
 
#define AD4080_FILTER_SINC1   1
 
#define AD4080_FILTER_SINC5   2
 
#define AD4080_FILTER_SINC5_PLUS   3
 
#define AD4080_SINC_DEC_2   0
 
#define AD4080_SINC_DEC_4   1
 
#define AD4080_SINC_DEC_8   2
 
#define AD4080_SINC_DEC_16   3
 
#define AD4080_SINC_DEC_32   4
 
#define AD4080_SINC_DEC_64   5
 
#define AD4080_SINC_DEC_128   6
 
#define AD4080_SINC_DEC_256   7
 
#define AD4080_SINC_DEC_512   8
 
#define AD4080_SINC_DEC_1024   9
 
#define AD4080_SW_RESET   NO_OS_BIT(7) | NO_OS_BIT(0)
 
#define AD4080_SPI_READ   NO_OS_BIT(7)
 
#define BYTE_ADDR_H   NO_OS_GENMASK(15, 8)
 
#define BYTE_ADDR_L   NO_OS_GENMASK(7, 0)
 
#define AD4080_CHIP_ID   NO_OS_GENMASK(2, 0)
 
#define AD4080_PRODUCT_ID   0x0050
 
#define AD4081_PRODUCT_ID   0x0051
 
#define AD4082_PRODUCT_ID   0x0052
 
#define AD4083_PRODUCT_ID   0x0053
 
#define AD4085_PRODUCT_ID   0x0055
 
#define AD4086_PRODUCT_ID   0x0056
 
#define AD4087_PRODUCT_ID   0x0057
 
#define AD4088_PRODUCT_ID   0x0058
 
#define AD4080_FIFO_SIZE   NO_OS_BIT(14)
 
#define AD4080_FIFO_DEPTH   16384 /* AD4080 is 16K deep maximum */
 
#define AD4080_MAX_FIFO_WATERMARK   (AD4080_FIFO_DEPTH)
 
#define AD4080_LAST_REG_ADDR   AD4080_REG_FILTER_CONFIG
 
#define AD4080_ADC_GRANULARITY   20 /* 20 Bits precision */
 
#define ADC_REF_VOLTAGE   3000 /* mV granularity */
 
#define AD4080_ADC_MAX_RESOLUTION_VAL   ((1 << AD4080_ADC_GRANULARITY) - 1)
 
#define OFFSET_CORRECTION_NEGATIVE_LIMIT   0x800
 

Enumerations

enum  ad4080_addr_asc {
  AD4080_ADDR_DECR ,
  AD4080_ADDR_INCR
}
 
enum  ad4080_single_instr {
  AD4080_STREAM_MODE ,
  AD4080_SINGLE_INST
}
 
enum  ad4080_short_instr {
  AD4080_15_BIT_ADDR ,
  AD4080_7_BIT_ADDR
}
 
enum  ad4080_op_mode {
  AD4080_OP_NORMAL = 0 ,
  AD4080_OP_STANDBY = 2 ,
  AD4080_OP_LOW_POWER = 3
}
 
enum  ad4080_strict_reg_access {
  AD4080_REG_NORMAL_MODE ,
  AD4080_REG_STRICT_MODE
}
 
enum  ad4080_intf_chk_en {
  AD4080_DATA ,
  AD4080_FIXED_PATTERN
}
 
enum  ad4080_cnv_spi_lvds_lanes {
  AD4080_ONE_LANE ,
  AD4080_MULTIPLE_LANES
}
 
enum  ad4080_conv_data_spi_lvds {
  AD4080_CONV_DATA_LVDS ,
  AD4080_CONV_DATA_SPI
}
 
enum  ad4080_lvds_self_clk_mode {
  AD4080_ECHO_CLK_MODE ,
  AD4080_SELF_CLK_MODE
}
 
enum  ad4080_lvds_cnv_clk_mode {
  AD4080_CNV_CMOS_MODE ,
  AD4080_CNV_LVDS_MODE
}
 
enum  ad4080_lvds_vod {
  AD4080_185mVPP = 1 ,
  AD4080_240mVPP = 2 ,
  AD4080_325mVPP = 4
}
 
enum  ad4080_ana_dig_ldo_pd {
  AD4080_AD_LDO_EN ,
  AD4080_AD_LDO_DISABLE
}
 
enum  ad4080_intf_ldo_pd {
  AD4080_INTF_LDO_EN ,
  AD4080_INTF_LDO_DISABLE
}
 
enum  ad4080_gpio {
  AD4080_GPIO_0 ,
  AD4080_GPIO_1 ,
  AD4080_GPIO_2 ,
  AD4080_GPIO_3 ,
  NUM_AD4080_GPIO
}
 
enum  ad4080_gpio_op_enable {
  AD4080_GPIO_INPUT ,
  AD4080_GPIO_OUTPUT
}
 
enum  ad4080_gpio_op_func_sel {
  AD4080_GPIO_ADI_NSPI_SDO_DATA ,
  AD4080_GPIO_FIFO_FULL ,
  AD4080_GPIO_FIFO_READ_DONE ,
  AD4080_GPIO_FILTER_RESULT_READY ,
  AD4080_GPIO_HT_DETECT ,
  AD4080_GPIO_LT_DETECT ,
  AD4080_GPIO_STATUS_ALERT ,
  AD4080_GPIO_GPO_DATA ,
  AD4080_GPIO_FILTER_SYNC_INPUT ,
  AD4080_GPIO_EXT_EVENT_TRIGGER_FIFO ,
  AD4080_GPIO_CNV_INHIBIT_INPUT
}
 
enum  ad4080_fifo_mode {
  AD4080_FIFO_DISABLE ,
  AD4080_IMMEDIATE_TRIGGER ,
  AD4080_EVENT_TRIGGER_LAST_WM ,
  AD4080_EVENT_TRIGGER
}
 
enum  ad4080_id {
  ID_AD4080 ,
  ID_AD4081 ,
  ID_AD4082 ,
  ID_AD4083 ,
  ID_AD4085 ,
  ID_AD4086 ,
  ID_AD4087 ,
  ID_AD4088 ,
  NUM_AD4080_DEVICES
}
 

Functions

int ad4080_read_data (struct ad4080_dev *dev, uint8_t *buf, size_t len)
 Read from the AD4080 FIFO.
 
int ad4080_write (struct ad4080_dev *dev, uint16_t reg_addr, uint8_t reg_val)
 Write device register.
 
int ad4080_read (struct ad4080_dev *dev, uint16_t reg_addr, uint8_t *reg_val)
 Read device register.
 
int ad4080_update_bits (struct ad4080_dev *dev, uint16_t reg_addr, uint8_t mask, uint8_t reg_val)
 Update specific register bits.
 
int ad4080_soft_reset (struct ad4080_dev *dev)
 Software reset the device.
 
int ad4080_set_addr_asc (struct ad4080_dev *dev, enum ad4080_addr_asc addr_asc)
 Set Address Ascension.
 
int ad4080_get_addr_asc (struct ad4080_dev *dev, enum ad4080_addr_asc *addr_asc)
 Get Address Ascension.
 
int ad4080_set_single_instr (struct ad4080_dev *dev, enum ad4080_single_instr single_instr)
 Set Single/Streaming Mode.
 
int ad4080_get_single_instr (struct ad4080_dev *dev, enum ad4080_single_instr *single_instr)
 Get Single/Streaming Mode.
 
int ad4080_set_short_instr (struct ad4080_dev *dev, enum ad4080_short_instr short_instr)
 Set Short Instruction.
 
int ad4080_get_short_instr (struct ad4080_dev *dev, enum ad4080_short_instr *short_instr)
 Get Short Instruction.
 
int ad4080_set_op_mode (struct ad4080_dev *dev, enum ad4080_op_mode op_mode)
 Set Operation Mode.
 
int ad4080_get_op_mode (struct ad4080_dev *dev, enum ad4080_op_mode *op_mode)
 Get Operation Mode.
 
int ad4080_set_strict_reg_access (struct ad4080_dev *dev, enum ad4080_strict_reg_access strict_reg)
 Set Strict Register Access.
 
int ad4080_get_strict_reg_access (struct ad4080_dev *dev, enum ad4080_strict_reg_access *strict_reg)
 Get Strict Register Access.
 
int ad4080_set_intf_chk_en (struct ad4080_dev *dev, enum ad4080_intf_chk_en intf_chk_en)
 Set AD4080 Output Pattern.
 
int ad4080_get_intf_chk_en (struct ad4080_dev *dev, enum ad4080_intf_chk_en *intf_chk_en)
 Get AD4080 Output Pattern.
 
int ad4080_set_cnv_spi_lvds_lanes (struct ad4080_dev *dev, enum ad4080_cnv_spi_lvds_lanes cnv_spi_lvds_lanes)
 Set AD4080 LVDS/SPI Lane Control.
 
int ad4080_get_cnv_spi_lvds_lanes (struct ad4080_dev *dev, enum ad4080_cnv_spi_lvds_lanes *cnv_spi_lvds_lanes)
 Get AD4080 LVDS/SPI Lane Control.
 
int ad4080_set_conv_data_spi_lvds (struct ad4080_dev *dev, enum ad4080_conv_data_spi_lvds conv_data_spi_lvds)
 Set AD4080 Data Interface Configuration.
 
int ad4080_get_conv_data_spi_lvds (struct ad4080_dev *dev, enum ad4080_conv_data_spi_lvds *conv_data_spi_lvds)
 Get AD4080 Data Interface Configuration.
 
int ad4080_set_lvds_cnv_clk_cnt (struct ad4080_dev *dev, uint8_t lvds_cnv_clk_cnt)
 Set AD4080 Interface clock periods from CNV rising edge.
 
int ad4080_get_lvds_cnv_clk_cnt (struct ad4080_dev *dev, uint8_t *lvds_cnv_clk_cnt)
 Get AD4080 Interface clock periods from CNV rising edge.
 
int ad4080_set_lvds_self_clk_mode (struct ad4080_dev *dev, enum ad4080_lvds_self_clk_mode lvds_self_clk_mode)
 Set AD4080 LVDS Self Clock Mode.
 
int ad4080_get_lvds_self_clk_mode (struct ad4080_dev *dev, enum ad4080_lvds_self_clk_mode *lvds_self_clk_mode)
 Get AD4080 LVDS Self Clock Mode.
 
int ad4080_set_lvds_cnv_clk_mode (struct ad4080_dev *dev, enum ad4080_lvds_cnv_clk_mode cnv_clk_mode)
 Set AD4080 LVDS CNV Clock Mode.
 
int ad4080_get_lvds_cnv_clk_mode (struct ad4080_dev *dev, enum ad4080_lvds_cnv_clk_mode *cnv_clk_mode)
 Get AD4080 LVDS CNV Clock Mode.
 
int ad4080_set_lvds_vod (struct ad4080_dev *dev, enum ad4080_lvds_vod lvds_vod)
 Set AD4080 LVDS Differential Output Voltage.
 
int ad4080_get_lvds_vod (struct ad4080_dev *dev, enum ad4080_lvds_vod *lvds_vod)
 Get AD4080 LVDS Differential Output Voltage.
 
int ad4080_set_ana_dig_ldo_pd (struct ad4080_dev *dev, enum ad4080_ana_dig_ldo_pd ana_dig_ldo_pd)
 Set AD4080 Analog/Digital LDO.
 
int ad4080_get_ana_dig_ldo_pd (struct ad4080_dev *dev, enum ad4080_ana_dig_ldo_pd *ana_dig_ldo_pd)
 Get AD4080 Analog/Digital LDO.
 
int ad4080_set_intf_ldo_pd (struct ad4080_dev *dev, enum ad4080_intf_ldo_pd intf_ldo_pd)
 Set AD4080 Interface LDO.
 
int ad4080_get_intf_ldo_pd (struct ad4080_dev *dev, enum ad4080_intf_ldo_pd *intf_ldo_pd)
 Get AD4080 Interface LDO.
 
int ad4080_set_fifo_mode (struct ad4080_dev *dev, enum ad4080_fifo_mode fifo_mode)
 Set AD4080 Conversion Data FIFO Mode.
 
int ad4080_get_fifo_mode (struct ad4080_dev *dev, enum ad4080_fifo_mode *fifo_mode)
 Get Set AD4080 Conversion Data FIFO Mode.
 
int ad4080_set_fifo_watermark (struct ad4080_dev *dev, uint16_t fifo_watermark)
 Set AD4080 FIFO Watermark.
 
int ad4080_get_fifo_watermark (struct ad4080_dev *dev, uint16_t *fifo_watermark)
 Get AD4080 FIFO Watermark.
 
int ad4080_set_gpio_output_enable (struct ad4080_dev *dev, enum ad4080_gpio gpio, enum ad4080_gpio_op_enable gpio_op_enable)
 Configure GPIO as input or output.
 
int ad4080_set_gpio_output_func (struct ad4080_dev *dev, enum ad4080_gpio gpio, enum ad4080_gpio_op_func_sel gpio_func)
 Configure the GPIO output for a specific function.
 
int ad4080_gpio_write_data (struct ad4080_dev *dev, enum ad4080_gpio gpio, bool data)
 Set the GPIO data.
 
int ad4080_gpio_read_data (struct ad4080_dev *dev, enum ad4080_gpio gpio, bool *data)
 Read the GPIO data.
 
int ad4080_configuration_intf_init (struct ad4080_dev *device, struct ad4080_init_param init_param)
 Configure the config SPI interface during initialization.
 
int ad4080_data_intf_init (struct ad4080_dev *device, struct ad4080_init_param init_param)
 Configure the data interface during initialization.
 
int ad4080_init (struct ad4080_dev **device, struct ad4080_init_param init_param)
 Initialize the device.
 
int ad4080_remove (struct ad4080_dev *dev)
 Remove the device and release resources.
 

Variables

const struct ad4080_chip_info ad4080_chip_info_tbl [NUM_AD4080_DEVICES]
 

Detailed Description

Header file of AD4080 Driver.

Author
Antoniu Miclaus (anton.nosp@m.iu.m.nosp@m.iclau.nosp@m.s@an.nosp@m.alog..nosp@m.com)
Niel Acuna (niel..nosp@m.acun.nosp@m.a@ana.nosp@m.log..nosp@m.com)

Copyright 2023-2025(c) Analog Devices, Inc.

SPDX-License-Identifier: BSD-3-Clause

Macro Definition Documentation

◆ AD4080_ADC_GRANULARITY

#define AD4080_ADC_GRANULARITY   20 /* 20 Bits precision */

◆ AD4080_ADC_MAX_RESOLUTION_VAL

#define AD4080_ADC_MAX_RESOLUTION_VAL   ((1 << AD4080_ADC_GRANULARITY) - 1)

◆ AD4080_ADDR_ASC_MSK

#define AD4080_ADDR_ASC_MSK   NO_OS_BIT(5)

◆ AD4080_ANA_DIG_LDO_PD_MSK

#define AD4080_ANA_DIG_LDO_PD_MSK   NO_OS_BIT(1)

AD4080_REG_PWR_CTRL Bit Definition

◆ AD4080_CHIP_ID

#define AD4080_CHIP_ID   NO_OS_GENMASK(2, 0)

◆ AD4080_DATA_INTF_MODE_MSK

#define AD4080_DATA_INTF_MODE_MSK   NO_OS_BIT(0)

◆ AD4080_FIFO_DEPTH

#define AD4080_FIFO_DEPTH   16384 /* AD4080 is 16K deep maximum */

◆ AD4080_FIFO_FULL_MSK

#define AD4080_FIFO_FULL_MSK   NO_OS_BIT(7)

AD4080_REG_DEVICE_STATUS Bit Definition

◆ AD4080_FIFO_MODE_MSK

#define AD4080_FIFO_MODE_MSK   NO_OS_GENMASK(1, 0)

◆ AD4080_FIFO_READ_DONE_MSK

#define AD4080_FIFO_READ_DONE_MSK   NO_OS_BIT(6)

◆ AD4080_FIFO_SIZE

#define AD4080_FIFO_SIZE   NO_OS_BIT(14)

◆ AD4080_FILTER_SEL_MSK

#define AD4080_FILTER_SEL_MSK   NO_OS_GENMASK(1, 0)

AD4080_REG_FILTER_CONFIG Bit Definition

◆ AD4080_FILTER_SINC1

#define AD4080_FILTER_SINC1   1

◆ AD4080_FILTER_SINC5

#define AD4080_FILTER_SINC5   2

◆ AD4080_FILTER_SINC5_PLUS

#define AD4080_FILTER_SINC5_PLUS   3

◆ AD4080_GPIO_DATA_MSK

#define AD4080_GPIO_DATA_MSK ( x)
Value:
(NO_OS_BIT(x) << 4)
#define NO_OS_BIT(x)
Definition no_os_util.h:23

◆ AD4080_GPIO_EN_MSK

#define AD4080_GPIO_EN_MSK ( x)
Value:

AD4080_GPIO_CONFIG Bit Defintion

◆ AD4080_GPIO_SEL_MSK

#define AD4080_GPIO_SEL_MSK ( x)
Value:
(NO_OS_GENMASK(3, 0) << (4 * ((x)%2)))
#define NO_OS_GENMASK(h, l)
Definition no_os_util.h:60

◆ AD4080_INT_EVENT_EN_MSK

#define AD4080_INT_EVENT_EN_MSK   NO_OS_BIT(7)

AD4080_REG_GENERAL_CONFIG Bit Definition

◆ AD4080_INTF_CHK_EN_MSK

#define AD4080_INTF_CHK_EN_MSK   NO_OS_BIT(4)

AD4080_REG_DATA_INTF_CONFIG_A Bit Definition

◆ AD4080_INTF_LDO_PD_MSK

#define AD4080_INTF_LDO_PD_MSK   NO_OS_BIT(0)

◆ AD4080_KEEP_STREAM_LEN_VAL_MSK

#define AD4080_KEEP_STREAM_LEN_VAL_MSK   NO_OS_BIT(2)

AD4080_REG_TRANSFER_CONFIG Bit Definition

◆ AD4080_LAST_REG_ADDR

#define AD4080_LAST_REG_ADDR   AD4080_REG_FILTER_CONFIG

◆ AD4080_LO_HI_ROUTE_MSK

#define AD4080_LO_HI_ROUTE_MSK   NO_OS_GENMASK(6, 5)

◆ AD4080_LVDS_CNV_CLK_CNT_MSK

#define AD4080_LVDS_CNV_CLK_CNT_MSK   NO_OS_GENMASK(7, 4)

AD4080_REG_DATA_INTF_CONFIG_B Bit Definition

◆ AD4080_LVDS_CNV_EN

#define AD4080_LVDS_CNV_EN   NO_OS_BIT(0)

◆ AD4080_LVDS_SELF_CLK_MODE_MSK

#define AD4080_LVDS_SELF_CLK_MODE_MSK   NO_OS_BIT(3)

◆ AD4080_LVDS_VOD_MSK

#define AD4080_LVDS_VOD_MSK   NO_OS_GENMASK(6, 4)

AD4080_REG_DATA_INTF_CONFIG_C Bit Definition

◆ AD4080_MAX_FIFO_WATERMARK

#define AD4080_MAX_FIFO_WATERMARK   (AD4080_FIFO_DEPTH)

◆ AD4080_OP_MODE_MSK

#define AD4080_OP_MODE_MSK   NO_OS_GENMASK(1, 0)

AD4080_REG_DEVICE_CONFIG Bit Definition

◆ AD4080_PRODUCT_ID

#define AD4080_PRODUCT_ID   0x0050

AD408x Product IDs (PRODUCT_ID_H:PRODUCT_ID_L)

◆ AD4080_REG_CHIP_GRADE

#define AD4080_REG_CHIP_GRADE   0x0006

◆ AD4080_REG_CHIP_TYPE

#define AD4080_REG_CHIP_TYPE   0x0003

◆ AD4080_REG_DATA_INTF_CONFIG_A

#define AD4080_REG_DATA_INTF_CONFIG_A   0x0015

◆ AD4080_REG_DATA_INTF_CONFIG_B

#define AD4080_REG_DATA_INTF_CONFIG_B   0x0016

◆ AD4080_REG_DATA_INTF_CONFIG_C

#define AD4080_REG_DATA_INTF_CONFIG_C   0x0017

◆ AD4080_REG_DEVICE_CONFIG

#define AD4080_REG_DEVICE_CONFIG   0x0002

◆ AD4080_REG_DEVICE_STATUS

#define AD4080_REG_DEVICE_STATUS   0x0014

◆ AD4080_REG_EVENT_DETECTION_HI

#define AD4080_REG_EVENT_DETECTION_HI   0x0021

◆ AD4080_REG_EVENT_DETECTION_LO

#define AD4080_REG_EVENT_DETECTION_LO   0x0023

◆ AD4080_REG_EVENT_HYSTERESIS

#define AD4080_REG_EVENT_HYSTERESIS   0x001F

◆ AD4080_REG_FIFO_WATERMARK

#define AD4080_REG_FIFO_WATERMARK   0x001D

◆ AD4080_REG_FILTER_CONFIG

#define AD4080_REG_FILTER_CONFIG   0x0029

◆ AD4080_REG_GAIN

#define AD4080_REG_GAIN   0x0027

◆ AD4080_REG_GENERAL_CONFIG

#define AD4080_REG_GENERAL_CONFIG   0x001C

◆ AD4080_REG_GPIO_CONFIG_A

#define AD4080_REG_GPIO_CONFIG_A   0x0019

◆ AD4080_REG_GPIO_CONFIG_B

#define AD4080_REG_GPIO_CONFIG_B   0x001A

◆ AD4080_REG_GPIO_CONFIG_C

#define AD4080_REG_GPIO_CONFIG_C   0x001B

◆ AD4080_REG_INTERFACE_CONFIG_A

#define AD4080_REG_INTERFACE_CONFIG_A   0x0000

Register Definition

◆ AD4080_REG_INTERFACE_CONFIG_B

#define AD4080_REG_INTERFACE_CONFIG_B   0x0001

◆ AD4080_REG_INTERFACE_CONFIG_C

#define AD4080_REG_INTERFACE_CONFIG_C   0x0010

◆ AD4080_REG_INTERFACE_STATUS_A

#define AD4080_REG_INTERFACE_STATUS_A   0x0011

◆ AD4080_REG_OFFSET

#define AD4080_REG_OFFSET   0x0025

◆ AD4080_REG_PRODUCT_ID_H

#define AD4080_REG_PRODUCT_ID_H   0x0005

◆ AD4080_REG_PRODUCT_ID_L

#define AD4080_REG_PRODUCT_ID_L   0x0004

◆ AD4080_REG_PWR_CTRL

#define AD4080_REG_PWR_CTRL   0x0018

◆ AD4080_REG_SCRATCH_PAD

#define AD4080_REG_SCRATCH_PAD   0x000A

◆ AD4080_REG_SPI_REVISION

#define AD4080_REG_SPI_REVISION   0x000B

◆ AD4080_REG_STREAM_MODE

#define AD4080_REG_STREAM_MODE   0x000E

◆ AD4080_REG_TRANSFER_CONFIG

#define AD4080_REG_TRANSFER_CONFIG   0x000F

◆ AD4080_REG_VENDOR_H

#define AD4080_REG_VENDOR_H   0x000D

◆ AD4080_REG_VENDOR_L

#define AD4080_REG_VENDOR_L   0x000C

◆ AD4080_SDO_ENABLE_MSK

#define AD4080_SDO_ENABLE_MSK   NO_OS_BIT(4)

◆ AD4080_SHORT_INST_MSK

#define AD4080_SHORT_INST_MSK   NO_OS_BIT(3)

◆ AD4080_SINC_DEC_1024

#define AD4080_SINC_DEC_1024   9

◆ AD4080_SINC_DEC_128

#define AD4080_SINC_DEC_128   6

◆ AD4080_SINC_DEC_16

#define AD4080_SINC_DEC_16   3

◆ AD4080_SINC_DEC_2

#define AD4080_SINC_DEC_2   0

◆ AD4080_SINC_DEC_256

#define AD4080_SINC_DEC_256   7

◆ AD4080_SINC_DEC_32

#define AD4080_SINC_DEC_32   4

◆ AD4080_SINC_DEC_4

#define AD4080_SINC_DEC_4   1

◆ AD4080_SINC_DEC_512

#define AD4080_SINC_DEC_512   8

◆ AD4080_SINC_DEC_64

#define AD4080_SINC_DEC_64   5

◆ AD4080_SINC_DEC_8

#define AD4080_SINC_DEC_8   2

◆ AD4080_SINC_DECIMATION_MSK

#define AD4080_SINC_DECIMATION_MSK   NO_OS_GENMASK(6, 3)

◆ AD4080_SINGLE_INST_MSK

#define AD4080_SINGLE_INST_MSK   NO_OS_BIT(7)

AD4080_REG_INTERFACE_CONFIG_B Bit Definition

◆ AD4080_SPI_LVDS_LANES_MSK

#define AD4080_SPI_LVDS_LANES_MSK   NO_OS_BIT(2)

◆ AD4080_SPI_READ

#define AD4080_SPI_READ   NO_OS_BIT(7)

◆ AD4080_STRICT_REG_ACCESS_MSK

#define AD4080_STRICT_REG_ACCESS_MSK   NO_OS_BIT(5)

AD4080_REG_INTERFACE_CONFIG_C Bit Definition

◆ AD4080_SW_RESET

#define AD4080_SW_RESET   NO_OS_BIT(7) | NO_OS_BIT(0)

Miscellaneous Definitions

◆ AD4080_SW_RESET_MSK

#define AD4080_SW_RESET_MSK   NO_OS_BIT(7) | NO_OS_BIT(0)

AD4080_REG_INTERFACE_CONFIG_A Bit Definition

◆ AD4080_THRESHOLD_STATUS_MSK

#define AD4080_THRESHOLD_STATUS_MSK   NO_OS_GENMASK(5, 4)

◆ AD4081_PRODUCT_ID

#define AD4081_PRODUCT_ID   0x0051

◆ AD4082_PRODUCT_ID

#define AD4082_PRODUCT_ID   0x0052

◆ AD4083_PRODUCT_ID

#define AD4083_PRODUCT_ID   0x0053

◆ AD4085_PRODUCT_ID

#define AD4085_PRODUCT_ID   0x0055

◆ AD4086_PRODUCT_ID

#define AD4086_PRODUCT_ID   0x0056

◆ AD4087_PRODUCT_ID

#define AD4087_PRODUCT_ID   0x0057

◆ AD4088_PRODUCT_ID

#define AD4088_PRODUCT_ID   0x0058

◆ ADC_REF_VOLTAGE

#define ADC_REF_VOLTAGE   3000 /* mV granularity */

◆ BYTE_ADDR_H

#define BYTE_ADDR_H   NO_OS_GENMASK(15, 8)

◆ BYTE_ADDR_L

#define BYTE_ADDR_L   NO_OS_GENMASK(7, 0)

◆ OFFSET_CORRECTION_NEGATIVE_LIMIT

#define OFFSET_CORRECTION_NEGATIVE_LIMIT   0x800

Enumeration Type Documentation

◆ ad4080_addr_asc

AD4080 Sequential Addressing Behavior

Enumerator
AD4080_ADDR_DECR 
AD4080_ADDR_INCR 

◆ ad4080_ana_dig_ldo_pd

AD4080 Analog/Digital LDO

Enumerator
AD4080_AD_LDO_EN 
AD4080_AD_LDO_DISABLE 

◆ ad4080_cnv_spi_lvds_lanes

AD4080 LVDS/SPI Lane Control.

Enumerator
AD4080_ONE_LANE 
AD4080_MULTIPLE_LANES 

◆ ad4080_conv_data_spi_lvds

AD4080 Data Interface Configuration

Enumerator
AD4080_CONV_DATA_LVDS 
AD4080_CONV_DATA_SPI 

◆ ad4080_fifo_mode

AD4080 Conversion Data FIFO Mode

Enumerator
AD4080_FIFO_DISABLE 
AD4080_IMMEDIATE_TRIGGER 
AD4080_EVENT_TRIGGER_LAST_WM 
AD4080_EVENT_TRIGGER 

◆ ad4080_gpio

Enumerator
AD4080_GPIO_0 
AD4080_GPIO_1 
AD4080_GPIO_2 
AD4080_GPIO_3 
NUM_AD4080_GPIO 

◆ ad4080_gpio_op_enable

Enumerator
AD4080_GPIO_INPUT 
AD4080_GPIO_OUTPUT 

◆ ad4080_gpio_op_func_sel

AD4080 GPIO Function Select

Enumerator
AD4080_GPIO_ADI_NSPI_SDO_DATA 
AD4080_GPIO_FIFO_FULL 
AD4080_GPIO_FIFO_READ_DONE 
AD4080_GPIO_FILTER_RESULT_READY 
AD4080_GPIO_HT_DETECT 
AD4080_GPIO_LT_DETECT 
AD4080_GPIO_STATUS_ALERT 
AD4080_GPIO_GPO_DATA 
AD4080_GPIO_FILTER_SYNC_INPUT 
AD4080_GPIO_EXT_EVENT_TRIGGER_FIFO 
AD4080_GPIO_CNV_INHIBIT_INPUT 

◆ ad4080_id

enum ad4080_id

AD408x Supported Device IDs

Enumerator
ID_AD4080 
ID_AD4081 
ID_AD4082 
ID_AD4083 
ID_AD4085 
ID_AD4086 
ID_AD4087 
ID_AD4088 
NUM_AD4080_DEVICES 

◆ ad4080_intf_chk_en

AD4080 Output Pattern

Enumerator
AD4080_DATA 
AD4080_FIXED_PATTERN 

◆ ad4080_intf_ldo_pd

AD4080 Interface LDO

Enumerator
AD4080_INTF_LDO_EN 
AD4080_INTF_LDO_DISABLE 

◆ ad4080_lvds_cnv_clk_mode

AD4080 LVDS CNV Clock Mode

Enumerator
AD4080_CNV_CMOS_MODE 
AD4080_CNV_LVDS_MODE 

◆ ad4080_lvds_self_clk_mode

AD4080 LVDS Self Clock Mode

Enumerator
AD4080_ECHO_CLK_MODE 
AD4080_SELF_CLK_MODE 

◆ ad4080_lvds_vod

AD4080 LVDS Differential Output Voltage

Enumerator
AD4080_185mVPP 
AD4080_240mVPP 
AD4080_325mVPP 

◆ ad4080_op_mode

AD4080 Operation Mode

Enumerator
AD4080_OP_NORMAL 
AD4080_OP_STANDBY 
AD4080_OP_LOW_POWER 

◆ ad4080_short_instr

AD4080 Short Instruction

Enumerator
AD4080_15_BIT_ADDR 
AD4080_7_BIT_ADDR 

◆ ad4080_single_instr

AD4080 Single/Streaming Mode

Enumerator
AD4080_STREAM_MODE 
AD4080_SINGLE_INST 

◆ ad4080_strict_reg_access

AD4080 Strict Register Access

Enumerator
AD4080_REG_NORMAL_MODE 
AD4080_REG_STRICT_MODE 

Function Documentation

◆ ad4080_configuration_intf_init()

int ad4080_configuration_intf_init ( struct ad4080_dev * dev,
struct ad4080_init_param init_param )

Configure the config SPI interface during initialization.

Configure the config SPI interface during initialization

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

◆ ad4080_data_intf_init()

int ad4080_data_intf_init ( struct ad4080_dev * dev,
struct ad4080_init_param init_param )

Configure the data interface during initialization.

Configure the data interface during initialization

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

◆ ad4080_get_addr_asc()

int ad4080_get_addr_asc ( struct ad4080_dev * dev,
enum ad4080_addr_asc * addr_asc )

Get Address Ascension.

Get Address Ascension

Parameters
dev- The device structure.
addr_asc- The address ascension mode.
Returns
Address ascension value

◆ ad4080_get_ana_dig_ldo_pd()

int ad4080_get_ana_dig_ldo_pd ( struct ad4080_dev * dev,
enum ad4080_ana_dig_ldo_pd * ana_dig_ldo_pd )

Get AD4080 Analog/Digital LDO.

Get AD4080 Analog/Digital LDO

Parameters
dev- The device structure.
ana_dig_ldo_pd- The Analog/Digital LDO value
Returns
MSPI Analog/Digital LDO value

◆ ad4080_get_cnv_spi_lvds_lanes()

int ad4080_get_cnv_spi_lvds_lanes ( struct ad4080_dev * dev,
enum ad4080_cnv_spi_lvds_lanes * cnv_spi_lvds_lanes )

Get AD4080 LVDS/SPI Lane Control.

Get AD4080 LVDS/SPI Lane Control

Parameters
dev- The device structure.
cnv_spi_lvds_lanes- The LVDS/SPI Lane Control mode.
Returns
LVDS/SPI Lane Control value

◆ ad4080_get_conv_data_spi_lvds()

int ad4080_get_conv_data_spi_lvds ( struct ad4080_dev * dev,
enum ad4080_conv_data_spi_lvds * conv_data_spi_lvds )

Get AD4080 Data Interface Configuration.

Get AD4080 Data Interface Configuration

Parameters
dev- The device structure.
conv_data_spi_lvds- The conversion data mode.
Returns
Data Interface Configuration value

◆ ad4080_get_fifo_mode()

int ad4080_get_fifo_mode ( struct ad4080_dev * dev,
enum ad4080_fifo_mode * fifo_mode )

Get Set AD4080 Conversion Data FIFO Mode.

Get AD4080 Conversion Data FIFO Mode

Parameters
dev- The device structure.
fifo_mode- The Conversion Data FIFO Mode
Returns
AD4080 Conversion Data FIFO Mode value

◆ ad4080_get_fifo_watermark()

int ad4080_get_fifo_watermark ( struct ad4080_dev * dev,
uint16_t * fifo_watermark )

Get AD4080 FIFO Watermark.

Get AD4080 FIFO Watermark

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

◆ ad4080_get_intf_chk_en()

int ad4080_get_intf_chk_en ( struct ad4080_dev * dev,
enum ad4080_intf_chk_en * intf_chk_en )

Get AD4080 Output Pattern.

Get AD4080 Output Pattern

Parameters
dev- The device structure.
intf_chk_en- The Output Pattern mode.
Returns
Output Pattern value

◆ ad4080_get_intf_ldo_pd()

int ad4080_get_intf_ldo_pd ( struct ad4080_dev * dev,
enum ad4080_intf_ldo_pd * intf_ldo_pd )

Get AD4080 Interface LDO.

Get AD4080 Interface LDO

Parameters
dev- The device structure.
intf_ldo_pd- The Interface LDO value
Returns
Interface LDO value

◆ ad4080_get_lvds_cnv_clk_cnt()

int ad4080_get_lvds_cnv_clk_cnt ( struct ad4080_dev * dev,
uint8_t * lvds_cnv_clk_cnt )

Get AD4080 Interface clock periods from CNV rising edge.

Get AD4080 Interface clock periods from CNV rising edge

Parameters
dev- The device structure.
lvds_cnv_clk_cnt- Interface clock periods from CNV rising edge value
Returns
Interface clock periods from CNV rising edge value

◆ ad4080_get_lvds_cnv_clk_mode()

int ad4080_get_lvds_cnv_clk_mode ( struct ad4080_dev * dev,
enum ad4080_lvds_cnv_clk_mode * cnv_clk_mode )

Get AD4080 LVDS CNV Clock Mode.

Get AD4080 LVDS CNV Clock Mode

Parameters
dev- The device structure.
cnv_clk_mode- The LVDS CNV Clock Mode value
Returns
LVDS CNV Clock Mode value

◆ ad4080_get_lvds_self_clk_mode()

int ad4080_get_lvds_self_clk_mode ( struct ad4080_dev * dev,
enum ad4080_lvds_self_clk_mode * lvds_self_clk_mode )

Get AD4080 LVDS Self Clock Mode.

Get AD4080 LVDS Self Clock Mode

Parameters
dev- The device structure.
lvds_self_clk_mode- The LVDS Self Clock Mode.
Returns
LVDS Self Clock Mode value

◆ ad4080_get_lvds_vod()

int ad4080_get_lvds_vod ( struct ad4080_dev * dev,
enum ad4080_lvds_vod * lvds_vod )

Get AD4080 LVDS Differential Output Voltage.

Get AD4080 LVDS Differential Output Voltage

Parameters
dev- The device structure.
lvds_vod- The LVDS Differential Output Voltage value
Returns
LVDS Differential Output Voltage value

◆ ad4080_get_op_mode()

int ad4080_get_op_mode ( struct ad4080_dev * dev,
enum ad4080_op_mode * op_mode )

Get Operation Mode.

Get Operation Mode

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

◆ ad4080_get_short_instr()

int ad4080_get_short_instr ( struct ad4080_dev * dev,
enum ad4080_short_instr * short_instr )

Get Short Instruction.

Get Short Instruction

Parameters
dev- The device structure.
short_instr- The short instruction mode.
Returns
Short Instruction value

◆ ad4080_get_single_instr()

int ad4080_get_single_instr ( struct ad4080_dev * dev,
enum ad4080_single_instr * single_instr )

Get Single/Streaming Mode.

Get Single/Streaming Mode

Parameters
dev- The device structure.
single_instr- The single instruction mode.
Returns
Single/Streaming Mode value

◆ ad4080_get_strict_reg_access()

int ad4080_get_strict_reg_access ( struct ad4080_dev * dev,
enum ad4080_strict_reg_access * strict_reg )

Get Strict Register Access.

Get Strict Register Access

Parameters
dev- The device structure.
strict_reg- The strict reg mode.
Returns
Strict Register Access value

◆ ad4080_gpio_read_data()

int ad4080_gpio_read_data ( struct ad4080_dev * dev,
enum ad4080_gpio gpio,
bool * data )

Read the GPIO data.

Read the GPIO data

Parameters
dev- The device structure.
gpio- The GPIO pin to be configured.
data- Pointer to the data (0 or 1) read back.
Returns
0 in case of success, negative error code otherwise

◆ ad4080_gpio_write_data()

int ad4080_gpio_write_data ( struct ad4080_dev * dev,
enum ad4080_gpio gpio,
bool data )

Set the GPIO data.

Set the GPIO data

Parameters
dev- The device structure.
gpio- The GPIO pin to be configured.
data- The data (0 or 1) to be written.
Returns
0 in case of success, negative error code otherwise

◆ ad4080_init()

int ad4080_init ( struct ad4080_dev ** device,
struct ad4080_init_param init_param )

Initialize the device.

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.

◆ ad4080_read()

int ad4080_read ( struct ad4080_dev * dev,
uint16_t reg_addr,
uint8_t * reg_val )

Read device register.

Reads data from a register.

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

◆ ad4080_read_data()

int ad4080_read_data ( struct ad4080_dev * dev,
uint8_t * buf,
size_t len )

Read from the AD4080 FIFO.

Reads data into a register

Parameters
dev- The device structure.
buf- Receive data buffer.
len- Length of the buf.
Returns
0 in case of success, negative error code otherwise.

◆ ad4080_remove()

int ad4080_remove ( struct ad4080_dev * dev)

Remove the device and release resources.

Remove the device and release resources.

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

◆ ad4080_set_addr_asc()

int ad4080_set_addr_asc ( struct ad4080_dev * dev,
enum ad4080_addr_asc addr_asc )

Set Address Ascension.

Set Address Ascension

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

◆ ad4080_set_ana_dig_ldo_pd()

int ad4080_set_ana_dig_ldo_pd ( struct ad4080_dev * dev,
enum ad4080_ana_dig_ldo_pd ana_dig_ldo_pd )

Set AD4080 Analog/Digital LDO.

Set AD4080 Analog/Digital LDO

Parameters
dev- The device structure.
ana_dig_ldo_pd- The Analog/Digital LDO value
Returns
0 in case of success, negative error code otherwise.

◆ ad4080_set_cnv_spi_lvds_lanes()

int ad4080_set_cnv_spi_lvds_lanes ( struct ad4080_dev * dev,
enum ad4080_cnv_spi_lvds_lanes cnv_spi_lvds_lanes )

Set AD4080 LVDS/SPI Lane Control.

Set AD4080 LVDS/SPI Lane Control

Parameters
dev- The device structure.
cnv_spi_lvds_lanes- The LVDS/SPI Lane Control mode.
Returns
0 in case of success, negative error code otherwise.

◆ ad4080_set_conv_data_spi_lvds()

int ad4080_set_conv_data_spi_lvds ( struct ad4080_dev * dev,
enum ad4080_conv_data_spi_lvds conv_data_spi_lvds )

Set AD4080 Data Interface Configuration.

Set AD4080 Data Interface Configuration

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

◆ ad4080_set_fifo_mode()

int ad4080_set_fifo_mode ( struct ad4080_dev * dev,
enum ad4080_fifo_mode fifo_mode )

Set AD4080 Conversion Data FIFO Mode.

Set AD4080 Conversion Data FIFO Mode

Parameters
dev- The device structure.
fifo_mode- The Conversion Data FIFO Mode
Returns
0 in case of success, negative error code otherwise.

◆ ad4080_set_fifo_watermark()

int ad4080_set_fifo_watermark ( struct ad4080_dev * dev,
uint16_t fifo_watermark )

Set AD4080 FIFO Watermark.

Set AD4080 FIFO Watermark

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

◆ ad4080_set_gpio_output_enable()

int ad4080_set_gpio_output_enable ( struct ad4080_dev * dev,
enum ad4080_gpio gpio,
enum ad4080_gpio_op_enable gpio_op_enable )

Configure GPIO as input or output.

Configure GPIO as input or output

Parameters
dev- The device structure.
gpio- The GPIO pin to be configured.
gpio_op_enable- The GPIO Output Enable bit selection
Returns
0 in case of success, negative error code otherwise

◆ ad4080_set_gpio_output_func()

int ad4080_set_gpio_output_func ( struct ad4080_dev * dev,
enum ad4080_gpio gpio,
enum ad4080_gpio_op_func_sel gpio_func )

Configure the GPIO output for a specific function.

Configure the GPIO for a specific function

Parameters
dev- The device structure.
gpio- The GPIO pin to be configured.
gpio_func- The function to be selected for the GPIO.
Returns
0 in case of success, negative error code otherwise

◆ ad4080_set_intf_chk_en()

int ad4080_set_intf_chk_en ( struct ad4080_dev * dev,
enum ad4080_intf_chk_en intf_chk_en )

Set AD4080 Output Pattern.

Set AD4080 Output Pattern

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

◆ ad4080_set_intf_ldo_pd()

int ad4080_set_intf_ldo_pd ( struct ad4080_dev * dev,
enum ad4080_intf_ldo_pd intf_ldo_pd )

Set AD4080 Interface LDO.

Set AD4080 Interface LDO

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

◆ ad4080_set_lvds_cnv_clk_cnt()

int ad4080_set_lvds_cnv_clk_cnt ( struct ad4080_dev * dev,
uint8_t lvds_cnv_clk_cnt )

Set AD4080 Interface clock periods from CNV rising edge.

Set AD4080 Interface clock periods from CNV rising edge

Parameters
dev- The device structure.
lvds_cnv_clk_cnt- Interface clock periods from CNV rising edge value
Returns
0 in case of success, negative error code otherwise.

◆ ad4080_set_lvds_cnv_clk_mode()

int ad4080_set_lvds_cnv_clk_mode ( struct ad4080_dev * dev,
enum ad4080_lvds_cnv_clk_mode cnv_clk_mode )

Set AD4080 LVDS CNV Clock Mode.

Set AD4080 LVDS CNV Clock Mode

Parameters
dev- The device structure.
cnv_clk_mode- The LVDS CNV Clock Mode value
Returns
0 in case of success, negative error code otherwise.

◆ ad4080_set_lvds_self_clk_mode()

int ad4080_set_lvds_self_clk_mode ( struct ad4080_dev * dev,
enum ad4080_lvds_self_clk_mode lvds_self_clk_mode )

Set AD4080 LVDS Self Clock Mode.

Set AD4080 LVDS Self Clock Mode

Parameters
dev- The device structure.
lvds_self_clk_mode- The LVDS Self Clock Mode.
Returns
0 in case of success, negative error code otherwise.

◆ ad4080_set_lvds_vod()

int ad4080_set_lvds_vod ( struct ad4080_dev * dev,
enum ad4080_lvds_vod lvds_vod )

Set AD4080 LVDS Differential Output Voltage.

Set AD4080 LVDS Differential Output Voltage

Parameters
dev- The device structure.
lvds_vod- The LVDS Differential Output Voltage value
Returns
0 in case of success, negative error code otherwise.

◆ ad4080_set_op_mode()

int ad4080_set_op_mode ( struct ad4080_dev * dev,
enum ad4080_op_mode op_mode )

Set Operation Mode.

Set Operation Mode

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

◆ ad4080_set_short_instr()

int ad4080_set_short_instr ( struct ad4080_dev * dev,
enum ad4080_short_instr short_instr )

Set Short Instruction.

Set Short Instruction

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

◆ ad4080_set_single_instr()

int ad4080_set_single_instr ( struct ad4080_dev * dev,
enum ad4080_single_instr single_instr )

Set Single/Streaming Mode.

Set Single/Streaming Mode

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

◆ ad4080_set_strict_reg_access()

int ad4080_set_strict_reg_access ( struct ad4080_dev * dev,
enum ad4080_strict_reg_access strict_reg )

Set Strict Register Access.

Set Strict Register Access

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

◆ ad4080_soft_reset()

int ad4080_soft_reset ( struct ad4080_dev * dev)

Software reset the device.

Software Reset.

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

◆ ad4080_update_bits()

int ad4080_update_bits ( struct ad4080_dev * dev,
uint16_t reg_addr,
uint8_t mask,
uint8_t reg_val )

Update specific register bits.

Update specific register bits

Parameters
dev- The device structure.
reg_addr- The register address.
mask- Specific bits mask.
reg_val- The data to be written.
Returns
0 in case of success, negative error code otherwise.

◆ ad4080_write()

int ad4080_write ( struct ad4080_dev * dev,
uint16_t reg_addr,
uint8_t reg_val )

Write device register.

Writes data into a register.

Parameters
dev-The device structure.
reg_addr- The register address.
reg_val- The data to be written.
Returns
0 in case of success, negative error code otherwise.

Variable Documentation

◆ ad4080_chip_info_tbl

const struct ad4080_chip_info ad4080_chip_info_tbl[NUM_AD4080_DEVICES]
extern