44#define AD463X_REG_INTERFACE_CONFIG_A 0x00
45#define AD463X_REG_INTERFACE_CONFIG_B 0x01
46#define AD463X_REG_DEVICE_CONFIG 0x02
47#define AD463X_REG_CHIP_TYPE 0x03
48#define AD463X_REG_PRODUCT_ID_L 0x04
49#define AD463X_REG_PRODUCT_ID_H 0x05
50#define AD463X_REG_CHIP_GRADE 0x06
51#define AD463X_REG_SCRATCH_PAD 0x0A
52#define AD463X_REG_SPI_REVISION 0x0B
53#define AD463X_REG_VENDOR_L 0x0C
54#define AD463X_REG_VENDOR_H 0x0D
55#define AD463X_REG_STREAM_MODE 0x0E
56#define AD463X_REG_EXIT_CFG_MODE 0x14
57#define AD463X_REG_AVG 0x15
58#define AD463X_REG_OFFSET_BASE 0x16
59#define AD463X_REG_OFFSET_X0_0 0x16
60#define AD463X_REG_OFFSET_X0_1 0x17
61#define AD463X_REG_OFFSET_X0_2 0x18
62#define AD463X_REG_OFFSET_X1_0 0x19
63#define AD463X_REG_OFFSET_X1_1 0x1A
64#define AD463X_REG_OFFSET_X1_2 0x1B
65#define AD463X_REG_GAIN_BASE 0x1C
66#define AD463X_REG_GAIN_X0_LSB 0x1C
67#define AD463X_REG_GAIN_X0_MSB 0x1D
68#define AD463X_REG_GAIN_X1_LSB 0x1E
69#define AD463X_REG_GAIN_X1_MSB 0x1F
70#define AD463X_REG_MODES 0x20
71#define AD463X_REG_OSCILATOR 0x21
72#define AD463X_REG_IO 0x22
73#define AD463X_REG_PAT0 0x23
74#define AD463X_REG_PAT1 0x24
75#define AD463X_REG_PAT2 0x25
76#define AD463X_REG_PAT3 0x26
77#define AD463X_REG_DIG_DIAG 0x34
78#define AD463X_REG_DIG_ERR 0x35
80#define AD463X_CFG_SW_RESET (NO_OS_BIT(7) | NO_OS_BIT(0))
81#define AD463X_CFG_SDO_ENABLE NO_OS_BIT(4)
83#define AD463X_SW_RESET_MSK (NO_OS_BIT(7) | NO_OS_BIT(0))
84#define AD463X_LANE_MODE_MSK (NO_OS_BIT(7) | NO_OS_BIT(6))
85#define AD463X_CLK_MODE_MSK (NO_OS_BIT(5) | NO_OS_BIT(4))
86#define AD463X_DDR_MODE_MSK NO_OS_BIT(3)
87#define AD463X_SDR_MODE 0x00
88#define AD463X_DDR_MODE NO_OS_BIT(3)
89#define AD463X_OUT_DATA_MODE_MSK (NO_OS_BIT(2) | NO_OS_BIT(1) | NO_OS_BIT(0))
90#define AD463X_24_DIFF 0x00
91#define AD463X_16_DIFF_8_COM 0x01
92#define AD463X_24_DIFF_8_COM 0x02
93#define AD463X_30_AVERAGED_DIFF 0x03
94#define AD463X_32_PATTERN 0x04
96#define AD463X_EXIT_CFG_MODE NO_OS_BIT(0)
98#define AD463X_CHANNEL_0 0x00
99#define AD463X_CHANNEL_1 0x01
101#define AD463X_OFFSET_0 0x00
102#define AD463X_OFFSET_1 0x01
103#define AD463X_OFFSET_2 0x02
105#define AD463X_GAIN_LSB 0x00
106#define AD463X_GAIN_MSB 0x01
108#define AD463X_ONE_LANE_PER_CH 0x00
109#define AD463X_TWO_LANES_PER_CH NO_OS_BIT(6)
110#define AD463X_FOUR_LANES_PER_CH NO_OS_BIT(7)
111#define AD463X_SHARED_TWO_CH (NO_OS_BIT(6) | NO_OS_BIT(7))
113#define AD463X_SPI_COMPATIBLE_MODE 0x00
114#define AD463X_ECHO_CLOCK_MODE NO_OS_BIT(4)
115#define AD463X_CLOCK_MASTER_MODE NO_OS_BIT(5)
117#define AD463X_NORMAL_MODE 0x00
118#define AD463X_LOW_POWER_MODE (NO_OS_BIT(1) | NO_OS_BIT(0))
120#define AD463X_AVG_FILTER_RESET NO_OS_BIT(7)
121#define AD463X_CONFIG_TIMING 0x2000
122#define AD463X_REG_READ_DUMMY 0x00
123#define AD463X_REG_WRITE 0x00
124#define AD463X_REG_READ NO_OS_BIT(7)
125#define AD463X_REG_CHAN_OFFSET(ch, pos) (AD463X_REG_OFFSET_BASE + (3 * ch) + pos)
126#define AD463X_REG_CHAN_GAIN(ch, pos) (AD463X_REG_GAIN_BASE + (2 * ch) + pos)
128#define AD463X_DRIVER_STRENGTH_MASK NO_OS_BIT(0)
129#define AD463X_NORMAL_OUTPUT_STRENGTH 0x00
130#define AD463X_DOUBLE_OUTPUT_STRENGTH NO_OS_BIT(1)
132#define AD463X_OUT_DATA_PAT 0x5A5A0F0F
134#define AD463X_TRIGGER_PULSE_WIDTH_NS 0x0A
136#define AD463X_GAIN_MAX_VAL_SCALED 19997
ad463x_id
Device type.
Definition ad463x.h:142
@ ID_AD4630_16
Definition ad463x.h:148
@ ID_AD4630_24
Definition ad463x.h:144
@ ID_AD4030
Definition ad463x.h:162
@ ID_AD4631_24
Definition ad463x.h:150
@ ID_AD4630_20
Definition ad463x.h:146
@ ID_AD4632_16
Definition ad463x.h:160
@ ID_AD4631_16
Definition ad463x.h:154
@ ID_AD4632_20
Definition ad463x.h:158
@ ID_AD4631_20
Definition ad463x.h:152
@ ID_ADAQ4224
Definition ad463x.h:164
@ ID_AD4632_24
Definition ad463x.h:156
int32_t ad463x_set_drive_strength(struct ad463x_dev *dev, uint8_t mode)
Set drive strength.
Definition ad463x.c:237
int32_t ad463x_exit_reg_cfg_mode(struct ad463x_dev *dev)
Exit register configuration mode.
Definition ad463x.c:252
int32_t ad463x_spi_reg_read_masked(struct ad463x_dev *dev, uint16_t reg_addr, uint8_t mask, uint8_t *data)
SPI read device register using a mask.
Definition ad463x.c:137
int32_t ad463x_read_data(struct ad463x_dev *dev, uint32_t *buf, uint16_t samples)
Read from device. Enter register mode to read/write registers.
Definition ad463x.c:616
int32_t ad463x_remove(struct ad463x_dev *dev)
Free the memory allocated by ad463x_init().
Definition ad463x.c:933
int32_t ad463x_spi_reg_write_masked(struct ad463x_dev *dev, uint16_t reg_addr, uint8_t mask, uint8_t data)
SPI write device register using a mask.
Definition ad463x.c:162
int32_t ad463x_calc_pgia_gain(int32_t gain_int, int32_t gain_fract, int32_t vref, int32_t precision, enum ad463x_pgia_gain *gain_idx)
Calculate the PGIA gain.
Definition ad463x.c:875
int32_t ad463x_set_ch_gain(struct ad463x_dev *dev, uint8_t ch_idx, uint64_t gain)
Set channel gain.
Definition ad463x.c:281
int32_t ad463x_spi_reg_write(struct ad463x_dev *dev, uint16_t reg_addr, uint8_t reg_data)
Write device register.
Definition ad463x.c:97
int32_t ad463x_init(struct ad463x_dev **device, struct ad463x_init_param *init_param)
Initialize the device.
Definition ad463x.c:674
ad463x_pgia_gain
Available pgia gains.
Definition ad463x.h:171
@ AD463X_GAIN_2_22
Definition ad463x.h:177
@ AD463X_GAIN_6_67
Definition ad463x.h:179
@ AD463X_GAIN_0_33
Definition ad463x.h:173
@ AD463X_GAIN_0_56
Definition ad463x.h:175
int32_t ad463x_set_avg_frame_len(struct ad463x_dev *dev, uint8_t mode)
Set average frame length.
Definition ad463x.c:200
int32_t ad463x_set_pgia_gain(struct ad463x_dev *dev, enum ad463x_pgia_gain gain_idx)
Set the PGIA gain.
Definition ad463x.c:903
int32_t ad463x_set_ch_offset(struct ad463x_dev *dev, uint8_t ch_idx, uint32_t offset)
Set channel offset.
Definition ad463x.c:310
int32_t ad463x_set_pwr_mode(struct ad463x_dev *dev, uint8_t mode)
Set power mode.
Definition ad463x.c:186
int32_t ad463x_spi_reg_read(struct ad463x_dev *dev, uint16_t reg_addr, uint8_t *reg_data)
Read device register.
Definition ad463x.c:73
int32_t ad463x_enter_config_mode(struct ad463x_dev *dev)
Enter register configuration mode.
Definition ad463x.c:115
struct ad7616_init_param init_param
Definition ad7616_sdz.c:107
Driver for the Analog Devices AXI CLKGEN.
Header file of GPIO Interface.
Header file of PWM Interface.
Header file of utility functions.
Device initialization parameters.
Definition ad463x.h:230
bool offload_enable
Definition ad463x.h:275
uint8_t data_rate
Definition ad463x.h:259
uint8_t clock_mode
Definition ad463x.h:257
int32_t scale_table[4][2]
Definition ad463x.h:265
struct no_os_gpio_desc * gpio_resetn
Definition ad463x.h:234
struct no_os_gpio_desc * gpio_pgia_a1
Definition ad463x.h:237
uint8_t capture_data_width
Definition ad463x.h:253
bool has_pgia
Definition ad463x.h:271
uint8_t pgia_idx
Definition ad463x.h:263
enum ad463x_id device_id
Definition ad463x.h:247
struct no_os_spi_desc * spi_desc
Definition ad463x.h:232
struct no_os_pwm_desc * trigger_pwm_desc
Definition ad463x.h:239
uint8_t output_mode
Definition ad463x.h:267
uint32_t reg_access_speed
Definition ad463x.h:245
struct axi_clkgen * clkgen
Definition ad463x.h:243
struct no_os_gpio_desc * gpio_cnv
Definition ad463x.h:235
uint8_t read_bytes_no
Definition ad463x.h:251
bool spi_dma_enable
Definition ad463x.h:273
uint8_t reg_data_width
Definition ad463x.h:249
struct no_os_gpio_desc * gpio_pgia_a0
Definition ad463x.h:236
uint8_t real_bits_precision
Definition ad463x.h:269
struct spi_engine_offload_init_param * offload_init_param
Definition ad463x.h:241
int32_t vref
Definition ad463x.h:261
uint8_t lane_mode
Definition ad463x.h:255
void(* dcache_invalidate_range)(uint32_t address, uint32_t bytes_count)
Definition ad463x.h:277
struct no_os_spi_init_param * spi_init
Definition ad463x.h:188
uint8_t data_rate
Definition ad463x.h:213
uint8_t clock_mode
Definition ad463x.h:211
struct no_os_gpio_init_param * gpio_cnv
Definition ad463x.h:191
struct no_os_gpio_init_param * gpio_resetn
Definition ad463x.h:190
uint8_t reg_data_width
Definition ad463x.h:207
struct no_os_gpio_init_param * gpio_pgia_a0
Definition ad463x.h:192
enum ad463x_id device_id
Definition ad463x.h:205
struct no_os_pwm_init_param * trigger_pwm_init
Definition ad463x.h:195
uint8_t lane_mode
Definition ad463x.h:209
bool spi_dma_enable
Definition ad463x.h:219
uint8_t output_mode
Definition ad463x.h:217
uint32_t reg_access_speed
Definition ad463x.h:203
void(* dcache_invalidate_range)(uint32_t address, uint32_t bytes_count)
Definition ad463x.h:223
int32_t vref
Definition ad463x.h:215
struct no_os_gpio_init_param * gpio_pgia_a1
Definition ad463x.h:193
uint32_t axi_clkgen_rate
Definition ad463x.h:201
bool offload_enable
Definition ad463x.h:221
struct spi_engine_offload_init_param * offload_init_param
Definition ad463x.h:197
struct axi_clkgen_init * clkgen_init
Definition ad463x.h:199
Definition clk_axi_clkgen.h:44
Definition clk_axi_clkgen.h:38
Definition ad9361_util.h:63
Structure holding the GPIO descriptor.
Definition no_os_gpio.h:84
Structure holding the parameters for GPIO initialization.
Definition no_os_gpio.h:67
Structure representing an PWM generator device.
Definition no_os_pwm.h:83
Structure containing the init parameters needed by the PWM generator.
Definition no_os_pwm.h:56
Structure holding SPI descriptor.
Definition no_os_spi.h:180
Structure holding the parameters for SPI initialization.
Definition no_os_spi.h:128
Structure containing the init parameters needed by the offload module.
Definition spi_engine.h:131