Go to the documentation of this file.
41 #define ADF4382_SOFT_RESET_R_MSK NO_OS_BIT(7)
42 #define ADF4382_LSB_FIRST_R_MSK NO_OS_BIT(6)
43 #define ADF4382_ADDRESS_ASC_R_MSK NO_OS_BIT(5)
44 #define ADF4382_SDO_ACTIVE_R_MSK NO_OS_BIT(4)
45 #define ADF4382_SDO_ACTIVE_MSK NO_OS_BIT(3)
46 #define ADF4382_ADDRESS_ASC_MSK NO_OS_BIT(2)
47 #define ADF4382_LSB_FIRST_MSK NO_OS_BIT(1)
48 #define ADF4382_SOFT_RESET_MSK NO_OS_BIT(0)
49 #define ADF4382_RESET_CMD 0x81
52 #define ADF4382_SDO_ACTIVE_SPI_3W 0x0
53 #define ADF4382_SDO_ACTIVE_SPI_4W 0x1
55 #define ADF4382_ADDR_ASC_AUTO_DECR 0x0
56 #define ADF4382_ADDR_ASC_AUTO_INCR 0x1
58 #define ADF4382_LSB_FIRST_MSB 0x0
59 #define ADF4382_LSB_FIRST_LSB 0x1
61 #define ADF4382_SOFT_RESET_N_OP 0x0
62 #define ADF4382_SOFT_RESET_EN 0x1
65 #define ADF4382_SINGLE_INSTR_MSK NO_OS_BIT(7)
66 #define ADF4382_MASTER_RB_CTRL_MSK NO_OS_BIT(5)
69 #define ADF4382_SPI_STREAM_EN 0x0
70 #define ADF4382_SPI_STREAM_DIS 0x1
72 #define ADF4382_RB_SLAVE_REG 0x0
73 #define ADF4382_RB_MASTER_REG 0x1
76 #define ADF4382_CHIP_TYPE 0x06
79 #define ADF4382_PRODUCT_ID_LSB 0x0005
82 #define ADF4382_PRODUCT_ID_MSB 0x0005
85 #define ADF4382_SCRATCHPAD_MSK NO_OS_GENMASK(7, 0)
88 #define ADF4382_VENDOR_ID_LSB 0x56
91 #define ADF4382_VENDOR_ID_MSB 0x04
94 #define ADF4382_M_S_TRANSF_NO_OS_BIT_MSK NO_OS_BIT(0)
97 #define ADF4382_N_INT_LSB_MSK NO_OS_GENMASK(7, 0)
100 #define ADF4382_CLKOUT_DIV_MSK NO_OS_GENMASK(7, 5)
101 #define ADF4382_INV_CLK_OUT_MSK NO_OS_BIT(4)
102 #define ADF4382_N_INT_MSB_MSK NO_OS_GENMASK(3, 0)
105 #define ADF4382_FRAC1WORD_LSB_MSK NO_OS_GENMASK(7, 0)
108 #define ADF4382_FRAC1WORD_MID_MSK NO_OS_GENMASK(7, 0)
111 #define ADF4382_FRAC1WORD_MSB_MSK NO_OS_GENMASK(7, 0)
114 #define ADF4382_M_VCO_BAND_LSB_MSK NO_OS_BIT(7)
115 #define ADF4382_M_VCO_CORE_MSK NO_OS_BIT(6)
116 #define ADF4382_BIAS_DEC_MODE_MSK NO_OS_GENMASK(5, 3)
117 #define ADF4382_INT_MODE_MSK NO_OS_BIT(2)
118 #define ADF4382_PFD_POL_MSK NO_OS_BIT(1)
119 #define ADF4382_FRAC1WORD_MSB NO_OS_BIT(0)
122 #define ADF4382_M_VCO_BAND_MSB_MSK NO_OS_GENMASK(7, 0)
125 #define ADF4382_FRAC2WORD_LSB_MSK NO_OS_GENMASK(7, 0)
128 #define ADF4382_FRAC2WORD_MID_MSK NO_OS_GENMASK(7, 0)
131 #define ADF4382_FRAC2WORD_MSB_MSK NO_OS_GENMASK(7, 0)
134 #define ADF4382_MOD2WORD_LSB_MSK NO_OS_GENMASK(7, 0)
137 #define ADF4382_MOD2WORD_MID_MSK NO_OS_GENMASK(7, 0)
140 #define ADF4382_MOD2WORD_MSB_MSK NO_OS_GENMASK(7, 0)
143 #define ADF4382_FINE_BLEED_LSB_MSK NO_OS_GENMASK(7, 0)
146 #define ADF4382_EN_PHASE_RESYNC_MSK NO_OS_BIT(7)
147 #define ADF4382_EN_REF_RST_MSK NO_OS_BIT(6)
148 #define ADF4382_TIMED_SYNC_MSK NO_OS_BIT(5)
149 #define ADF4382_COARSE_BLEED_MSK NO_OS_GENMASK(4, 1)
150 #define ADF4382_FINE_BLEED_MSB_MSK NO_OS_BIT(0)
153 #define ADF4382_SW_SYNC_MSK NO_OS_BIT(7)
154 #define ADF4382_SPARE_1F_MSK NO_OS_BIT(6)
155 #define ADF4382_BLEED_POL_MSK NO_OS_BIT(5)
156 #define ADF4382_EN_BLEED_MSK NO_OS_BIT(4)
157 #define ADF4382_CP_I_MSK NO_OS_GENMASK(3, 0)
160 #define ADF4382_EN_AUTOCAL_MSK NO_OS_BIT(7)
161 #define ADF4382_EN_RDBLR_MSK NO_OS_BIT(6)
162 #define ADF4382_R_DIV_MSK NO_OS_GENMASK(5, 0)
165 #define ADF4382_PHASE_WORD_LSB_MSK NO_OS_GENMASK(7, 0)
168 #define ADF4382_PHASE_WORD_MID_MSK NO_OS_GENMASK(7, 0)
171 #define ADF4382_PHASE_WORD_MSB_MSK NO_OS_GENMASK(7, 0)
174 #define ADF4382_SPARE_24_MSK NO_OS_GENMASK(7, 5)
175 #define ADF4382_DCLK_DIV_SEL_MSK NO_OS_BIT(4)
176 #define ADF4382_DNCLK_DIV1_MSK NO_OS_GENMASK(3, 2)
177 #define ADF4382_DCLK_DIV1_MSK NO_OS_GENMASK(1, 0)
180 #define ADF4382_RESYNC_WAIT_LSB_MSK NO_OS_GENMASK(7, 0)
183 #define ADF4382_RESYNC_WAIT_MSB_MSK NO_OS_GENMASK(7, 0)
186 #define ADF4382_CAL_BLEED_FINE_MIN_MSK NO_OS_GENMASK(7, 4)
187 #define ADF4382_BLEED_ADJ_SCALE_MSK NO_OS_GENMASK(3, 0)
190 #define ADF4382_PH_RESYNC_RB_SEL_MSK NO_OS_BIT(7)
191 #define ADF4382_LSB_P1_MSK NO_OS_BIT(6)
192 #define ADF4382_VAR_MOD_EN_MSK NO_OS_BIT(5)
193 #define ADF4382_DITHER1_SCALE_MSK NO_OS_GENMASK(4, 2)
194 #define ADF4382_EN_DITHER2_MSK NO_OS_BIT(1)
195 #define ADF4382_EN_DITHER1_MSK NO_OS_BIT(0)
198 #define ADF4382_CLK2_OPWR_MSK NO_OS_GENMASK(7, 4)
199 #define ADF4382_CLK1_OPWR_MSK NO_OS_GENMASK(3, 0)
202 #define ADF4382_FN_DBL_MSK NO_OS_BIT(7)
203 #define ADF4382_PD_NDIV_TL_MSK NO_OS_BIT(6)
204 #define ADF4382_CLKOUT_BST_MSK NO_OS_BIT(5)
205 #define ADF4382_PD_SYNC_MSK NO_OS_BIT(4)
206 #define ADF4382_PD_CLK_MSK NO_OS_BIT(3)
207 #define ADF4382_PD_RDET_MSK NO_OS_BIT(2)
208 #define ADF4382_PD_ADC_MSK NO_OS_BIT(1)
209 #define ADF4382_PD_CALGEN_MSK NO_OS_BIT(0)
212 #define ADF4382_PD_ALL_MSK NO_OS_BIT(7)
213 #define ADF4382_PD_RDIV_TL_MSK NO_OS_BIT(6)
214 #define ADF4382_PD_NDIV_MSK NO_OS_BIT(5)
215 #define ADF4382_PD_VCO_MSK NO_OS_BIT(4)
216 #define ADF4382_PD_LD_MSK NO_OS_BIT(3)
217 #define ADF4382_PD_PFDCP_MSK NO_OS_BIT(2)
218 #define ADF4382_PD_CLKOUT1_MSK NO_OS_BIT(1)
219 #define ADF4382_PD_CLKOUT2_MSK NO_OS_BIT(0)
222 #define ADF4382_LDWIN_PW_MSK NO_OS_GENMASK(7, 5)
223 #define ADF4382_LD_COUNT_OPWR_MSK NO_OS_GENMASK(4, 0)
226 #define ADF4382_EN_DNCLK_MSK NO_OS_BIT(7)
227 #define ADF4382_EN_DRCLK_MSK NO_OS_BIT(6)
228 #define ADF4382_EN_LOL_MSK NO_OS_BIT(5)
229 #define ADF4382_EN_LDWIN_MSK NO_OS_BIT(4)
230 #define ADF4382_PDET_POL_MSK NO_OS_BIT(3)
231 #define ADF4382_RST_LD_MSK NO_OS_BIT(2)
232 #define ADF4382_LD_O_CTRL_MSK NO_OS_GENMASK(1, 0)
235 #define ADF4382_MUXOUT_MSK NO_OS_GENMASK(7, 4)
236 #define ADF4382_ABPW_WD_MSK NO_OS_BIT(3)
237 #define ADF4382_EN_CPTEST_MSK NO_OS_BIT(2)
238 #define ADF4382_CP_DOWN_MSK NO_OS_BIT(1)
239 #define ADF4382_CP_UP_MSK NO_OS_BIT(0)
242 #define ADF4382_BST_REF_MSK NO_OS_BIT(7)
243 #define ADF4382_FILT_REF_MSK NO_OS_BIT(6)
244 #define ADF4382_RDBLR_DC_MSK NO_OS_GENMASK(5, 0)
247 #define ADF4382_MUTE_NCLK_MSK NO_OS_BIT(7)
248 #define ADF4382_MUTE_RCLK_MSK NO_OS_BIT(6)
249 #define ADF4382_REF_SEL_MSK NO_OS_BIT(5)
250 #define ADF4382_INV_RDBLR_MSK NO_OS_BIT(4)
251 #define ADF4382_RDBLR_DEL_SEL_MSK NO_OS_GENMASK(3, 0)
254 #define ADF4382_SYNC_DEL_MSK NO_OS_GENMASK(7, 5)
255 #define ADF4382_RST_SYS_MSK NO_OS_BIT(4)
256 #define ADF4382_EN_ADC_CLK_MSK NO_OS_BIT(3)
257 #define ADF4382_EN_VCAL_MSK NO_OS_BIT(2)
258 #define ADF4382_CAL_CT_SEL_MSK NO_OS_BIT(1)
259 #define ADF4382_DCLK_MODE_MSK NO_OS_BIT(0)
262 #define ADF4382_SPARE_32_MSK NO_OS_BIT(7)
263 #define ADF4382_BLEED_ADJ_CAL_MSK NO_OS_BIT(6)
264 #define ADF4382_DEL_MODE_MSK NO_OS_BIT(5)
265 #define ADF4382_EN_AUTO_ALIGN_MSK NO_OS_BIT(4)
266 #define ADF4382_PHASE_ADJ_POL_MSK NO_OS_BIT(3)
267 #define ADF4382_EFM3_MODE_MSK NO_OS_GENMASK(2, 0)
270 #define ADF4382_PHASE_ADJUST_MSK NO_OS_GENMASK(7, 0)
273 #define ADF4382_PHASE_ADJ_MSK NO_OS_BIT(7)
274 #define ADF4382_DRCLK_DEL_MSK NO_OS_GENMASK(6, 4)
275 #define ADF4382_DNCLK_DEL_MSK NO_OS_GENMASK(3, 1)
276 #define ADF4382_RST_CNTR_MSK NO_OS_BIT(0)
279 #define ADF4382_SPARE_35_MSK NO_OS_GENMASK(7, 6)
280 #define ADF4382_M_VCO_BIAS_MSK NO_OS_GENMASK(5, 0)
283 #define ADF4382_CLKODIV_DB_MSK NO_OS_BIT(7)
284 #define ADF4382_DCLK_DIV_DB_MSK NO_OS_BIT(6)
285 #define ADF4382_SPARE_36_MSK NO_OS_GENMASK(5, 2)
286 #define ADF4382_EN_LUT_GEN_MSK NO_OS_BIT(1)
287 #define ADF4382_EN_LUT_CAL_MSK NO_OS_BIT(0)
290 #define ADF4382_CAL_COUNT_TO_MSK NO_OS_GENMASK(7, 0)
293 #define ADF4382_CAL_VTUNE_TO_LSB_MSK NO_OS_GENMASK(7, 0)
296 #define ADF4382_O_VCO_DB_MSK NO_OS_BIT(7)
297 #define ADF4382_CAL_VTUNE_TO_MSB_MSK NO_OS_GENMASK(6, 0)
300 #define ADF4382_CAL_VCO_TO_LSB_MSK NO_OS_GENMASK(7, 0)
303 #define ADF4382_DEL_CTRL_DB_MSK NO_OS_BIT(7)
304 #define ADF4382_CAL_VCO_TO_MSB_MSK NO_OS_GENMASK(6, 0)
307 #define ADF4382_CNTR_DIV_WORD_MSK NO_OS_GENMASK(7, 0)
310 #define ADF4382_SPARE_3D_MSK NO_OS_BIT(7)
311 #define ADF4382_SYNC_SP_DB_MSK NO_OS_BIT(6)
312 #define ADF4382_CMOS_OV_MSK NO_OS_BIT(5)
313 #define ADF4382_READ_MODE_MSK NO_OS_BIT(4)
314 #define ADF4382_CNTR_DIV_WORD_MSB_MSK NO_OS_GENMASK(3, 0)
317 #define ADF4382_ADC_CLK_DIV_MSK NO_OS_GENMASK(7, 0)
320 #define ADF4382_EN_ADC_CNV_MSK NO_OS_BIT(7)
321 #define ADF4382_EN_ADC_VTEST_MSK NO_OS_BIT(6)
322 #define ADF4382_ADC_VTEST_SEL_MSK NO_OS_BIT(5)
323 #define ADF4382_ADC_MUX_SEL_MSK NO_OS_BIT(4)
324 #define ADF4382_ADC_F_CONV_MSK NO_OS_BIT(3)
325 #define ADF4382_ADC_C_CONV_MSK NO_OS_BIT(2)
326 #define ADF4382_EN_ADC_MSK NO_OS_BIT(1)
327 #define ADF4382_SPARE_3F_MSK NO_OS_BIT(0)
330 #define ADF4382_EXT_DIV_DEC_SEL_MSK NO_OS_BIT(7)
331 #define ADF4382_ADC_CLK_TEST_SEL_MSK NO_OS_BIT(6)
332 #define ADF4382_MUTE_CLKOUT2_MSK NO_OS_GENMASK(5, 3)
333 #define ADF4382_MUTE_CLKOUT1_MSK NO_OS_GENMASK(2, 0)
336 #define ADF4382_EXT_DIV_MSK NO_OS_GENMASK(7, 5)
337 #define ADF4382_EN_VCO_CAP_TEST_MSK NO_OS_BIT(4)
338 #define ADF4382_EN_CALGEN_CAP_TEST_MSK NO_OS_BIT(3)
339 #define ADF4382_EN_CP_CAP_TEST_MSK NO_OS_BIT(2)
340 #define ADF4382_CAP_TEST_STATE_MSK NO_OS_BIT(1)
341 #define ADF4382_TRANS_LOOP_SEL_MSK NO_OS_BIT(0)
344 #define ADF4382_NDIV_PWRUP_TIMEOUT_MSK NO_OS_GENMASK(7, 0)
347 #define ADF4382_CAL_BLEED_FINE_MAX_MSK NO_OS_GENMASK(7, 0)
350 #define ADF4382_VCAL_ZERO_MSK NO_OS_BIT(7)
351 #define ADF4382_VPTAT_CALGEN_MSK NO_OS_GENMASK(6, 0)
354 #define ADF4382_SPARE_45_MSK NO_OS_BIT(7)
355 #define ADF4382_VCTAT_CALGEN_MSK NO_OS_GENMASK(6, 0)
358 #define ADF4382_NVMDIN_MSK NO_OS_GENMASK(7, 0)
361 #define ADF4382_SPARE_47_MSK NO_OS_BIT(7)
362 #define ADF4382_NVMADDR_MSK NO_OS_GENMASK(6, 3)
363 #define ADF4382_NVMNO_OS_BIT_SEL NO_OS_GENMASK(2, 0)
366 #define ADF4382_TRIM_LATCH_MSK NO_OS_BIT(7)
367 #define ADF4382_NVMTEST_MSK NO_OS_BIT(6)
368 #define ADF4382_NVMPROG_MSK NO_OS_BIT(5)
369 #define ADF4382_NVMRD_MSK NO_OS_BIT(4)
370 #define ADF4382_NVMSTART_MSK NO_OS_BIT(3)
371 #define ADF4382_NVMON_MSK NO_OS_BIT(2)
372 #define ADF4382_MARGIN_MSK NO_OS_GENMASK(1, 0)
375 #define ADF4382_NVMDOUT_MSK NO_OS_GENMASK(7, 0)
378 #define ADF4382_SCAN_MODE_CODE_MSK NO_OS_GENMASK(7, 0)
381 #define ADF4382_TEMP_OFFSET_MSK NO_OS_GENMASK(7, 0)
384 #define ADF4382_SPARE_4C_MSK NO_OS_GENMASK(7, 6)
385 #define ADF4382_TEMP_SLOPE_MSK NO_OS_GENMASK(5, 0)
388 #define ADF4382_VCO_FSM_TEST_MUX_MSK NO_OS_GENMASK(7, 5)
389 #define ADF4382_SPARE_4D_MSK NO_OS_GENMASK(4, 3)
390 #define ADF4382_O_VCO_BIAS_MSK NO_OS_BIT(2)
391 #define ADF4382_O_VCO_BAND_MSK NO_OS_BIT(1)
392 #define ADF4382_O_VCO_CORE_MSK NO_OS_BIT(0)
395 #define ADF4382_SPARE_4E_MSK NO_OS_GENMASK(7, 5)
396 #define ADF4382_EN_TWO_PASS_CAL_MSK NO_OS_BIT(4)
397 #define ADF4382_TWO_PASS_BAND_START_MSK NO_OS_GENMASK(3, 0)
400 #define ADF4382_LUT_SCALE_MSK NO_OS_GENMASK(7, 0)
403 #define ADF4382_SPARE0_MSK NO_OS_GENMASK(7, 0)
406 #define ADF4382_SPARE1_MSK NO_OS_GENMASK(7, 0)
409 #define ADF4382_SYNC_REF_SPARE_MSK NO_OS_GENMASK(7, 4)
410 #define ADF4382_SYNC_MON_DEL_MSK NO_OS_GENMASK(3, 0)
413 #define ADF4382_SPARE_53_MSK NO_OS_BIT(7)
414 #define ADF4382_PD_SYNC_MON_MSK NO_OS_BIT(6)
415 #define ADF4382_SYNC_SEL_MSK NO_OS_BIT(5)
416 #define ADF4382_RST_SYNC_MON_MSK NO_OS_BIT(4)
417 #define ADF4382_SYNC_SH_DEL_MSK NO_OS_GENMASK(3, 0)
420 #define ADF4382_ADC_ST_CNV_MSK NO_OS_BIT(0)
423 #define ADF4382_LOCKED_MSK NO_OS_BIT(0)
425 #define ADF4382_SPI_3W_CFG(x) (no_os_field_prep(ADF4382_SDO_ACTIVE_MSK, x) | \
426 no_os_field_prep(ADF4382_SDO_ACTIVE_R_MSK, x))
427 #define ADF4382_BLEED_MSB_MSK (ADF4382_COARSE_BLEED_MSK | \
428 ADF4382_FINE_BLEED_MSB_MSK)
430 #define ADF4382_SPI_SCRATCHPAD_TEST 0x5A
433 #define ADF4382_SPI_WRITE_CMD 0x0
434 #define ADF4382_SPI_READ_CMD 0x8000
435 #define ADF4382_SPI_DUMMY_DATA 0x00
436 #define ADF4382_BUFF_SIZE_BYTES 3
437 #define ADF4382_VCO_FREQ_MIN 11000000000U // 11GHz
438 #define ADF4382_VCO_FREQ_MAX 22000000000U // 22GHz
439 #define ADF4382A_VCO_FREQ_MIN 11500000000U // 11.5GHz
440 #define ADF4382A_VCO_FREQ_MAX 21000000000U // 21GHz
441 #define ADF4382_MOD1WORD 0x2000000U // 2^25
442 #define ADF4382_MOD2WORD_MAX 0xFFFFFFU // 2^24 - 1
443 #define ADF4382_PHASE_RESYNC_MOD2WORD_MAX 0x1FFFFU // 2^17 - 1
444 #define ADF4382_CHANNEL_SPACING_MAX 78125U
445 #define ADF4382_PFD_FREQ_MAX 625000000U // 625MHz
446 #define ADF4382_PFD_FREQ_FRAC_MAX 250000000U // 250MHz
447 #define ADF4382_PFD_FREQ_MIN 5400000U // 5.4MHz
448 #define ADF4382_DCLK_DIV1_0_MAX 160000000U // 160MHz
449 #define ADF4382_DCLK_DIV1_1_MAX 320000000U // 320MHz
450 #define ADF4382_CLKOUT_DIV_REG_VAL_MAX 4
451 #define ADF4382A_CLKOUT_DIV_REG_VAL_MAX 2
453 #define ADF4382_RFOUT_MAX 22000000000U
454 #define ADF4382_RFOUT_MIN 687500000U
455 #define ADF4382A_RFOUT_MAX 21000000000U
456 #define ADF4382A_RFOUT_MIN 2875000000U
457 #define ADF4382_REF_CLK_MAX 5000000000U
458 #define ADF4382_REF_CLK_MIN 10000000
459 #define ADF4382_REF_DIV_MAX 63
460 #define ADF4382_OUT_PWR_MAX 15
461 #define ADF4382_CPI_VAL_MAX 15
462 #define ADF4382_BLEED_WORD_MAX 8191
464 #define ADF4382_PHASE_BLEED_CNST 2044000
465 #define ADF4382_VCO_CAL_CNT 202
466 #define ADF4382_VCO_CAL_VTUNE 124
467 #define ADF4382_VCO_CAL_ALC 250
468 #define ADF4382_POR_DELAY_US 200
469 #define ADF4382_LKD_DELAY_US 500
473 #define NS_TO_PS KHZ_PER_MHZ
643 uint8_t mask, uint8_t data);
uint8_t clkout_div_reg_val_max
Definition: adf4382.h:523
#define ADF4382_FRAC1WORD_MSB_MSK
Definition: adf4382.h:111
adf4382_dev_id
Supported device ids.
Definition: adf4382.h:478
#define ADF4382_EN_ADC_CLK_MSK
Definition: adf4382.h:256
int adf4382_set_en_sync(struct adf4382_dev *dev, bool en)
Set the sync to enable or disable based on the passed parameter. If the parameter is different then 0...
Definition: adf4382.c:515
#define ADF4382_COARSE_BLEED_MSK
Definition: adf4382.h:149
#define ADF4382_RFOUT_MIN
Definition: adf4382.h:454
#define ADF4382_REF_CLK_MAX
Definition: adf4382.h:457
#define ADF4382A_RFOUT_MIN
Definition: adf4382.h:456
#define ADF4382_PHASE_RESYNC_MOD2WORD_MAX
Definition: adf4382.h:443
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
uint8_t cp_i
Definition: adf4382.h:515
enum adf4382_dev_id id
Definition: adf4382.h:499
#define ADF4382_INT_MODE_MSK
Definition: adf4382.h:117
int adf4382_reg_dump(struct adf4382_dev *dev)
Will output on the terminal the values of all the ADF4382 registers.
Definition: adf4382.c:160
Header file of SPI Interface.
#define NS_TO_PS
Definition: adf4382.h:473
#define ADF4382_FRAC2WORD_LSB_MSK
Definition: adf4382.h:125
ADF4382 register format structure for default values.
Definition: adf4371.c:185
uint8_t ref_div
Definition: adf4382.h:495
#define ADF4382_EN_RDBLR_MSK
Definition: adf4382.h:161
#define ADF4382_VCO_CAL_ALC
Definition: adf4382.h:467
int adf4382_get_rfout(struct adf4382_dev *dev, uint64_t *val)
Gets the user proposed output frequency.
Definition: adf4382.c:590
uint64_t ref_freq_hz
Definition: adf4382.h:492
#define ADF4382_CPI_VAL_MAX
Definition: adf4382.h:461
int adf4382_get_en_sync(struct adf4382_dev *dev, bool *en)
Gets the value the sync if it is enabled or disable.
Definition: adf4382.c:529
int adf4382_get_en_sync(struct adf4382_dev *dev, bool *en)
Gets the value the sync if it is enabled or disable.
Definition: adf4382.c:529
int adf4382_set_out_power(struct adf4382_dev *dev, uint8_t ch, int32_t pwr)
Set the output power register value of a channel and reset everything over to maximum supported value...
Definition: adf4382.c:414
#define ADF4382_PHASE_ADJ_POL_MSK
Definition: adf4382.h:266
#define pr_err(fmt, args...)
Definition: no_os_print_log.h:88
uint64_t freq
Definition: adf4382.h:512
int adf4382_set_rfout(struct adf4382_dev *dev, uint64_t val)
Set the desired output frequency and reset everything over to maximum supported value of 22GHz (21GHz...
Definition: adf4382.c:552
Header file of Delay functions.
int adf4382_get_bleed_word(struct adf4382_dev *dev, int32_t *word)
Gets the value of the set bleed word.
Definition: adf4382.c:384
uint8_t ref_div
Definition: adf4382.h:514
#define ADF4382_DEL_MODE_MSK
Definition: adf4382.h:264
int adf4382_set_en_chan(struct adf4382_dev *dev, uint8_t ch, bool en)
Set the output channel to enable or disable based on the passed parameter. If the parameter is differ...
Definition: adf4382.c:465
#define ADF4382_RFOUT_MAX
Definition: adf4382.h:453
int adf4382_remove(struct adf4382_dev *dev)
Free resources allocated for ADF4382.
Definition: adf4382.c:1283
#define pr_info(fmt, args...)
Definition: no_os_print_log.h:115
#define ADF4382_FINE_BLEED_LSB_MSK
Definition: adf4382.h:143
#define NO_OS_DIV_ROUND_CLOSEST_ULL(x, y)
Definition: no_os_util.h:56
int adf4382_get_cp_i(struct adf4382_dev *dev, int32_t *reg_val)
Gets the charge pump value from the register. The value will be between 0 and 15 on 8 bits....
Definition: adf4382.c:343
#define ADF4382_FRAC1WORD_LSB_MSK
Definition: adf4382.h:105
uint64_t vco_min
Definition: adf4382.h:520
int adf4382_set_freq(struct adf4382_dev *dev)
Set the output frequency.
Definition: adf4382.c:788
bool spi_3wire_en
Definition: adf4382.h:490
#define MICROAMPER_PER_AMPER
Definition: no_os_units.h:64
#define ADF4382_VCO_CAL_VTUNE
Definition: adf4382.h:466
Definition: ad9361_util.h:69
#define ADF4382_CAL_CT_SEL_MSK
Definition: adf4382.h:258
uint64_t vco_max
Definition: adf4382.h:519
uint64_t no_os_div64_u64_rem(uint64_t dividend, uint64_t divisor, uint64_t *remainder)
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
#define NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:49
#define ADF4382_SPI_SCRATCHPAD_TEST
Definition: adf4382.h:430
@ ID_ADF4382A
Definition: adf4382.h:480
ADF4382 Initialization Parameters structure.
Definition: adf4382.h:487
int adf4382_set_bleed_word(struct adf4382_dev *dev, int32_t word)
Set the bleed word, which represents the value of the bleed current written to the register space.
Definition: adf4382.c:365
#define ADF4382_EN_BLEED_MSK
Definition: adf4382.h:156
#define ADF4382_CLK1_OPWR_MSK
Definition: adf4382.h:199
#define ADF4382_MOD2WORD_MAX
Definition: adf4382.h:442
#define MHZ
Definition: adf4382.h:471
#define ADF4382_VAR_MOD_EN_MSK
Definition: adf4382.h:192
int adf4382_set_en_sync(struct adf4382_dev *dev, bool en)
Set the sync to enable or disable based on the passed parameter. If the parameter is different then 0...
Definition: adf4382.c:515
int adf4382_get_out_power(struct adf4382_dev *dev, uint8_t ch, int32_t *pwr)
Gets the output power register value.
Definition: adf4382.c:438
#define ADF4382_REF_CLK_MIN
Definition: adf4382.h:458
#define ADF4382_VCO_FREQ_MAX
Definition: adf4382.h:438
#define ADF4382_FRAC1WORD_MID_MSK
Definition: adf4382.h:108
#define ADF4382_EN_PHASE_RESYNC_MSK
Definition: adf4382.h:146
int adf4382_spi_write(struct adf4382_dev *dev, uint16_t reg_addr, uint8_t data)
Writes data to ADF4382 over SPI.
Definition: adf4382.c:68
bool spi_3wire_en
Definition: adf4382.h:509
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
int adf4382_set_ref_clk(struct adf4382_dev *dev, uint64_t val)
Set the desired reference frequency and reset everything over to maximum supported value of 5GHz to t...
Definition: adf4382.c:201
int adf4382_get_ref_div(struct adf4382_dev *dev, int32_t *div)
Gets the value the reference divider.
Definition: adf4382.c:299
int adf4382_set_ref_clk(struct adf4382_dev *dev, uint64_t val)
Set the desired reference frequency and reset everything over to maximum supported value of 5GHz to t...
Definition: adf4382.c:201
#define ADF4382_FRAC1WORD_MSB
Definition: adf4382.h:119
#define NO_OS_DIV_ROUND_UP(x, y)
Definition: no_os_util.h:52
#define ADF4382_DCLK_MODE_MSK
Definition: adf4382.h:259
#define ADF4382_N_INT_LSB_MSK
Definition: adf4382.h:97
#define ADF4382_OUT_PWR_MAX
Definition: adf4382.h:460
bool cmos_3v3
Definition: adf4382.h:491
uint32_t phase_adj
Definition: adf4382.h:518
int adf4382_get_phase_pol(struct adf4382_dev *dev, bool *polarity)
Gets the polarity of the phase adjust.
Definition: adf4382.c:1138
#define ADF4382_LOCKED_MSK
Definition: adf4382.h:423
uint64_t freq
Definition: adf4382.h:493
#define ADF4382_VCO_CAL_CNT
Definition: adf4382.h:465
ADF4382 Device Descriptor.
Definition: adf4382.h:506
int adf4382_spi_read(struct adf4382_dev *dev, uint16_t reg_addr, uint8_t *data)
Reads data from ADF4382 over SPI.
Definition: adf4382.c:98
#define ADF4382_FRAC2WORD_MID_MSK
Definition: adf4382.h:128
int adf4382_get_ref_div(struct adf4382_dev *dev, int32_t *div)
Gets the value the reference divider.
Definition: adf4382.c:299
int adf4382_get_phase_pol(struct adf4382_dev *dev, bool *polarity)
Gets the polarity of the phase adjust.
Definition: adf4382.c:1138
#define NO_OS_DIV_U64(x, y)
Definition: no_os_util.h:115
#define ADF4382_PD_SYNC_MSK
Definition: adf4382.h:205
int adf4382_set_en_chan(struct adf4382_dev *dev, uint8_t ch, bool en)
Set the output channel to enable or disable based on the passed parameter. If the parameter is differ...
Definition: adf4382.c:465
uint8_t val
Definition: adf4371.c:187
#define ADF4382_MOD2WORD_LSB_MSK
Definition: adf4382.h:134
int adf4382_set_bleed_word(struct adf4382_dev *dev, int32_t word)
Set the bleed word, which represents the value of the bleed current written to the register space.
Definition: adf4382.c:365
#define ADF4382_CLKOUT_DIV_MSK
Definition: adf4382.h:100
#define ADF4382_SPI_READ_CMD
Definition: adf4382.h:434
int adf4382_remove(struct adf4382_dev *dev)
Free resources allocated for ADF4382.
Definition: adf4382.c:1283
#define ADF4382_REF_DIV_MAX
Definition: adf4382.h:459
int adf4382_set_cp_i(struct adf4382_dev *dev, int32_t reg_val)
Set the charge pump value which will be written to the register. The value will be between 0 and 15 o...
Definition: adf4382.c:322
enum no_os_spi_bit_order bit_order
Definition: no_os_spi.h:204
#define ADF4382_DCLK_DIV1_0_MAX
Definition: adf4382.h:448
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
#define ADF4382_CP_I_MSK
Definition: adf4382.h:157
#define no_os_clamp(val, min_val, max_val)
Definition: no_os_util.h:69
uint8_t ld_count
Definition: adf4382.h:498
bool ref_doubler_en
Definition: adf4382.h:513
#define ADF4382_VCO_FREQ_MIN
Definition: adf4382.h:437
#define ADF4382_N_INT_MSB_MSK
Definition: adf4382.h:102
#define ADF4382A_RFOUT_MAX
Definition: adf4382.h:455
int adf4382_get_en_ref_doubler(struct adf4382_dev *dev, bool *en)
Gets the value the doubler if it is enabled or disable and stores it it the dev structure.
Definition: adf4382.c:258
uint32_t no_os_greatest_common_divisor(uint32_t a, uint32_t b)
#define ADF4382_CMOS_OV_MSK
Definition: adf4382.h:312
int adf4382_set_ref_div(struct adf4382_dev *dev, int32_t div)
Set the reference divider value and reset everything over to maximum supported value of 63 to the max...
Definition: adf4382.c:280
int adf4382_get_en_chan(struct adf4382_dev *dev, uint8_t ch, bool *en)
Gets the value the output channel if it is enabled or disable.
Definition: adf4382.c:488
#define ADF4382_POR_DELAY_US
Definition: adf4382.h:468
bool ref_doubler_en
Definition: adf4382.h:494
#define ADF4382_MOD1WORD
Definition: adf4382.h:441
int adf4382_get_out_power(struct adf4382_dev *dev, uint8_t ch, int32_t *pwr)
Gets the output power register value.
Definition: adf4382.c:438
#define ADF4382_PHASE_ADJ_MSK
Definition: adf4382.h:273
#define ADF4382_FINE_BLEED_MSB_MSK
Definition: adf4382.h:150
int adf4382_init(struct adf4382_dev **device, struct adf4382_init_param *init_param)
Initializes the ADF4382.
Definition: adf4382.c:1181
#define ADF4382A_CLKOUT_DIV_REG_VAL_MAX
Definition: adf4382.h:451
uint8_t ld_count
Definition: adf4382.h:517
int adf4382_spi_update_bits(struct adf4382_dev *dev, uint16_t reg_addr, uint8_t mask, uint8_t data)
Updates the values of the ADF4382 register.
Definition: adf4382.c:136
#define ADF4382_LKD_DELAY_US
Definition: adf4382.h:469
uint8_t cp_i
Definition: adf4382.h:496
#define ADF4382A_VCO_FREQ_MAX
Definition: adf4382.h:440
int adf4382_reg_dump(struct adf4382_dev *dev)
Will output on the terminal the values of all the ADF4382 registers.
Definition: adf4382.c:160
#define ADF4382_DCLK_DIV1_MSK
Definition: adf4382.h:177
uint32_t no_os_field_get(uint32_t mask, uint32_t word)
#define ADF4382_BUFF_SIZE_BYTES
Definition: adf4382.h:436
ADF4382 register initialization.
int adf4382_set_phase_adjust(struct adf4382_dev *dev, uint32_t phase_ps)
Set the phase adjustment in pico-seconds. The phase adjust will enable the Bleed current option as we...
Definition: adf4382.c:1054
bool cmos_3v3
Definition: adf4382.h:510
int adf4382_get_rfout(struct adf4382_dev *dev, uint64_t *val)
Gets the user proposed output frequency.
Definition: adf4382.c:590
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
#define ADF4382_LDWIN_PW_MSK
Definition: adf4382.h:222
int adf4382_get_ref_clk(struct adf4382_dev *dev, uint64_t *val)
Gets the user proposed reference frequency.
Definition: adf4382.c:223
int adf4382_get_bleed_word(struct adf4382_dev *dev, int32_t *word)
Gets the value of the set bleed word.
Definition: adf4382.c:384
#define ADF4382_SPI_DUMMY_DATA
Definition: adf4382.h:435
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:114
uint32_t gcd(uint32_t x, uint32_t y)
Computes the greatest common divider of two numbers.
Definition: adf4156.c:208
int adf4382_set_freq(struct adf4382_dev *dev)
Set the output frequency.
Definition: adf4382.c:788
#define ADF4382_CLKOUT_DIV_REG_VAL_MAX
Definition: adf4382.h:450
#define ADF4382_BLEED_WORD_MAX
Definition: adf4382.h:462
int adf4382_spi_update_bits(struct adf4382_dev *dev, uint16_t reg_addr, uint8_t mask, uint8_t data)
Updates the values of the ADF4382 register.
Definition: adf4382.c:136
#define ADF4382_CLK2_OPWR_MSK
Definition: adf4382.h:198
#define ADF4382_DCLK_DIV1_1_MAX
Definition: adf4382.h:449
uint16_t bleed_word
Definition: adf4382.h:497
#define ADF4382_PD_CLKOUT2_MSK
Definition: adf4382.h:219
Implementation of adf4382 Driver.
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
#define ADF4382_R_DIV_MSK
Definition: adf4382.h:162
int adf4382_get_en_chan(struct adf4382_dev *dev, uint8_t ch, bool *en)
Gets the value the output channel if it is enabled or disable.
Definition: adf4382.c:488
#define ADF4382_SPI_WRITE_CMD
Definition: adf4382.h:433
int adf4382_get_en_ref_doubler(struct adf4382_dev *dev, bool *en)
Gets the value the doubler if it is enabled or disable and stores it it the dev structure.
Definition: adf4382.c:258
int adf4382_spi_read(struct adf4382_dev *dev, uint16_t reg_addr, uint8_t *data)
Reads data from ADF4382 over SPI.
Definition: adf4382.c:98
struct no_os_spi_init_param * spi_init
Definition: adf4382.h:489
int adf4382_spi_write(struct adf4382_dev *dev, uint16_t reg_addr, uint8_t data)
Writes data to ADF4382 over SPI.
Definition: adf4382.c:68
struct no_os_spi_desc * spi_desc
Definition: adf4382.h:508
#define ADF4382_SPI_3W_CFG(x)
Definition: adf4382.h:425
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
int adf4382_get_ref_clk(struct adf4382_dev *dev, uint64_t *val)
Gets the user proposed reference frequency.
Definition: adf4382.c:223
int adf4382_set_en_ref_doubler(struct adf4382_dev *dev, bool en)
Set the reference doubler to enable or disable based on the passed parameter. If the parameter is dif...
Definition: adf4382.c:241
int adf4382_set_phase_pol(struct adf4382_dev *dev, bool polarity)
Set the phase polarity. If pol = 0 then it will add the phase value otherwise it will subtract the ph...
Definition: adf4382.c:1122
uint64_t freq_min
Definition: adf4382.h:522
int adf4382_set_phase_pol(struct adf4382_dev *dev, bool polarity)
Set the phase polarity. If pol = 0 then it will add the phase value otherwise it will subtract the ph...
Definition: adf4382.c:1122
int adf4382_init(struct adf4382_dev **dev, struct adf4382_init_param *init_param)
Initializes the ADF4382.
Definition: adf4382.c:1181
#define ADF4382_FRAC2WORD_MSB_MSK
Definition: adf4382.h:131
#define ADF4382_PHASE_BLEED_CNST
Definition: adf4382.h:464
int adf4382_set_out_power(struct adf4382_dev *dev, uint8_t ch, int32_t pwr)
Set the output power register value of a channel and reset everything over to maximum supported value...
Definition: adf4382.c:414
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
#define ADF4382_BLEED_MSB_MSK
Definition: adf4382.h:427
Header file of utility functions.
#define ADF4382_CHANNEL_SPACING_MAX
Definition: adf4382.h:444
#define ADF4382A_VCO_FREQ_MIN
Definition: adf4382.h:439
int adf4382_set_cp_i(struct adf4382_dev *dev, int32_t reg_val)
Set the charge pump value which will be written to the register. The value will be between 0 and 15 o...
Definition: adf4382.c:322
uint16_t bleed_word
Definition: adf4382.h:516
int adf4382_set_en_ref_doubler(struct adf4382_dev *dev, bool en)
Set the reference doubler to enable or disable based on the passed parameter. If the parameter is dif...
Definition: adf4382.c:241
@ ID_ADF4382
Definition: adf4382.h:479
#define ADF4382_RESET_CMD
Definition: adf4382.h:49
uint16_t reg
Definition: adf4371.c:186
#define ADF4382_MOD2WORD_MID_MSK
Definition: adf4382.h:137
#define S_TO_NS
Definition: adf4382.h:472
#define ADF4382_PD_CLKOUT1_MSK
Definition: adf4382.h:218
#define ADF4382_LD_COUNT_OPWR_MSK
Definition: adf4382.h:223
#define no_os_bit_swap_constant_8(x)
Definition: no_os_util.h:102
int adf4382_set_rfout(struct adf4382_dev *dev, uint64_t val)
Set the desired output frequency and reset everything over to maximum supported value of 22GHz (21GHz...
Definition: adf4382.c:552
uint64_t ref_freq_hz
Definition: adf4382.h:511
uint64_t freq_max
Definition: adf4382.h:521
int adf4382_set_phase_adjust(struct adf4382_dev *dev, uint32_t phase_ps)
Set the phase adjustment in pico-seconds. The phase adjust will enable the Bleed current option as we...
Definition: adf4382.c:1054
int adf4382_get_cp_i(struct adf4382_dev *dev, int32_t *reg_val)
Gets the charge pump value from the register. The value will be between 0 and 15 on 8 bits....
Definition: adf4382.c:343
#define NO_OS_DIV_ROUND_CLOSEST(x, y)
Definition: no_os_util.h:54
#define ADF4382_MOD2WORD_MSB_MSK
Definition: adf4382.h:140
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
int adf4382_set_ref_div(struct adf4382_dev *dev, int32_t div)
Set the reference divider value and reset everything over to maximum supported value of 63 to the max...
Definition: adf4382.c:280
uint64_t no_os_div_u64(uint64_t dividend, uint32_t divisor)