Debian Codegraph @

thirdparty/analogdevicesinc/no-OS/drivers/AD6673/AD6673.h

raw symbols SCIP
1 /***************************************************************************//**
2 * @file AD6673.h
3 * @brief Header file of AD6673 Driver.
4 * @author DNechita ([email protected])
5 ********************************************************************************
6 * Copyright 2013(c) Analog Devices, Inc.
7 *
8 * All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions are met:
12 * - Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * - Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in
16 * the documentation and/or other materials provided with the
17 * distribution.
18 * - Neither the name of Analog Devices, Inc. nor the names of its
19 * contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 * - The use of this software may or may not infringe the patent rights
22 * of one or more patent holders. This license does not release you
23 * from the requirement that you obtain separate licenses from these
24 * patent holders to use this software.
25 * - Use of the software either in source or binary form, must be run
26 * on or directly connected to an Analog Devices Inc. component.
27 *
28 * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
29 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
30 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
31 * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
32 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
33 * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
34 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
35 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
36 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 *
39 ********************************************************************************
40 * SVN Revision: $WCREV$
41 *******************************************************************************/
42 #ifndef __AD6673_H__
43 #define __AD6673_H__
44
45 /******************************************************************************/
46 /***************************** Include Files **********************************/
47 /******************************************************************************/
48 #include <stdint.h>
49
50 /******************************************************************************/
51 /*********************************** AD6673 ***********************************/
52 /******************************************************************************/
53
54 /* Registers */
55
56 #define AD6673_READ (1 << 15)
57 #define AD6673_WRITE (0 << 15)
58 #define AD6673_CNT(x) ((((x) & 0x3) - 1) << 13)
59 #define AD6673_ADDR(x) ((x) & 0xFF)
60
61 #define AD6673_R1B (1 << 8)
62 #define AD6673_R2B (2 << 8)
63 #define AD6673_R3B (3 << 8)
64 #define AD6673_TRANSF_LEN(x) (((x) >> 8) & 0xFF)
65 #define SHADOW(x) ((x) << 16)
66
67 /* Chip configuration registers */
68 #define AD6673_REG_SPI_CFG (AD6673_R1B | 0x00)
69 #define AD6673_REG_CHIP_ID (AD6673_R1B | 0x01)
70 #define AD6673_REG_CHIP_INFO (AD6673_R1B | 0x02)
71
72 /* Channel index and transfer registers */
73 #define AD6673_REG_CH_INDEX (AD6673_R1B | 0x05)
74 #define AD6673_REG_DEVICE_UPDATE (AD6673_R1B | 0xFF)
75
76 /* Program register map */
77 #define AD6673_REG_PDWN (AD6673_R1B | 0x08)
78 #define AD6673_REG_CLOCK (AD6673_R1B | 0x09 | SHADOW(1))
79 #define AD6673_REG_PLL_STAT (AD6673_R1B | 0x0A)
80 #define AD6673_REG_CLOCK_DIV (AD6673_R1B | 0x0B | SHADOW(2))
81 #define AD6673_REG_TEST (AD6673_R1B | 0x0D | SHADOW(3))
82 #define AD6673_REG_BIST (AD6673_R1B | 0x0E | SHADOW(4))
83 #define AD6673_REG_OFFSET (AD6673_R1B | 0x10 | SHADOW(5))
84 #define AD6673_REG_OUT_MODE (AD6673_R1B | 0x14 | SHADOW(6))
85 #define AD6673_REG_CML (AD6673_R1B | 0x15)
86 #define AD6673_REG_VREF (AD6673_R1B | 0x18 | SHADOW(7))
87 #define AD6673_REG_USER_TEST1 (AD6673_R2B | 0x1A)
88 #define AD6673_REG_USER_TEST2 (AD6673_R2B | 0x1C)
89 #define AD6673_REG_USER_TEST3 (AD6673_R2B | 0x1E)
90 #define AD6673_REG_USER_TEST4 (AD6673_R2B | 0x20)
91 #define AD6673_REG_PLL_ENCODE (AD6673_R1B | 0x21)
92 #define AD6673_REG_BIST_MISR (AD6673_R2B | 0x25)
93 #define AD6673_REG_SYS_CTRL (AD6673_R1B | 0x3A | SHADOW(8))
94 #define AD6673_REG_NSR_CTRL (AD6673_R1B | 0x3C | SHADOW(9))
95 #define AD6673_REG_NSR_TUNING (AD6673_R1B | 0x3E | SHADOW(10))
96 #define AD6673_REG_DCC_CTRL (AD6673_R1B | 0x40 | SHADOW(11))
97 #define AD6673_REG_DCC_VAL (AD6673_R2B | 0x42 | SHADOW(12))
98 #define AD6673_REG_FAST_DETECT (AD6673_R1B | 0x45 | SHADOW(13))
99 #define AD6673_REG_FD_UPPER_THD (AD6673_R2B | 0x48 | SHADOW(14))
100 #define AD6673_REG_FD_LOWER_THD (AD6673_R2B | 0x4A | SHADOW(15))
101 #define AD6673_REG_FD_DWELL_TIME (AD6673_R2B | 0x4C | SHADOW(16))
102 #define AD6673_REG_204B_QUICK_CFG (AD6673_R1B | 0x5E)
103 #define AD6673_REG_204B_CTRL1 (AD6673_R1B | 0x5F)
104 #define AD6673_REG_204B_CTRL2 (AD6673_R1B | 0x60)
105 #define AD6673_REG_204B_CTRL3 (AD6673_R1B | 0x61)
106 #define AD6673_REG_204B_DID_CFG (AD6673_R1B | 0x64)
107 #define AD6673_REG_204B_BID_CFG (AD6673_R1B | 0x65)
108 #define AD6673_REG_204B_LID_CFG1 (AD6673_R1B | 0x67)
109 #define AD6673_REG_204B_LID_CFG2 (AD6673_R1B | 0x68)
110 #define AD6673_REG_204B_PARAM_SCR_L (AD6673_R1B | 0x6E)
111 #define AD6673_REG_204B_PARAM_F (AD6673_R1B | 0x6F)
112 #define AD6673_REG_204B_PARAM_K (AD6673_R1B | 0x70)
113 #define AD6673_REG_204B_PARAM_M (AD6673_R1B | 0x71)
114 #define AD6673_REG_204B_PARAM_CS_N (AD6673_R1B | 0x72)
115 #define AD6673_REG_204B_PARAM_NP (AD6673_R1B | 0x73)
116 #define AD6673_REG_204B_PARAM_S (AD6673_R1B | 0x74)
117 #define AD6673_REG_204B_PARAM_HD_CF (AD6673_R1B | 0x75)
118 #define AD6673_REG_204B_RESV1 (AD6673_R1B | 0x76)
119 #define AD6673_REG_204B_RESV2 (AD6673_R1B | 0x77)
120 #define AD6673_REG_204B_CHKSUM0 (AD6673_R1B | 0x79)
121 #define AD6673_REG_204B_CHKSUM1 (AD6673_R1B | 0x7A)
122 #define AD6673_REG_204B_LANE_ASSGN1 (AD6673_R1B | 0x82)
123 #define AD6673_REG_204B_LANE_ASSGN2 (AD6673_R1B | 0x83)
124 #define AD6673_REG_204B_LMFC_OFFSET (AD6673_R1B | 0x8B)
125 #define AD6673_REG_204B_PRE_EMPHASIS (AD6673_R1B | 0xA8)
126
127 /* AD6673_REG_SPI_CFG */
128 #define AD6673_SPI_CFG_LSB_FIRST ((1 << 6) | (1 << 1))
129 #define AD6673_SPI_CFG_SOFT_RST ((1 << 5) | (1 << 2))
130
131 /* AD6673_REG_CH_INDEX */
132 #define AD6673_CH_INDEX_ADC_A (1 << 0)
133 #define AD6673_CH_INDEX_ADC_B (1 << 1)
134
135 /* AD6673_REG_DEVICE_UPDATE */
136 #define AD6673_DEVICE_UPDATE_SW (1 << 0)
137
138 /* AD6673_REG_PDWN */
139 #define AD6673_PDWN_EXTERN (1 << 5)
140 #define AD6673_PDWN_JTX (1 << 4)
141 #define AD6673_PDWN_JESD204B(x) (((x) & 0x3) << 2)
142 #define AD6673_PDWN_CHIP(x) (((x) & 0x3) << 0)
143
144 /* AD6673_REG_CLOCK */
145 #define AD6673_CLOCK_SELECTION(x) (((x) & 0x3) << 4)
146 #define AD6673_CLOCK_DUTY_CYCLE (1 << 0)
147
148 /* AD6673_REG_PLL_STAT */
149 #define AD6673_PLL_STAT_LOCKED (1 << 7)
150 #define AD6673_PLL_STAT_204B_LINK_RDY (1 << 0)
151
152 /* AD6673_REG_CLOCK_DIV */
153 #define AD6673_CLOCK_DIV_PHASE(x) (((x) & 0x7) << 3)
154 #define AD6673_CLOCK_DIV_RATIO(x) (((x) & 0x7) << 0)
155
156 /* AD6673_REG_TEST */
157 #define AD6673_TEST_USER_TEST_MODE(x) (((x) & 0x3) << 6)
158 #define AD6673_TEST_RST_PN_LONG (1 << 5)
159 #define AD6673_TEST_RST_PN_SHOR (1 << 4)
160 #define AD6673_TEST_OUTPUT_TEST(x) (((x) & 0xF) << 0)
161
162 /* AD6673_REG_BIST */
163 #define AD6673_BIST_RESET (1 << 2)
164 #define AD6673_BIST_ENABLE (1 << 0)
165
166 /* AD6673_REG_OFFSET */
167 #define AD6673_REG_OFFSET_ADJUST(x) (((x) & 0x3F) << 0)
168
169 /* AD6673_REG_OUT_MODE */
170 #define AD6673_OUT_MODE_JTX_BIT_ASSIGN(x) (((x) & 0x7) << 5)
171 #define AD6673_OUT_MODE_DISABLE (1 << 4)
172 #define AD6673_OUT_MODE_INVERT_DATA (1 << 3)
173 #define AD6673_OUT_MODE_DATA_FORMAT(x) (((x) & 0x1) << 0)
174
175 /* AD6673_REG_CML */
176 #define AD6673_CML_DIFF_OUT_LEVEL(x) (((x) & 0x7) << 0)
177
178 /* AD6673_REG_VREF */
179 #define AD6673_VREF_FS_ADJUST(x) (((x) & 0x1F) << 0)
180
181 /* AD6673_REG_PLL_ENCODE */
182 #define AD6673_PLL_ENCODE(x) (((x) & 0x3) << 3)
183
184 /* AD6673_REG_SYS_CTRL */
185 #define AD6673_SYS_CTRL_REALIGN_ON_SYNCINB (1 << 4)
186 #define AD6673_SYS_CTRL_REALIGN_ON_SYSREF (1 << 3)
187 #define AD6673_SYS_CTRL_SYSREF_MODE (1 << 2)
188 #define AD6673_SYS_CTRL_SYSREF_EN (1 << 1)
189 #define AD6673_SYS_CTRL_SYNCINB_EN (1 << 0)
190
191 /* AD6673_REG_NSR_CTRL */
192 #define AD6673_NSR_CTRL_BW_MODE (1 << 1)
193 #define AD6673_NSR_CTRL_ENABLE (1 << 0)
194
195 /* AD6673_REG_NSR_TUNING */
196 #define AD6673_NSR_TUNING(x) (((x) & 0x3F) << 0)
197
198 /* AD6673_REG_DCC_CTRL */
199 #define AD6673_DCC_CTRL_FREEZE_DCC (1 << 6)
200 #define AD6673_DCC_CTRL_DCC_BW(x) (((x) & 0xF) << 2)
201 #define AD6673_DCC_CTRL_DCC_EN (1 << 1)
202
203 /* AD6673_REG_FAST_DETECT */
204 #define AD6673_FAST_DETECT_PIN_FCT (1 << 4)
205 #define AD6673_FAST_DETECT_FORCE_FDA_FDB_PIN (1 << 3)
206 #define AD6673_FAST_DETECT_FORCE_FDA_FDB_VAL (1 << 2)
207 #define AD6673_FAST_DETECT_OUTPUT_ENABLE (1 << 0)
208
209 /* AD6673_REG_204B_QUICK_CFG */
210 #define AD6673_204B_QUICK_CFG(x) (((x) & 0xFF) << 0)
211
212 /* AD6673_REG_204B_CTRL1 */
213 #define AD6673_204B_CTRL1_TAIL_BITS (1 << 6)
214 #define AD6673_204B_CTRL1_TEST_SAMPLE_EN (1 << 5)
215 #define AD6673_204B_CTRL1_ILAS_MODE(x) (((x) & 0x3) << 2)
216 #define AD6673_204B_CTRL1_POWER_DOWN (1 << 0)
217
218 /* AD6673_REG_204B_CTRL2 */
219 #define AD6673_204B_CTRL2_INVERT_JESD_BITS (1 << 1)
220
221 /* AD6673_REG_204B_CTRL3 */
222 #define AD6673_204B_CTRL3_TEST_DATA_INJ_PT(x) (((x) & 0x3) << 4)
223 #define AD6673_204B_CTRL3_JESD_TEST_MODE(x) (((x) & 0xF) << 0)
224
225 /* AD6673_REG_204B_PARAM_SCR_L */
226 #define AD6673_204B_PARAM_SCR_L_SCRAMBLING (1 << 7)
227 #define AD6673_204B_PARAM_SCR_L_LANES (1 << 0)
228
229 /* AD6673_REG_204B_PARAM_CS_N */
230 #define AD6673_204B_PARAM_CS_N_NR_CTRL_BITS(x) (((x) & 0x3) << 6)
231 #define AD6673_204B_PARAM_CS_N_ADC_RESOLUTION(x) (((x) & 0xF) << 0)
232
233 /* AD6673_REG_204B_PARAM_NP */
234 #define AD6673_204B_PARAM_NP_JESD_SUBCLASS(x) (((x) & 0x3) << 5)
235 #define AD6673_204B_PARAM_NP_JESD_N_VAL(x) (((x) & 0xF) << 0)
236
237 /* AD6673_REG_204B_PARAM_S */
238 #define AD6673_204B_PARAM_S(x) (((x) << 0x1F) << 0)
239
240 /* AD6673_REG_204B_PARAM_HD_CF */
241 #define AD6673_204B_PARAM_HD_CF_HD_VAL (1 << 7)
242 #define AD6673_204B_PARAM_HD_CF_CF_VAL(x) (((x) & 0x1F) << 0)
243
244 /* AD6673_REG_204B_LANE_ASSGN1 */
245 #define AD6673_204B_LANE_ASSGN1(x) (((x) & 0x3) << 4)
246
247 /* AD6673_REG_204B_LANE_ASSGN2 */
248 #define AD6673_204B_LANE_ASSGN2(x) (((x) &0x3) << 0)
249
250 /* AD6673_REG_204B_LMFC_OFFSET */
251 #define AD6673_204B_LMFC_OFFSET(x) (((x) & 0x1F) << 0)
252
253 /*****************************************************************************/
254 /************************** Types Declarations *******************************/
255 /*****************************************************************************/
256
257 /**
258 * struct ad6673_platform_data - Platform specific information.
259 *
260 * @extrnPDWNmode: External PDWN mode.
261 * 0 = PDWN is full power down
262 * 1 = PDWN puts device in standby
263 * @enClkDCS: Clock duty cycle stabilizer enable.
264 * 0 = disable
265 * 1 = enable
266 * @clkSelection: Clock selection.
267 * 0 = Nyquist clock
268 * 2 = RF clock divide by 4
269 * 3 = clock off
270 * @clkDivRatio: Clock divider ratio relative to the encode clock.
271 * 0x00 = divide by 1
272 * 0x01 = divide by 2
273 * ...
274 * 0x07 = divide by 8
275 * @clkDivPhase: Clock divide phase relative to the encode clock.
276 * 0x0 = 0 input clock cycles delayed
277 * 0x1 = 1 input clock cycles delayed
278 * ...
279 * 0x7 = 7 input clock cycles delayed
280 * @adcVref: Main reference full-scale VREF adjustment.
281 * 0x0f = internal 2.087 V p-p
282 * ...
283 * 0x01 = internal 1.772 V p-p
284 * 0x00 = internal 1.75 V p-p [default]
285 * 0x1F = internal 1.727 V p-p
286 * ...
287 * 0x10 = internal 1.383 V p-p
288 * @pllLowEncode: PLL low encode.
289 * 0 = for lane speeds > 2 Gbps
290 * 1 = for lane speeds < 2 Gbps
291 * @name: Device name.
292 */
293 struct ad6673_platform_data
294 {
295 /* Power configuration */
296 int8_t extrnPDWNmode;
297 /* Global clock */
298 int8_t enClkDCS;
299 int8_t clkSelection;
300 int8_t clkDivRatio;
301 int8_t clkDivPhase;
302 /* ADC Vref */
303 int8_t adcVref;
304 /* PLL */
305 int8_t pllLowEncode;
306 /* Device name */
307 int8_t name[16];
308 };
309
310 /**
311 * struct ad6673_jesd204b_cfg - JESD204B interface configuration.
312 *
313 * @jtxInStandBy: JTX in standby.
314 * 0 = 204B core is unaffected in standby
315 * 1 = 204B core is powered down except for PLL during standby
316 * @cmlLevel: JESD204B CML differential output drive level adjustment.
317 * 0 = 81% of nominal (that is, 238 mV)
318 * 1 = 89% of nominal (that is, 262 mV)
319 * 2 = 98% of nominal (that is, 286 mV)
320 * 3 = nominal [default] (that is, 293 mV)
321 * 6 = 126% of nominal (that is, 368 mV)
322 * @quickCfgOption: Quick configuration register.
323 * 0x11 = M = 1, L = 1; one converter, one lane
324 * 0x12 = M = 1, L = 2; one converter, two lanes
325 * 0x21 = M = 2, L = 1; two converters, one lane
326 * 0x22 = M = 2, L = 2; two converters, two lanes
327 * @subclass: JESD204B subclass.
328 * 0 = Subclass 0
329 * 1 = Subclass 1
330 * @ctrlBitsNo: Number of control bits (CS).
331 * 0 = no control bits(CS = 0)
332 * 1 = 1 control bit (CS = 1)
333 * 2 = 2 control bits (CS = 2)
334 * @ctrlBitsAssign: JTX CS bits assignment.
335 * 0 = {overrange||underrange, valid}
336 * 1 = {overrange||underrange}
337 * 2 = {overrange||underrange, blank}
338 * 3 = {blank, valid}
339 * 4 = {blank, blank}
340 * All others = {overrange||underrange, valid}
341 * @tailBitsMode: Tail bits: If CS bits are not enabled.
342 * 0 = extra bits are 0
343 * 1 = extra bits are 9-bit PN
344 * @did: JESD204B device identification value: DID[7:0]
345 * @bid: JESD204B bank identification value : BID[3:0]
346 * @lid0: JESD204B lane0 identification value: LID[4:0]
347 * @lid1: JESD204B lane1 identification value: LID[4:0]
348 * @k: JESD204B number of frames per multiframe (K); set value of K per JESD204B
349 * specifications, but also must be a multiple of 4 octets.
350 * @scrambling: JESD204B scrambling (SCR).
351 * 0 = disabled
352 * 1 = enabled
353 * @ilasMode: Initial lane alignment sequence (ILAS) mode.
354 * 1 = ILAS normal mode enabled
355 * 3 = ILAS always on, test mode
356 * @enIlasTest: JESD204B test sample.
357 * 0 = disabled
358 * 1 = enabled
359 * @invertLogicBits: Invert logic of JESD204B bits.
360 * 0 = non-invert
361 * 1 = invert
362 * @enSysRef: SYSREF+- enable.
363 * 0 = disabled
364 * 1 = enabled
365 * @enSyncInB: Enable SYNCINB+- buffer.
366 * 0 = buffer disabled
367 * 1 = buffer enabled
368 * @sysRefMode: SYSREF+- mode.
369 * 0 = continuous reset clock dividers
370 * 1 = sync on next SYSREF+- rising edge only
371 * @alignSyncInB: Options for interpreting single on SYNCINB+-.
372 * 0 = normal mode
373 * 1 = realign lanes on every active SYNCINB+-
374 * @alignSysRef: Options for interpreting single on SYSREF+-.
375 * 0 = normal mode;
376 * 1 = realign lanes on every active SYSREF+-
377 * @lane0Assign: Option to remap converter and lane assignments.
378 * 0 = assign Logical Lane 0 to Physical Lane A [default]
379 * 1 = assign Logical Lane 0 to Physical Lane B
380 * @lane1Assign: Option to remap converter and lane assignments.
381 * 0 = assign Logical Lane 1 to Physical Lane A
382 * 1 = assign Logical Lane 1 to Physical Lane B [default]
383 */
384 struct ad6673_jesd204b_cfg
385 {
386 /* Power configuration */
387 int8_t jtxInStandBy;
388 /* Output drive adjustment */
389 int8_t cmlLevel;
390 /* Quick configuration */
391 int8_t quickCfgOption;
392 /* Detailed Options */
393 int8_t subclass;
394 int8_t ctrlBitsNo;
395 int8_t ctrlBitsAssign;
396 int8_t tailBitsMode;
397 int8_t did;
398 int8_t bid;
399 int8_t lid0;
400 int8_t lid1;
401 int8_t k;
402 int8_t scrambling;
403 int8_t ilasMode;
404 int8_t enIlasTest;
405 int8_t invertLogicBits;
406 int8_t enSysRef;
407 int8_t enSyncInB;
408 int8_t sysRefMode;
409 int8_t alignSyncInB;
410 int8_t alignSysRef;
411 int8_t lane0Assign;
412 int8_t lane1Assign;
413 };
414
415 /**
416 * struct ad6673_fast_detect_cfg - Fast Detect module configuration.
417 *
418 * @enFd: Enable fast detect output.
419 * 0 = disable
420 * 1 = enable
421 * @pinFunction: Pin function.
422 * 0 = fast detect
423 * 1 = overrange
424 * @forcePins: Force FDA/FDB pins
425 * 0 = normal function
426 * 1 = force to value
427 * @pinForceValue: Force value of FDA/FDB pins.
428 * 0 = output on FD pins will be 0
429 * 1 = output on FD pins will be 1
430 * @fdUpperTresh: Fast Detect Upper Threshold[14:0].
431 * @fdLowerTresh: Fast Detect Lower Threshold[14:0].
432 * @dfDwellTime: Fast Detect Dwell Time[15:0].
433 */
434 struct ad6673_fast_detect_cfg
435 {
436 int8_t enFd;
437 int8_t pinFunction;
438 int8_t forcePins;
439 int8_t pinForceValue;
440 int16_t fdUpperTresh;
441 int16_t fdLowerTresh;
442 int16_t dfDwellTime;
443 };
444
445 typedef struct _ad6673_typeBand
446 {
447 int32_t f0;
448 int32_t fCenter;
449 int32_t f1;
450 }ad6673_typeBand;
451
452 /******************************************************************************/
453 /************************ Functions Declarations ******************************/
454 /******************************************************************************/
455
456 /*! Configures the device. */
457 int32_t ad6673_setup(int32_t spiBaseAddr, int32_t ssNo);
458 /*! Reads the value of the selected register. */
459 int32_t ad6673_read(int32_t registerAddress);
460 /*! Writes a value to the selected register. */
461 int32_t ad6673_write(int32_t registerAddress, int32_t registerValue);
462 /*! Initiates a transfer and waits for the operation to end. */
463 int32_t ad6673_transfer(void);
464 /*! Resets all registers to their default values. */
465 int32_t ad6673_soft_reset(void);
466 /*! Configures the power mode of the chip. */
467 int32_t ad6673_chip_pwr_mode(int32_t mode);
468 /*! Selects a channel as the current channel for further configurations. */
469 int32_t ad6673_select_channel_for_config(int32_t channel);
470 /*! Sets the ADC's test mode. */
471 int32_t ad6673_test_mode(int32_t mode);
472 /*! Sets the offset adjustment. */
473 int32_t ad6673_offset_adj(int32_t adj);
474 /*! Disables (1) or enables (0) the data output. */
475 int32_t ad6673_output_disable(int32_t en);
476 /*! Activates the inverted (1) or normal (0) output mode. */
477 int32_t ad6673_output_invert(int32_t invert);
478 /*! Specifies the output format. */
479 int32_t ad6673_output_format(int32_t format);
480 /*! Sets (1) or clears (0) the reset short PN sequence bit(PN9). */
481 int32_t ad6673_reset_PN9(int32_t rst);
482 /*! Sets (1) or clears (0) the reset long PN sequence bit(PN23). */
483 int32_t ad6673_reset_PN23(int32_t rst);
484 /*! Configures a User Test Pattern. */
485 int32_t ad6673_set_user_pattern(int32_t patternNo, int32_t user_pattern);
486 /*! Enables the Build-In-Self-Test. */
487 int32_t ad6673_bist_enable(int32_t enable);
488 /*! Resets the Build-In-Self-Test. */
489 int32_t ad6673_bist_reset(int32_t reset);
490 /*! Configures the JESD204B interface. */
491 int32_t ad6673_jesd204b_setup(void);
492 /*! Configures the power mode of the JESD204B data transmit block. */
493 int32_t ad6673_jesd204b_pwr_mode(int32_t mode);
494 /*! Selects the point in the processing path of a lane, where the test data will
495 be inserted. */
496 int32_t ad6673_jesd204b_select_test_injection_point(int32_t injPoint);
497 /*! Selects a JESD204B test mode. */
498 int32_t ad6673_jesd204b_test_mode(int32_t testMode);
499 /*! Inverts the logic of JESD204B bits. */
500 int32_t ad6673_jesd204b_invert_logic(int32_t invert);
501 /*! Configures the Fast-Detect module. */
502 int32_t ad6673_fast_detect_setup(void);
503 /*! Enables DC correction for use in the output data signal path. */
504 int32_t ad6673_dcc_enable(int32_t enable);
505 /*! Selects the bandwidth value for the DC correction circuit. */
506 int32_t ad6673_dcc_bandwidth(int32_t bw);
507 /*! Freezes DC correction value. */
508 int32_t ad6673_dcc_freeze(int32_t freeze);
509 /*! Enables the Noise shaped requantizer(NRS). */
510 int32_t ad6673_nsr_enable(int32_t enable);
511 /*! Selects the NSR Bandwidth mode. */
512 int32_t ad6673_nsr_bandwidth_mode(int32_t mode);
513 /*! Sets the NSR frequency range. */
514 int32_t ad6673_nsr_tuning_freq(int64_t tuneFreq,
515 int64_t fAdc,
516 ad6673_typeBand *pBand);
517
518 #endif /* __AD6673_H__ */