Debian Codegraph @

thirdparty/analogdevicesinc/no-OS/fmcomms1/AD9122/AD9122.h

raw symbols SCIP
1 /***************************************************************************//**
2 * @file AD9122.h
3 * @brief Header file of AD9122 Driver.
4 * @author DBogdan ([email protected])
5 ********************************************************************************
6 * Copyright 2012(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 __AD9122_H__
43 #define __AD9122_H__
44
45 /*****************************************************************************/
46 /***************************** Include Files *********************************/
47 /*****************************************************************************/
48 #include <stdint.h>
49
50 /******************************************************************************/
51 /***************************** AD9122 *****************************************/
52 /******************************************************************************/
53 /* Registers */
54 #define AD9122_REG_COMM 0x00
55 #define AD9122_REG_POWER_CTRL 0x01
56 #define AD9122_REG_DATA_FORMAT 0x03
57 #define AD9122_REG_INTERRUPT_EN_1 0x04
58 #define AD9122_REG_INTERRUPT_EN_2 0x05
59 #define AD9122_REG_EVENT_FLAG_1 0x06
60 #define AD9122_REG_EVENT_FLAG_2 0x07
61 #define AD9122_REG_CLK_REC_CTRL 0x08
62 #define AD9122_REG_PLL_CTRL_1 0x0A
63 #define AD9122_REG_PLL_CTRL_2 0x0C
64 #define AD9122_REG_PLL_CTRL_3 0x0D
65 #define AD9122_REG_PLL_STATUS_1 0x0E
66 #define AD9122_REG_PLL_STATUS_2 0x0F
67 #define AD9122_REG_SYNC_CTRL_1 0x10
68 #define AD9122_REG_SYNC_CTRL_2 0x11
69 #define AD9122_REG_SYNC_STATUS_1 0x12
70 #define AD9122_REG_SYNC_STATUS_2 0x13
71 #define AD9122_REG_DATA_REC_STATUS 0x15
72 #define AD9122_REG_DCI_DELAY 0x16
73 #define AD9122_REG_FIFO_CTRL 0x17
74 #define AD9122_REG_FIFO_STATUS_1 0x18
75 #define AD9122_REG_FIFO_STATUS_2 0x19
76 #define AD9122_REG_DATAPATH_CTRL 0x1B
77 #define AD9122_REG_HB1_CTRL 0x1C
78 #define AD9122_REG_HB2_CTRL 0x1D
79 #define AD9122_REG_HB3_CTRL 0x1E
80 #define AD9122_REG_CHIP_ID 0x1F
81 #define AD9122_REG_FTW_7_0 0x30
82 #define AD9122_REG_FTW_15_8 0x31
83 #define AD9122_REG_FTW_23_16 0x32
84 #define AD9122_REG_FTW_31_24 0x33
85 #define AD9122_REG_NCO_PHA_OFFSET_LSB 0x34
86 #define AD9122_REG_NCO_PHA_OFFSET_MSB 0x35
87 #define AD9122_REG_NCO_FTW_UPDATE 0x36
88 #define AD9122_REG_I_PHA_ADJ_LSB 0x38
89 #define AD9122_REG_I_PHA_ADJ_MSB 0x39
90 #define AD9122_REG_Q_PHA_ADJ_LSB 0x3A
91 #define AD9122_REG_Q_PHA_ADJ_MSB 0x3B
92 #define AD9122_REG_I_DAC_OFFSET_LSB 0x3C
93 #define AD9122_REG_I_DAC_OFFSET_MSB 0x3D
94 #define AD9122_REG_Q_DAC_OFFSET_LSB 0x3E
95 #define AD9122_REG_Q_DAC_OFFSET_MSB 0x3F
96 #define AD9122_REG_I_DAC_FS_ADJ 0x40
97 #define AD9122_REG_I_DAC_CTRL 0x41
98 #define AD9122_REG_I_AUX_DAC_DATA 0x42
99 #define AD9122_REG_I_AUX_DAC_CTRL 0x43
100 #define AD9122_REG_Q_DAC_FS_ADJ 0x44
101 #define AD9122_REG_Q_DAC_CTRL 0x45
102 #define AD9122_REG_Q_AUX_DAC_DATA 0x46
103 #define AD9122_REG_Q_AUX_DAC_CTRL 0x47
104 #define AD9122_REG_DIE_TEMP_RANGE_CTRL 0x48
105 #define AD9122_REG_DIE_TEMP_LSB 0x49
106 #define AD9122_REG_DIE_TEMP_MSB 0x4A
107 #define AD9122_REG_SED_CTRL 0x67
108 #define AD9122_REG_COMPARE_I0_LSBS 0x68
109 #define AD9122_REG_COMPARE_I0_MSBS 0x69
110 #define AD9122_REG_COMPARE_Q0_LSBS 0x6A
111 #define AD9122_REG_COMPARE_Q0_MSBS 0x6B
112 #define AD9122_REG_COMPARE_I1_LSBS 0x6C
113 #define AD9122_REG_COMPARE_I1_MSBS 0x6D
114 #define AD9122_REG_COMPARE_Q1_LSBS 0x6E
115 #define AD9122_REG_COMPARE_Q1_MSBS 0x6F
116 #define AD9122_REG_SED_I_LSBS 0x70
117 #define AD9122_REG_SED_I_MSBS 0x71
118 #define AD9122_REG_SED_Q_LSBS 0x72
119 #define AD9122_REG_SED_Q_MSBS 0x73
120 #define AD9122_REG_REVISION 0x7F
121
122 /* AD9122_REG_COMM definitions */
123 #define AD9122_COMM_SDIO (1 << 7)
124 #define AD9122_COMM_LSB_FIRST (1 << 6)
125 #define AD9122_COMM_RESET (1 << 5)
126
127 /* AD9122_REG_POWER_CTRL definitions */
128 #define AD9122_POWER_CTRL_PD_I_DAC (1 << 7)
129 #define AD9122_POWER_CTRL_PD_Q_DAC (1 << 6)
130 #define AD9122_POWER_CTRL_PD_DATA_REC (1 << 5)
131 #define AD9122_POWER_CTRL_PD_AUX_ADC (1 << 4)
132
133 /* AD9122_REG_DATA_FORMAT definitions */
134 #define AD9122_DATA_FORMAT_BINARY (1 << 7)
135 #define AD9122_DATA_FORMAT_Q_DATA_FIRST (1 << 6)
136 #define AD9122_DATA_FORMAT_MSB_SWAP (1 << 5)
137 #define AD9122_DATA_FORMAT_BUS_WIDTH(x) (((x) & 0x3) << 0)
138
139 /* AD9122_REG_INTERRUPT_EN_1 definitions */
140 #define AD9122_INTERRUPT_EN_1_EN_PLL_LOCK_LOST (1 << 7)
141 #define AD9122_INTERRUPT_EN_1_EN_PLL_LOCKED (1 << 6)
142 #define AD9122_INTERRUPT_EN_1_EN_SYNC_SIGNAL_LOST (1 << 5)
143 #define AD9122_INTERRUPT_EN_1_EN_SYNC_SIGNAL_LOCKED (1 << 4)
144 #define AD9122_INTERRUPT_EN_1_EN_FIFO_WARNING_1 (1 << 1)
145 #define AD9122_INTERRUPT_EN_1_EN_FIFO_WARNING_2 (1 << 0)
146
147 /* AD9122_REG_INTERRUPT_EN_2 definitions */
148 #define AD9122_INTERRUPT_EN_2_EN_AED_COMPARE_PASS (1 << 4)
149 #define AD9122_INTERRUPT_EN_2_EN_AED_COMPARE_FAIL (1 << 3)
150 #define AD9122_INTERRUPT_EN_2_EN_SED_COMPARE_FAIL (1 << 2)
151
152 /* AD9122_REG_EVENT_FLAG_1 definitions */
153 #define AD9122_EVENT_FLAG_1_PLL_LOCK_LOST (1 << 7)
154 #define AD9122_EVENT_FLAG_1_PLL_LOCKED (1 << 6)
155 #define AD9122_EVENT_FLAG_1_SYNC_SIGNAL_LOST (1 << 5)
156 #define AD9122_EVENT_FLAG_1_SYNC_SIGNAL_LOCKED (1 << 4)
157 #define AD9122_EVENT_FLAG_1_FIFO_WARNING_1 (1 << 1)
158 #define AD9122_EVENT_FLAG_1_FIFO_WARNING_2 (1 << 0)
159
160 /* AD9122_REG_EVENT_FLAG_2 definitions */
161 #define AD9122_EVENT_FLAG_2_AED_COMPARE_PASS (1 << 4)
162 #define AD9122_EVENT_FLAG_2_AED_COMPARE_FAIL (1 << 3)
163 #define AD9122_EVENT_FLAG_2_SED_COMPARE_FAIL (1 << 2)
164
165 /* AD9122_REG_CLK_REC_CTRL definitions */
166 #define AD9122_CLK_REC_CTRL_DACCLK_DUTY_CORRECTION (1 << 7)
167 #define AD9122_CLK_REC_CTRL_REFCLK_DUTY_CORRECTION (1 << 6)
168 #define AD9122_CLK_REC_CTRL_DACCLK_CROSS_CORRECTION (1 << 5)
169 #define AD9122_CLK_REC_CTRL_REFCLK_CROSS_CORRECTION (1 << 4)
170
171 /* AD9122_REG_PLL_CTRL_1 definitions */
172 #define AD9122_PLL_CTRL_1_PLL_EN (1 << 7)
173 #define AD9122_PLL_CTRL_1_PLL_MANUAL_EN (1 << 6)
174 #define AD9122_PLL_CTRL_1_MANUAL_VCO_BAND(x) (((x) & 0x3F) << 0)
175
176 /* AD9122_REG_PLL_CTRL_2 definitions */
177 #define AD9122_PLL_CTRL_2_PLL_LOOP_BANDWIDTH(x) (((x) & 0x3) << 6)
178 #define AD9122_PLL_CTRL_2_PLL_CHARGE_PUMP_CURRENT(x) (((x) & 0x1F) << 0)
179
180 /* AD9122_REG_PLL_CTRL_3 definitions */
181 #define AD9122_PLL_CTRL_3_N2(x) (((x) & 0x3) << 6)
182 #define AD9122_PLL_CTRL_3_PLL_CROSS_CTRL_EN (1 << 4)
183 #define AD9122_PLL_CTRL_3_N0(x) (((x) & 0x3) << 2)
184 #define AD9122_PLL_CTRL_3_N1(x) (((x) & 0x3) << 0)
185
186 /* AD9122_REG_PLL_STATUS_1 definitions */
187 #define AD9122_PLL_STATUS_1_PLL_LOCKED (1 << 7)
188 #define AD9122_PLL_STATUS_1_VCO_CTRL_VOLTAGE(x) (((x) & 0xF) << 0)
189
190 /* AD9122_REG_PLL_STATUS_2 definitions */
191 #define AD9122_PLL_STATUS_2_VCO_BAND_READBACK(x) (((x) & 0x3F) << 0)
192
193 /* AD9122_REG_SYNC_CTRL_1 definitions */
194 #define AD9122_SYNC_CTRL_1_SYNC_EN (1 << 7)
195 #define AD9122_SYNC_CTRL_1_DATA_FIFO_RATE_TOGGLE (1 << 6)
196 #define AD9122_SYNC_CTRL_1_RISING_EDGE_SYNC (1 << 3)
197 #define AD9122_SYNC_CTRL_1_SYNC_AVERAGING(x) (((x) & 0x7) << 0)
198
199 /* AD9122_REG_SYNC_CTRL_2 definitions */
200 #define AD9122_SYNC_CTRL_2_SYNC_PHA_REQUEST(x) (((x) & 0x3F) << 0)
201
202 /* AD9122_REG_SYNC_STATUS_1 definitions */
203 #define AD9122_SYNC_STATUS_1_SYNC_LOST (1 << 7)
204 #define AD9122_SYNC_STATUS_1_SYNC_LOCKED (1 << 6)
205
206 /* AD9122_REG_SYNC_STATUS_2 definitions */
207 #define AD9122_SYNC_STATUS_2_SYNC_PHA_READBACK (((x) & 0xFF) << 0)
208
209 /* AD9122_REG_DATA_REC_STATUS definitions */
210 #define AD9122_DATA_REC_STATUS_LVDS_FRAME_LEVEL_H (1 << 5)
211 #define AD9122_DATA_REC_STATUS_LVDS_FRAME_LEVEL_L (1 << 4)
212 #define AD9122_DATA_REC_STATUS_LVDS_DCI_LEVEL_H (1 << 3)
213 #define AD9122_DATA_REC_STATUS_LVDS_DCI_LEVEL_L (1 << 2)
214 #define AD9122_DATA_REC_STATUS_LVDS_DATA_LEVEL_H (1 << 1)
215 #define AD9122_DATA_REC_STATUS_LVDS_DATA_LEVEL_L (1 << 0)
216
217 /* AD9122_REG_DCI_DELAY definitions */
218 #define AD9122_DCI_DELAY_DCI_DELAY(x) (((x) & 0x3) << 0)
219
220 /* AD9122_REG_FIFO_CTRL definitions */
221 #define AD9122_FIFO_CTRL_FIFO_PHA_OFFSET(x) (((x) & 0x7) << 0)
222
223 /* AD9122_REG_FIFO_STATUS_1 definitions */
224 #define AD9122_FIFO_STATUS_1_FIFO_WARNING_1 (1 << 7)
225 #define AD9122_FIFO_STATUS_1_FIFO_WARNING_2 (1 << 6)
226 #define AD9122_FIFO_STATUS_1_FIFO_SOFT_ALIGN_ACK (1 << 2)
227 #define AD9122_FIFO_STATUS_1_FIFO_SOFT_ALIGN_REQ (1 << 1)
228
229 /* AD9122_REG_FIFO_STATUS_2 definitions */
230 #define AD9122_FIFO_STATUS_2_FIFO_LEVEL (((x) & 0xFF) << 0)
231
232 /* AD9122_REG_DATAPATH_CTRL definitions */
233 #define AD9122_DATAPATH_CTRL_BYPASS_PREMOD (1 << 7)
234 #define AD9122_DATAPATH_CTRL_BYPASS_INV_SINC (1 << 6)
235 #define AD9122_DATAPATH_CTRL_BYPASS_NCO (1 << 5)
236 #define AD9122_DATAPATH_CTRL_NCO_GAIN (1 << 3)
237 #define AD9122_DATAPATH_CTRL_BYPASS_PHA_COMP_DC_OFFSET (1 << 2)
238 #define AD9122_DATAPATH_CTRL_SELECT_SIDEBAND (1 << 1)
239 #define AD9122_DATAPATH_CTRL_SEND_I_DATA_TO_Q_DATA (1 << 0)
240
241 /* AD9122_REG_HB1_CTRL definitions */
242 #define AD9122_HB1_CTRL_HB1(x) (((x) & 0x3) << 1)
243 #define AD9122_HB1_CTRL_BYPASS_HB1 (1 << 0)
244
245 /* AD9122_REG_HB2_CTRL definitions */
246 #define AD9122_HB2_CTRL_HB2(x) (((x) & 0x3F) << 1)
247 #define AD9122_HB2_CTRL_BYPASS_HB2 (1 << 0)
248
249 /* AD9122_REG_HB3_CTRL definitions */
250 #define AD9122_HB3_CTRL_HB3(x) (((x) & 0x3F) << 1)
251 #define AD9122_HB3_CTRL_BYPASS_HB3 (1 << 0)
252
253 /* Value of AD9122_REG_CHIP_ID */
254 #define AD9122_CHIP_ID 0x08
255
256 /* AD9122_REG_NCO_FTW_UPDATE definitions */
257 #define AD9122_NCO_FTW_UPDATE_FRAME_FTW_ACK (1 << 5)
258 #define AD9122_NCO_FTW_UPDATE_FRAME_FTW_REQ (1 << 4)
259 #define AD9122_NCO_FTW_UPDATE_UPDATE_FTW_ACK (1 << 1)
260 #define AD9122_NCO_FTW_UPDATE_UPDATE_FTW_REQ (1 << 0)
261
262 /* AD9122_REG_I_PHA_ADJ_LSB definitions */
263 #define AD9122_REG_I_PHA_ADJ_7_0(x) (((x) & 0xFF) << 0)
264
265 /* AD9122_REG_I_PHA_ADJ_MSB definitions */
266 #define AD9122_REG_I_PHA_ADJ_9_8(x) (((x) & 0x3) << 0)
267
268 /* AD9122_REG_Q_PHA_ADJ_LSB definitions */
269 #define AD9122_REG_Q_PHA_ADJ_7_0(x) (((x) & 0xFF) << 0)
270
271 /* AD9122_REG_Q_PHA_ADJ_MSB definitions */
272 #define AD9122_REG_Q_PHA_ADJ_9_8(x) (((x) & 0x3) << 0)
273
274 /* AD9122_REG_I_DAC_FS_ADJ definitions */
275 #define AD9122_I_DAC_FS_ADJ_I_DAC_FS_ADJ_7_0(x) (((x) & 0xFF) << 0)
276
277 /* AD9122_I_DAC_CTRL definitions */
278 #define AD9122_I_DAC_CTRL_I_DAC_SLEEP (1 << 7)
279 #define AD9122_I_DAC_CTRL_I_DAC_FS_ADJ_9_8(x) (((x) & 0x3) << 0)
280
281 /* AD9122_REG_I_AUX_DAC_DATA definitions */
282 #define AD9122_I_AUX_DAC_DATA_I_AUX_DAC_7_0 (((x) & 0xFF) << 0)
283
284 /* AD9122_REG_I_AUX_DAC_CTRL definitions */
285 #define AD9122_I_AUX_DAC_CTRL_I_AUX_DAC_SIGN (1 << 7)
286 #define AD9122_I_AUX_DAC_CTRL_I_AUX_DAC_CURRENT_DIR (1 << 6)
287 #define AD9122_I_AUX_DAC_CTRL_I_AUX_DAC_SLEEP (1 << 5)
288 #define AD9122_I_AUX_DAC_CTRL_I_AUX_DAC_9_8(x) (((x) & 0x3) << 0)
289
290 /* AD9122_REG_Q_DAC_FS_ADJ definitions */
291 #define AD9122_Q_DAC_FS_ADJ_Q_DAC_FS_ADJ_7_0(x) (((x) & 0xFF) << 0)
292
293 /* AD9122_Q_DAC_CTRL definitions */
294 #define AD9122_Q_DAC_CTRL_Q_DAC_SLEEP (1 << 7)
295 #define AD9122_Q_DAC_CTRL_Q_DAC_FS_ADJ_9_8(x) (((x) & 0x3) << 0)
296
297 /* AD9122_REG_Q_AUX_DAC_DATA definitions */
298 #define AD9122_Q_AUX_DAC_DATA_Q_AUX_DAC_7_0 (((x) & 0xFF) << 0)
299
300 /* AD9122_REG_Q_AUX_DAC_CTRL definitions */
301 #define AD9122_Q_AUX_DAC_CTRL_Q_AUX_DAC_SIGN (1 << 7)
302 #define AD9122_Q_AUX_DAC_CTRL_Q_AUX_DAC_CURRENT_DIR (1 << 6)
303 #define AD9122_Q_AUX_DAC_CTRL_Q_AUX_DAC_SLEEP (1 << 5)
304 #define AD9122_Q_AUX_DAC_CTRL_Q_AUX_DAC_9_8(x) (((x) & 0x3) << 0)
305
306 /* AD9122_REG_DIE_TEMP_RANGE_CTRL definitions */
307 #define AD9122_DIE_TEMP_RANGE_CTRL_FS_CURRENT(x) (((x) & 0x7) << 4)
308 #define AD9122_DIE_TEMP_RANGE_CTRL_REF_CURRENT(x) (((x) & 0x7) << 1)
309 #define AD9122_DIE_TEMP_RANGE_CTRL_CAP_VALUE (1 << 0)
310
311 /* AD9122_REG_SED_CTRL definitions */
312 #define AD9122_SED_CTRL_SED_COMPARE_EN (1 << 7)
313 #define AD9122_SED_CTRL_SAMPLE_ERR_DETECTED (1 << 5)
314 #define AD9122_SED_CTRL_AUTOCLEAR_EN (1 << 3)
315 #define AD9122_SED_CTRL_COMPARE_FAIL (1 << 1)
316 #define AD9122_SED_CTRL_COMPARE_PASS (1 << 0)
317
318 /* Values of AD9122_REG_REVISION */
319 #define AD9122_DIE_REV_1 0x1
320 #define AD9122_DIE_REV_2 0x3
321
322 #define CHIPID_AD9122 0x8
323
324 #define AD9122_HB23_INTERP(x) (((x) << 1) | ((x) << 4))
325 #define AD9122_HB1_INTERP(x) ((x) << 1)
326
327 #define AD9122_MAX_DAC_RATE 1230000000UL
328
329 /******************************************************************************/
330 /************************ Functions Declarations ******************************/
331 /******************************************************************************/
332 /** Initializes the AD9122. */
333 /* **Returns negative error code or 0 in case of success. */
334 int32_t ad9122_setup(void* pfnSetDataClock,
335 void* pfnSetDacClock,
336 void* pfnSetRefClock,
337 void* pfnRoundRateDataClock,
338 void* pfnRoundRateDacClock,
339 void* pfnRoundRateRefClock);
340
341 /** Resets the device. */
342 int32_t ad9122_reset();
343
344 /** Calibrates the AD9122 DCI.*/
345 int32_t ad9122_dci_calibrate();
346
347 /** Sets the data rate.*/
348 /* ** Returns the set data rate. */
349 int32_t ad9122_set_data_rate(uint32_t rate);
350
351 /** Sets the interpolation frequency. */
352 /* ** Returns the set interpolation frequency. */
353 int32_t ad9122_out_altvoltage_interpolation_frequency(int32_t val);
354
355 /** Stores the available interpolation frequencies in the array supplied as parameter. */
356 /* ** Returns 0 for success or negative error code. */
357 int32_t out_altvoltage_interpolation_frequency_available(int32_t* val_array);
358
359 /** Sets the center frequency shift value.*/
360 /* ** Returns the set center frequency shift. */
361 int32_t ad9122_out_altvoltage_interpolation_center_shift_frequency(int32_t val);
362
363 /** Stores the available center shift frequencies in the array supplied as parameter. */
364 /* ** Returns 0 for success or negative error code. */
365 int32_t out_altvoltage_interpolation_center_shift_frequency_available(int32_t* val_array);
366
367 /** Sets the full-scale current for I DAC. */
368 /* ** Returns the set full-scale current. */
369 int32_t ad9122_fs_adj_I_DAC(int32_t fs_adj);
370
371 /** Sets the full-scale current for Q DAC. */
372 /* ** Returns the set full-scale current. */
373 int32_t ad9122_fs_adj_Q_DAC(int32_t fs_adj);
374
375 /** Sets the offset of the I DAC. */
376 /* ** Returns the set offset. */
377 int32_t ad9122_offset_I_DAC(int32_t offset);
378
379 /** Sets the offset of the Q DAC. */
380 /* ** Returns the set offset. */
381 int32_t ad9122_offset_Q_DAC(int32_t offset);
382
383 /** Sets the phase adjustment of the I DAC. */
384 /* ** Returns the set phase adjustment. */
385 int32_t ad9122_phaseAdj_I_DAC(int32_t phaseAdj);
386
387 /** Sets the phase adjustment of the Q DAC. */
388 /* ** Returns the set phase adjustment. */
389 int32_t ad9122_phaseAdj_Q_DAC(int32_t phaseAdj);
390
391 /** Gets the AD9122 FIFO status registers. */
392 /* ** Returns negative error code in case of error or 0 in case of success.*/
393 int32_t ad9122_get_fifo_status_regs(uint8_t *status1,
394 uint8_t *status2);
395 /** Sets the input data format. */
396 /* ** Returns negative error code in case of error or the set input data format.*/
397 int32_t ad9122_set_data_format(uint8_t format);
398
399 /** Gets the AD9122 die temperature code. */
400 int32_t ad9122_get_temperature_code(void);
401 /* ** Returns negative error code in case of error or the die temperature code. */
402 #endif // __AD9122_H__