no-OS
adf5902.h
Go to the documentation of this file.
1 /***************************************************************************/
34 #ifndef SRC_ADF5902_H_
35 #define SRC_ADF5902_H_
36 
37 /******************************************************************************/
38 /***************************** Include Files **********************************/
39 /******************************************************************************/
40 #include <stdint.h>
41 #include "no_os_spi.h"
42 #include "no_os_gpio.h"
43 
44 /******************************************************************************/
45 /********************** Macros and Constants Definitions **********************/
46 /******************************************************************************/
47 
48 /* Registers Control Bits */
49 #define ADF5902_REG0 0x0
50 #define ADF5902_REG1 0x1
51 #define ADF5902_REG2 0x2
52 #define ADF5902_REG3 0x3
53 #define ADF5902_REG4 0x4
54 #define ADF5902_REG5 0x5
55 #define ADF5902_REG6 0x6
56 #define ADF5902_REG7 0x7
57 #define ADF5902_REG8 0x8
58 #define ADF5902_REG9 0x9
59 #define ADF5902_REG10 0xA
60 #define ADF5902_REG11 0xB
61 #define ADF5902_REG12 0xC
62 #define ADF5902_REG13 0xD
63 #define ADF5902_REG14 0xE
64 #define ADF5902_REG15 0xF
65 #define ADF5902_REG16 0x10
66 #define ADF5902_REG17 0x11
67 
68 /* Register 0 Map */
69 #define ADF5902_REG0_PLO(x) (((x) & 0x1) << 5)
70 #define ADF5902_REG0_PTX1(x) (((x) & 0x1) << 6)
71 #define ADF5902_REG0_PTX2(x) (((x) & 0x1) << 7)
72 #define ADF5902_REG0_PADC(x) (((x) & 0x1) << 8)
73 #define ADF5902_REG0_VCAL(x) (((x) & 0x1) << 9)
74 #define ADF5902_REG0_PVCO(x) (((x) & 0x1) << 10)
75 #define ADF5902_REG0_TX1C(x) (((x) & 0x1) << 11)
76 #define ADF5902_REG0_TX2C(x) (((x) & 0x1) << 12)
77 #define ADF5902_REG0_RESERVED (0x4007FU << 13)
78 
79 /* Register 0 Bit Definitions */
80 #define ADF5902_POWER_DOWN_LO 0x0
81 #define ADF5902_POWER_UP_LO 0x1
82 
83 #define ADF5902_POWER_DOWN_TX1 0x0
84 #define ADF5902_POWER_UP_TX1 0x1
85 
86 #define ADF5902_POWER_DOWN_TX2 0x0
87 #define ADF5902_POWER_UP_TX2 0x1
88 
89 #define ADF5902_POWER_DOWN_ADC 0x0
90 #define ADF5902_POWER_UP_ADC 0x1
91 
92 #define ADF5902_VCO_NORMAL_OP 0x0
93 #define ADF5902_VCO_FULL_CAL 0x1
94 
95 #define ADF5902_POWER_DOWN_VCO 0x0
96 #define ADF5902_POWER_UP_VCO 0x1
97 
98 #define ADF5902_TX1_NORMAL_OP 0x0
99 #define ADF5902_TX1_AMP_CAL 0x1
100 
101 #define ADF5902_TX2_NORMAL_OP 0x0
102 #define ADF5902_TX2_AMP_CAL 0x1
103 
104 /* Register 1 Map */
105 #define ADF5902_REG1_TX_AMP_CAL_REF(x) (((x) & 0xFF) << 5)
106 #define ADF5902_REG1_RESERVED (0x7FFBFU << 13)
107 
108 /* Register 1 Bit Definitions */
109 #define ADF5902_TX_AMP_CAL_MIN_REF_CODE 0x00
110 #define ADF5902_TX_AMP_CAL_MAX_REF_CODE 0xFF
111 
112 /* Register 2 Map */
113 #define ADF5902_REG2_ADC_CLK_DIV(x) (((x) & 0xFF) << 5)
114 #define ADF5902_REG2_ADC_AVG(x) (((x) & 0x3) << 13)
115 #define ADF5902_REG2_ADC_START(x) (((x) & 0x1) << 15)
116 #define ADF5902_REG2_RESERVED (0x2 << 16)
117 
118 /* Register 2 Bit Definitions */
119 #define ADF5902_ADC_MIN_CLK_DIVIDER 0x1
120 #define ADF5902_ADC_MAX_CLK_DIVIDER 0x7F
121 
122 #define ADF5902_ADC_AVG_1 0x0
123 #define ADF5902_ADC_AVG_2 0x1
124 #define ADF5902_ADC_AVG_3 0x2
125 #define ADF5902_ADC_AVG_4 0x3
126 
127 #define ADF5902_ADC_NORMAL_OP 0x0
128 #define ADF5902_START_ADC_CONV 0x1
129 
130 /* Register 3 Map */
131 #define ADF5902_REG3_READBACK_CTRL(x) (((x) & 0x3F) << 5)
132 #define ADF5902_REG3_IO_LVL(x) (((x) & 0x1) << 11)
133 #define ADF5902_REG3_MUXOUT(x) (((x) & 0xF) << 12)
134 #define ADF5902_REG3_RESERVED (0x189 << 16)
135 
136 /* Register 3 Bit Definitions */
137 #define ADF5902_REG_RB_NONE 0x0
138 #define ADF5902_REG0_RB 0x1
139 #define ADF5902_REG1_RB 0x2
140 #define ADF5902_REG2_RB 0x3
141 #define ADF5902_REG3_RB 0x4
142 #define ADF5902_REG4_RB 0x5
143 #define ADF5902_REG5_RB 0x6
144 #define ADF5902_REG6_RB 0x7
145 #define ADF5902_REG7_RB 0x8
146 #define ADF5902_REG8_RB 0x9
147 #define ADF5902_REG9_RB 0xA
148 #define ADF5902_REG10_RB 0xB
149 #define ADF5902_REG11_RB 0xC
150 #define ADF5902_REG12_RB 0xD
151 #define ADF5902_REG13_SEL_0_RB 0xE
152 #define ADF5902_REG14_SEL_0_RB 0xF
153 #define ADF5902_REG15_SEL_0_RB 0x10
154 #define ADF5902_REG16_SEL_0_RB 0x11
155 #define ADF5902_REG17_RB 0x12
156 #define ADF5902_ADC_RB 0x16
157 #define ADF5902_FREQ_RB 0x1A
158 #define ADF5902_REG13_SEL_1_RB 0x33
159 #define ADF5902_REG14_SEL_1_RB 0x34
160 #define ADF5902_REG15_SEL_1_RB 0x35
161 #define ADF5902_REG16_SEL_1_RB 0x36
162 #define ADF5902_REG13_SEL_2_RB 0x37
163 #define ADF5902_REG14_SEL_2_RB 0x38
164 #define ADF5902_REG15_SEL_2_RB 0x39
165 #define ADF5902_REG16_SEL_2_RB 0x3A
166 #define ADF5902_REG13_SEL_3_RB 0x3B
167 #define ADF5902_REG14_SEL_3_RB 0x3C
168 #define ADF5902_REG15_SEL_3_RB 0x3D
169 #define ADF5902_REG16_SEL_3_RB 0x3F
170 
171 #define ADF5902_IO_LVL_1V8 0x0
172 #define ADF5902_IO_LVL_3V3 0x1
173 
174 #define ADF5902_MUXOUT_TRISTATE_OUT 0x0
175 #define ADF5902_MUXOUT_LOGIC_HIGH 0x1
176 #define ADF5902_MUXOUT_LOGIC_LOW 0x2
177 #define ADF5902_MUXOUT_R_DIV_OUT 0x3
178 #define ADF5902_MUXOUT_N_DIV_OUT 0x4
179 #define ADF5902_MUXOUT_CAL_BUSY 0x7
180 #define ADF5902_MUXOUT_R_DIV_OUT_2 0xB
181 #define ADF5902_MUXOUT_N_DIV_OUT_2 0xC
182 #define ADF5902_MUXOUT_RAMP_STATUS 0xF
183 
184 /* Register 4 Map */
185 #define ADF5902_REG4_TEST_BUS(x) (((x) & 0x7FFF) << 5)
186 #define ADF5902_REG4_RESERVED (0x0 << 16)
187 
188 /* Register 4 Bit Definitions */
189 #define ADF5902_TEST_BUS_NONE 0x0000
190 #define ADF5902_RAMP_COMPL_TO_MUXOUT 0x00C0
191 #define ADF5902_RAMP_DOWN_TO_MUXOUT 0x0100
192 #define ADF5902_TEMP_SENS_TO_ATEST 0x0503
193 #define ADF5902_TEMP_SENS_TO_ADC 0x0903
194 
195 /* Register 5 Map */
196 #define ADF5902_REG5_FRAC_MSB_WORD(x) (((x) & 0xFFF) << 5)
197 #define ADF5902_REG5_INTEGER_WORD(x) (((x) & 0xFFF) << 17)
198 #define ADF5902_REG5_RAMP_ON(x) (((x) & 0x1) << 29)
199 #define ADF5902_REG5_RESERVED (0x0 << 30)
200 
201 /* Register 5 Bit Definitions */
202 #define ADF5902_MIN_FRAC_MSB_WORD 0x000
203 #define ADF5902_MAX_FRAC_MSB_WORD 0xFFF
204 
205 #define ADF5902_MIN_INT_MSB_WORD 0x000
206 #define ADF5902_MAX_INT_MSB_WORD 0xFFF
207 
208 #define ADF5902_RAMP_ON_DISABLED 0x0
209 #define ADF5902_RAMP_ON_ENABLED 0x1
210 
211 /* Register 6 Map */
212 #define ADF5902_REG6_FRAC_LSB_WORD(x) (((x) & 0x1FFF) << 5)
213 #define ADF5902_REG6_RESERVED (0x0 << 18)
214 
215 /* Register 6 Bit Definitions */
216 #define ADF5902_MIN_FRAC_LSB_WORD 0x000
217 #define ADF5902_MAX_FRAC_LSB_WORD 0x1FFF
218 
219 /* Register 7 Map */
220 #define ADF5902_REG7_R_DIVIDER(x) (((x) & 0x1F) << 5)
221 #define ADF5902_REG7_REF_DOUBLER(x) (((x) & 0x1) << 10)
222 #define ADF5902_REG7_R_DIV_2(x) (((x) & 0x1) << 11)
223 #define ADF5902_REG7_CLK_DIV(x) (((x) & 0xFFF) << 12)
224 #define ADF5902_REG7_MASTER_RESET(x) (((x) & 0x1) << 25)
225 #define ADF5902_REG7_RESERVED ((0x0 << 26) | (0x1 << 24))
226 
227 /* Register 7 Bit Definitions */
228 #define ADF5902_MIN_R_DIVIDER 0x01
229 #define ADF5902_MAX_R_DIVIDER 0x1F
230 
231 #define ADF5902_R_DIV_2_DISABLE 0x0
232 #define ADF5902_R_DIV_2_ENABLE 0x1
233 
234 #define ADF5902_REF_DOUBLER_DISABLE 0x0
235 #define ADF5902_REF_DOUBLER_ENABLE 0x1
236 
237 #define ADF5902_MIN_CLK_DIVIDER 0x000
238 #define ADF5902_MAX_CLK_DIVIDER 0xFFF
239 
240 #define ADF5902_MASTER_RESET_DISABLE 0x0
241 #define ADF5902_MASTER_RESET_ENABLE 0x1
242 
243 /* Register 8 Map */
244 #define ADF5902_REG8_FREQ_CAL_DIV(x) (((x) & 0x3FF) << 5)
245 #define ADF5902_REG8_RESERVED (0x8000 << 15)
246 
247 /* Register 8 Bit Definitions */
248 #define ADF5902_MIN_FREQ_CAL_DIV 0x000
249 #define ADF5902_MAX_FREQ_CAL_DIV 0x3FF
250 
251 /* Register 9 Map */
252 #define ADF5902_REG9_RESERVED_CALIB (0x15105C9 << 5)
253 #define ADF5902_REG9_RESERVED_NORMAL (0x14005C9 << 5)
254 
255 /* Register 10 Map */
256 #define ADF5902_REG10_RESERVED (0xE99532 << 5)
257 
258 /* Register 11 Map */
259 #define ADF5902_REG11_CNTR_RESET(x) (((x) & 0x1) << 5)
260 #define ADF5902_REG11_RAMP_MODE(x) (((x) & 0x3) << 7)
261 #define ADF5902_REG11_SING_FULL_TRI(x) (((x) & 0x1) << 9)
262 #define ADF5902_REG11_SD_RESET(x) (((x) & 0x1) << 11)
263 #define ADF5902_REG11_RESERVED ((0x0 << 6) | (0x0 << 10) | (0x0 << 12))
264 
265 /* Register 11 Bit Definitions */
266 #define ADF5902_CNTR_RESET_DISABLE 0x0
267 #define ADF5902_CNTR_RESET_ENABLE 0x1
268 
269 #define ADF5902_CONT_SAWTOOTH 0x0
270 #define ADF5902_SAWTOOTH_BURST 0x1
271 #define ADF5902_CONTINUOUS_TRIANGULAR 0x2
272 #define ADF5902_SINGLE_RAMP_BURST 0x3
273 
274 #define ADF5902_SINGLE_FULL_TRI_DISBLE 0x0
275 #define ADF5902_SINGLE_FULL_TRI_ENABLE 0x1
276 
277 #define ADF5902_SD_RESET_ENABLE 0x0
278 #define ADF5902_SD_RESET_DISABLE 0x1
279 
280 /* Register 12 Map */
281 #define ADF5902_REG12_CP_TRISTATE(x) (((x) & 0x1) << 15)
282 #define ADF5902_REG12_CHARGE_PUMP(x) (((x) & 0xF) << 17)
283 #define ADF5902_REG12_RESERVED ((0x0 << 5) | (0x1 << 16) | (0x2 << 21))
284 
285 /* Register 12 Bit Definition */
286 #define ADF5902_CP_TRISTATE_DISABLE 0x0
287 #define ADF5902_CP_TRISTATE_ENABLE 0x1
288 
289 #define ADF5902_CP_CURRENT_280UA 0x0
290 #define ADF5902_CP_CURRENT_560UA 0x1
291 #define ADF5902_CP_CURRENT_840UA 0x2
292 #define ADF5902_CP_CURRENT_1MA12 0x3
293 #define ADF5902_CP_CURRENT_1MA40 0x4
294 #define ADF5902_CP_CURRENT_1MA68 0x5
295 #define ADF5902_CP_CURRENT_1MA96 0x6
296 #define ADF5902_CP_CURRENT_2MA24 0x7
297 #define ADF5902_CP_CURRENT_2MA52 0x8
298 #define ADF5902_CP_CURRENT_2MA80 0x9
299 #define ADF5902_CP_CURRENT_3MA08 0xA
300 #define ADF5902_CP_CURRENT_3MA36 0xB
301 #define ADF5902_CP_CURRENT_3MA64 0xC
302 #define ADF5902_CP_CURRENT_3MA92 0xD
303 #define ADF5902_CP_CURRENT_4MA20 0xE
304 #define ADF5902_CP_CURRENT_4MA48 0xF
305 
306 /* Register 13 Map */
307 #define ADF5902_REG13_CLK_DIV_SEL(x) (((x) & 0x3) << 5)
308 #define ADF5902_REG13_CLK_DIV_2(x) (((x) & 0xFFF) << 7)
309 #define ADF5902_REG13_CLK_DIV_MODE(x) (((x) & 0x3) << 19)
310 #define ADF5902_REG13_LE_SEL(x) (((x) & 0x1) << 21)
311 #define ADF5902_REG13_RESERVED (0x0 << 22)
312 
313 /* Register 13 Bit Definitions */
314 #define ADF5902_CLK_DIV_SEL_0 0x0
315 #define ADF5902_CLK_DIV_SEL_1 0x1
316 #define ADF5902_CLK_DIV_SEL_2 0x2
317 #define ADF5902_CLK_DIV_SEL_3 0x3
318 
319 #define ADF5902_MIN_CLK_DIV_2 0x000
320 #define ADF5902_MAX_CLK_DIV_2 0xFFF
321 
322 #define ADF5902_CLK_DIV_OFF 0x0
323 #define ADF5902_FREQ_MEASURE 0x2
324 #define ADF5902_RAMP_DIV 0x3
325 
326 #define ADF5902_LE_FROM_PIN 0x0
327 #define ADF5902_LE_SYNC_REFIN 0x1
328 
329 /* Register 14 Map */
330 #define ADF5902_REG14_DEV_WORD(x) (((x) & 0xFFFF) << 5)
331 #define ADF5902_REG14_DEV_OFFSET(x) (((x) & 0xF) << 21)
332 #define ADF5902_REG14_DEV_SEL(x) (((x) & 0x3) << 25)
333 #define ADF5902_REG14_TX_RAMP_CLK(x) (((x) & 0x1) << 30)
334 #define ADF5902_REG14_TX_DATA_INV(x) (((x) & 0x1) << 31)
335 #define ADF5902_REG14_RESERVED (0x0 << 27)
336 
337 /* Register 14 Bit Definitions */
338 #define ADF5902_MAX_DEV_WORD 0x7FFF
339 #define ADF5902_MIN_DEV_WORD (int16_t)0x8000
340 
341 #define ADF5902_MAX_DEV_OFFSET 0x9
342 #define ADF5902_MIN_DEV_OFFSET 0x0
343 
344 #define ADF5902_DEV_SEL_0 0x0
345 #define ADF5902_DEV_SEL_1 0x1
346 #define ADF5902_DEV_SEL_2 0x2
347 #define ADF5902_DEV_SEL_3 0x3
348 
349 #define ADF5902_TX_RAMP_CLK_DIV 0x0
350 #define ADF5902_TX_RAMP_TX_DATA_PIN 0x1
351 
352 #define AD5902_TX_DATA_INV_DISABLE 0x0
353 #define AD5902_TX_DATA_INV_ENABLE 0x1
354 
355 /* Register 15 Map */
356 #define ADF5902_REG15_STEP_WORD(x) (((x) & 0xFFFFF) << 5)
357 #define ADF5902_REG15_STEP_SEL(x) (((x) & 0x3) << 25)
358 #define ADF5902_REG15_RESERVED (0x0 << 27)
359 
360 /* Register 15 Bit Definition */
361 #define ADF5902_MIN_STEP_WORD 0x00000
362 #define ADF5902_MAX_STEP_WORD 0xFFFFF
363 
364 #define ADF5902_STEP_SEL_0 0x0
365 #define ADF5902_STEP_SEL_1 0x1
366 #define ADF5902_STEP_SEL_2 0x2
367 #define ADF5902_STEP_SEL_3 0x3
368 
369 /* Register 16 Map */
370 #define ADF5902_REG16_DEL_START_WORD(x) (((x) & 0xFFF) << 5)
371 #define ADF5902_REG16_RAMP_DEL(x) (((x) & 0x1) << 19)
372 #define ADF5902_REG16_TX_DATA_TRIG(x) (((x) & 0x1) << 20)
373 #define ADF5902_REG16_DEL_SEL(x) (((x) & 0x3) << 23)
374 #define ADF5902_REG16_RESERVED ((0x0 << 17) | (0x0 << 21) | (0x1 << 25))
375 
376 #define ADF5902_MIN_DELAY_START_WRD 0x000
377 #define ADF5902_MAX_DELAY_START_WRD 0xFFF
378 
379 #define ADF5902_RAMP_DEL_DISABLE 0x0
380 #define ADF5902_RAMP_DEL_ENABLE 0x1
381 
382 #define ADF5902_TX_DATA_TRIG_DISABLE 0x0
383 #define ADF5902_TX_DATA_TRIG_ENABLE 0x1
384 
385 #define ADF5902_DEL_SEL_0 0x0
386 #define ADF5902_DEL_SEL_1 0x1
387 #define ADF5902_DEL_SEL_2 0x2
388 #define ADF5902_DEL_SEL_3 0x3
389 
390 /* Register 17 Map */
391 #define ADF5902_REG17_RESERVED (0x0 << 5)
392 
394 #define ADF5902_MAX_VCO_FREQ 24250000000ull
395 #define ADF5902_MIN_VCO_FREQ 24000000000ull
396 #define ADF5902_MIN_REFIN_FREQ 10000000
397 #define ADF5902_MAX_REFIN_FREQ 260000000
398 #define ADF5902_MAX_FREQ_PFD 110000000
399 #define ADF5902_MAX_SLOPE_NO 4
400 #define ADF5902_MAX_DELAY_WORD_NO 4
401 #define ADF5902_MAX_CLK2_DIV_NO 4
402 #define ADF5902_VLSB 0.00733f
403 #define ADF5902_VOFF 0.699f
404 #define ADF5902_VGAIN 0.0064f
405 #define ADF5902_SPI_DUMMY_DATA 0x0
406 #define ADF5902_FREQ_CAL_DIV_100KHZ 100000
407 #define ADF5902_CLK1_DIV_25KHZ 25000
408 #define ADF5902_ADC_CLK_DIV_1MHZ 1000000
409 #define ADF5902_BUFF_SIZE_BYTES 4
410 #define ADF5902_FRAC_MSB_MSK 0xFFF
411 #define ADF5902_FRAC_LSB_MSK 0x1FFF
412 
413 /******************************************************************************/
414 /*************************** Types Declarations *******************************/
415 /******************************************************************************/
416 
417 struct slope {
418  /* Deviation Word */
419  int16_t dev_word;
420  /* Deviation Offset */
421  uint8_t dev_offset;
422  /* Step Word */
423  uint32_t step_word;
424 };
425 
427  /* SPI Initialization parameters */
429  /* GPIO Chip Enable */
431  /* Reference input frequency */
432  uint64_t ref_in;
433  /* Output frequency of the internal VCO */
434  uint64_t rf_out;
435  /* Reference doubler enable */
436  uint8_t ref_doubler_en;
437  /* Reference divide by 2 bit */
438  uint8_t ref_div2_en;
439  /* ADC Average value */
440  uint8_t adc_avg;
441  /* Transmitter Amplitude Calibration Reference Code */
442  uint8_t tx_amp_cal_ref;
443  /* Ramp delay enable */
444  uint8_t ramp_delay_en;
445  /* TX Data trigger */
446  uint8_t tx_trig_en;
447  /* Delay words number */
448  uint8_t delay_words_no;
449  /* Delay Words */
451  /* Number of deviaton parameters */
452  uint8_t slopes_no;
453  /* Slope structure */
454  struct slope *slopes;
455  /* Tx Data Ramp Clock */
456  uint8_t tx_ramp_clk;
457  /* Tx Data Invert */
458  uint8_t tx_data_invert;
459  /* Ramp Status */
460  uint16_t ramp_status;
461  /* Clock divider (CLK1) divider value in Ramp mode */
462  uint16_t clk1_div_ramp;
463  /* 12-bit Clock Divider number */
464  uint8_t clk2_div_no;
465  /* 12-bit Clock Divider */
467  /* LE Select */
468  uint8_t le_sel;
469  /* Clock Divider Mode*/
470  uint8_t clk_div_mode;
471  /* Charge Pump current */
472  uint8_t cp_current;
473  /* Charge Pump tristate */
474  uint8_t cp_tristate_en;
475  /* Ramp Mode */
476  uint8_t ramp_mode;
477 };
478 
479 struct adf5902_dev {
480  /* SPI Descriptor */
482  /* GPIO Chip Enable */
484  /* Reference input frequency*/
485  uint64_t ref_in;
486  /* Output frequency(Hz) of the internal VCO */
487  uint64_t rf_out;
488  /* Phase Frequency Detector */
489  uint64_t f_pfd;
490  /* Divide ration of the binary 5-bit reference counter */
491  uint8_t ref_div_factor;
492  /* Reference doubler enable */
493  uint8_t ref_doubler_en;
494  /* Reference divide by 2 bit */
495  uint8_t ref_div2_en;
496  /* Register 5 Integer word */
497  uint16_t int_div;
498  /* Register 5 MSB FRAC value */
499  uint16_t frac_msb;
500  /* Register 5 LSB FRAC value */
501  uint16_t frac_lsb;
502  /* Frequency calibration divider value */
503  uint16_t freq_cal_div;
504  /* Clock divider (CLK1) divider value */
505  uint16_t clk1_div;
506  /* Clock divider (CLK1) divider value in Ramp mode */
507  uint16_t clk1_div_ramp;
508  /* ADC Clock divider */
509  uint16_t adc_clk_div;
510  /* ADC Average value */
511  uint8_t adc_avg;
512  /* Transmitter Amplitude Calibration Reference Code */
513  uint8_t tx_amp_cal_ref;
514  /* Ramp delay enable */
515  uint8_t ramp_delay_en;
516  /* TX Data trigger */
517  uint8_t tx_trig_en;
518  /* Delay words number */
519  uint8_t delay_words_no;
520  /* Delay Words */
521  uint16_t *delay_wd;
522  /* Number of deviaton parameters */
523  uint8_t slopes_no;
524  /* Slope Structure */
525  struct slope *slopes;
526  /* Tx Data Ramp Clock */
527  uint8_t tx_ramp_clk;
528  /* Tx Data Invert */
529  uint8_t tx_data_invert;
530  /* Ramp Status */
531  uint16_t ramp_status;
532  /* 12-bit Clock Divider number */
533  uint8_t clk2_div_no;
534  /* 12-bit Clock Divider */
535  uint16_t *clk2_div;
536  /* LE Select */
537  uint8_t le_sel;
538  /* Clock Divider Mode*/
539  uint8_t clk_div_mode;
540  /* Charge Pump current */
541  uint8_t cp_current;
542  /* Charge Pump tristate */
543  uint8_t cp_tristate_en;
544  /* Ramp Mode */
545  uint8_t ramp_mode;
546 };
547 
548 /******************************************************************************/
549 /************************ Functions Declarations ******************************/
550 /******************************************************************************/
551 
553 int32_t adf5902_write(struct adf5902_dev *dev, uint8_t reg_addr,
554  uint32_t data);
555 
557 int32_t adf5902_readback(struct adf5902_dev *dev, uint8_t reg_addr,
558  uint32_t *data);
559 
561 int32_t adf5902_init(struct adf5902_dev **device,
563 
565 int32_t adf5902_recalibrate(struct adf5902_dev *dev);
566 
568 int32_t adf5902_read_temp(struct adf5902_dev *dev, float *temp);
569 
570 /* ADF5902 Measure Output locked frequency */
571 int32_t adf5902f_compute_frequency(struct adf5902_dev *dev, uint64_t *freq);
572 
574 int32_t adf5902_remove(struct adf5902_dev *dev);
575 
576 #endif /* SRC_ADF5902_H_ */
ADF5902_REG10_RESERVED
#define ADF5902_REG10_RESERVED
Definition: adf5902.h:256
ADF5902_MAX_CLK_DIV_2
#define ADF5902_MAX_CLK_DIV_2
Definition: adf5902.h:320
adf5902_dev::freq_cal_div
uint16_t freq_cal_div
Definition: adf5902.h:503
adf5902_dev::ref_div_factor
uint8_t ref_div_factor
Definition: adf5902.h:491
ADF5902_REG8_FREQ_CAL_DIV
#define ADF5902_REG8_FREQ_CAL_DIV(x)
Definition: adf5902.h:244
ADF5902_REG7_MASTER_RESET
#define ADF5902_REG7_MASTER_RESET(x)
Definition: adf5902.h:224
adf5902_init_param::ramp_delay_en
uint8_t ramp_delay_en
Definition: adf5902.h:444
ADF5902_REG6
#define ADF5902_REG6
Definition: adf5902.h:55
no_os_alloc.h
no_os_gpio_init_param
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
adf5902_init_param::ref_div2_en
uint8_t ref_div2_en
Definition: adf5902.h:438
adf5902_dev::ramp_status
uint16_t ramp_status
Definition: adf5902.h:531
ADF5902_TX_RAMP_TX_DATA_PIN
#define ADF5902_TX_RAMP_TX_DATA_PIN
Definition: adf5902.h:350
ADF5902_REG3_MUXOUT
#define ADF5902_REG3_MUXOUT(x)
Definition: adf5902.h:133
ADF5902_REG7_R_DIV_2
#define ADF5902_REG7_R_DIV_2(x)
Definition: adf5902.h:222
ADF5902_RAMP_DIV
#define ADF5902_RAMP_DIV
Definition: adf5902.h:324
ADF5902_CONTINUOUS_TRIANGULAR
#define ADF5902_CONTINUOUS_TRIANGULAR
Definition: adf5902.h:271
ADF5902_R_DIV_2_DISABLE
#define ADF5902_R_DIV_2_DISABLE
Definition: adf5902.h:231
adf5902_recalibrate
int32_t adf5902_recalibrate(struct adf5902_dev *dev)
Recalibration procedure.
Definition: adf5902.c:676
ADF5902_REF_DOUBLER_ENABLE
#define ADF5902_REF_DOUBLER_ENABLE
Definition: adf5902.h:235
adf5902_dev::slopes
struct slope * slopes
Definition: adf5902.h:525
ADF5902_REG12_CP_TRISTATE
#define ADF5902_REG12_CP_TRISTATE(x)
Definition: adf5902.h:281
ADF5902_CNTR_RESET_ENABLE
#define ADF5902_CNTR_RESET_ENABLE
Definition: adf5902.h:267
adf5902_dev::cp_tristate_en
uint8_t cp_tristate_en
Definition: adf5902.h:543
ADF5902_LE_SYNC_REFIN
#define ADF5902_LE_SYNC_REFIN
Definition: adf5902.h:327
ADF5902_MAX_DELAY_START_WRD
#define ADF5902_MAX_DELAY_START_WRD
Definition: adf5902.h:377
no_os_spi_write_and_read
int32_t no_os_spi_write_and_read(struct no_os_spi_desc *desc, uint8_t *data, uint16_t bytes_number)
Write and read data to/from SPI.
Definition: no_os_spi.c:159
ADF5902_TX1_AMP_CAL
#define ADF5902_TX1_AMP_CAL
Definition: adf5902.h:99
adf5902_write
int32_t adf5902_write(struct adf5902_dev *dev, uint8_t reg_addr, uint32_t data)
Writes 4 bytes of data to ADF5902.
Definition: adf5902.c:55
ADF5902_ADC_AVG_4
#define ADF5902_ADC_AVG_4
Definition: adf5902.h:125
no_os_spi.h
Header file of SPI Interface.
ADF5902_REG13_CLK_DIV_MODE
#define ADF5902_REG13_CLK_DIV_MODE(x)
Definition: adf5902.h:309
adf5902_read_temp
int32_t adf5902_read_temp(struct adf5902_dev *dev, float *temp)
Free resoulces allocated for ADF5902.
Definition: adf5902.c:738
adf5902_init_param::tx_trig_en
uint8_t tx_trig_en
Definition: adf5902.h:446
ADF5902_REG7_RESERVED
#define ADF5902_REG7_RESERVED
Definition: adf5902.h:225
ADF5902_REG6_RESERVED
#define ADF5902_REG6_RESERVED
Definition: adf5902.h:213
adf5902_dev::spi_desc
struct no_os_spi_desc * spi_desc
Definition: adf5902.h:481
ADF5902_REG5_RAMP_ON
#define ADF5902_REG5_RAMP_ON(x)
Definition: adf5902.h:198
ADF5902_FREQ_RB
#define ADF5902_FREQ_RB
Definition: adf5902.h:157
ADF5902_REG12
#define ADF5902_REG12
Definition: adf5902.h:61
adf5902_dev::ref_div2_en
uint8_t ref_div2_en
Definition: adf5902.h:495
ADF5902_REG1
#define ADF5902_REG1
Definition: adf5902.h:50
adf5902_init_param::tx_ramp_clk
uint8_t tx_ramp_clk
Definition: adf5902.h:456
ADF5902_REG2
#define ADF5902_REG2
Definition: adf5902.h:51
adf5902_dev::ref_in
uint64_t ref_in
Definition: adf5902.h:485
ADF5902_REG0_TX2C
#define ADF5902_REG0_TX2C(x)
Definition: adf5902.h:76
no_os_delay.h
Header file of Delay functions.
ADF5902_REG11_RAMP_MODE
#define ADF5902_REG11_RAMP_MODE(x)
Definition: adf5902.h:260
ADF5902_POWER_UP_TX1
#define ADF5902_POWER_UP_TX1
Definition: adf5902.h:84
ADF5902_FREQ_CAL_DIV_100KHZ
#define ADF5902_FREQ_CAL_DIV_100KHZ
Definition: adf5902.h:406
ADF5902_RAMP_COMPL_TO_MUXOUT
#define ADF5902_RAMP_COMPL_TO_MUXOUT
Definition: adf5902.h:190
ADF5902_REG8_RESERVED
#define ADF5902_REG8_RESERVED
Definition: adf5902.h:245
ADF5902_LE_FROM_PIN
#define ADF5902_LE_FROM_PIN
Definition: adf5902.h:326
adf5902_dev::clk2_div
uint16_t * clk2_div
Definition: adf5902.h:535
ADF5902_REG0_PTX1
#define ADF5902_REG0_PTX1(x)
Definition: adf5902.h:70
ADF5902_REG0_RESERVED
#define ADF5902_REG0_RESERVED
Definition: adf5902.h:77
device
Definition: ad9361_util.h:69
ADF5902_REG15_RESERVED
#define ADF5902_REG15_RESERVED
Definition: adf5902.h:358
NO_OS_GPIO_HIGH
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:117
adf5902_dev::tx_data_invert
uint8_t tx_data_invert
Definition: adf5902.h:529
adf5902_init_param::adc_avg
uint8_t adc_avg
Definition: adf5902.h:440
ADF5902_RAMP_ON_DISABLED
#define ADF5902_RAMP_ON_DISABLED
Definition: adf5902.h:208
ADF5902_REG9
#define ADF5902_REG9
Definition: adf5902.h:58
ADF5902_TX_DATA_TRIG_DISABLE
#define ADF5902_TX_DATA_TRIG_DISABLE
Definition: adf5902.h:382
ADF5902_TX_DATA_TRIG_ENABLE
#define ADF5902_TX_DATA_TRIG_ENABLE
Definition: adf5902.h:383
ADF5902_REG15
#define ADF5902_REG15
Definition: adf5902.h:64
ADF5902_SINGLE_RAMP_BURST
#define ADF5902_SINGLE_RAMP_BURST
Definition: adf5902.h:272
adf5902_dev::tx_amp_cal_ref
uint8_t tx_amp_cal_ref
Definition: adf5902.h:513
ADF5902_REG13_CLK_DIV_SEL
#define ADF5902_REG13_CLK_DIV_SEL(x)
Definition: adf5902.h:307
adf5902_init_param::spi_init
struct no_os_spi_init_param * spi_init
Definition: adf5902.h:428
ADF5902_VGAIN
#define ADF5902_VGAIN
Definition: adf5902.h:404
no_os_calloc
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:54
ADF5902_SPI_DUMMY_DATA
#define ADF5902_SPI_DUMMY_DATA
Definition: adf5902.h:405
ADF5902_REG7_REF_DOUBLER
#define ADF5902_REG7_REF_DOUBLER(x)
Definition: adf5902.h:221
adf5902_dev::clk1_div_ramp
uint16_t clk1_div_ramp
Definition: adf5902.h:507
adf5902_init_param::cp_current
uint8_t cp_current
Definition: adf5902.h:472
ADF5902_REG2_ADC_AVG
#define ADF5902_REG2_ADC_AVG(x)
Definition: adf5902.h:114
ADF5902_REG10
#define ADF5902_REG10
Definition: adf5902.h:59
ADF5902_REG2_ADC_CLK_DIV
#define ADF5902_REG2_ADC_CLK_DIV(x)
Definition: adf5902.h:113
ADF5902_DEL_SEL_3
#define ADF5902_DEL_SEL_3
Definition: adf5902.h:388
ADF5902_POWER_DOWN_TX2
#define ADF5902_POWER_DOWN_TX2
Definition: adf5902.h:86
ADF5902_MAX_INT_MSB_WORD
#define ADF5902_MAX_INT_MSB_WORD
Definition: adf5902.h:206
ADF5902_FRAC_LSB_MSK
#define ADF5902_FRAC_LSB_MSK
Definition: adf5902.h:411
ADF5902_REG13_CLK_DIV_2
#define ADF5902_REG13_CLK_DIV_2(x)
Definition: adf5902.h:308
ADF5902_ADC_RB
#define ADF5902_ADC_RB
Definition: adf5902.h:156
ADF5902_REG17_RESERVED
#define ADF5902_REG17_RESERVED
Definition: adf5902.h:391
ADF5902_REG13
#define ADF5902_REG13
Definition: adf5902.h:62
ADF5902_REG0_PADC
#define ADF5902_REG0_PADC(x)
Definition: adf5902.h:72
adf5902_dev::tx_trig_en
uint8_t tx_trig_en
Definition: adf5902.h:517
adf5902_dev::frac_msb
uint16_t frac_msb
Definition: adf5902.h:499
adf5902_write
int32_t adf5902_write(struct adf5902_dev *dev, uint8_t reg_addr, uint32_t data)
Writes 4 bytes of data to ADF5902.
Definition: adf5902.c:55
ADF5902_REG5_FRAC_MSB_WORD
#define ADF5902_REG5_FRAC_MSB_WORD(x)
Definition: adf5902.h:196
ADF5902_REG5_INTEGER_WORD
#define ADF5902_REG5_INTEGER_WORD(x)
Definition: adf5902.h:197
ADF5902_REG16_TX_DATA_TRIG
#define ADF5902_REG16_TX_DATA_TRIG(x)
Definition: adf5902.h:372
adf5902_dev::int_div
uint16_t int_div
Definition: adf5902.h:497
adf5902_dev::le_sel
uint8_t le_sel
Definition: adf5902.h:537
ADF5902_REG3_IO_LVL
#define ADF5902_REG3_IO_LVL(x)
Definition: adf5902.h:132
adf5902_readback
int32_t adf5902_readback(struct adf5902_dev *dev, uint8_t reg_addr, uint32_t *data)
Readback data from ADF5902.
Definition: adf5902.c:76
adf5902_remove
int32_t adf5902_remove(struct adf5902_dev *dev)
Free resoulces allocated for ADF5902.
Definition: adf5902.c:904
adf5902_init_param::clk_div_mode
uint8_t clk_div_mode
Definition: adf5902.h:470
ADF5902_MIN_REFIN_FREQ
#define ADF5902_MIN_REFIN_FREQ
Definition: adf5902.h:396
ADF5902_REG5
#define ADF5902_REG5
Definition: adf5902.h:54
no_os_error.h
Error codes definition.
ADF5902_REG3_RESERVED
#define ADF5902_REG3_RESERVED
Definition: adf5902.h:134
NO_OS_DIV_ROUND_UP
#define NO_OS_DIV_ROUND_UP(x, y)
Definition: no_os_util.h:52
ADF5902_REG16_RESERVED
#define ADF5902_REG16_RESERVED
Definition: adf5902.h:374
ADF5902_MAX_DELAY_WORD_NO
#define ADF5902_MAX_DELAY_WORD_NO
Definition: adf5902.h:400
ADF5902_REG4_TEST_BUS
#define ADF5902_REG4_TEST_BUS(x)
Definition: adf5902.h:185
ADF5902_REG6_FRAC_LSB_WORD
#define ADF5902_REG6_FRAC_LSB_WORD(x)
Definition: adf5902.h:212
ADF5902_RAMP_DEL_DISABLE
#define ADF5902_RAMP_DEL_DISABLE
Definition: adf5902.h:379
ADF5902_MIN_VCO_FREQ
#define ADF5902_MIN_VCO_FREQ
Definition: adf5902.h:395
adf5902_init_param::slopes
struct slope * slopes
Definition: adf5902.h:454
adf5902_init_param::ramp_mode
uint8_t ramp_mode
Definition: adf5902.h:476
ADF5902_CNTR_RESET_DISABLE
#define ADF5902_CNTR_RESET_DISABLE
Definition: adf5902.h:266
ADF5902_ADC_CLK_DIV_1MHZ
#define ADF5902_ADC_CLK_DIV_1MHZ
Definition: adf5902.h:408
ADF5902_REG7
#define ADF5902_REG7
Definition: adf5902.h:56
ADF5902_MAX_DEV_OFFSET
#define ADF5902_MAX_DEV_OFFSET
Definition: adf5902.h:341
ADF5902_REG7_CLK_DIV
#define ADF5902_REG7_CLK_DIV(x)
Definition: adf5902.h:223
slope
Definition: adf5902.h:417
adf5902_init_param::slopes_no
uint8_t slopes_no
Definition: adf5902.h:452
adf5902_init_param
Definition: adf5902.h:426
ADF5902_ADC_MAX_CLK_DIVIDER
#define ADF5902_ADC_MAX_CLK_DIVIDER
Definition: adf5902.h:120
adf5902_init_param::delay_words_no
uint8_t delay_words_no
Definition: adf5902.h:448
ADF5902_TX_RAMP_CLK_DIV
#define ADF5902_TX_RAMP_CLK_DIV
Definition: adf5902.h:349
adf5902_dev::clk2_div_no
uint8_t clk2_div_no
Definition: adf5902.h:533
ADF5902_REG11_CNTR_RESET
#define ADF5902_REG11_CNTR_RESET(x)
Definition: adf5902.h:259
ADF5902_REG3
#define ADF5902_REG3
Definition: adf5902.h:52
ADF5902_REG15_STEP_SEL
#define ADF5902_REG15_STEP_SEL(x)
Definition: adf5902.h:357
ADF5902_TEMP_SENS_TO_ATEST
#define ADF5902_TEMP_SENS_TO_ATEST
Definition: adf5902.h:192
adf5902_init_param::clk2_div_no
uint8_t clk2_div_no
Definition: adf5902.h:464
adf5902_init_param::tx_data_invert
uint8_t tx_data_invert
Definition: adf5902.h:458
ADF5902_RAMP_DOWN_TO_MUXOUT
#define ADF5902_RAMP_DOWN_TO_MUXOUT
Definition: adf5902.h:191
adf5902_dev::adc_avg
uint8_t adc_avg
Definition: adf5902.h:511
ADF5902_REF_DOUBLER_DISABLE
#define ADF5902_REF_DOUBLER_DISABLE
Definition: adf5902.h:234
ADF5902_FRAC_MSB_MSK
#define ADF5902_FRAC_MSB_MSK
Definition: adf5902.h:410
adf5902_init
int32_t adf5902_init(struct adf5902_dev **device, struct adf5902_init_param *init_param)
Initializes the ADF5902.
Definition: adf5902.c:470
adf5902_dev::ref_doubler_en
uint8_t ref_doubler_en
Definition: adf5902.h:493
adf5902_init_param::le_sel
uint8_t le_sel
Definition: adf5902.h:468
ADF5902_REG3_READBACK_CTRL
#define ADF5902_REG3_READBACK_CTRL(x)
Definition: adf5902.h:131
ADF5902_REG12_RESERVED
#define ADF5902_REG12_RESERVED
Definition: adf5902.h:283
adf5902_init_param::tx_amp_cal_ref
uint8_t tx_amp_cal_ref
Definition: adf5902.h:442
adf5902_dev::clk1_div
uint16_t clk1_div
Definition: adf5902.h:505
ADF5902_REG2_RESERVED
#define ADF5902_REG2_RESERVED
Definition: adf5902.h:116
ADF5902_VOFF
#define ADF5902_VOFF
Definition: adf5902.h:403
no_os_gpio_remove
int32_t no_os_gpio_remove(struct no_os_gpio_desc *desc)
Free the resources allocated by no_os_gpio_get().
Definition: no_os_gpio.c:104
ADF5902_RAMP_DEL_ENABLE
#define ADF5902_RAMP_DEL_ENABLE
Definition: adf5902.h:380
slope::dev_offset
uint8_t dev_offset
Definition: adf5902.h:421
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
adf5902_dev::ramp_delay_en
uint8_t ramp_delay_en
Definition: adf5902.h:515
ADF5902_MAX_FREQ_CAL_DIV
#define ADF5902_MAX_FREQ_CAL_DIV
Definition: adf5902.h:249
adf5902_dev::gpio_ce
struct no_os_gpio_desc * gpio_ce
Definition: adf5902.h:483
ADF5902_VLSB
#define ADF5902_VLSB
Definition: adf5902.h:402
ADF5902_REG0_PVCO
#define ADF5902_REG0_PVCO(x)
Definition: adf5902.h:74
ADF5902_POWER_UP_VCO
#define ADF5902_POWER_UP_VCO
Definition: adf5902.h:96
adf5902_remove
int32_t adf5902_remove(struct adf5902_dev *dev)
Free resoulces allocated for ADF5902.
Definition: adf5902.c:904
no_os_gpio_desc
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
ADF5902_REG0_VCAL
#define ADF5902_REG0_VCAL(x)
Definition: adf5902.h:73
adf5902.h
Header file for adf5902 Driver.
adf5902_init_param::rf_out
uint64_t rf_out
Definition: adf5902.h:434
ADF5902_CONT_SAWTOOTH
#define ADF5902_CONT_SAWTOOTH
Definition: adf5902.h:269
ADF5902_TEST_BUS_NONE
#define ADF5902_TEST_BUS_NONE
Definition: adf5902.h:189
adf5902_init_param::ref_in
uint64_t ref_in
Definition: adf5902.h:432
ADF5902_REG1_RESERVED
#define ADF5902_REG1_RESERVED
Definition: adf5902.h:106
ADF5902_REG16
#define ADF5902_REG16
Definition: adf5902.h:65
ADF5902_CLK_DIV_SEL_3
#define ADF5902_CLK_DIV_SEL_3
Definition: adf5902.h:317
ADF5902_MAX_VCO_FREQ
#define ADF5902_MAX_VCO_FREQ
Definition: adf5902.h:394
ADF5902_REG11_RESERVED
#define ADF5902_REG11_RESERVED
Definition: adf5902.h:263
no_os_gpio_get
int32_t no_os_gpio_get(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Obtain the GPIO decriptor.
Definition: no_os_gpio.c:49
ADF5902_REG13_RESERVED
#define ADF5902_REG13_RESERVED
Definition: adf5902.h:311
ADF5902_MUXOUT_CAL_BUSY
#define ADF5902_MUXOUT_CAL_BUSY
Definition: adf5902.h:179
ADF5902_POWER_UP_TX2
#define ADF5902_POWER_UP_TX2
Definition: adf5902.h:87
ADF5902_REG0_PTX2
#define ADF5902_REG0_PTX2(x)
Definition: adf5902.h:71
ADF5902_MUXOUT_RAMP_STATUS
#define ADF5902_MUXOUT_RAMP_STATUS
Definition: adf5902.h:182
slope::dev_word
int16_t dev_word
Definition: adf5902.h:419
ADF5902_MASTER_RESET_DISABLE
#define ADF5902_MASTER_RESET_DISABLE
Definition: adf5902.h:240
ADF5902_CLK_DIV_OFF
#define ADF5902_CLK_DIV_OFF
Definition: adf5902.h:322
ADF5902_REG16_RAMP_DEL
#define ADF5902_REG16_RAMP_DEL(x)
Definition: adf5902.h:371
ADF5902_CLK1_DIV_25KHZ
#define ADF5902_CLK1_DIV_25KHZ
Definition: adf5902.h:407
ADF5902_REG4
#define ADF5902_REG4
Definition: adf5902.h:53
adf5902_dev::ramp_mode
uint8_t ramp_mode
Definition: adf5902.h:545
ADF5902_CP_TRISTATE_DISABLE
#define ADF5902_CP_TRISTATE_DISABLE
Definition: adf5902.h:286
AD5902_TX_DATA_INV_DISABLE
#define AD5902_TX_DATA_INV_DISABLE
Definition: adf5902.h:352
no_os_free
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:69
ADF5902_VCO_NORMAL_OP
#define ADF5902_VCO_NORMAL_OP
Definition: adf5902.h:92
ADF5902_MAX_STEP_WORD
#define ADF5902_MAX_STEP_WORD
Definition: adf5902.h:362
ADF5902_MAX_FREQ_PFD
#define ADF5902_MAX_FREQ_PFD
Definition: adf5902.h:398
ADF5902_REG12_CHARGE_PUMP
#define ADF5902_REG12_CHARGE_PUMP(x)
Definition: adf5902.h:282
ADF5902_MAX_REFIN_FREQ
#define ADF5902_MAX_REFIN_FREQ
Definition: adf5902.h:397
ADF5902_R_DIV_2_ENABLE
#define ADF5902_R_DIV_2_ENABLE
Definition: adf5902.h:232
adf5902_init_param::cp_tristate_en
uint8_t cp_tristate_en
Definition: adf5902.h:474
ADF5902_REG14_DEV_OFFSET
#define ADF5902_REG14_DEV_OFFSET(x)
Definition: adf5902.h:331
adf5902_init
int32_t adf5902_init(struct adf5902_dev **device, struct adf5902_init_param *init_param)
Initializes the ADF5902.
Definition: adf5902.c:470
ADF5902_TX2_AMP_CAL
#define ADF5902_TX2_AMP_CAL
Definition: adf5902.h:102
ADF5902_REG15_STEP_WORD
#define ADF5902_REG15_STEP_WORD(x)
Definition: adf5902.h:356
ADF5902_TEMP_SENS_TO_ADC
#define ADF5902_TEMP_SENS_TO_ADC
Definition: adf5902.h:193
ADF5902_REG0_PLO
#define ADF5902_REG0_PLO(x)
Definition: adf5902.h:69
no_os_udelay
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:114
ADF5902_REG0
#define ADF5902_REG0
Definition: adf5902.h:49
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
adf5902_readback
int32_t adf5902_readback(struct adf5902_dev *dev, uint8_t reg_addr, uint32_t *data)
Readback data from ADF5902.
Definition: adf5902.c:76
ADF5902_POWER_DOWN_TX1
#define ADF5902_POWER_DOWN_TX1
Definition: adf5902.h:83
ADF5902_REG9_RESERVED_CALIB
#define ADF5902_REG9_RESERVED_CALIB
Definition: adf5902.h:252
ADF5902_POWER_UP_ADC
#define ADF5902_POWER_UP_ADC
Definition: adf5902.h:90
AD5902_TX_DATA_INV_ENABLE
#define AD5902_TX_DATA_INV_ENABLE
Definition: adf5902.h:353
ADF5902_SAWTOOTH_BURST
#define ADF5902_SAWTOOTH_BURST
Definition: adf5902.h:270
adf5902_dev::adc_clk_div
uint16_t adc_clk_div
Definition: adf5902.h:509
ADF5902_REG4_RESERVED
#define ADF5902_REG4_RESERVED
Definition: adf5902.h:186
ADF5902_REG5_RESERVED
#define ADF5902_REG5_RESERVED
Definition: adf5902.h:199
adf5902f_compute_frequency
int32_t adf5902f_compute_frequency(struct adf5902_dev *dev, uint64_t *freq)
Measure output locked frequency.
Definition: adf5902.c:794
ADF5902_MASTER_RESET_ENABLE
#define ADF5902_MASTER_RESET_ENABLE
Definition: adf5902.h:241
ADF5902_POWER_DOWN_LO
#define ADF5902_POWER_DOWN_LO
Definition: adf5902.h:80
adf5902_dev::tx_ramp_clk
uint8_t tx_ramp_clk
Definition: adf5902.h:527
no_os_spi_remove
int32_t no_os_spi_remove(struct no_os_spi_desc *desc)
Free the resources allocated by no_os_spi_init().
Definition: no_os_spi.c:116
adf5902_recalibrate
int32_t adf5902_recalibrate(struct adf5902_dev *dev)
Recalibration procedure.
Definition: adf5902.c:676
ADF5902_MAX_CLK2_DIV_NO
#define ADF5902_MAX_CLK2_DIV_NO
Definition: adf5902.h:401
slope::step_word
uint32_t step_word
Definition: adf5902.h:423
ADF5902_VCO_FULL_CAL
#define ADF5902_VCO_FULL_CAL
Definition: adf5902.h:93
adf5902_dev::delay_wd
uint16_t * delay_wd
Definition: adf5902.h:521
no_os_gpio.h
Header file of GPIO Interface.
adf5902_init_param::delay_wd
uint16_t delay_wd[ADF5902_MAX_DELAY_WORD_NO]
Definition: adf5902.h:450
ADF5902_REG2_ADC_START
#define ADF5902_REG2_ADC_START(x)
Definition: adf5902.h:115
adf5902_dev::cp_current
uint8_t cp_current
Definition: adf5902.h:541
adf5902_dev::f_pfd
uint64_t f_pfd
Definition: adf5902.h:489
ADF5902_REG9_RESERVED_NORMAL
#define ADF5902_REG9_RESERVED_NORMAL
Definition: adf5902.h:253
ADF5902_CP_TRISTATE_ENABLE
#define ADF5902_CP_TRISTATE_ENABLE
Definition: adf5902.h:287
ADF5902_POWER_UP_LO
#define ADF5902_POWER_UP_LO
Definition: adf5902.h:81
ADF5902_TX2_NORMAL_OP
#define ADF5902_TX2_NORMAL_OP
Definition: adf5902.h:101
adf5902_init_param::ramp_status
uint16_t ramp_status
Definition: adf5902.h:460
adf5902_init_param::gpio_ce_param
struct no_os_gpio_init_param * gpio_ce_param
Definition: adf5902.h:430
no_os_spi_init
int32_t no_os_spi_init(struct no_os_spi_desc **desc, const struct no_os_spi_init_param *param)
Initialize the SPI communication peripheral.
Definition: no_os_spi.c:52
adf5902_dev::frac_lsb
uint16_t frac_lsb
Definition: adf5902.h:501
ADF5902_REG0_TX1C
#define ADF5902_REG0_TX1C(x)
Definition: adf5902.h:75
ADF5902_REG16_DEL_START_WORD
#define ADF5902_REG16_DEL_START_WORD(x)
Definition: adf5902.h:370
ADF5902_CP_CURRENT_4MA48
#define ADF5902_CP_CURRENT_4MA48
Definition: adf5902.h:304
no_os_util.h
Header file of utility functions.
ADF5902_REG17
#define ADF5902_REG17
Definition: adf5902.h:66
ADF5902_FREQ_MEASURE
#define ADF5902_FREQ_MEASURE
Definition: adf5902.h:323
ADF5902_REG14_DEV_SEL
#define ADF5902_REG14_DEV_SEL(x)
Definition: adf5902.h:332
ADF5902_REG14
#define ADF5902_REG14
Definition: adf5902.h:63
adf5902_dev::rf_out
uint64_t rf_out
Definition: adf5902.h:487
adf5902_dev::slopes_no
uint8_t slopes_no
Definition: adf5902.h:523
adf5902_dev::delay_words_no
uint8_t delay_words_no
Definition: adf5902.h:519
ADF5902_REG14_RESERVED
#define ADF5902_REG14_RESERVED
Definition: adf5902.h:335
ADF5902_REG13_LE_SEL
#define ADF5902_REG13_LE_SEL(x)
Definition: adf5902.h:310
ADF5902_STEP_SEL_3
#define ADF5902_STEP_SEL_3
Definition: adf5902.h:367
adf5902_init_param::ref_doubler_en
uint8_t ref_doubler_en
Definition: adf5902.h:436
no_os_gpio_direction_output
int32_t no_os_gpio_direction_output(struct no_os_gpio_desc *desc, uint8_t value)
Enable the output direction of the specified GPIO.
Definition: no_os_gpio.c:147
ADF5902_REG14_DEV_WORD
#define ADF5902_REG14_DEV_WORD(x)
Definition: adf5902.h:330
ADF5902_BUFF_SIZE_BYTES
#define ADF5902_BUFF_SIZE_BYTES
Definition: adf5902.h:409
ADF5902_START_ADC_CONV
#define ADF5902_START_ADC_CONV
Definition: adf5902.h:128
adf5902_init_param::clk2_div
uint16_t clk2_div[ADF5902_MAX_CLK2_DIV_NO]
Definition: adf5902.h:466
adf5902f_compute_frequency
int32_t adf5902f_compute_frequency(struct adf5902_dev *dev, uint64_t *freq)
Measure output locked frequency.
Definition: adf5902.c:794
ADF5902_REG16_DEL_SEL
#define ADF5902_REG16_DEL_SEL(x)
Definition: adf5902.h:373
ADF5902_MAX_CLK_DIVIDER
#define ADF5902_MAX_CLK_DIVIDER
Definition: adf5902.h:238
adf5902_dev::clk_div_mode
uint8_t clk_div_mode
Definition: adf5902.h:539
ADF5902_REG7_R_DIVIDER
#define ADF5902_REG7_R_DIVIDER(x)
Definition: adf5902.h:220
adf5902_init_param::clk1_div_ramp
uint16_t clk1_div_ramp
Definition: adf5902.h:462
ADF5902_REG1_TX_AMP_CAL_REF
#define ADF5902_REG1_TX_AMP_CAL_REF(x)
Definition: adf5902.h:105
ADF5902_TX1_NORMAL_OP
#define ADF5902_TX1_NORMAL_OP
Definition: adf5902.h:98
ADF5902_REG_RB_NONE
#define ADF5902_REG_RB_NONE
Definition: adf5902.h:137
ADF5902_IO_LVL_3V3
#define ADF5902_IO_LVL_3V3
Definition: adf5902.h:172
ADF5902_REG8
#define ADF5902_REG8
Definition: adf5902.h:57
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
ADF5902_ADC_NORMAL_OP
#define ADF5902_ADC_NORMAL_OP
Definition: adf5902.h:127
ADF5902_REG11
#define ADF5902_REG11
Definition: adf5902.h:60
adf5902_read_temp
int32_t adf5902_read_temp(struct adf5902_dev *dev, float *temp)
Free resoulces allocated for ADF5902.
Definition: adf5902.c:738
adf5902_dev
Definition: adf5902.h:479