43#define ADF4030_SOFT_RESET_R_MSK NO_OS_BIT(7)
44#define ADF4030_LSB_FIRST_R_MSK NO_OS_BIT(6)
45#define ADF4030_ADDRESS_ASC_R_MSK NO_OS_BIT(5)
46#define ADF4030_SDO_ACTIVE_R_MSK NO_OS_BIT(4)
47#define ADF4030_SDO_ACTIVE_MSK NO_OS_BIT(3)
48#define ADF4030_ADDRESS_ASC_MSK NO_OS_BIT(2)
49#define ADF4030_LSB_FIRST_MSK NO_OS_BIT(1)
50#define ADF4030_SOFT_RESET_MSK NO_OS_BIT(0)
51#define ADF4030_RESET_CMD 0x81
54#define ADF4030_CHIP_TYPE 0x06
57#define ADF4030_PRODUCT_ID_LSB 0x0005
60#define ADF4030_PRODUCT_ID_MSB 0x0005
63#define ADF4030_SCRATCHPAD_MSK NO_OS_GENMASK(7, 0)
66#define ADF4030_TDC_TARGET NO_OS_GENMASK(4, 0)
69#define ADF4030_MANUAL_MODE NO_OS_BIT(7)
70#define ADF4030_EN_ALIGN NO_OS_BIT(6)
71#define ADF4030_TDC_SOURCE NO_OS_GENMASK(4, 0)
74#define ADF4030_EN_DRV7 NO_OS_BIT(7)
75#define ADF4030_EN_DRV6 NO_OS_BIT(6)
76#define ADF4030_EN_DRV5 NO_OS_BIT(5)
77#define ADF4030_EN_DRV4 NO_OS_BIT(4)
78#define ADF4030_EN_DRV3 NO_OS_BIT(3)
79#define ADF4030_EN_DRV2 NO_OS_BIT(2)
80#define ADF4030_EN_DRV1 NO_OS_BIT(1)
81#define ADF4030_EN_DRV0 NO_OS_BIT(0)
84#define ADF4030_PRBS5 NO_OS_BIT(7)
85#define ADF4030_PRBS4 NO_OS_BIT(6)
86#define ADF4030_PRBS3 NO_OS_BIT(5)
87#define ADF4030_PRBS2 NO_OS_BIT(4)
88#define ADF4030_PRBS1 NO_OS_BIT(3)
89#define ADF4030_PRBS0 NO_OS_BIT(2)
90#define ADF4030_EN_DRV9 NO_OS_BIT(1)
91#define ADF4030_EN_DRV8 NO_OS_BIT(0)
94#define ADF4030_CHAN_INV3 NO_OS_BIT(7)
95#define ADF4030_CHAN_INV2 NO_OS_BIT(6)
96#define ADF4030_CHAN_INV1 NO_OS_BIT(5)
97#define ADF4030_CHAN_INV0 NO_OS_BIT(4)
98#define ADF4030_PRBS9 NO_OS_BIT(3)
99#define ADF4030_PRBS8 NO_OS_BIT(2)
100#define ADF4030_PRBS7 NO_OS_BIT(1)
101#define ADF4030_PRBS6 NO_OS_BIT(0)
104#define ADF4030_FALL_EDGE_SRC NO_OS_BIT(7)
105#define ADF4030_FALL_EDGE_TGT NO_OS_BIT(6)
106#define ADF4030_CHAN_INV9 NO_OS_BIT(5)
107#define ADF4030_CHAN_INV8 NO_OS_BIT(4)
108#define ADF4030_CHAN_INV7 NO_OS_BIT(3)
109#define ADF4030_CHAN_INV6 NO_OS_BIT(2)
110#define ADF4030_CHAN_INV5 NO_OS_BIT(1)
111#define ADF4030_CHAN_INV4 NO_OS_BIT(0)
114#define ADF4030_TDC_ARM_M NO_OS_BIT(7)
115#define ADF4030_AVGRXP NO_OS_GENMASK(4, 0)
118#define ADF4030_NDEL_ADJ NO_OS_BIT(7)
119#define ADF4030_STOP_FSM NO_OS_BIT(6)
120#define ADF4030_ADEL NO_OS_GENMASK(5, 0)
123#define ADF4030_DELTA_NDEL_COAR_LSB NO_OS_GENMASK(7, 0)
126#define ADF4030_DELTA_NDEL_COAR_MSB NO_OS_GENMASK(7, 0)
129#define ADF4030_TDC_OFFSET_COM_LSB NO_OS_GENMASK(7, 0)
132#define ADF4030_TDC_OFFSET_COM_MID NO_OS_GENMASK(7, 0)
135#define ADF4030_TDC_OFFSET_COM_MSB NO_OS_GENMASK(4, 0)
138#define ADF4030_TDC_OFFSET0_LSB NO_OS_GENMASK(7, 0)
141#define ADF4030_TDC_OFFSET0_MSB NO_OS_GENMASK(7, 0)
144#define ADF4030_TDC_OFFSET1_LSB NO_OS_GENMASK(7, 0)
147#define ADF4030_TDC_OFFSET1_MSB NO_OS_GENMASK(7, 0)
150#define ADF4030_TDC_OFFSET2_LSB NO_OS_GENMASK(7, 0)
153#define ADF4030_TDC_OFFSET2_MSB NO_OS_GENMASK(7, 0)
156#define ADF4030_TDC_OFFSET3_LSB NO_OS_GENMASK(7, 0)
159#define ADF4030_TDC_OFFSET3_MSB NO_OS_GENMASK(7, 0)
162#define ADF4030_TDC_OFFSET4_LSB NO_OS_GENMASK(7, 0)
165#define ADF4030_TDC_OFFSET4_MSB NO_OS_GENMASK(7, 0)
168#define ADF4030_TDC_OFFSET5_LSB NO_OS_GENMASK(7, 0)
171#define ADF4030_TDC_OFFSET5_MSB NO_OS_GENMASK(7, 0)
174#define ADF4030_TDC_OFFSET6_LSB NO_OS_GENMASK(7, 0)
177#define ADF4030_TDC_OFFSET6_MSB NO_OS_GENMASK(7, 0)
180#define ADF4030_TDC_OFFSET7_LSB NO_OS_GENMASK(7, 0)
183#define ADF4030_TDC_OFFSET7_MSB NO_OS_GENMASK(7, 0)
186#define ADF4030_TDC_OFFSET8_LSB NO_OS_GENMASK(7, 0)
189#define ADF4030_TDC_OFFSET8_MSB NO_OS_GENMASK(7, 0)
192#define ADF4030_TDC_OFFSET9_LSB NO_OS_GENMASK(7, 0)
195#define ADF4030_TDC_OFFSET9_MSB NO_OS_GENMASK(7, 0)
198#define ADF4030_ONE_SHOT NO_OS_BIT(7)
199#define ADF4030_CYCLES NO_OS_BIT(6)
200#define ADF4030_DELCAL NO_OS_GENMASK(5, 0)
203#define ADF4030_BSYNC_CAL_ON_1_0 NO_OS_GENMASK(7, 6)
204#define ADF4030_ALIGN_THOLD NO_OS_GENMASK(5, 0)
207#define ADF4030_BSYNC_CAL_ON_9_2 NO_OS_GENMASK(7, 0)
210#define ADF4030_ALIGN_CYCLES NO_OS_GENMASK(7, 5)
211#define ADF4030_AUTO_PF_BG NO_OS_BIT(4)
212#define ADF4030_EN_BKGND_ALGN NO_OS_BIT(3)
213#define ADF4030_EN_SERIAL_ALIGN NO_OS_BIT(2)
214#define ADF4030_EN_CYCS_RED NO_OS_BIT(1)
215#define ADF4030_EN_ITER NO_OS_BIT(0)
218#define ADF4030_RST_BSYNC_CH_7_0 NO_OS_GENMASK(7, 0)
221#define ADF4030_RST_SYS NO_OS_BIT(7)
222#define ADF4030_MSTR_RST_BSYNC NO_OS_BIT(6)
223#define ADF4030_RST_BSYNC_CH_9_8 NO_OS_GENMASK(1, 0)
226#define ADF4030_PD_DRV7 NO_OS_BIT(7)
227#define ADF4030_PD_DRV6 NO_OS_BIT(6)
228#define ADF4030_PD_DRV5 NO_OS_BIT(5)
229#define ADF4030_PD_DRV4 NO_OS_BIT(4)
230#define ADF4030_PD_DRV3 NO_OS_BIT(3)
231#define ADF4030_PD_DRV2 NO_OS_BIT(2)
232#define ADF4030_PD_DRV1 NO_OS_BIT(1)
233#define ADF4030_PD_DRV0 NO_OS_BIT(0)
236#define ADF4030_PD_TX_PATH5 NO_OS_BIT(7)
237#define ADF4030_PD_TX_PATH4 NO_OS_BIT(6)
238#define ADF4030_PD_TX_PATH3 NO_OS_BIT(5)
239#define ADF4030_PD_TX_PATH2 NO_OS_BIT(4)
240#define ADF4030_PD_TX_PATH1 NO_OS_BIT(3)
241#define ADF4030_PD_TX_PATH0 NO_OS_BIT(2)
242#define ADF4030_PD_DRV9 NO_OS_BIT(1)
243#define ADF4030_PD_DRV8 NO_OS_BIT(0)
246#define ADF4030_PD_ALL NO_OS_BIT(7)
247#define ADF4030_PD_PLL NO_OS_BIT(6)
248#define ADF4030_PD_TDC NO_OS_BIT(5)
249#define ADF4030_PD_ADC NO_OS_BIT(4)
250#define ADF4030_PD_TX_PATH9 NO_OS_BIT(3)
251#define ADF4030_PD_TX_PATH8 NO_OS_BIT(2)
252#define ADF4030_PD_TX_PATH7 NO_OS_BIT(1)
253#define ADF4030_PD_TX_PATH6 NO_OS_BIT(0)
256#define ADF4030_ODIV_SEL0 NO_OS_BIT(7)
257#define ADF4030_BOOST0 NO_OS_BIT(6)
258#define ADF4030_RCM0 NO_OS_GENMASK(5, 0)
261#define ADF4030_AUTO_PD_RCV0 NO_OS_BIT(7)
262#define ADF4030_FLOAT_RX0 NO_OS_BIT(5)
263#define ADF4030_FLOAT_TX0 NO_OS_BIT(4)
264#define ADF4030_LINK_RX0 NO_OS_BIT(3)
265#define ADF4030_LINK_TX0 NO_OS_BIT(2)
266#define ADF4030_AC_COUPLED0 NO_OS_BIT(1)
269#define ADF4030_ODIV_SEL1 NO_OS_BIT(7)
270#define ADF4030_BOOST1 NO_OS_BIT(6)
271#define ADF4030_RCM1 NO_OS_GENMASK(5, 0)
274#define ADF4030_AUTO_PD_RCV1 NO_OS_BIT(7)
275#define ADF4030_FLOAT_RX1 NO_OS_BIT(5)
276#define ADF4030_FLOAT_TX1 NO_OS_BIT(4)
277#define ADF4030_LINK_RX1 NO_OS_BIT(3)
278#define ADF4030_LINK_TX1 NO_OS_BIT(2)
279#define ADF4030_AC_COUPLED1 NO_OS_BIT(1)
282#define ADF4030_ODIV_SEL2 NO_OS_BIT(7)
283#define ADF4030_BOOST2 NO_OS_BIT(6)
284#define ADF4030_RCM2 NO_OS_GENMASK(5, 0)
287#define ADF4030_AUTO_PD_RCV2 NO_OS_BIT(7)
288#define ADF4030_FLOAT_RX2 NO_OS_BIT(5)
289#define ADF4030_FLOAT_TX2 NO_OS_BIT(4)
290#define ADF4030_LINK_RX2 NO_OS_BIT(3)
291#define ADF4030_LINK_TX2 NO_OS_BIT(2)
292#define ADF4030_AC_COUPLED2 NO_OS_BIT(1)
295#define ADF4030_ODIV_SEL3 NO_OS_BIT(7)
296#define ADF4030_BOOST3 NO_OS_BIT(6)
297#define ADF4030_RCM3 NO_OS_GENMASK(5, 0)
300#define ADF4030_AUTO_PD_RCV3 NO_OS_BIT(7)
301#define ADF4030_FLOAT_RX3 NO_OS_BIT(5)
302#define ADF4030_FLOAT_TX3 NO_OS_BIT(4)
303#define ADF4030_LINK_RX3 NO_OS_BIT(3)
304#define ADF4030_LINK_TX3 NO_OS_BIT(2)
305#define ADF4030_AC_COUPLED3 NO_OS_BIT(1)
308#define ADF4030_ODIV_SEL4 NO_OS_BIT(7)
309#define ADF4030_BOOST4 NO_OS_BIT(6)
310#define ADF4030_RCM4 NO_OS_GENMASK(5, 0)
313#define ADF4030_AUTO_PD_RCV4 NO_OS_BIT(7)
314#define ADF4030_FLOAT_RX4 NO_OS_BIT(5)
315#define ADF4030_FLOAT_TX4 NO_OS_BIT(4)
316#define ADF4030_LINK_RX4 NO_OS_BIT(3)
317#define ADF4030_LINK_TX4 NO_OS_BIT(2)
318#define ADF4030_AC_COUPLED4 NO_OS_BIT(1)
321#define ADF4030_ODIV_SEL5 NO_OS_BIT(7)
322#define ADF4030_BOOST5 NO_OS_BIT(6)
323#define ADF4030_RCM5 NO_OS_GENMASK(5, 0)
326#define ADF4030_AUTO_PD_RCV5 NO_OS_BIT(7)
327#define ADF4030_FLOAT_RX5 NO_OS_BIT(5)
328#define ADF4030_FLOAT_TX5 NO_OS_BIT(4)
329#define ADF4030_LINK_RX5 NO_OS_BIT(3)
330#define ADF4030_LINK_TX5 NO_OS_BIT(2)
331#define ADF4030_AC_COUPLED5 NO_OS_BIT(1)
334#define ADF4030_ODIV_SEL6 NO_OS_BIT(7)
335#define ADF4030_BOOST6 NO_OS_BIT(6)
336#define ADF4030_RCM6 NO_OS_GENMASK(5, 0)
339#define ADF4030_AUTO_PD_RCV6 NO_OS_BIT(7)
340#define ADF4030_FLOAT_RX6 NO_OS_BIT(5)
341#define ADF4030_FLOAT_TX6 NO_OS_BIT(4)
342#define ADF4030_LINK_RX6 NO_OS_BIT(3)
343#define ADF4030_LINK_TX6 NO_OS_BIT(2)
344#define ADF4030_AC_COUPLED6 NO_OS_BIT(1)
347#define ADF4030_ODIV_SEL7 NO_OS_BIT(7)
348#define ADF4030_BOOST7 NO_OS_BIT(6)
349#define ADF4030_RCM7 NO_OS_GENMASK(5, 0)
352#define ADF4030_AUTO_PD_RCV7 NO_OS_BIT(7)
353#define ADF4030_FLOAT_RX7 NO_OS_BIT(5)
354#define ADF4030_FLOAT_TX7 NO_OS_BIT(4)
355#define ADF4030_LINK_RX7 NO_OS_BIT(3)
356#define ADF4030_LINK_TX7 NO_OS_BIT(2)
357#define ADF4030_AC_COUPLED7 NO_OS_BIT(1)
360#define ADF4030_ODIV_SEL8 NO_OS_BIT(7)
361#define ADF4030_BOOST8 NO_OS_BIT(6)
362#define ADF4030_RCM8 NO_OS_GENMASK(5, 0)
365#define ADF4030_AUTO_PD_RCV8 NO_OS_BIT(7)
366#define ADF4030_FLOAT_RX8 NO_OS_BIT(5)
367#define ADF4030_FLOAT_TX8 NO_OS_BIT(4)
368#define ADF4030_LINK_RX8 NO_OS_BIT(3)
369#define ADF4030_LINK_TX8 NO_OS_BIT(2)
370#define ADF4030_AC_COUPLED8 NO_OS_BIT(1)
373#define ADF4030_ODIV_SEL9 NO_OS_BIT(7)
374#define ADF4030_BOOST9 NO_OS_BIT(6)
375#define ADF4030_RCM9 NO_OS_GENMASK(5, 0)
378#define ADF4030_AUTO_PD_RCV9 NO_OS_BIT(7)
379#define ADF4030_FLOAT_RX9 NO_OS_BIT(5)
380#define ADF4030_FLOAT_TX9 NO_OS_BIT(4)
381#define ADF4030_LINK_RX9 NO_OS_BIT(3)
382#define ADF4030_LINK_TX9 NO_OS_BIT(2)
383#define ADF4030_AC_COUPLED9 NO_OS_BIT(1)
386#define ADF4030_ODIVA_LSB NO_OS_GENMASK(7, 0)
389#define ADF4030_ODIVB_LSB NO_OS_GENMASK(7, 4)
390#define ADF4030_ODIVA_MSB NO_OS_GENMASK(3, 0)
393#define ADF4030_ODIVB_MSB NO_OS_GENMASK(7, 0)
396#define ADF4030_NDIV NO_OS_GENMASK(7, 0)
399#define ADF4030_CP_I NO_OS_GENMASK(6, 5)
400#define ADF4030_RDIV NO_OS_GENMASK(4, 0)
403#define ADF4030_RST_PLL_CAL NO_OS_BIT(7)
404#define ADF4030_PLL_CAL_EN NO_OS_BIT(6)
407#define ADF4030_CMOS_OV NO_OS_BIT(7)
408#define ADF4030_RST_ALIGN_IRQ NO_OS_BIT(5)
409#define ADF4030_RST_TEMP NO_OS_BIT(5)
410#define ADF4030_MASK_TDC_ERR NO_OS_BIT(4)
411#define ADF4030_MASK_LD NO_OS_BIT(3)
412#define ADF4030_MASK_ALIGN_IRQ NO_OS_BIT(2)
413#define ADF4030_MASK_TEMP NO_OS_BIT(1)
414#define ADF4030_IRQB_OPEN_DRAIN NO_OS_BIT(0)
417#define ADF4030_ADC_C_CNV NO_OS_BIT(6)
420#define ADF4030_RST_TDC_ERR NO_OS_BIT(7)
421#define ADF4030_ADC_CLK_SEL NO_OS_BIT(6)
422#define ADF4030_EN_ADC_CNV NO_OS_BIT(2)
423#define ADF4030_EN_ADC_CLK NO_OS_BIT(1)
424#define ADF4030_EN_ADC NO_OS_BIT(0)
427#define ADF4030_MUXCODE1 NO_OS_GENMASK(4, 0)
430#define ADF4030_MUXCODE2 NO_OS_GENMASK(4, 0)
433#define ADF4030_GPO2 NO_OS_BIT(7)
434#define ADF4030_GPO1 NO_OS_BIT(6)
437#define ADF4030_ADC_ST_CNV NO_OS_BIT(0)
440#define ADF4030_TDC_RSLT_UI_LSB NO_OS_GENMASK(7, 0)
443#define ADF4030_TDC_RSLT_UI_MID NO_OS_GENMASK(7, 0)
446#define ADF4030_TDC_RSLT_UI_MSB NO_OS_GENMASK(7, 0)
449#define ADF4030_REF_OK NO_OS_BIT(6)
450#define ADF4030_TDC_BUSY NO_OS_BIT(4)
451#define ADF4030_DL_BUSY NO_OS_BIT(3)
452#define ADF4030_MATH_BUSY NO_OS_BIT(2)
453#define ADF4030_ADC_BUSY NO_OS_BIT(1)
454#define ADF4030_FSM_BUSY NO_OS_BIT(0)
457#define ADF4030_TEMP_MON NO_OS_BIT(4)
458#define ADF4030_TMP_ALIGN_ERR NO_OS_BIT(3)
459#define ADF4030_TDC_ERR NO_OS_GENMASK(2, 1)
460#define ADF4030_PLL_LD NO_OS_BIT(0)
463#define ADF4030_TEMP_MEAS_LSB NO_OS_GENMASK(7, 0)
466#define ADF4030_TEMP_MEAS_MSB NO_OS_BIT(0)
468#define ADF4030_SPI_4W_CFG(x) (no_os_field_prep(ADF4030_SDO_ACTIVE_MSK, x) | \
469 no_os_field_prep(ADF4030_SDO_ACTIVE_R_MSK, x))
471#define ADF4030_SPI_LSB_CFG(x) (no_os_field_prep(ADF4030_LSB_FIRST_MSK, x) | \
472 no_os_field_prep(ADF4030_LSB_FIRST_R_MSK, x))
474#define ADF4030_SPI_SCRATCHPAD_TEST 0x5A
475#define ADF4030_CHANNEL_TX_PD_SEPARATOR 6
476#define ADF4030_CHANNEL_DRV_SEPARATOR 8
477#define ADF4030_CHANNEL_PRBS_SEPARATOR 6
478#define ADF4030_CHANNEL_INV_SEPARATOR 4
479#define ADF4030_POR_DELAY_US 200
480#define ADF4030_RCM_CONST1 7000
481#define ADF4030_RCM_CONST2 735
482#define ADF4030_RCM_CONST3 10
483#define ADF4030_RCM_CONST4 265
484#define ADF4030_RCM_CURRENT0 14
485#define ADF4030_RCM_CURRENT1 20
486#define ADF4030_RCM_VOLTAGE_MIN0 504
487#define ADF4030_RCM_VOLTAGE_MAX0 1304
488#define ADF4030_RCM_VOLTAGE_MIN1 720
489#define ADF4030_RCM_VOLTAGE_MAX1 1863
492#define ADF4030_SPI_WRITE_CMD 0x0
493#define ADF4030_SPI_READ_CMD 0x8000
494#define ADF4030_CHIP_ADDRESS(x) (x << 9)
495#define ADF4030_SPI_DUMMY_DATA 0x00
496#define ADF4030_BUFF_SIZE_BYTES 3
497#define ADF4030_CHANNEL_NUMBER 10
498#define ADF4030_ADC_CLK_DIV 64U
500#define ADF4030_VCO_FREQ_MIN 2375000000U
501#define ADF4030_VCO_FREQ_MAX 2625000000U
502#define ADF4030_PFD_FREQ_MIN 10000000U
503#define ADF4030_PFD_FREQ_MAX 20000000U
505#define ADF4030_BSYNC_FREQ_MIN 650000U
506#define ADF4030_BSYNC_FREQ_MAX 200000000U
507#define ADF4030_REF_FREQ_MAX 250000000U
508#define ADF4030_REF_FREQ_MIN 10000000
509#define ADF4030_REF_DIV_MAX 31
510#define ADF4030_R_DIV_MIN 1U
511#define ADF4030_R_DIV_MAX 31U
512#define ADF4030_N_DIV_MIN 8U
513#define ADF4030_N_DIV_MAX 255U
514#define ADF4030_O_DIV_MIN 10U
515#define ADF4030_O_DIV_MAX 4095U
516#define ADF4030_ALIGN_CYCLES_MIN (1U)
517#define ADF4030_ALIGN_CYCLES_MAX (8U)
518#define ADF4030_CHIP_ADDRESS_MIN 0U
519#define ADF4030_CHIP_ADDRESS_MAX 15U
585 uint8_t mask, uint8_t data);
614 int64_t *tdc_result_fs);
621 uint32_t threshold_fs);
624 uint32_t *threshold_fs);
627 uint8_t tdc_target_ch);
630 uint16_t channel_flags);
633 uint16_t *channel_flags);
636 uint16_t channel_flags);
639 uint16_t *channel_flags);
678 uint32_t voltage_mv);
681 uint32_t *voltage_mv);
struct ad7616_init_param init_param
Definition ad7616_sdz.c:107
int adf4030_spi_read(struct adf4030_dev *dev, uint16_t reg_addr, uint8_t *data)
Reads data from ADF4030 over SPI.
Definition adf4030.c:137
int adf4030_set_channel_odivb(struct adf4030_dev *dev, uint8_t channel, bool odivb_en)
Set the output divider selection for a specific channel. If odivb_en is enabled, the output divider b...
Definition adf4030.c:1573
int adf4030_remove(struct adf4030_dev *dev)
Free resources allocated for adf4030.
Definition adf4030.c:1849
int adf4030_set_bsync_freq(struct adf4030_dev *dev, uint32_t bsync_freq, bool odivb_sel)
Set the BSYNC frequency in Hz. Output divider will be choose according to odiv sel argument.
Definition adf4030.c:622
int adf4030_get_bsync_freq(struct adf4030_dev *dev, uint32_t *bsync_freq, bool odivb_sel)
Get the BSYNC frequency in Hz.
Definition adf4030.c:671
int adf4030_get_alignment_iter(struct adf4030_dev *dev, uint8_t *iter_number)
Get the iteration number of alignment.
Definition adf4030.c:886
int adf4030_get_serial_alignment(struct adf4030_dev *dev, uint16_t *channel_flags)
Get the serial alignment channel flags for multiple BSYNC channels.
Definition adf4030.c:1064
int adf4030_get_channel_direction(struct adf4030_dev *dev, uint8_t channel, bool *tx_en)
Get the TX direction (TX/RX) of a specific channel.
Definition adf4030.c:1332
int adf4030_set_single_ch_alignment(struct adf4030_dev *dev, uint8_t tdc_target_ch)
Perform single-channel alignment. Before calling this function, please set tdc_source to the desired ...
Definition adf4030.c:975
int adf4030_set_alignment_threshold(struct adf4030_dev *dev, uint32_t threshold_fs)
Set the alignment threshold in femtoseconds.
Definition adf4030.c:908
int adf4030_get_tdc_source(struct adf4030_dev *dev, uint8_t *tdc_source)
Get the TDC source.
Definition adf4030.c:746
int adf4030_get_channel_prbs(struct adf4030_dev *dev, uint8_t channel, bool *prbs_en)
Get the PRBS (Pseudo-Random Binary Sequence) state for a specific channel.
Definition adf4030.c:1537
int adf4030_set_background_serial_alignment(struct adf4030_dev *dev, uint16_t channel_flags)
Set background serial alignment for multiple BSYNC channels.
Definition adf4030.c:1096
int adf4030_set_channel_voltage(struct adf4030_dev *dev, uint8_t channel, uint32_t voltage_mv)
Set the voltage level for the BSYNC channel.
Definition adf4030.c:1697
int adf4030_set_channel_prbs(struct adf4030_dev *dev, uint8_t channel, bool prbs_en)
Set the PRBS (Pseudo-Random Binary Sequence) state for a specific channel.
Definition adf4030.c:1505
int adf4030_set_serial_alignment(struct adf4030_dev *dev, uint16_t channel_flags)
Set serial alignment for multiple BSYNC channels.
Definition adf4030.c:1023
int adf4030_set_ref_clk(struct adf4030_dev *dev, uint32_t val)
Set the desired reference frequency and reset everything over to maximum supported value of 250MHz to...
Definition adf4030.c:498
int adf4030_get_vco_freq(struct adf4030_dev *dev, uint32_t *vco_freq)
Get the VCO frequency in Hz.
Definition adf4030.c:586
int adf4030_get_channel_delay(struct adf4030_dev *dev, uint8_t channel, int64_t *delay_fs)
Get the delay for a specific channel.
Definition adf4030.c:1244
int adf4030_get_channel_voltage(struct adf4030_dev *dev, uint8_t channel, uint32_t *voltage_mv)
Get the voltage level for a specific channel.
Definition adf4030.c:1744
int adf4030_spi_write(struct adf4030_dev *dev, uint16_t reg_addr, uint8_t data)
Writes data to ADF4030 over SPI.
Definition adf4030.c:106
int adf4030_set_tdc_source(struct adf4030_dev *dev, uint8_t tdc_source)
Set the TDC source.
Definition adf4030.c:723
int adf4030_get_channel_termination(struct adf4030_dev *dev, uint8_t channel, enum adf4030_terminations_e *termination)
Get the termination type for a specific channel.
Definition adf4030.c:1447
int adf4030_set_tdc_measurement(struct adf4030_dev *dev, uint8_t tdc_target)
Set the TDC measurement target and start the measurement. Before calling this function,...
Definition adf4030.c:770
int adf4030_set_channel_direction(struct adf4030_dev *dev, uint8_t channel, bool tx_en)
Set the TX-RX direction of a specific channel.
Definition adf4030.c:1287
int adf4030_get_channel_invert(struct adf4030_dev *dev, uint8_t channel, bool *invert_en)
Get the inversion state for a specific channel.
Definition adf4030.c:1663
adf4030_terminations_e
Definition adf4030.h:521
@ TX_CURRENT_DRIVER_UNTERMINATED
Definition adf4030.h:523
@ RX_AC_COUPLED_CLKS
Definition adf4030.h:526
@ RX_DC_COUPLED_HCSL
Definition adf4030.h:527
@ TX_CURRENT_DRIVER_TERMINATED
Definition adf4030.h:524
@ RX_DC_COUPLED_CLKS
Definition adf4030.h:525
@ TX_VOLTAGE_DRIVER
Definition adf4030.h:522
int adf4030_set_channel_termination(struct adf4030_dev *dev, uint8_t channel, enum adf4030_terminations_e termination)
Set the termination type for a specific channel.
Definition adf4030.c:1380
#define ADF4030_CHANNEL_NUMBER
Definition adf4030.h:497
int adf4030_get_background_serial_alignment(struct adf4030_dev *dev, uint16_t *channel_flags)
Get the background serial alignment channel flags for multiple BSYNC channels.
Definition adf4030.c:1161
int adf4030_get_temperature(struct adf4030_dev *dev, int16_t *temperature)
Gets the value of the approximate die temperature.
Definition adf4030.c:443
int adf4030_set_channel_invert(struct adf4030_dev *dev, uint8_t channel, bool invert_en)
Set the inversion state for the BSYNC channel.
Definition adf4030.c:1631
int adf4030_set_chip_address(struct adf4030_dev *dev, uint8_t addr)
Set the chip address value.
Definition adf4030.c:477
int adf4030_set_default_regs(struct adf4030_dev *dev, bool spi_4wire)
Applys a softreset, sets the SPI 4 wire mode and writes the default registers.
Definition adf4030.c:252
int adf4030_init(struct adf4030_dev **dev, struct adf4030_init_param *init_param)
Initializes the adf4030.
Definition adf4030.c:1778
int adf4030_set_temperature(struct adf4030_dev *dev, bool en)
Set Temperature Readback feature's initial state. This function should be called before reading tempe...
Definition adf4030.c:398
int adf4030_get_alignment_threshold(struct adf4030_dev *dev, uint32_t *threshold_fs)
Get the alignment threshold in femtoseconds.
Definition adf4030.c:945
int adf4030_set_channel_delay(struct adf4030_dev *dev, uint8_t channel, int64_t delay_fs)
Set the delay for a specific BSYNC channel. This Delay will show up between TDC_SOURCE and channel.
Definition adf4030.c:1204
int adf4030_spi_update_bits(struct adf4030_dev *dev, uint16_t reg_addr, uint8_t mask, uint8_t data)
Updates the values of the ADF4030 register.
Definition adf4030.c:178
int adf4030_set_vco_freq(struct adf4030_dev *dev, uint32_t vco_freq)
Set the desired VCO frequency.
Definition adf4030.c:517
int adf4030_get_tdc_measurement(struct adf4030_dev *dev, int64_t *tdc_result_fs)
Get the TDC measurement result. Reads bitfileds and calculates the TDC result with period of the BSYN...
Definition adf4030.c:807
int adf4030_get_channel_odivb(struct adf4030_dev *dev, uint8_t channel, bool *odivb_en)
Get the output divider selection for a specific channel. If odivb_en is enabled, the output divider b...
Definition adf4030.c:1601
int adf4030_set_alignment_iter(struct adf4030_dev *dev, uint8_t iter_number)
Set the iteration number of alignment.
Definition adf4030.c:861
Header file of SPI Interface.
Header file of utility functions.
bool invert_en
Definition adf4030.h:534
uint32_t rcm_mv
Definition adf4030.h:532
bool boost_en
Definition adf4030.h:537
enum adf4030_terminations_e termination
Definition adf4030.h:533
bool prbs_en
Definition adf4030.h:536
bool tx_en
Definition adf4030.h:538
bool odivb_en
Definition adf4030.h:535
int64_t delay_fs
Definition adf4030.h:531
bool spi_4wire_en
Definition adf4030.h:559
bool cmos_3v3
Definition adf4030.h:560
uint8_t ndiv
Definition adf4030.h:555
uint8_t tdc_target
Definition adf4030.h:557
uint32_t bsync_freq_odiv_b
Definition adf4030.h:552
bool tdc_status
Definition adf4030.h:558
struct no_os_spi_desc * spi_desc
Definition adf4030.h:547
uint8_t ref_div
Definition adf4030.h:554
uint8_t chip_addr
Definition adf4030.h:553
uint8_t tdc_source
Definition adf4030.h:556
uint32_t vco_freq
Definition adf4030.h:550
uint32_t ref_freq
Definition adf4030.h:549
struct adf4030_chan_spec channels[ADF4030_CHANNEL_NUMBER]
Definition adf4030.h:548
uint32_t bsync_freq_odiv_a
Definition adf4030.h:551
ADF4030 Initialization Parameters structure.
Definition adf4030.h:567
bool spi_4wire_en
Definition adf4030.h:575
bool cmos_3v3
Definition adf4030.h:576
uint32_t bsync_freq
Definition adf4030.h:572
uint8_t ref_div
Definition adf4030.h:573
uint32_t vco_freq
Definition adf4030.h:571
struct no_os_spi_init_param * spi_init
Definition adf4030.h:569
uint32_t ref_freq
Definition adf4030.h:570
uint8_t chip_addr
Definition adf4030.h:574
Structure holding SPI descriptor.
Definition no_os_spi.h:180
Structure holding the parameters for SPI initialization.
Definition no_os_spi.h:128