no-OS
adf5355.h
Go to the documentation of this file.
1 /***************************************************************************/
40 /* Register Definition */
41 #define ADF5355_REG(x) (x)
42 
43 /* REG0 Bit Definitions */
44 #define ADF5355_REG0_INT(x) (((x) & 0xFFFF) << 4)
45 #define ADF5355_REG0_PRESCALER(x) ((x) << 20)
46 #define ADF5355_REG0_AUTOCAL(x) ((x) << 21)
47 
48 /* REG1 Bit Definitions */
49 #define ADF5355_REG1_FRACT(x) (((x) & 0xFFFFFF) << 4)
50 
51 /* REG2 Bit Definitions */
52 #define ADF5355_REG2_MOD2(x) (((x) & 0x3FFF) << 4)
53 #define ADF5355_REG2_FRAC2(x) (((x) & 0x3FFF) << 18)
54 
55 /* REG3 Bit Definitions */
56 #define ADF5355_REG3_PHASE(x) (((x) & 0xFFFFFF) << 4)
57 #define ADF5355_REG3_PHASE_ADJUST(x) ((x) << 28)
58 #define ADF5355_REG3_PHASE_RESYNC(x) ((x) << 29)
59 #define ADF5355_REG3_EXACT_SDLOAD_RESET(x) ((x) << 30)
60 
61 /* REG4 Bit Definitions */
62 #define ADF5355_REG4_COUNTER_RESET_EN(x) ((x) << 4)
63 #define ADF5355_REG4_CP_THREESTATE_EN(x) ((x) << 5)
64 #define ADF5355_REG4_POWER_DOWN_EN(x) ((x) << 6)
65 #define ADF5355_REG4_PD_POLARITY_POS(x) ((x) << 7)
66 #define ADF5355_REG4_MUX_LOGIC(x) ((x) << 8)
67 #define ADF5355_REG4_REFIN_MODE_DIFF(x) ((x) << 9)
68 #define ADF5355_REG4_CHARGE_PUMP_CURR(x) (((x) & 0xF) << 10)
69 #define ADF5355_REG4_DOUBLE_BUFF_EN(x) ((x) << 14)
70 #define ADF5355_REG4_10BIT_R_CNT(x) (((x) & 0x3FF) << 15)
71 #define ADF5355_REG4_RDIV2_EN(x) ((x) << 25)
72 #define ADF5355_REG4_RMULT2_EN(x) ((x) << 26)
73 #define ADF5355_REG4_MUXOUT(x) (((x) & 0x7) << 27)
74 
75 /* REG5 Bit Definitions */
76 #define ADF5355_REG5_DEFAULT 0x00800025
77 
78 /* REG6 Bit Definitions */
79 #define ADF4355_REG6_OUTPUTB_PWR(x) (((x) & 0x3) << 7)
80 #define ADF4355_REG6_RF_OUTB_EN(x) ((x) << 9)
81 #define ADF5355_REG6_OUTPUT_PWR(x) (((x) & 0x3) << 4)
82 #define ADF5355_REG6_RF_OUT_EN(x) ((x) << 6)
83 #define ADF5355_REG6_RF_OUTB_EN(x) ((x) << 10)
84 #define ADF5355_REG6_MUTE_TILL_LOCK_EN(x) ((x) << 11)
85 #define ADF5355_REG6_CP_BLEED_CURR(x) (((x) & 0xFF) << 13)
86 #define ADF5355_REG6_RF_DIV_SEL(x) (((x) & 0x7) << 21)
87 #define ADF5355_REG6_FEEDBACK_FUND(x) ((x) << 24)
88 #define ADF5355_REG6_NEG_BLEED_EN(x) ((x) << 29)
89 #define ADF5355_REG6_GATED_BLEED_EN(x) ((x) << 30)
90 #define ADF5356_REG6_BLEED_POLARITY(x) ((x) << 31)
91 #define ADF5355_REG6_DEFAULT 0x14000006
92 
93 /* REG7 Bit Definitions */
94 #define ADF5355_REG7_LD_MODE_INT_N_EN(x) ((x) << 4)
95 #define ADF5355_REG7_FACT_N_LD_PRECISION(x) (((x) & 0x3) << 5)
96 #define ADF5355_REG7_LOL_MODE_EN(x) ((x) << 7)
97 #define ADF5355_REG7_LD_CYCLE_CNT(x) (((x) & 0x3) << 8)
98 #define ADF5355_REG7_LE_SYNCED_REFIN_EN(x) ((x) << 25)
99 #define ADF5356_REG7_LE_SYNCE_EDGE_RISING_EN(x) ((x) << 27)
100 #define ADF5355_REG7_DEFAULT 0x10000007
101 #define ADF5356_REG7_DEFAULT 0x04000007
102 
103 /* REG8 Bit Definitions */
104 #define ADF5355_REG8_DEFAULT 0x102D0428
105 #define ADF5356_REG8_DEFAULT 0x15596568
106 
107 /* REG9 Bit Definitions */
108 #define ADF5355_REG9_SYNTH_LOCK_TIMEOUT(x) (((x) & 0x1F) << 4)
109 #define ADF5355_REG9_ALC_TIMEOUT(x) (((x) & 0x1F) << 9)
110 #define ADF5355_REG9_TIMEOUT(x) (((x) & 0x3FF) << 14)
111 #define ADF5355_REG9_VCO_BAND_DIV(x) (((x) & 0xFF) << 24)
112 
113 /* REG10 Bit Definitions */
114 #define ADF5355_REG10_ADC_EN(x) ((x) << 4)
115 #define ADF5355_REG10_ADC_CONV_EN(x) ((x) << 5)
116 #define ADF5355_REG10_ADC_CLK_DIV(x) (((x) & 0xFF) << 6)
117 #define ADF5355_REG10_DEFAULT 0x00C0000A
118 
119 /* REG11 Bit Definitions */
120 #define ADF5356_REG11_VCO_BAND_HOLD_EN(x) ((x) << 24)
121 #define ADF5355_REG11_DEFAULT 0x0061300B
122 #define ADF5356_REG11_DEFAULT 0x0061200B
123 
124 /* REG12 Bit Definitions */
125 #define ADF5355_REG12_PHASE_RESYNC_CLK_DIV(x) (((x) & 0xFFFF) << 16)
126 #define ADF5355_REG12_DEFAULT 0x0000041C
127 #define ADF5356_REG12_PHASE_RESYNC_CLK_DIV(x) (((x) & 0xFFFFF) << 12)
128 #define ADF5356_REG12_DEFAULT 0x000005FC
129 
130 /* REG13 Bit Definitions (ADF5356) */
131 #define ADF5356_REG13_MOD2_MSB(x) (((x) & 0x3FFF) << 4)
132 #define ADF5356_REG13_FRAC2_MSB(x) (((x) & 0x3FFF) << 18)
133 
134 /* Specifications */
135 #define ADF5355_MIN_VCO_FREQ 3400000000ULL /* Hz */
136 #define ADF5355_MAX_VCO_FREQ 6800000000ULL /* Hz */
137 #define ADF5355_MAX_OUT_FREQ ADF5355_MAX_VCO_FREQ /* Hz */
138 #define ADF5355_MIN_OUT_FREQ (ADF5355_MIN_VCO_FREQ / 64) /* Hz */
139 #define ADF5355_MAX_OUTB_FREQ (ADF5355_MAX_VCO_FREQ * 2) /* Hz */
140 #define ADF5355_MIN_OUTB_FREQ (ADF5355_MIN_VCO_FREQ * 2) /* Hz */
141 
142 #define ADF4355_MIN_VCO_FREQ 3400000000ULL /* Hz */
143 #define ADF4355_MAX_VCO_FREQ 6800000000ULL /* Hz */
144 #define ADF4355_MAX_OUT_FREQ ADF4355_MAX_VCO_FREQ /* Hz */
145 #define ADF4355_MIN_OUT_FREQ (ADF4355_MIN_VCO_FREQ / 64) /* Hz */
146 
147 #define ADF4355_3_MIN_VCO_FREQ 3300000000ULL /* Hz */
148 #define ADF4355_3_MAX_VCO_FREQ 6600000000ULL /* Hz */
149 #define ADF4355_3_MAX_OUT_FREQ ADF4355_3_MAX_VCO_FREQ /* Hz */
150 #define ADF4355_3_MIN_OUT_FREQ (ADF4355_3_MIN_VCO_FREQ / 64) /* Hz */
151 
152 #define ADF4355_2_MIN_VCO_FREQ 3400000000ULL /* Hz */
153 #define ADF4355_2_MAX_VCO_FREQ 6800000000ULL /* Hz */
154 #define ADF4355_2_MAX_OUT_FREQ 4400000000ULL /* Hz */
155 #define ADF4355_2_MIN_OUT_FREQ (ADF4355_2_MIN_VCO_FREQ / 64) /* Hz */
156 
157 #define ADF5355_MAX_FREQ_PFD 75000000UL /* Hz */
158 #define ADF5355_MAX_FREQ_REFIN 600000000UL /* Hz */
159 #define ADF5355_MAX_MODULUS2 16384
160 #define ADF5356_MAX_MODULUS2 268435456
161 #define ADF5355_MAX_R_CNT 1023
162 
163 #define ADF5355_MODULUS1 16777216ULL
164 #define ADF5355_MIN_INT_PRESCALER_89 75
165 
166 #define ADF5355_REG_NUM 14
167 
168 #define ADF5355_SPI_NO_BYTES 4
169 
170 /******************************************************************************/
171 /***************************** Include Files **********************************/
172 /******************************************************************************/
173 #include <stdint.h>
174 #include "no_os_spi.h"
175 
176 /******************************************************************************/
177 /*************************** Types Declarations *******************************/
178 /******************************************************************************/
179 
190 };
191 
204 };
205 
210 struct adf5355_dev {
215  uint64_t freq_req;
216  uint8_t freq_req_chan;
217  uint8_t num_channels;
218  uint32_t clkin_freq;
219  uint64_t max_out_freq;
220  uint64_t min_out_freq;
221  uint64_t min_vco_freq;
222  uint32_t fpfd;
223  uint32_t integer;
224  uint32_t fract1;
225  uint32_t fract2;
226  uint32_t mod2;
227  uint32_t cp_ua;
232  bool outa_en;
233  bool outb_en;
234  uint8_t outa_power;
235  uint8_t outb_power;
239  uint8_t ref_doubler_en;
240  uint8_t ref_div2_en;
241  uint8_t rf_div_sel;
242  uint16_t ref_div_factor;
244  uint32_t delay_us;
245 };
246 
254  uint64_t freq_req;
255  uint8_t freq_req_chan;
256  uint32_t clkin_freq;
257  uint32_t cp_ua;
262  bool outa_en;
263  bool outb_en;
264  uint8_t outa_power;
265  uint8_t outb_power;
269  uint8_t ref_doubler_en;
270  uint8_t ref_div2_en;
272 };
273 
274 /******************************************************************************/
275 /************************ Functions Declarations ******************************/
276 /******************************************************************************/
277 
278 /* Recalculate rate corresponding to a channel. */
279 int32_t adf5355_clk_recalc_rate(struct adf5355_dev *dev, uint32_t chan,
280  uint64_t *rate);
281 
282 /* Set channel rate. */
283 int32_t adf5355_clk_set_rate(struct adf5355_dev *dev, uint32_t chan,
284  uint64_t rate);
285 
286 /* Calculate closest possible rate */
287 int32_t adf5355_clk_round_rate(struct adf5355_dev *dev, uint64_t rate,
288  uint64_t *rounded_rate);
289 
290 /* Initializes the ADF5355. */
291 int32_t adf5355_init(struct adf5355_dev **device,
292  const struct adf5355_init_param *init_param);
293 
294 /* Remove the device. */
295 int32_t adf5355_remove(struct adf5355_dev *device);
ADF5355_REG0_INT
#define ADF5355_REG0_INT(x)
Definition: adf5355.h:44
ADF5356_REG12_PHASE_RESYNC_CLK_DIV
#define ADF5356_REG12_PHASE_RESYNC_CLK_DIV(x)
Definition: adf5355.h:127
adf5355_init_param::ref_div2_en
uint8_t ref_div2_en
Definition: adf5355.h:270
adf5355_clk_round_rate
int32_t adf5355_clk_round_rate(struct adf5355_dev *dev, uint64_t rate, uint64_t *rounded_rate)
Definition: adf5355.c:345
adf5355_init
int32_t adf5355_init(struct adf5355_dev **device, const struct adf5355_init_param *init_param)
Initializes the ADF5355.
Definition: adf5355.c:440
ADF5355_REG6_RF_OUTB_EN
#define ADF5355_REG6_RF_OUTB_EN(x)
Definition: adf5355.h:83
adf5355_dev::all_synced
bool all_synced
Definition: adf5355.h:213
adf5355_init_param::outb_power
uint8_t outb_power
Definition: adf5355.h:265
ADF5355_REG9_SYNTH_LOCK_TIMEOUT
#define ADF5355_REG9_SYNTH_LOCK_TIMEOUT(x)
Definition: adf5355.h:108
ADF5355_REG7_LD_MODE_INT_N_EN
#define ADF5355_REG7_LD_MODE_INT_N_EN(x)
Definition: adf5355.h:94
ADF5355_REG6_NEG_BLEED_EN
#define ADF5355_REG6_NEG_BLEED_EN(x)
Definition: adf5355.h:88
adf5355_init_param::spi_init
struct no_os_spi_init_param * spi_init
Definition: adf5355.h:252
adf5355_dev::mux_out_sel
enum adf5355_mux_out_sel mux_out_sel
Definition: adf5355.h:243
adf5355_dev::ref_diff_en
bool ref_diff_en
Definition: adf5355.h:237
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:95
adf5355_dev
Device descriptor.
Definition: adf5355.h:210
adf5355_dev::num_channels
uint8_t num_channels
Definition: adf5355.h:217
adf5355_dev::delay_us
uint32_t delay_us
Definition: adf5355.h:244
adf5355_dev::freq_req
uint64_t freq_req
Definition: adf5355.h:215
no_os_spi.h
Header file of SPI Interface.
ADF5355_REG2_FRAC2
#define ADF5355_REG2_FRAC2(x)
Definition: adf5355.h:53
adf5355_init_param
Definition: adf5355.h:251
ADF5355_REG0_PRESCALER
#define ADF5355_REG0_PRESCALER(x)
Definition: adf5355.h:45
ADF5355_REG7_FACT_N_LD_PRECISION
#define ADF5355_REG7_FACT_N_LD_PRECISION(x)
Definition: adf5355.h:95
ADF5355_REG4_COUNTER_RESET_EN
#define ADF5355_REG4_COUNTER_RESET_EN(x)
Definition: adf5355.h:62
adf5355_clk_set_rate
int32_t adf5355_clk_set_rate(struct adf5355_dev *dev, uint32_t chan, uint64_t rate)
Definition: adf5355.c:329
ADF5355_REG5_DEFAULT
#define ADF5355_REG5_DEFAULT
Definition: adf5355.h:76
adf5355_dev::clkin_freq
uint32_t clkin_freq
Definition: adf5355.h:218
adf5355_dev::ref_div2_en
uint8_t ref_div2_en
Definition: adf5355.h:240
adf5355_dev::ref_doubler_en
uint8_t ref_doubler_en
Definition: adf5355.h:239
ADF5355_MUXOUT_ANALOG_LOCK_DETECT
@ ADF5355_MUXOUT_ANALOG_LOCK_DETECT
Definition: adf5355.h:202
ADF5355_MUXOUT_GND
@ ADF5355_MUXOUT_GND
Definition: adf5355.h:199
no_os_delay.h
Header file of Delay functions.
ADF4355_REG6_RF_OUTB_EN
#define ADF4355_REG6_RF_OUTB_EN(x)
Definition: adf5355.h:80
ADF5355_REG4_POWER_DOWN_EN
#define ADF5355_REG4_POWER_DOWN_EN(x)
Definition: adf5355.h:64
ADF5355_REG6_MUTE_TILL_LOCK_EN
#define ADF5355_REG6_MUTE_TILL_LOCK_EN(x)
Definition: adf5355.h:84
adf5355_dev::dev_id
enum adf5355_device_id dev_id
Definition: adf5355.h:212
adf5355_device_id
adf5355_device_id
Devices supported by the drivers.
Definition: adf5355.h:184
ADF5355_REG6_FEEDBACK_FUND
#define ADF5355_REG6_FEEDBACK_FUND(x)
Definition: adf5355.h:87
ADF4355
@ ADF4355
Definition: adf5355.h:186
ADF4355_REG6_OUTPUTB_PWR
#define ADF4355_REG6_OUTPUTB_PWR(x)
Definition: adf5355.h:79
ADF5355_MUXOUT_N_DIV_OUT
@ ADF5355_MUXOUT_N_DIV_OUT
Definition: adf5355.h:201
ADF4355_MIN_OUT_FREQ
#define ADF4355_MIN_OUT_FREQ
Definition: adf5355.h:145
device
Definition: ad9361_util.h:75
adf5355_init_param::freq_req_chan
uint8_t freq_req_chan
Definition: adf5355.h:255
adf5355_dev::cp_gated_bleed_en
bool cp_gated_bleed_en
Definition: adf5355.h:229
ADF5355_MUXOUT_DIGITAL_LOCK_DETECT
@ ADF5355_MUXOUT_DIGITAL_LOCK_DETECT
Definition: adf5355.h:203
adf5355_init_param::cp_bleed_current_polarity_en
bool cp_bleed_current_polarity_en
Definition: adf5355.h:260
ADF5356
@ ADF5356
Definition: adf5355.h:189
ADF5355_REG6_DEFAULT
#define ADF5355_REG6_DEFAULT
Definition: adf5355.h:91
adf5355_dev::fpfd
uint32_t fpfd
Definition: adf5355.h:222
ADF5355_REG9_TIMEOUT
#define ADF5355_REG9_TIMEOUT(x)
Definition: adf5355.h:110
adf5355_init_param::outb_en
bool outb_en
Definition: adf5355.h:263
ADF5355_REG4_10BIT_R_CNT
#define ADF5355_REG4_10BIT_R_CNT(x)
Definition: adf5355.h:70
ADF5355_MAX_OUT_FREQ
#define ADF5355_MAX_OUT_FREQ
Definition: adf5355.h:137
adf5355_clk_recalc_rate
int32_t adf5355_clk_recalc_rate(struct adf5355_dev *dev, uint32_t chan, uint64_t *rate)
Definition: adf5355.c:311
NO_OS_ARRAY_SIZE
#define NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:53
ADF5355_REG10_DEFAULT
#define ADF5355_REG10_DEFAULT
Definition: adf5355.h:117
ADF5355_REG12_PHASE_RESYNC_CLK_DIV
#define ADF5355_REG12_PHASE_RESYNC_CLK_DIV(x)
Definition: adf5355.h:125
ADF4355_MIN_VCO_FREQ
#define ADF4355_MIN_VCO_FREQ
Definition: adf5355.h:142
adf5355_dev::max_out_freq
uint64_t max_out_freq
Definition: adf5355.h:219
ADF5355_REG0_AUTOCAL
#define ADF5355_REG0_AUTOCAL(x)
Definition: adf5355.h:46
ADF5355_REG10_ADC_CONV_EN
#define ADF5355_REG10_ADC_CONV_EN(x)
Definition: adf5355.h:115
ADF5356_REG7_DEFAULT
#define ADF5356_REG7_DEFAULT
Definition: adf5355.h:101
ADF5355_REG9_ALC_TIMEOUT
#define ADF5355_REG9_ALC_TIMEOUT(x)
Definition: adf5355.h:109
ADF5355_MUXOUT_THREESTATE
@ ADF5355_MUXOUT_THREESTATE
Definition: adf5355.h:197
adf5355_dev::rf_div_sel
uint8_t rf_div_sel
Definition: adf5355.h:241
adf5355_dev::regs
uint32_t regs[ADF5355_REG_NUM]
Definition: adf5355.h:214
no_os_do_div
uint64_t no_os_do_div(uint64_t *n, uint64_t base)
adf5355_dev::integer
uint32_t integer
Definition: adf5355.h:223
no_os_error.h
Error codes definition.
NO_OS_DIV_ROUND_UP
#define NO_OS_DIV_ROUND_UP(x, y)
Definition: no_os_util.h:56
adf5355_clk_set_rate
int32_t adf5355_clk_set_rate(struct adf5355_dev *dev, uint32_t chan, uint64_t rate)
Definition: adf5355.c:329
ADF5355_REG6_CP_BLEED_CURR
#define ADF5355_REG6_CP_BLEED_CURR(x)
Definition: adf5355.h:85
ADF5355
@ ADF5355
Definition: adf5355.h:185
adf5355_dev::fract1
uint32_t fract1
Definition: adf5355.h:224
adf5355_dev::cp_ua
uint32_t cp_ua
Definition: adf5355.h:227
ADF4355_2_MIN_VCO_FREQ
#define ADF4355_2_MIN_VCO_FREQ
Definition: adf5355.h:152
adf5355.h
Header file for adf5355 Driver.
adf5355_init_param::cp_ua
uint32_t cp_ua
Definition: adf5355.h:257
ADF5355_MIN_VCO_FREQ
#define ADF5355_MIN_VCO_FREQ
Definition: adf5355.h:135
ADF5355_REG6_OUTPUT_PWR
#define ADF5355_REG6_OUTPUT_PWR(x)
Definition: adf5355.h:81
ADF4355_2
@ ADF4355_2
Definition: adf5355.h:187
ADF5355_REG4_RDIV2_EN
#define ADF5355_REG4_RDIV2_EN(x)
Definition: adf5355.h:71
ADF5355_REG1_FRACT
#define ADF5355_REG1_FRACT(x)
Definition: adf5355.h:49
ADF5355_REG_NUM
#define ADF5355_REG_NUM
Definition: adf5355.h:166
ADF5355_REG10_ADC_CLK_DIV
#define ADF5355_REG10_ADC_CLK_DIV(x)
Definition: adf5355.h:116
adf5355_clk_recalc_rate
int32_t adf5355_clk_recalc_rate(struct adf5355_dev *dev, uint32_t chan, uint64_t *rate)
Definition: adf5355.c:311
ADF5355_MAX_OUTB_FREQ
#define ADF5355_MAX_OUTB_FREQ
Definition: adf5355.h:139
adf5355_init_param::outa_en
bool outa_en
Definition: adf5355.h:262
adf5355_dev::mute_till_lock_en
bool mute_till_lock_en
Definition: adf5355.h:231
adf5355_mux_out_sel
adf5355_mux_out_sel
Muxout selection.
Definition: adf5355.h:196
adf5355_init_param::cp_neg_bleed_en
bool cp_neg_bleed_en
Definition: adf5355.h:258
ADF5355_REG4_DOUBLE_BUFF_EN
#define ADF5355_REG4_DOUBLE_BUFF_EN(x)
Definition: adf5355.h:69
adf5355_init_param::freq_req
uint64_t freq_req
Definition: adf5355.h:254
ADF5355_MIN_INT_PRESCALER_89
#define ADF5355_MIN_INT_PRESCALER_89
Definition: adf5355.h:164
ADF5355_REG4_MUX_LOGIC
#define ADF5355_REG4_MUX_LOGIC(x)
Definition: adf5355.h:66
ADF5355_REG9_VCO_BAND_DIV
#define ADF5355_REG9_VCO_BAND_DIV(x)
Definition: adf5355.h:111
ADF5356_REG8_DEFAULT
#define ADF5356_REG8_DEFAULT
Definition: adf5355.h:105
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:143
ADF5356_REG13_MOD2_MSB
#define ADF5356_REG13_MOD2_MSB(x)
Definition: adf5355.h:131
adf5355_init_param::mute_till_lock_en
bool mute_till_lock_en
Definition: adf5355.h:261
no_os_clamp
#define no_os_clamp(val, min_val, max_val)
Definition: no_os_util.h:73
ADF5355_SPI_NO_BYTES
#define ADF5355_SPI_NO_BYTES
Definition: adf5355.h:168
ADF5355_MUXOUT_DVDD
@ ADF5355_MUXOUT_DVDD
Definition: adf5355.h:198
adf5355_dev::mux_out_3v3_en
bool mux_out_3v3_en
Definition: adf5355.h:238
adf5355_dev::fract2
uint32_t fract2
Definition: adf5355.h:225
adf5355_init_param::outa_power
uint8_t outa_power
Definition: adf5355.h:264
adf5355_init_param::phase_detector_polarity_neg
bool phase_detector_polarity_neg
Definition: adf5355.h:266
no_os_greatest_common_divisor
uint32_t no_os_greatest_common_divisor(uint32_t a, uint32_t b)
adf5355_dev::outb_en
bool outb_en
Definition: adf5355.h:233
ADF5355_MUXOUT_R_DIV_OUT
@ ADF5355_MUXOUT_R_DIV_OUT
Definition: adf5355.h:200
adf5355_dev::phase_detector_polarity_neg
uint8_t phase_detector_polarity_neg
Definition: adf5355.h:236
adf5355_dev::spi_desc
struct no_os_spi_desc * spi_desc
Definition: adf5355.h:211
ADF5355_REG11_DEFAULT
#define ADF5355_REG11_DEFAULT
Definition: adf5355.h:121
ADF4355_3_MIN_OUT_FREQ
#define ADF4355_3_MIN_OUT_FREQ
Definition: adf5355.h:150
ADF5355_REG10_ADC_EN
#define ADF5355_REG10_ADC_EN(x)
Definition: adf5355.h:114
ADF5355_REG4_MUXOUT
#define ADF5355_REG4_MUXOUT(x)
Definition: adf5355.h:73
ADF5355_REG7_LD_CYCLE_CNT
#define ADF5355_REG7_LD_CYCLE_CNT(x)
Definition: adf5355.h:97
ADF4355_3_MAX_OUT_FREQ
#define ADF4355_3_MAX_OUT_FREQ
Definition: adf5355.h:149
ADF5355_REG12_DEFAULT
#define ADF5355_REG12_DEFAULT
Definition: adf5355.h:126
ADF5355_MIN_OUTB_FREQ
#define ADF5355_MIN_OUTB_FREQ
Definition: adf5355.h:140
adf5355_dev::min_vco_freq
uint64_t min_vco_freq
Definition: adf5355.h:221
adf5355_dev::freq_req_chan
uint8_t freq_req_chan
Definition: adf5355.h:216
ADF5355_REG7_LOL_MODE_EN
#define ADF5355_REG7_LOL_MODE_EN(x)
Definition: adf5355.h:96
adf5355_dev::mod2
uint32_t mod2
Definition: adf5355.h:226
ADF5355_MIN_OUT_FREQ
#define ADF5355_MIN_OUT_FREQ
Definition: adf5355.h:138
ADF4355_3
@ ADF4355_3
Definition: adf5355.h:188
adf5355_dev::outa_en
bool outa_en
Definition: adf5355.h:232
no_os_udelay
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:120
adf5355_init_param::clkin_freq
uint32_t clkin_freq
Definition: adf5355.h:256
ADF5355_MODULUS1
#define ADF5355_MODULUS1
Definition: adf5355.h:163
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:96
ADF5355_REG
#define ADF5355_REG(x)
Definition: adf5355.h:41
adf5355_dev::outb_power
uint8_t outb_power
Definition: adf5355.h:235
ADF5355_REG7_LE_SYNCED_REFIN_EN
#define ADF5355_REG7_LE_SYNCED_REFIN_EN(x)
Definition: adf5355.h:98
ADF4355_3_MIN_VCO_FREQ
#define ADF4355_3_MIN_VCO_FREQ
Definition: adf5355.h:147
ADF4355_2_MAX_OUT_FREQ
#define ADF4355_2_MAX_OUT_FREQ
Definition: adf5355.h:154
adf5355_dev::cp_neg_bleed_en
bool cp_neg_bleed_en
Definition: adf5355.h:228
adf5355_init_param::ref_doubler_en
uint8_t ref_doubler_en
Definition: adf5355.h:269
ADF5355_REG8_DEFAULT
#define ADF5355_REG8_DEFAULT
Definition: adf5355.h:104
adf5355_clk_round_rate
int32_t adf5355_clk_round_rate(struct adf5355_dev *dev, uint64_t rate, uint64_t *rounded_rate)
Definition: adf5355.c:345
ADF5355_REG4_REFIN_MODE_DIFF
#define ADF5355_REG4_REFIN_MODE_DIFF(x)
Definition: adf5355.h:67
ADF5356_REG7_LE_SYNCE_EDGE_RISING_EN
#define ADF5356_REG7_LE_SYNCE_EDGE_RISING_EN(x)
Definition: adf5355.h:99
adf5355_dev::cp_bleed_current_polarity_en
bool cp_bleed_current_polarity_en
Definition: adf5355.h:230
adf5355_dev::ref_div_factor
uint16_t ref_div_factor
Definition: adf5355.h:242
ADF5355_MAX_MODULUS2
#define ADF5355_MAX_MODULUS2
Definition: adf5355.h:159
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:77
ADF5355_REG2_MOD2
#define ADF5355_REG2_MOD2(x)
Definition: adf5355.h:52
ADF5355_MAX_FREQ_PFD
#define ADF5355_MAX_FREQ_PFD
Definition: adf5355.h:157
ADF5355_REG4_CHARGE_PUMP_CURR
#define ADF5355_REG4_CHARGE_PUMP_CURR(x)
Definition: adf5355.h:68
ADF5356_REG13_FRAC2_MSB
#define ADF5356_REG13_FRAC2_MSB(x)
Definition: adf5355.h:132
adf5355_init_param::dev_id
enum adf5355_device_id dev_id
Definition: adf5355.h:253
ADF5355_REG6_GATED_BLEED_EN
#define ADF5355_REG6_GATED_BLEED_EN(x)
Definition: adf5355.h:89
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:51
ADF4355_MAX_OUT_FREQ
#define ADF4355_MAX_OUT_FREQ
Definition: adf5355.h:144
adf5355_remove
int32_t adf5355_remove(struct adf5355_dev *device)
Definition: adf5355.c:520
ADF5355_REG4_RMULT2_EN
#define ADF5355_REG4_RMULT2_EN(x)
Definition: adf5355.h:72
no_os_util.h
Header file of utility functions.
ADF5355_REG4_CP_THREESTATE_EN
#define ADF5355_REG4_CP_THREESTATE_EN(x)
Definition: adf5355.h:63
adf5355_init_param::mux_out_sel
enum adf5355_mux_out_sel mux_out_sel
Definition: adf5355.h:271
adf5355_dev::outa_power
uint8_t outa_power
Definition: adf5355.h:234
ADF5355_REG6_RF_OUT_EN
#define ADF5355_REG6_RF_OUT_EN(x)
Definition: adf5355.h:82
adf5355_remove
int32_t adf5355_remove(struct adf5355_dev *device)
Definition: adf5355.c:520
dev_id
dev_id
Definition: ad9361.h:3334
ADF5355_REG6_RF_DIV_SEL
#define ADF5355_REG6_RF_DIV_SEL(x)
Definition: adf5355.h:86
adf5355_dev::min_out_freq
uint64_t min_out_freq
Definition: adf5355.h:220
adf5355_init_param::cp_gated_bleed_en
bool cp_gated_bleed_en
Definition: adf5355.h:259
ADF5355_REG7_DEFAULT
#define ADF5355_REG7_DEFAULT
Definition: adf5355.h:100
ADF5356_REG12_DEFAULT
#define ADF5356_REG12_DEFAULT
Definition: adf5355.h:128
ADF5356_REG6_BLEED_POLARITY
#define ADF5356_REG6_BLEED_POLARITY(x)
Definition: adf5355.h:90
adf5355_init_param::mux_out_3v3_en
bool mux_out_3v3_en
Definition: adf5355.h:268
NO_OS_DIV_ROUND_CLOSEST
#define NO_OS_DIV_ROUND_CLOSEST(x, y)
Definition: no_os_util.h:58
adf5355_init
int32_t adf5355_init(struct adf5355_dev **device, const struct adf5355_init_param *init_param)
Initializes the ADF5355.
Definition: adf5355.c:440
ADF5355_REG4_PD_POLARITY_POS
#define ADF5355_REG4_PD_POLARITY_POS(x)
Definition: adf5355.h:65
ADF4355_2_MIN_OUT_FREQ
#define ADF4355_2_MIN_OUT_FREQ
Definition: adf5355.h:155
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:121
ADF5356_MAX_MODULUS2
#define ADF5356_MAX_MODULUS2
Definition: adf5355.h:160
adf5355_init_param::ref_diff_en
bool ref_diff_en
Definition: adf5355.h:267