42#define AD6673_READ (1 << 15)
43#define AD6673_WRITE (0 << 15)
44#define AD6673_CNT(x) ((((x) & 0x3) - 1) << 13)
45#define AD6673_ADDR(x) ((x) & 0xFF)
47#define AD6673_R1B (1 << 8)
48#define AD6673_R2B (2 << 8)
49#define AD6673_R3B (3 << 8)
50#define AD6673_TRANSF_LEN(x) (((x) >> 8) & 0xFF)
51#define SHADOW(x) ((x) << 16)
54#define AD6673_REG_SPI_CFG (AD6673_R1B | 0x00)
55#define AD6673_REG_CHIP_ID (AD6673_R1B | 0x01)
56#define AD6673_REG_CHIP_INFO (AD6673_R1B | 0x02)
59#define AD6673_REG_CH_INDEX (AD6673_R1B | 0x05)
60#define AD6673_REG_DEVICE_UPDATE (AD6673_R1B | 0xFF)
63#define AD6673_REG_PDWN (AD6673_R1B | 0x08)
64#define AD6673_REG_CLOCK (AD6673_R1B | 0x09 | SHADOW(1))
65#define AD6673_REG_PLL_STAT (AD6673_R1B | 0x0A)
66#define AD6673_REG_CLOCK_DIV (AD6673_R1B | 0x0B | SHADOW(2))
67#define AD6673_REG_TEST (AD6673_R1B | 0x0D | SHADOW(3))
68#define AD6673_REG_BIST (AD6673_R1B | 0x0E | SHADOW(4))
69#define AD6673_REG_OFFSET (AD6673_R1B | 0x10 | SHADOW(5))
70#define AD6673_REG_OUT_MODE (AD6673_R1B | 0x14 | SHADOW(6))
71#define AD6673_REG_CML (AD6673_R1B | 0x15)
72#define AD6673_REG_VREF (AD6673_R1B | 0x18 | SHADOW(7))
73#define AD6673_REG_USER_TEST1 (AD6673_R2B | 0x1A)
74#define AD6673_REG_USER_TEST2 (AD6673_R2B | 0x1C)
75#define AD6673_REG_USER_TEST3 (AD6673_R2B | 0x1E)
76#define AD6673_REG_USER_TEST4 (AD6673_R2B | 0x20)
77#define AD6673_REG_PLL_ENCODE (AD6673_R1B | 0x21)
78#define AD6673_REG_BIST_MISR (AD6673_R2B | 0x25)
79#define AD6673_REG_SYS_CTRL (AD6673_R1B | 0x3A | SHADOW(8))
80#define AD6673_REG_NSR_CTRL (AD6673_R1B | 0x3C | SHADOW(9))
81#define AD6673_REG_NSR_TUNING (AD6673_R1B | 0x3E | SHADOW(10))
82#define AD6673_REG_DCC_CTRL (AD6673_R1B | 0x40 | SHADOW(11))
83#define AD6673_REG_DCC_VAL (AD6673_R2B | 0x42 | SHADOW(12))
84#define AD6673_REG_FAST_DETECT (AD6673_R1B | 0x45 | SHADOW(13))
85#define AD6673_REG_FD_UPPER_THD (AD6673_R2B | 0x48 | SHADOW(14))
86#define AD6673_REG_FD_LOWER_THD (AD6673_R2B | 0x4A | SHADOW(15))
87#define AD6673_REG_FD_DWELL_TIME (AD6673_R2B | 0x4C | SHADOW(16))
88#define AD6673_REG_204B_QUICK_CFG (AD6673_R1B | 0x5E)
89#define AD6673_REG_204B_CTRL1 (AD6673_R1B | 0x5F)
90#define AD6673_REG_204B_CTRL2 (AD6673_R1B | 0x60)
91#define AD6673_REG_204B_CTRL3 (AD6673_R1B | 0x61)
92#define AD6673_REG_204B_DID_CFG (AD6673_R1B | 0x64)
93#define AD6673_REG_204B_BID_CFG (AD6673_R1B | 0x65)
94#define AD6673_REG_204B_LID_CFG1 (AD6673_R1B | 0x67)
95#define AD6673_REG_204B_LID_CFG2 (AD6673_R1B | 0x68)
96#define AD6673_REG_204B_PARAM_SCR_L (AD6673_R1B | 0x6E)
97#define AD6673_REG_204B_PARAM_F (AD6673_R1B | 0x6F)
98#define AD6673_REG_204B_PARAM_K (AD6673_R1B | 0x70)
99#define AD6673_REG_204B_PARAM_M (AD6673_R1B | 0x71)
100#define AD6673_REG_204B_PARAM_CS_N (AD6673_R1B | 0x72)
101#define AD6673_REG_204B_PARAM_NP (AD6673_R1B | 0x73)
102#define AD6673_REG_204B_PARAM_S (AD6673_R1B | 0x74)
103#define AD6673_REG_204B_PARAM_HD_CF (AD6673_R1B | 0x75)
104#define AD6673_REG_204B_RESV1 (AD6673_R1B | 0x76)
105#define AD6673_REG_204B_RESV2 (AD6673_R1B | 0x77)
106#define AD6673_REG_204B_CHKSUM0 (AD6673_R1B | 0x79)
107#define AD6673_REG_204B_CHKSUM1 (AD6673_R1B | 0x7A)
108#define AD6673_REG_204B_LANE_ASSGN1 (AD6673_R1B | 0x82)
109#define AD6673_REG_204B_LANE_ASSGN2 (AD6673_R1B | 0x83)
110#define AD6673_REG_204B_LMFC_OFFSET (AD6673_R1B | 0x8B)
111#define AD6673_REG_204B_PRE_EMPHASIS (AD6673_R1B | 0xA8)
114#define AD6673_SPI_CFG_LSB_FIRST ((1 << 6) | (1 << 1))
115#define AD6673_SPI_CFG_SOFT_RST ((1 << 5) | (1 << 2))
118#define AD6673_CH_INDEX_ADC_A (1 << 0)
119#define AD6673_CH_INDEX_ADC_B (1 << 1)
122#define AD6673_DEVICE_UPDATE_SW (1 << 0)
125#define AD6673_PDWN_EXTERN (1 << 5)
126#define AD6673_PDWN_JTX (1 << 4)
127#define AD6673_PDWN_JESD204B(x) (((x) & 0x3) << 2)
128#define AD6673_PDWN_CHIP(x) (((x) & 0x3) << 0)
131#define AD6673_CLOCK_SELECTION(x) (((x) & 0x3) << 4)
132#define AD6673_CLOCK_DUTY_CYCLE (1 << 0)
135#define AD6673_PLL_STAT_LOCKED (1 << 7)
136#define AD6673_PLL_STAT_204B_LINK_RDY (1 << 0)
139#define AD6673_CLOCK_DIV_PHASE(x) (((x) & 0x7) << 3)
140#define AD6673_CLOCK_DIV_RATIO(x) (((x) & 0x7) << 0)
143#define AD6673_TEST_USER_TEST_MODE(x) (((x) & 0x3) << 6)
144#define AD6673_TEST_RST_PN_LONG (1 << 5)
145#define AD6673_TEST_RST_PN_SHOR (1 << 4)
146#define AD6673_TEST_OUTPUT_TEST(x) (((x) & 0xF) << 0)
149#define AD6673_BIST_RESET (1 << 2)
150#define AD6673_BIST_ENABLE (1 << 0)
153#define AD6673_REG_OFFSET_ADJUST(x) (((x) & 0x3F) << 0)
156#define AD6673_OUT_MODE_JTX_BIT_ASSIGN(x) (((x) & 0x7) << 5)
157#define AD6673_OUT_MODE_DISABLE (1 << 4)
158#define AD6673_OUT_MODE_INVERT_DATA (1 << 3)
159#define AD6673_OUT_MODE_DATA_FORMAT(x) (((x) & 0x1) << 0)
162#define AD6673_CML_DIFF_OUT_LEVEL(x) (((x) & 0x7) << 0)
165#define AD6673_VREF_FS_ADJUST(x) (((x) & 0x1F) << 0)
168#define AD6673_PLL_ENCODE(x) (((x) & 0x3) << 3)
171#define AD6673_SYS_CTRL_REALIGN_ON_SYNCINB (1 << 4)
172#define AD6673_SYS_CTRL_REALIGN_ON_SYSREF (1 << 3)
173#define AD6673_SYS_CTRL_SYSREF_MODE (1 << 2)
174#define AD6673_SYS_CTRL_SYSREF_EN (1 << 1)
175#define AD6673_SYS_CTRL_SYNCINB_EN (1 << 0)
178#define AD6673_NSR_CTRL_BW_MODE (1 << 1)
179#define AD6673_NSR_CTRL_ENABLE (1 << 0)
182#define AD6673_NSR_TUNING(x) (((x) & 0x3F) << 0)
185#define AD6673_DCC_CTRL_FREEZE_DCC (1 << 6)
186#define AD6673_DCC_CTRL_DCC_BW(x) (((x) & 0xF) << 2)
187#define AD6673_DCC_CTRL_DCC_EN (1 << 1)
190#define AD6673_FAST_DETECT_PIN_FCT (1 << 4)
191#define AD6673_FAST_DETECT_FORCE_FDA_FDB_PIN (1 << 3)
192#define AD6673_FAST_DETECT_FORCE_FDA_FDB_VAL (1 << 2)
193#define AD6673_FAST_DETECT_OUTPUT_ENABLE (1 << 0)
196#define AD6673_204B_QUICK_CFG(x) (((x) & 0xFF) << 0)
199#define AD6673_204B_CTRL1_TAIL_BITS (1 << 6)
200#define AD6673_204B_CTRL1_TEST_SAMPLE_EN (1 << 5)
201#define AD6673_204B_CTRL1_ILAS_MODE(x) (((x) & 0x3) << 2)
202#define AD6673_204B_CTRL1_POWER_DOWN (1 << 0)
205#define AD6673_204B_CTRL2_INVERT_JESD_BITS (1 << 1)
208#define AD6673_204B_CTRL3_TEST_DATA_INJ_PT(x) (((x) & 0x3) << 4)
209#define AD6673_204B_CTRL3_JESD_TEST_MODE(x) (((x) & 0xF) << 0)
212#define AD6673_204B_PARAM_SCR_L_SCRAMBLING (1 << 7)
213#define AD6673_204B_PARAM_SCR_L_LANES (1 << 0)
216#define AD6673_204B_PARAM_CS_N_NR_CTRL_BITS(x) (((x) & 0x3) << 6)
217#define AD6673_204B_PARAM_CS_N_ADC_RESOLUTION(x) (((x) & 0xF) << 0)
220#define AD6673_204B_PARAM_NP_JESD_SUBCLASS(x) (((x) & 0x3) << 5)
221#define AD6673_204B_PARAM_NP_JESD_N_VAL(x) (((x) & 0xF) << 0)
224#define AD6673_204B_PARAM_S(x) (((x) << 0x1F) << 0)
227#define AD6673_204B_PARAM_HD_CF_HD_VAL (1 << 7)
228#define AD6673_204B_PARAM_HD_CF_CF_VAL(x) (((x) & 0x1F) << 0)
231#define AD6673_204B_LANE_ASSGN1(x) (((x) & 0x3) << 4)
234#define AD6673_204B_LANE_ASSGN2(x) (((x) &0x3) << 0)
237#define AD6673_204B_LMFC_OFFSET(x) (((x) & 0x1F) << 0)
526 int32_t register_address);
529 int32_t register_address,
530 int32_t register_value);
565 int32_t user_pattern);
int32_t ad6673_jesd204b_test_mode(struct ad6673_dev *dev, int32_t test_mode)
Selects a JESD204B test mode.
Definition ad6673.c:1086
int32_t ad6673_output_disable(struct ad6673_dev *dev, int32_t en)
Disables (1) or enables (0) the data output. Note: This function modifies a shadowed register,...
Definition ad6673.c:532
int32_t ad6673_remove(struct ad6673_dev *dev)
Free the resources allocated by ad6673_setup().
Definition ad6673.c:175
int32_t ad6673_dcc_bandwidth(struct ad6673_dev *dev, int32_t bw)
Selects the bandwidth value for the DC correction circuit.
Definition ad6673.c:1228
int32_t ad6673_fast_detect_setup(struct ad6673_dev *dev)
Configures the Fast-Detect module.
Definition ad6673.c:1147
int32_t ad6673_read(struct ad6673_dev *dev, int32_t register_address)
Reads the value of the selected register.
Definition ad6673.c:194
int32_t ad6673_jesd204b_select_test_injection_point(struct ad6673_dev *dev, int32_t inj_point)
Selects the point in the processing path of a lane, where the test data will be inserted.
Definition ad6673.c:1045
shadow_registers
Definition ad6673.h:486
@ AD6673_SHD_REG_CLOCK_DIV
Definition ad6673.h:488
@ AD6673_SHD_REG_DCC_VAL
Definition ad6673.h:498
@ AD6673_SHD_REG_FD_UPPER_THD
Definition ad6673.h:500
@ AD6673_SHD_REG_BIST
Definition ad6673.h:490
@ SHADOW_REGISTER_COUNT
Definition ad6673.h:503
@ AD6673_SHD_REG_TEST
Definition ad6673.h:489
@ AD6673_REG_SHD_NSR_TUNING
Definition ad6673.h:496
@ AD6673_REG_SHD_NSR_CTRL
Definition ad6673.h:495
@ AD6673_SHD_REG_DCC_CTRL
Definition ad6673.h:497
@ AD6673_SHD_REG_FD_LOWER_THD
Definition ad6673.h:501
@ AD6673_SHD_REG_CLOCK
Definition ad6673.h:487
@ AD6673_SHD_REG_FD_DWELL_TIME
Definition ad6673.h:502
@ AD6673_SHD_REG_OFFSET
Definition ad6673.h:491
@ AD6673_SHD_REG_FAST_DETECT
Definition ad6673.h:499
@ AD6673_SHD_REG_VREF
Definition ad6673.h:493
@ AD6673_SHD_REG_SYS_CTRL
Definition ad6673.h:494
@ AD6673_SHD_REG_OUT_MODE
Definition ad6673.h:492
int32_t ad6673_jesd204b_invert_logic(struct ad6673_dev *dev, int32_t invert)
Inverts the logic of JESD204B bits.
Definition ad6673.c:1118
int32_t ad6673_select_channel_for_config(struct ad6673_dev *dev, int32_t channel)
Selects a channel as the current channel for further configurations.
Definition ad6673.c:432
int32_t ad6673_dcc_enable(struct ad6673_dev *dev, int32_t enable)
Enables DC correction for use in the output data signal path.
Definition ad6673.c:1194
int32_t ad6673_test_mode(struct ad6673_dev *dev, int32_t mode)
Sets the ADC's test mode.
Definition ad6673.c:472
int32_t ad6673_bist_reset(struct ad6673_dev *dev, int32_t reset)
Resets the Build-In-Self-Test.
Definition ad6673.c:750
int32_t ad6673_set_user_pattern(struct ad6673_dev *dev, int32_t pattern_no, int32_t user_pattern)
Configures a User Test Pattern.
Definition ad6673.c:698
int32_t ad6673_jesd204b_pwr_mode(struct ad6673_dev *dev, int32_t mode)
Configures the power mode of the JESD204B data transmit block.
Definition ad6673.c:1011
int32_t ad6673_nsr_tuning_freq(int64_t tune_freq, int64_t f_adc, struct ad6673_type_band *p_band)
Sets the NSR frequency range.
Definition ad6673.c:1357
int32_t ad6673_offset_adj(struct ad6673_dev *dev, int32_t adj)
Sets the offset adjustment.
Definition ad6673.c:502
int32_t ad6673_reset_pn23(struct ad6673_dev *dev, int32_t rst)
Sets (1) or clears (0) the reset long PN sequence bit(PN23).
Definition ad6673.c:667
int32_t ad6673_chip_pwr_mode(struct ad6673_dev *dev, int32_t mode)
Configures the power mode of the chip.
Definition ad6673.c:399
int32_t ad6673_dcc_freeze(struct ad6673_dev *dev, int32_t freeze)
Freezes DC correction value.
Definition ad6673.c:1260
int32_t ad6673_setup(struct ad6673_dev **device, struct ad6673_init_param init_param)
Configures the device.
Definition ad6673.c:75
int32_t ad6673_jesd204b_setup(struct ad6673_dev *dev)
Configures the JESD204B interface.
Definition ad6673.c:819
int32_t ad6673_transfer(struct ad6673_dev *dev)
Initiates a transfer and waits for the operation to end. Note: This function may be called after a sh...
Definition ad6673.c:275
int32_t ad6673_write(struct ad6673_dev *dev, int32_t register_address, int32_t register_value)
Writes a value to the selected register.
Definition ad6673.c:231
int32_t ad6673_output_invert(struct ad6673_dev *dev, int32_t invert)
Activates the inverted (1) or normal (0) output mode. Note: This function modifies a shadowed registe...
Definition ad6673.c:567
int32_t ad6673_soft_reset(struct ad6673_dev *dev)
Resets all registers to their default values.
Definition ad6673.c:307
int32_t ad6673_bist_enable(struct ad6673_dev *dev, int32_t enable)
Enables the Build-In-Self-Test.
Definition ad6673.c:720
int32_t ad6673_nsr_enable(struct ad6673_dev *dev, int32_t enable)
Enables the Noise shaped requantizer(NRS).
Definition ad6673.c:1292
int32_t ad6673_nsr_bandwidth_mode(struct ad6673_dev *dev, int32_t mode)
Selects the NSR Bandwidth mode.
Definition ad6673.c:1324
int32_t ad6673_output_format(struct ad6673_dev *dev, int32_t format)
Specifies the output format. Note: This function modifies a shadowed register, therefore a call of ad...
Definition ad6673.c:603
int32_t ad6673_reset_pn9(struct ad6673_dev *dev, int32_t rst)
Sets (1) or clears (0) the reset short PN sequence bit(PN9).
Definition ad6673.c:635
struct ad7616_init_param init_param
Definition ad7616_sdz.c:107
Header file of SPI Interface.
int32_t shadow_regs[SHADOW_REGISTER_COUNT]
Definition ad6673.h:511
struct no_os_spi_desc * spi_desc
Definition ad6673.h:508
struct ad6673_state ad6673_st
Definition ad6673.h:510
Fast Detect module configuration.
Definition ad6673.h:441
int8_t pin_function
Definition ad6673.h:453
int8_t force_pins
Definition ad6673.h:459
int8_t pin_force_value
Definition ad6673.h:465
int16_t fd_upper_tresh
Definition ad6673.h:467
int16_t fd_lower_tresh
Definition ad6673.h:469
int8_t en_fd
Definition ad6673.h:447
int16_t df_dwell_time
Definition ad6673.h:471
struct no_os_spi_init_param spi_init
Definition ad6673.h:516
JESD204B interface configuration.
Definition ad6673.h:304
int8_t cml_level
Definition ad6673.h:319
int8_t lane0_assign
Definition ad6673.h:429
int8_t quick_cfg_option
Definition ad6673.h:327
int8_t bid
Definition ad6673.h:360
int8_t scrambling
Definition ad6673.h:375
int8_t lid1
Definition ad6673.h:364
int8_t ctrl_bits_assign
Definition ad6673.h:350
int8_t invert_logic_bits
Definition ad6673.h:393
int8_t en_ilas_test
Definition ad6673.h:387
int8_t lane1_assign
Definition ad6673.h:434
int8_t jtx_in_standby
Definition ad6673.h:310
int8_t en_sys_ref
Definition ad6673.h:399
int8_t align_sync_in_b
Definition ad6673.h:417
int8_t subclass
Definition ad6673.h:333
int8_t ctrl_bits_no
Definition ad6673.h:340
int8_t k
Definition ad6673.h:369
int8_t lid0
Definition ad6673.h:362
int8_t sys_ref_mode
Definition ad6673.h:411
int8_t ilas_mode
Definition ad6673.h:381
int8_t did
Definition ad6673.h:358
int8_t align_sys_ref
Definition ad6673.h:423
int8_t en_sync_in_b
Definition ad6673.h:405
int8_t tail_bits_mode
Definition ad6673.h:356
struct ad6673_fast_detect_cfg * p_fd
Definition ad6673.h:483
struct ad6673_platform_data * pdata
Definition ad6673.h:481
struct ad6673_jesd204b_cfg * p_jesd204b
Definition ad6673.h:482
int32_t f0
Definition ad6673.h:475
int32_t f_center
Definition ad6673.h:476
int32_t f1
Definition ad6673.h:477
Definition ad9361_util.h:63
Structure holding SPI descriptor.
Definition no_os_spi.h:180
Structure holding the parameters for SPI initialization.
Definition no_os_spi.h:128
enum no_os_spi_mode mode
Definition no_os_spi.h:136