no-OS
adf4377.h
Go to the documentation of this file.
1 /***************************************************************************/
34 #ifndef ADF4377_H_
35 #define ADF4377_H_
36 
37 /******************************************************************************/
38 /***************************** Include Files **********************************/
39 /******************************************************************************/
40 #include <stdint.h>
41 #include <stdbool.h>
42 #include "no_os_spi.h"
43 #include "no_os_gpio.h"
44 #include "no_os_util.h"
45 
46 /******************************************************************************/
47 /********************** Macros and Constants Definitions **********************/
48 /******************************************************************************/
49 
50 /* Registers Control Bits */
51 #define ADF4377_REG(x) (x)
52 
53 /* ADF4377 REG0000 Map */
54 #define ADF4377_SOFT_RESET_R_MSK NO_OS_BIT(7)
55 #define ADF4377_SOFT_RESET_R(x) no_os_field_prep(ADF4377_SOFT_RESET_R_MSK, x)
56 #define ADF4377_SOFT_RESET_MSK NO_OS_BIT(0)
57 #define ADF4377_SOFT_RESET(x) no_os_field_prep(ADF4377_SOFT_RESET_MSK, x)
58 #define ADF4377_LSB_FIRST_R_MSK NO_OS_BIT(6)
59 #define ADF4377_LSB_FIRST_R(x) no_os_field_prep(ADF4377_LSB_FIRST_R_MSK, x)
60 #define ADF4377_LSB_FIRST_MSK NO_OS_BIT(1)
61 #define ADF4377_LSB_FIRST(x) no_os_field_prep(ADF4377_LSB_FIRST_MSK, x)
62 #define ADF4377_ADDRESS_ASC_R_MSK NO_OS_BIT(5)
63 #define ADF4377_ADDRESS_ASC_R(x) no_os_field_prep(ADF4377_ADDRESS_ASC_R_MSK, x)
64 #define ADF4377_ADDRESS_ASC_MSK NO_OS_BIT(2)
65 #define ADF4377_ADDRESS_ASC(x) no_os_field_prep(ADF4377_ADDRESS_ASC_MSK, x)
66 #define ADF4377_SDO_ACTIVE_R_MSK NO_OS_BIT(4)
67 #define ADF4377_SDO_ACTIVE_R(x) no_os_field_prep(ADF4377_SDO_ACTIVE_R_MSK, x)
68 #define ADF4377_SDO_ACTIVE_MSK NO_OS_BIT(3)
69 #define ADF4377_SDO_ACTIVE(x) no_os_field_prep(ADF4377_SDO_ACTIVE_MSK, x)
70 
71 /* ADF4377 REG0000 Bit Definition */
72 #define ADF4377_SDO_ACTIVE_SPI_3W 0x0
73 #define ADF4377_SDO_ACTIVE_SPI_4W 0x1
74 
75 #define ADF4377_ADDR_ASC_AUTO_DECR 0x0
76 #define ADF4377_ADDR_ASC_AUTO_INCR 0x1
77 
78 #define ADF4377_LSB_FIRST_MSB 0x0
79 #define ADF4377_LSB_FIRST_LSB 0x1
80 
81 #define ADF4377_SOFT_RESET_N_OP 0x0
82 #define ADF4377_SOFT_RESET_EN 0x1
83 
84 /* ADF4377 REG0001 Map */
85 #define ADF4377_SINGLE_INSTR_MSK NO_OS_BIT(7)
86 #define ADF4377_SINGLE_INSTR(x) no_os_field_prep(ADF4377_SINGLE_INSTRUCTION_MSK, x)
87 #define ADF4377_MASTER_RB_CTRL_MSK NO_OS_BIT(5)
88 #define ADF4377_MASTER_RB_CTRL(x) no_os_field_prep(ADF4377_MASTER_RB_CTRL_MSK, x)
89 
90 /* ADF4377 REG0001 Bit Definition */
91 #define ADF4377_SPI_STREAM_EN 0x0
92 #define ADF4377_SPI_STREAM_DIS 0x1
93 
94 #define ADF4377_RB_SLAVE_REG 0x0
95 #define ADF4377_RB_MASTER_REG 0x1
96 
97 /* ADF4377 REG0003 Bit Definition */
98 #define ADF4377_CHIP_TYPE 0x06
99 
100 /* ADF4377 REG0004 Bit Definition */
101 #define ADF4377_PRODUCT_ID_LSB 0x0005
102 
103 /* ADF4377 REG0005 Bit Definition */
104 #define ADF4377_PRODUCT_ID_MSB 0x0005
105 
106 /* ADF4377 REG000A Map */
107 #define ADF4377_SCRATCHPAD_MSK NO_OS_GENMASK(7, 0)
108 #define ADF4377_SCRATCHPAD(x) no_os_field_prep(ADF4377_SCRATCHPAD_MSK, x)
109 
110 /* ADF4377 REG000B Bit Definition */
111 #define ADF4377_SPI_REVISION 0x01
112 
113 /* ADF4377 REG000C Bit Definition */
114 #define ADF4377_VENDOR_ID_LSB 0x456
115 
116 /* ADF4377 REG000D Bit Definition */
117 #define ADF4377_VENDOR_ID_MSB 0x456
118 
119 /* ADF4377 REG000F Bit Definition */
120 #define ADF4377_R00F_RSV1 0x14
121 
122 /* ADF4377 REG0010 Map*/
123 #define ADF4377_N_INT_LSB_MSK NO_OS_GENMASK(7, 0)
124 #define ADF4377_N_INT_LSB(x) no_os_field_prep(ADF4377_N_INT_LSB_MSK, x)
125 
126 /* ADF4377 REG0011 Map*/
127 #define ADF4377_EN_AUTOCAL_MSK NO_OS_BIT(7)
128 #define ADF4377_EN_AUTOCAL(x) no_os_field_prep(ADF4377_EN_AUTOCAL_MSK, x)
129 #define ADF4377_EN_RDBLR_MSK NO_OS_BIT(6)
130 #define ADF4377_EN_RDBLR(x) no_os_field_prep(ADF4377_EN_RDBLR_MSK, x)
131 #define ADF4377_DCLK_DIV2_MSK NO_OS_GENMASK(5,4)
132 #define ADF4377_DCLK_DIV2(x) no_os_field_prep(ADF4377_DCLK_DIV2_MSK, x)
133 #define ADF4377_N_INT_MSB_MSK NO_OS_GENMASK(3,0)
134 #define ADF4377_N_INT_MSB(x) no_os_field_prep(ADF4377_N_INT_MSB_MSK, x)
135 
136 /* ADF4377 REG0011 Bit Definition */
137 #define ADF4377_VCO_CALIB_DIS 0x0
138 #define ADF4377_VCO_CALIB_EN 0x1
139 
140 #define ADF4377_REF_DBLR_DIS 0x0
141 #define ADF4377_REF_DBLR_EN 0x1
142 
143 #define ADF4377_DCLK_DIV2_1 0x0
144 #define ADF4377_DCLK_DIV2_2 0x1
145 #define ADF4377_DCLK_DIV2_4 0x2
146 #define ADF4377_DCLK_DIV2_8 0x3
147 
148 /* ADF4377 REG0012 Map*/
149 #define ADF4377_CLKOUT_DIV_MSK NO_OS_GENMASK(7, 6)
150 #define ADF4377_CLKOUT_DIV(x) no_os_field_prep(ADF4377_CLKOUT_DIV_MSK, x)
151 #define ADF4377_R_DIV_MSK NO_OS_GENMASK(5, 0)
152 #define ADF4377_R_DIV(x) no_os_field_prep(ADF4377_R_DIV_MSK, x)
153 
154 /* ADF4377 REG0012 Bit Definition */
155 #define ADF4377_CLKOUT_DIV_1 0x0
156 #define ADF4377_CLKOUT_DIV_2 0x1
157 #define ADF4377_CLKOUT_DIV_4 0x2
158 #define ADF4377_CLKOUT_DIV_8 0x3
159 
160 #define ADF4377_MIN_R_DIV 0x00
161 #define ADF4378_MAX_R_DIV 0x3F
162 
163 /* ADF4377 REG0013 Map */
164 #define ADF4377_M_VCO_CORE_MSK NO_OS_GENMASK(5,4)
165 #define ADF4377_M_VCO_CORE(x) no_os_field_prep(ADF4377_M_VCO_CORE_MSK, x)
166 #define ADF4377_M_VCO_BIAS_MSK NO_OS_GENMASK(3,0)
167 #define ADF4377_M_VCO_BIAS(x) no_os_field_prep(ADF4377_M_VCO_BIAS_MSK, x)
168 
169 /* ADF4377 REG0013 Bit Definition */
170 #define ADF4377_M_VCO_0 0x0
171 #define ADF4377_M_VCO_1 0x1
172 #define ADF4377_M_VCO_2 0x2
173 #define ADF4377_M_VCO_3 0x3
174 
175 #define M_VCO_BIAS_MIN 0xF
176 #define M_VCO_BIAS_MAX 0x0
177 
178 /* ADF4377 REG0014 Map */
179 #define ADF4377_M_VCO_BAND_MSK NO_OS_GENMASK(7,0)
180 #define ADF4377_M_VCO_BAND(x) no_os_field_prep(ADF4377_M_VCO_BAND_MSK, x)
181 
182 /* ADF4377 REG0014 Bit Definition */
183 #define ADF4377_VCO_BAND_MIN 0xFF
184 #define ADF4377_VCO_BAND_MAX 0x00
185 
186 /* ADF4377 REG0015 Map */
187 #define ADF4377_BLEED_I_LSB_MSK NO_OS_GENMASK(7, 6)
188 #define ADF4377_BLEED_I_LSB(x) no_os_field_prep(ADF4377_BLEED_I_LSB_MSK, x)
189 #define ADF4377_BLEED_POL_MSK NO_OS_BIT(5)
190 #define ADF4377_BLEED_POL(x) no_os_field_prep(ADF4377_BLEED_POL_MSK, x)
191 #define ADF4377_EN_BLEED_MSK NO_OS_BIT(4)
192 #define ADF4377_EN_BLEED(x) no_os_field_prep(ADF4377_EN_BLEED_MSK, x)
193 #define ADF4377_CP_I_MSK NO_OS_GENMASK(3, 0)
194 #define ADF4377_CP_I(x) no_os_field_prep(ADF4377_CP_I_MSK, x)
195 
196 /* ADF4377 REG0015 Bit Description */
197 #define ADF4377_CURRENT_SINK 0x0
198 #define ADF4377_CURRENT_SOURCE 0x1
199 
200 #define ADF4377_CP_0MA7 0x0
201 #define ADF4377_CP_0MA9 0x1
202 #define ADF4377_CP_1MA1 0x2
203 #define ADF4377_CP_1MA3 0x3
204 #define ADF4377_CP_1MA4 0x4
205 #define ADF4377_CP_1MA8 0x5
206 #define ADF4377_CP_2MA2 0x6
207 #define ADF4377_CP_2MA5 0x7
208 #define ADF4377_CP_2MA9 0x8
209 #define ADF4377_CP_3MA6 0x9
210 #define ADF4377_CP_4MA3 0xA
211 #define ADF4377_CP_5MA0 0xB
212 #define ADF4377_CP_5MA7 0xC
213 #define ADF4377_CP_7MA2 0xD
214 #define ADF4377_CP_8MA6 0xE
215 #define ADF4377_CP_10MA1 0xF
216 
217 /* ADF4377 REG0016 Map */
218 #define ADF4377_BLEED_I_MSB_MSK NO_OS_GENMASK(7, 0)
219 #define ADF4377_BLEED_I_MSB(x) no_os_field_prep(ADF4377_BLEED_I_MSB_MSK, x)
220 
221 /* ADF4377 REG0017 Map */
222 #define ADF4377_INV_CLKOUT_MSK NO_OS_BIT(7)
223 #define ADF4377_INV_CLKOUT(x) no_os_field_prep(ADF4377_INV_CLKOUT_MSK, x)
224 #define ADF4377_N_DEL_MSK NO_OS_GENMASK(6, 0)
225 #define ADF4377_N_DEL(x) no_os_field_prep(ADF4377_N_DEL_MSK, x)
226 
227 /* ADF4377 REG0018 Map */
228 #define ADF4377_CMOS_OV_MSK NO_OS_BIT(7)
229 #define ADF4377_CMOS_OV(x) no_os_field_prep(ADF4377_CMOS_OV_MSK, x)
230 #define ADF4377_R_DEL_MSK NO_OS_GENMASK(6, 0)
231 #define ADF4377_R_DEL(x) no_os_field_prep(ADF4377_R_DEL_MSK, x)
232 
233 /* ADF4377 REG0018 Bit Definition */
234 #define ADF4377_1V8_LOGIC 0x0
235 #define ADF4377_3V3_LOGIC 0x1
236 
237 #define ADF4377_R_DEL_MIN 0x00
238 #define ADF4377_R_DEL_MAX 0x7F
239 
240 /* ADF4377 REG0019 Map */
241 #define ADF4377_CLKOUT2_OP_MSK NO_OS_GENMASK(7, 6)
242 #define ADF4377_CLKOUT2_OP(x) no_os_field_prep(ADF4377_CLKOUT2_OP_MSK, x)
243 #define ADF4377_CLKOUT1_OP_MSK NO_OS_GENMASK(5, 4)
244 #define ADF4377_CLKOUT1_OP(x) no_os_field_prep(ADF4377_CLKOUT1_OP_MSK, x)
245 #define ADF4377_PD_CLK_MSK NO_OS_BIT(3)
246 #define ADF4377_PD_CLK(x) no_os_field_prep(ADF4377_PD_CLK_MSK, x)
247 #define ADF4377_PD_RDET_MSK NO_OS_BIT(2)
248 #define ADF4377_PD_RDET(x) no_os_field_prep(ADF4377_PD_RDET_MSK, x)
249 #define ADF4377_PD_ADC_MSK NO_OS_BIT(1)
250 #define ADF4377_PD_ADC(x) no_os_field_prep(ADF4377_PD_ADC_MSK, x)
251 #define ADF4377_PD_CALADC_MSK NO_OS_BIT(0)
252 #define ADF4377_PD_CALADC(x) no_os_field_prep(ADF4377_PD_CALADC_MSK, x)
253 
254 /* ADF4377 REG0019 Bit Definition */
255 #define ADF4377_CLKOUT_320MV 0x0
256 #define ADF4377_CLKOUT_420MV 0x1
257 #define ADF4377_CLKOUT_530MV 0x2
258 #define ADF4377_CLKOUT_640MV 0x3
259 
260 #define ADF4377_PD_CLK_N_OP 0x0
261 #define ADF4377_PD_CLK_PD 0x1
262 
263 #define ADF4377_PD_RDET_N_OP 0x0
264 #define ADF4377_PD_RDET_PD 0x1
265 
266 #define ADF4377_PD_ADC_N_OP 0x0
267 #define ADF4377_PD_ADC_PD 0x1
268 
269 #define ADF4377_PD_CALADC_N_OP 0x0
270 #define ADF4377_PD_CALADC_PD 0x1
271 
272 /* ADF4377 REG001A Map */
273 #define ADF4377_PD_ALL_MSK NO_OS_BIT(7)
274 #define ADF4377_PD_ALL(x) no_os_field_prep(ADF4377_PD_ALL_MSK, x)
275 #define ADF4377_PD_RDIV_MSK NO_OS_BIT(6)
276 #define ADF4377_PD_RDIV(x) no_os_field_prep(ADF4377_PD_RDIV_MSK, x)
277 #define ADF4377_PD_NDIV_MSK NO_OS_BIT(5)
278 #define ADF4377_PD_NDIV(x) no_os_field_prep(ADF4377_PD_NDIV_MSK, x)
279 #define ADF4377_PD_VCO_MSK NO_OS_BIT(4)
280 #define ADF4377_PD_VCO(x) no_os_field_prep(ADF4377_PD_VCO_MSK, x)
281 #define ADF4377_PD_LD_MSK NO_OS_BIT(3)
282 #define ADF4377_PD_LD(x) no_os_field_prep(ADF4377_PD_LD_MSK, x)
283 #define ADF4377_PD_PFDCP_MSK NO_OS_BIT(2)
284 #define ADF4377_PD_PFDCP(x) no_os_field_prep(ADF4377_PD_PFDCP_MSK, x)
285 #define ADF4377_PD_CLKOUT1_MSK NO_OS_BIT(1)
286 #define ADF4377_PD_CLKOUT1(x) no_os_field_prep(ADF4377_PD_CLKOUT1_MSK, x)
287 #define ADF4377_PD_CLKOUT2_MSK NO_OS_BIT(0)
288 #define ADF4377_PD_CLKOUT2(x) no_os_field_prep(ADF4377_PD_CLKOUT2_MSK, x)
289 
290 /* ADF4377 REG001A Bit Definition */
291 #define ADF4377_PD_ALL_N_OP 0x0
292 #define ADF4377_PD_ALL_PD 0x1
293 
294 #define ADF4377_PD_RDIV_N_OP 0x0
295 #define ADF4377_PD_RDIV_PD 0x1
296 
297 #define ADF4377_PD_NDIV_N_OP 0x0
298 #define ADF4377_PD_NDIV_PD 0x1
299 
300 #define ADF4377_PD_VCO_N_OP 0x0
301 #define ADF4377_PD_VCO_PD 0x1
302 
303 #define ADF4377_PD_LD_N_OP 0x0
304 #define ADF4377_PD_LD_PD 0x1
305 
306 #define ADF4377_PD_PFDCP_N_OP 0x0
307 #define ADF4377_PD_PFDCP_PD 0x1
308 
309 #define ADF4377_PD_CLKOUT1_N_OP 0x0
310 #define ADF4377_PD_CLKOUT1_PD 0x1
311 
312 #define ADF4377_PD_CLKOUT2_N_OP 0x0
313 #define ADF4377_PD_CLKOUT2_PD 0x1
314 
315 /* ADF4377 REG001B Map */
316 #define ADF4377_EN_LOL_MSK NO_OS_BIT(7)
317 #define ADF4377_EN_LOL(x) no_os_field_prep(ADF4377_EN_LOL_MSK, x)
318 #define ADF4377_LDWIN_PW_MSK NO_OS_BIT(6)
319 #define ADF4377_LDWIN_PW(x) no_os_field_prep(ADF4377_LDWIN_PW_MSK, x)
320 #define ADF4377_EN_LDWIN_MSK NO_OS_BIT(5)
321 #define ADF4377_EN_LDWIN(x) no_os_field_prep(ADF4377_EN_LDWIN_MSK, x)
322 #define ADF4377_LD_COUNT_MSK NO_OS_GENMASK(4, 0)
323 #define ADF4377_LD_COUNT(x) no_os_field_prep(ADF4377_LD_COUNT_MSK, x)
324 
325 /* ADF4377 REG001B Bit Definition */
326 
327 #define ADF4377_LDWIN_PW_NARROW 0x0
328 #define ADF4377_LDWIN_PW_WIDE 0x1
329 
330 /* ADF4377 REG001C Map */
331 #define ADF4377_EN_DNCLK_MSK NO_OS_BIT(7)
332 #define ADF4377_EN_DNCLK(x) no_os_field_prep(ADF4377_EN_DNCLK_MSK, x)
333 #define ADF4377_EN_DRCLK_MSK NO_OS_BIT(6)
334 #define ADF4377_EN_DRCLK(x) no_os_field_prep(ADF4377_EN_DRCLK_MSK, x)
335 #define ADF4377_RST_LD_MSK NO_OS_BIT(2)
336 #define ADF4377_RST_LD(x) no_os_field_prep(ADF4377_RST_LD_MSK, x)
337 #define ADF4377_R01C_RSV1_MSK NO_OS_BIT(0)
338 #define ADF4377_R01C_RSV1(x) no_os_field_prep(ADF4377_R01C_RSV1_MSK, x)
339 
340 /* ADF4377 REG001C Bit Definition */
341 #define ADF4377_EN_DNCLK_OFF 0x0
342 #define ADF4377_EN_DNCLK_ON 0x1
343 
344 #define ADF4377_EN_DRCLK_OFF 0x0
345 #define ADF4377_EN_DRCLK_ON 0x1
346 
347 #define ADF4377_RST_LD_INACTIVE 0x0
348 #define ADF4377_RST_LD_ACTIVE 0x1
349 
350 /* ADF4377 REG001D Map */
351 #define ADF4377_MUXOUT_MSK NO_OS_GENMASK(7, 4)
352 #define ADF4377_MUXOUT(x) no_os_field_prep(ADF4377_MUXOUT_MSK, x)
353 #define ADF4377_EN_CPTEST_MSK NO_OS_BIT(2)
354 #define ADF4377_EN_CPTEST(x) no_os_field_prep(ADF4377_EN_CPTEST_MSK, x)
355 #define ADF4377_CP_DOWN_MSK NO_OS_BIT(1)
356 #define ADF4377_CP_DOWN(x) no_os_field_prep(ADF4377_CP_DOWN_MSK, x)
357 #define ADF4377_CP_UP_MSK NO_OS_BIT(0)
358 #define ADF4377_CP_UP(x) no_os_field_prep(ADF4377_CP_UP_MSK, x)
359 
360 /* ADF4377 REG001D Bit Definitons */
361 #define ADF4377_MUXOUT_HIGH_Z 0x0
362 #define ADF4377_MUXOUT_LKDET 0x1
363 #define ADF4377_MUXOUT_LOW 0x2
364 #define ADF4377_MUXOUT_DIV_RCLK_2 0x4
365 #define ADF4377_MUXOUT_DIV_NCLK_2 0x5
366 #define ADF4377_MUXOUT_HIGH 0x8
367 
368 #define ADF4377_EN_CPTEST_OFF 0x0
369 #define ADF4377_EN_CPTEST_ON 0x1
370 
371 #define ADF4377_CP_DOWN_OFF 0x0
372 #define ADF4377_CP_DOWN_ON 0x1
373 
374 #define ADF4377_CP_UP_OFF 0x0
375 #define ADF4377_CP_UP_ON 0x1
376 
377 /* ADF4377 REG001F Map */
378 #define ADF4377_BST_REF_MSK NO_OS_BIT(7)
379 #define ADF4377_BST_REF(x) no_os_field_prep(ADF4377_BST_REF_MSK, x)
380 #define ADF4377_FILT_REF_MSK NO_OS_BIT(6)
381 #define ADF4377_FILT_REF(x) no_os_field_prep(ADF4377_FILT_REF_MSK, x)
382 #define ADF4377_REF_SEL_MSK NO_OS_BIT(5)
383 #define ADF4377_REF_SEL(x) no_os_field_prep(ADF4377_REF_SEL_MSK, x)
384 #define ADF4377_R01F_RSV1_MSK NO_OS_GENMASK(2, 0)
385 #define ADF4377_R01F_RSV1(x) no_os_field_prep(ADF4377_R01F_RSV1_MSK, x)
386 
387 /* ADF4377 REG001F Bit Description */
388 #define ADF4377_BST_LARGE_REF_IN 0x0
389 #define ADF4377_BST_SMALL_REF_IN 0x1
390 
391 #define ADF4377_FILT_REF_OFF 0x0
392 #define ADF4377_FILT_REF_ON 0x1
393 
394 #define ADF4377_REF_SEL_DMA 0x0
395 #define ADF4377_REF_SEL_LNA 0x1
396 
397 /* ADF4377 REG0020 Map */
398 #define ADF4377_RST_SYS_MSK NO_OS_BIT(4)
399 #define ADF4377_RST_SYS(x) no_os_field_prep(ADF4377_RST_SYS_MSK, x)
400 #define ADF4377_EN_ADC_CLK_MSK NO_OS_BIT(3)
401 #define ADF4377_EN_ADC_CLK(x) no_os_field_prep(ADF4377_EN_ADC_CLK_MSK, x)
402 #define ADF4377_R020_RSV1_MSK NO_OS_BIT(0)
403 #define ADF4377_R020_RSV1(x) no_os_field_prep(ADF4377_R020_RSV1_MSK, x)
404 
405 /* ADF4377 REG0020 Bit Description */
406 #define ADF4377_RST_SYS_INACTIVE 0x0
407 #define ADF4377_RST_SYS_ACTIVE 0x1
408 
409 /* ADF4377 REG0021 Map */
410 #define ADF4377_R021_RSV1 0xD3
411 
412 /* ADF4377 REG0022 Map */
413 #define ADF4377_R022_RSV1 0x32
414 
415 /* ADF4377 REG0023 Map */
416 #define ADF4377_R023_RSV1 0x18
417 
418 /* ADF4377 REG0024 Map */
419 #define ADF4377_DCLK_MODE_MSK NO_OS_BIT(2)
420 #define ADF4377_DCLK_MODE(x) no_os_field_prep(ADF4377_DCLK_MODE_MSK, x)
421 
422 /* ADF4377 REG0025 Map */
423 #define ADF4377_CLKODIV_DB_MSK NO_OS_BIT(7)
424 #define ADF4377_CLKODIV_DB(x) no_os_field_prep(ADF4377_CLKODIV_DB_MSK, x)
425 #define ADF4377_DCLK_DB_MSK NO_OS_BIT(6)
426 #define ADF4377_DCLK_DB(x) no_os_field_prep(ADF4377_DCLK_DB_MSK, x)
427 #define ADF4377_R025_RSV1_MSK NO_OS_BIT(4) | NO_OS_BIT(2) | NO_OS_BIT(1)
428 #define ADF4377_R025_RSV1(x) no_os_field_prep(ADF4377_R025_RSV1_MSK, x)
429 
430 /* ADF4377 REG0026 Map */
431 #define ADF4377_VCO_BAND_DIV_MSK NO_OS_GENMASK(7, 0)
432 #define ADF4377_VCO_BAND_DIV(x) no_os_field_prep(ADF4377_VCO_BAND_DIV_MSK, x)
433 
434 /* ADF4377 REG0026 Bit Definition */
435 #define ADF4377_VCO_BAND_DIV_MIN 0x00
436 #define ADF4377_VCO_BAND_DIV_MAX 0xFF
437 
438 /* ADF4377 REG0027 Map */
439 #define ADF4377_SYNTH_LOCK_TO_LSB_MSK NO_OS_GENMASK(7, 0)
440 #define ADF4377_SYNTH_LOCK_TO_LSB(x) no_os_field_prep(ADF4377_SYNTH_LOCK_TO_LSB_MSK, x)
441 
442 /* ADF4377 REG0028 Map */
443 #define ADF4377_O_VCO_DB_MSK NO_OS_BIT(7)
444 #define ADF4377_O_VCO_DB(x) no_os_field_prep(ADF4377_O_VCO_DB_MSK, x)
445 #define ADF4377_SYNTH_LOCK_TO_MSB_MSK NO_OS_GENMASK(6, 0)
446 #define ADF4377_SYNTH_LOCK_TO_MSB(x) no_os_field_prep(ADF4377_SYNTH_LOCK_TO_MSB_MSK, x)
447 
448 /* ADF4377 REG0029 Map */
449 #define ADF4377_VCO_ALC_TO_LSB_MSK NO_OS_GENMASK(7, 0)
450 #define ADF4377_VCO_ALC_TO_LSB(x) no_os_field_prep(ADF4377_VCO_ALC_TO_LSB_MSK, x)
451 
452 /* ADF4377 REG002A Map */
453 #define ADF4377_DEL_CTRL_DB_MSK NO_OS_BIT(7)
454 #define ADF4377_DEL_CTRL_DB(x) no_os_field_prep(ADF4377_DEL_CTRL_DB_MSK, x)
455 #define ADF4377_VCO_ALC_TO_MSB_MSK NO_OS_GENMASK(6, 0)
456 #define ADF4377_VCO_ALC_TO_MSB(x) no_os_field_prep(ADF4377_VCO_ALC_TO_MSB_MSK, x)
457 
458 /* ADF4377 REG002C Map */
459 #define ADF4377_R02C_RSV1 0xC0
460 
461 /* ADF4377 REG002D Map */
462 #define ADF4377_ADC_CLK_DIV_MSK NO_OS_GENMASK(7, 0)
463 #define ADF4377_ADC_CLK_DIV(x) no_os_field_prep(ADF4377_ADC_CLK_DIV_MSK, x)
464 
465 /* ADF4377 REG002E Map */
466 #define ADF4377_EN_ADC_CNV_MSK NO_OS_BIT(7)
467 #define ADF4377_EN_ADC_CNV(x) no_os_field_prep(ADF4377_EN_ADC_CNV_MSK, x)
468 #define ADF4377_EN_ADC_MSK NO_OS_BIT(1)
469 #define ADF4377_EN_ADC(x) no_os_field_prep(ADF4377_EN_ADC_MSK, x)
470 #define ADF4377_ADC_A_CONV_MSK NO_OS_BIT(0)
471 #define ADF4377_ADC_A_CONV(x) no_os_field_prep(ADF4377_ADC_A_CONV_MSK, x)
472 
473 /* ADF4377 REG002E Bit Definition */
474 #define ADF4377_ADC_A_CONV_ADC_ST_CNV 0x0
475 #define ADF4377_ADC_A_CONV_VCO_CALIB 0x1
476 
477 /* ADF4377 REG002F Map */
478 #define ADF4377_DCLK_DIV1_MSK NO_OS_GENMASK(1, 0)
479 #define ADF4377_DCLK_DIV1(x) no_os_field_prep(ADF4377_DCLK_DIV1_MSK, x)
480 
481 /* ADF4377 REG002F Bit Definition */
482 #define ADF4377_DCLK_DIV1_1 0x0
483 #define ADF4377_DCLK_DIV1_2 0x1
484 #define ADF4377_DCLK_DIV1_8 0x2
485 #define ADF4377_DCLK_DIV1_32 0x3
486 
487 /* ADF4377 REG0031 Map */
488 #define ADF4377_R031_RSV1 0x09
489 
490 /* ADF4377 REG0032 Map */
491 #define ADF4377_ADC_CLK_SEL_MSK NO_OS_BIT(6)
492 #define ADF4377_ADC_CLK_SEL(x) no_os_field_prep(ADF4377_ADC_CLK_SEL_MSK, x)
493 #define ADF4377_R032_RSV1_MSK NO_OS_BIT(3) | NO_OS_BIT(0)
494 #define ADF4377_R032_RSV1(x) no_os_field_prep(ADF4377_R032_RSV1_MSK, x)
495 
496 /* ADF4377 REG0032 Bit Definition */
497 #define ADF4377_ADC_CLK_SEL_N_OP 0x0
498 #define ADF4377_ADC_CLK_SEL_SPI_CLK 0x1
499 
500 /* ADF4377 REG0033 Map */
501 #define ADF4377_R033_RSV1 0x18
502 
503 /* ADF4377 REG0034 Map */
504 #define ADF4377_R034_RSV1 0x08
505 
506 /* ADF4377 REG003A Map */
507 #define ADF4377_R03A_RSV1 0x5C
508 
509 /* ADF4377 REG003B Map */
510 #define ADF4377_R03B_RSV1 0x2B
511 
512 /* ADF4377 REG003D Map */
513 #define ADF4377_O_VCO_BAND_MSK NO_OS_BIT(3)
514 #define ADF4377_O_VCO_BAND(x) no_os_field_prep(ADF4377_O_VCO_BAND_MSK, x)
515 #define ADF4377_O_VCO_CORE_MSK NO_OS_BIT(2)
516 #define ADF4377_O_VCO_CORE(x) no_os_field_prep(ADF4377_O_VCO_CORE_MSK, x)
517 #define ADF4377_O_VCO_BIAS_MSK NO_OS_BIT(1)
518 #define ADF4377_O_VCO_BIAS(x) no_os_field_prep(ADF4377_O_VCO_BIAS_MSK, x)
519 
520 /* ADF4377 REG003D Bit Definition */
521 #define ADF4377_O_VCO_BAND_VCO_CALIB 0x0
522 #define ADF4377_O_VCO_BAND_M_VCO 0x1
523 
524 #define ADF4377_O_VCO_CORE_VCO_CALIB 0x0
525 #define ADF4377_O_VCO_CORE_M_VCO 0x1
526 
527 #define ADF4377_O_VCO_BIAS_VCO_CALIB 0x0
528 #define ADF4377_O_VCO_BIAS_M_VCO 0x1
529 
530 /* ADF4377 REG0042 Map */
531 #define ADF4377_R042_RSV1 0x05
532 
533 /* ADF4377 REG0045 Map */
534 #define ADF4377_ADC_ST_CNV_MSK NO_OS_BIT(0)
535 #define ADF4377_ADC_ST_CNV(x) no_os_field_prep(ADF4377_ADC_ST_CNV_MSK, x)
536 
537 /* ADF4377 REG0049 Map */
538 #define ADF4377_EN_CLK2_MSK NO_OS_BIT(7)
539 #define ADF4377_EN_CLK2(x) no_os_field_prep(ADF4377_EN_CLK2_MSK, x)
540 #define ADF4377_EN_CLK1_MSK NO_OS_BIT(6)
541 #define ADF4377_EN_CLK1(x) no_os_field_prep(ADF4377_EN_CLK1_MSK, x)
542 #define ADF4377_REF_OK_MSK NO_OS_BIT(3)
543 #define ADF4377_REF_OK(x) no_os_field_prep(ADF4377_REF_OK_MSK, x)
544 #define ADF4377_ADC_BUSY_MSK NO_OS_BIT(2)
545 #define ADF4377_ADC_BUSY(x) no_os_field_prep(ADF4377_ADC_BUSY_MSK, x)
546 #define ADF4377_FSM_BUSY_MSK NO_OS_BIT(1)
547 #define ADF4377_FSM_BUSY(x) no_os_field_prep(ADF4377_FSM_BUSY_MSK, x)
548 #define ADF4377_LOCKED_MSK NO_OS_BIT(0)
549 #define ADF4377_LOCKED(x) no_os_field_prep(ADF4377_LOCKED_MSK, x)
550 
551 /* ADF4377 REG004B Map */
552 #define ADF4377_VCO_CORE_MSK NO_OS_GENMASK(1, 0)
553 #define ADF4377_VCO_CORE(x) no_os_field_prep(ADF4377_VCO_CORE_MSK, x)
554 
555 /* ADF4377 REG004C Map */
556 #define ADF4377_CHIP_TEMP_LSB_MSK NO_OS_GENMASK(7, 0)
557 #define ADF4377_CHIP_TEMP_LSB(x) no_os_field_prep(ADF4377_CHIP_TEMP_LSB_MSK, x)
558 
559 /* ADF4377 REG004D Map */
560 #define ADF4377_CHIP_TEMP_MSB_MSK NO_OS_BIT(0)
561 #define ADF4377_CHIP_TEMP_MSB(x) no_os_field_prep(ADF4377_CHIP_TEMP_MSB_MSK, x)
562 
563 /* ADF4377 REG004F Map */
564 #define ADF4377_VCO_BAND_MSK NO_OS_GENMASK(7, 0)
565 #define ADF4377_VCO_BAND(x) no_os_field_prep(ADF4377_VCO_BAND_MSK, x)
566 
567 /* ADF4377 REG0054 Map */
568 #define ADF4377_CHIP_VERSION_MSK NO_OS_GENMASK(7, 0)
569 #define ADF4377_CHIP_VERSION(x) no_os_field_prep(ADF4377_CHIP_VERSION_MSK, x)
570 
571 /* Specifications */
572 #define ADF4377_SPI_WRITE_CMD 0x0
573 #define ADF4377_SPI_READ_CMD NO_OS_BIT(7)
574 #define ADF4377_BUFF_SIZE_BYTES 3
575 #define ADF4377_MAX_VCO_FREQ 12800000000ull /* Hz */
576 #define ADF4377_MIN_VCO_FREQ 6400000000ull /* Hz */
577 #define ADF4377_MAX_REFIN_FREQ 1000000000 /* Hz */
578 #define ADF4377_MIN_REFIN_FREQ 10000000 /* Hz */
579 #define ADF4377_MAX_FREQ_PFD 500000000 /* Hz */
580 #define ADF4377_MIN_FREQ_PFD 3000000 /* Hz */
581 #define ADF4377_MAX_CLKPN_FREQ ADF4377_MAX_VCO_FREQ /* Hz */
582 #define ADF4377_MIN_CLKPN_FREQ (ADF4377_MIN_VCO_FREQ / 8) /* Hz */
583 #define ADF4377_FREQ_PFD_80MHZ 80000000
584 #define ADF4377_FREQ_PFD_125MHZ 125000000
585 #define ADF4377_FREQ_PFD_160MHZ 160000000
586 #define ADF4377_FREQ_PFD_250MHZ 250000000
587 #define ADF4377_FREQ_PFD_320MHZ 320000000
588 
589 /* ADF4377 Extra Definitions */
590 #define ADF4377_SPI_SCRATCHPAD_TEST_A 0xA5u
591 #define ADF4377_SPI_SCRATCHPAD_TEST_B 0x5Au
592 #define ADF4377_SPI_DUMMY_DATA 0x00
593 #define ADF4377_CHECK_RANGE(freq, range) \
594  ((freq > ADF4377_MAX_ ## range) || (freq < ADF4377_MIN_ ## range))
595 
596 /******************************************************************************/
597 /*************************** Types Declarations *******************************/
598 /******************************************************************************/
599 
605  ADF4377 = 0x05,
606  ADF4378 = 0x06
607 };
608 
625  bool spi4wire;
627  uint32_t clkin_freq;
629  uint64_t f_clk;
631  uint8_t cp_i;
633  uint32_t muxout_select;
635  uint8_t ref_doubler_en;
637  uint8_t clkout_op;
638 };
639 
644 struct adf4377_dev {
656  bool spi4wire;
658  uint32_t f_pfd;
660  uint64_t f_clk;
662  uint64_t f_vco;
664  uint32_t clkin_freq;
666  uint8_t cp_i;
668  uint8_t muxout_default;
670  uint8_t ref_doubler_en;
672  uint32_t ref_div_factor;
674  uint8_t clkout_div_sel;
676  uint16_t n_int;
678  uint8_t clkout_op;
679 };
680 
681 /******************************************************************************/
682 /************************ Functions Declarations ******************************/
683 /******************************************************************************/
684 
686 int32_t adf4377_spi_write(struct adf4377_dev *dev, uint8_t reg_addr,
687  uint8_t data);
688 
689 /* ADF4377 Register Update */
690 int32_t adf4377_spi_write_mask(struct adf4377_dev *dev, uint8_t reg_addr,
691  uint8_t mask, uint8_t data);
692 
694 int32_t adf4377_spi_read(struct adf4377_dev *dev, uint8_t reg_addr,
695  uint8_t *data);
696 
697 /* Software Reset */
698 int32_t adf4377_soft_reset(struct adf4377_dev *dev);
699 
700 /* ADF4377 Scratchpad check */
701 int32_t adf4377_check_scratchpad(struct adf4377_dev *dev);
702 
703 /* Set Output frequency */
704 int32_t adf4377_set_freq(struct adf4377_dev *dev, uint64_t freq);
705 
707 int32_t adf4377_init(struct adf4377_dev **device,
709 
711 int32_t adf4377_remove(struct adf4377_dev *dev);
712 
713 #endif /* ADF4377_H_ */
ADF4377_EN_DNCLK_ON
#define ADF4377_EN_DNCLK_ON
Definition: adf4377.h:342
ADF4377_R020_RSV1
#define ADF4377_R020_RSV1(x)
Definition: adf4377.h:403
ADF4377_FREQ_PFD_125MHZ
#define ADF4377_FREQ_PFD_125MHZ
Definition: adf4377.h:584
adf4377_dev::f_pfd
uint32_t f_pfd
Definition: adf4377.h:658
ADF4377_CLKOUT1_OP
#define ADF4377_CLKOUT1_OP(x)
Definition: adf4377.h:244
timeout
uint32_t timeout
Definition: ad413x.c:49
no_os_alloc.h
no_os_gpio_init_param
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
adf4377_dev::ref_doubler_en
uint8_t ref_doubler_en
Definition: adf4377.h:670
ADF4377_CLKOUT_DIV
#define ADF4377_CLKOUT_DIV(x)
Definition: adf4377.h:150
ADF4377_PD_CLKOUT1
#define ADF4377_PD_CLKOUT1(x)
Definition: adf4377.h:286
adf4377_dev::clkout_div_sel
uint8_t clkout_div_sel
Definition: adf4377.h:674
ADF4377_ADC_A_CONV_VCO_CALIB
#define ADF4377_ADC_A_CONV_VCO_CALIB
Definition: adf4377.h:475
ADF4377_PD_ALL_N_OP
#define ADF4377_PD_ALL_N_OP
Definition: adf4377.h:291
adf4377_dev::f_vco
uint64_t f_vco
Definition: adf4377.h:662
ADF4377_SYNTH_LOCK_TO_MSB_MSK
#define ADF4377_SYNTH_LOCK_TO_MSB_MSK
Definition: adf4377.h:445
adf4377_spi_write
int32_t adf4377_spi_write(struct adf4377_dev *dev, uint8_t reg_addr, uint8_t data)
Writes data to ADF4377 over SPI.
Definition: adf4377.c:54
ADF4377_EN_DRCLK
#define ADF4377_EN_DRCLK(x)
Definition: adf4377.h:334
ADF4377_R01F_RSV1_MSK
#define ADF4377_R01F_RSV1_MSK
Definition: adf4377.h:384
ADF4377_PD_LD
#define ADF4377_PD_LD(x)
Definition: adf4377.h:282
adf4377_init_param::cp_i
uint8_t cp_i
Definition: adf4377.h:631
ADF4377_SPI_SCRATCHPAD_TEST_B
#define ADF4377_SPI_SCRATCHPAD_TEST_B
Definition: adf4377.h:591
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
adf4377_spi_read
int32_t adf4377_spi_read(struct adf4377_dev *dev, uint8_t reg_addr, uint8_t *data)
Reads data from ADF4377 over SPI.
Definition: adf4377.c:103
ADF4377_R03B_RSV1
#define ADF4377_R03B_RSV1
Definition: adf4377.h:510
ADF4377_N_INT_LSB
#define ADF4377_N_INT_LSB(x)
Definition: adf4377.h:124
ADF4377_CLKOUT2_OP_MSK
#define ADF4377_CLKOUT2_OP_MSK
Definition: adf4377.h:241
ADF4377_N_INT_MSB
#define ADF4377_N_INT_MSB(x)
Definition: adf4377.h:134
adf4377_init_param
ADF4377 Initialization Parameters structure.
Definition: adf4377.h:613
no_os_spi.h
Header file of SPI Interface.
ADF4377_R01C_RSV1
#define ADF4377_R01C_RSV1(x)
Definition: adf4377.h:338
ADF4377_ADC_CLK_DIV
#define ADF4377_ADC_CLK_DIV(x)
Definition: adf4377.h:463
ADF4377_EN_DRCLK_MSK
#define ADF4377_EN_DRCLK_MSK
Definition: adf4377.h:333
ADF4377_LSB_FIRST_R
#define ADF4377_LSB_FIRST_R(x)
Definition: adf4377.h:59
ADF4377_CLKOUT2_OP
#define ADF4377_CLKOUT2_OP(x)
Definition: adf4377.h:242
adf4377_init
int32_t adf4377_init(struct adf4377_dev **device, struct adf4377_init_param *init_param)
Initializes the ADF4377.
Definition: adf4377.c:514
no_os_delay.h
Header file of Delay functions.
adf4377_init_param::clkin_freq
uint32_t clkin_freq
Definition: adf4377.h:627
ADF4377_SDO_ACTIVE_R
#define ADF4377_SDO_ACTIVE_R(x)
Definition: adf4377.h:67
ADF4377_PD_NDIV
#define ADF4377_PD_NDIV(x)
Definition: adf4377.h:278
ADF4377_CLKOUT_DIV_MSK
#define ADF4377_CLKOUT_DIV_MSK
Definition: adf4377.h:149
adf4377_soft_reset
int32_t adf4377_soft_reset(struct adf4377_dev *dev)
Software reset.
Definition: adf4377.c:245
adf4377_remove
int32_t adf4377_remove(struct adf4377_dev *dev)
Free resoulces allocated for ADF4377.
Definition: adf4377.c:645
ADF4377_DCLK_DIV2
#define ADF4377_DCLK_DIV2(x)
Definition: adf4377.h:132
ADF4377_EN_AUTOCAL_MSK
#define ADF4377_EN_AUTOCAL_MSK
Definition: adf4377.h:127
ADF4377_SYNTH_LOCK_TO_MSB
#define ADF4377_SYNTH_LOCK_TO_MSB(x)
Definition: adf4377.h:446
ADF4377_VCO_ALC_TO_MSB_MSK
#define ADF4377_VCO_ALC_TO_MSB_MSK
Definition: adf4377.h:455
adf4377.h
Header file for adf4377 Driver.
ADF4377_EN_AUTOCAL
#define ADF4377_EN_AUTOCAL(x)
Definition: adf4377.h:128
device
Definition: ad9361_util.h:69
ADF4377_R032_RSV1
#define ADF4377_R032_RSV1(x)
Definition: adf4377.h:494
NO_OS_GPIO_HIGH
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:117
ADF4377_R025_RSV1_MSK
#define ADF4377_R025_RSV1_MSK
Definition: adf4377.h:427
adf4377_init_param::ref_doubler_en
uint8_t ref_doubler_en
Definition: adf4377.h:635
ADF4377_ADC_BUSY
#define ADF4377_ADC_BUSY(x)
Definition: adf4377.h:545
ADF4377_BUFF_SIZE_BYTES
#define ADF4377_BUFF_SIZE_BYTES
Definition: adf4377.h:574
ADF4377_EN_ADC_CLK_MSK
#define ADF4377_EN_ADC_CLK_MSK
Definition: adf4377.h:400
ADF4377_R01C_RSV1_MSK
#define ADF4377_R01C_RSV1_MSK
Definition: adf4377.h:337
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
adf4377_dev::clkin_freq
uint32_t clkin_freq
Definition: adf4377.h:664
ADF4377_DCLK_DIV2_2
#define ADF4377_DCLK_DIV2_2
Definition: adf4377.h:144
ADF4377_N_INT_MSB_MSK
#define ADF4377_N_INT_MSB_MSK
Definition: adf4377.h:133
ADF4377_SOFT_RESET_EN
#define ADF4377_SOFT_RESET_EN
Definition: adf4377.h:82
ADF4377_R033_RSV1
#define ADF4377_R033_RSV1
Definition: adf4377.h:501
ADF4377_CP_I
#define ADF4377_CP_I(x)
Definition: adf4377.h:194
adf4377_init_param::f_clk
uint64_t f_clk
Definition: adf4377.h:629
ADF4377_FREQ_PFD_160MHZ
#define ADF4377_FREQ_PFD_160MHZ
Definition: adf4377.h:585
ADF4377_ADDRESS_ASC_R
#define ADF4377_ADDRESS_ASC_R(x)
Definition: adf4377.h:63
adf4377_dev::gpio_enclk2
struct no_os_gpio_desc * gpio_enclk2
Definition: adf4377.h:650
adf4377_dev::muxout_default
uint8_t muxout_default
Definition: adf4377.h:668
adf4377_dev
ADF4377 Device Descriptor.
Definition: adf4377.h:644
ADF4377_DCLK_DIV1_1
#define ADF4377_DCLK_DIV1_1
Definition: adf4377.h:482
ADF4377_PD_CLKOUT2_N_OP
#define ADF4377_PD_CLKOUT2_N_OP
Definition: adf4377.h:312
ADF4377_EN_ADC_CNV
#define ADF4377_EN_ADC_CNV(x)
Definition: adf4377.h:467
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:52
ADF4377_EN_ADC_CNV_MSK
#define ADF4377_EN_ADC_CNV_MSK
Definition: adf4377.h:466
ADF4377_SPI_SCRATCHPAD_TEST_A
#define ADF4377_SPI_SCRATCHPAD_TEST_A
Definition: adf4377.h:590
ADF4377_FSM_BUSY
#define ADF4377_FSM_BUSY(x)
Definition: adf4377.h:547
ADF4377_PD_LD_N_OP
#define ADF4377_PD_LD_N_OP
Definition: adf4377.h:303
ADF4377_CHECK_RANGE
#define ADF4377_CHECK_RANGE(freq, range)
Definition: adf4377.h:593
ADF4377_R022_RSV1
#define ADF4377_R022_RSV1
Definition: adf4377.h:413
ADF4377_R021_RSV1
#define ADF4377_R021_RSV1
Definition: adf4377.h:410
ADF4377_DCLK_DIV2_1
#define ADF4377_DCLK_DIV2_1
Definition: adf4377.h:143
ADF4377_EN_DRCLK_ON
#define ADF4377_EN_DRCLK_ON
Definition: adf4377.h:345
adf4377_dev::gpio_enclk1
struct no_os_gpio_desc * gpio_enclk1
Definition: adf4377.h:648
adf4377_dev::n_int
uint16_t n_int
Definition: adf4377.h:676
ADF4377_FREQ_PFD_80MHZ
#define ADF4377_FREQ_PFD_80MHZ
Definition: adf4377.h:583
ADF4377_SOFT_RESET
#define ADF4377_SOFT_RESET(x)
Definition: adf4377.h:57
adf4377_dev::spi4wire
bool spi4wire
Definition: adf4377.h:656
ADF4377_R_DIV
#define ADF4377_R_DIV(x)
Definition: adf4377.h:152
ADF4377_PD_ALL
#define ADF4377_PD_ALL(x)
Definition: adf4377.h:274
ADF4377_SDO_ACTIVE
#define ADF4377_SDO_ACTIVE(x)
Definition: adf4377.h:69
ADF4377_R020_RSV1_MSK
#define ADF4377_R020_RSV1_MSK
Definition: adf4377.h:402
adf4377_dev::gpio_ce
struct no_os_gpio_desc * gpio_ce
Definition: adf4377.h:652
ADF4377_R034_RSV1
#define ADF4377_R034_RSV1
Definition: adf4377.h:504
ADF4377_CLKOUT1_OP_MSK
#define ADF4377_CLKOUT1_OP_MSK
Definition: adf4377.h:243
adf4377_init_param::muxout_select
uint32_t muxout_select
Definition: adf4377.h:633
ADF4377_EN_ADC_MSK
#define ADF4377_EN_ADC_MSK
Definition: adf4377.h:468
adf4377_dev::cp_i
uint8_t cp_i
Definition: adf4377.h:666
ADF4377_EN_RDBLR_MSK
#define ADF4377_EN_RDBLR_MSK
Definition: adf4377.h:129
ADF4377_DCLK_DIV1
#define ADF4377_DCLK_DIV1(x)
Definition: adf4377.h:479
ADF4377_PD_CLKOUT2
#define ADF4377_PD_CLKOUT2(x)
Definition: adf4377.h:288
no_os_spi_desc::bit_order
enum no_os_spi_bit_order bit_order
Definition: no_os_spi.h:204
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
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
ADF4377_EN_DNCLK_OFF
#define ADF4377_EN_DNCLK_OFF
Definition: adf4377.h:341
ADF4377_PD_VCO
#define ADF4377_PD_VCO(x)
Definition: adf4377.h:280
ADF4377_EN_RDBLR
#define ADF4377_EN_RDBLR(x)
Definition: adf4377.h:130
ADF4377_SOFT_RESET_R
#define ADF4377_SOFT_RESET_R(x)
Definition: adf4377.h:55
adf4377_init
int32_t adf4377_init(struct adf4377_dev **device, struct adf4377_init_param *init_param)
Initializes the ADF4377.
Definition: adf4377.c:514
adf4377_spi_write_mask
int32_t adf4377_spi_write_mask(struct adf4377_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t data)
Update ADF4377 register.
Definition: adf4377.c:80
adf4377_dev::dev_id
enum adf4377_dev_id dev_id
Definition: adf4377.h:654
ADF4377
@ ADF4377
Definition: adf4377.h:605
ADF4377_MIN_VCO_FREQ
#define ADF4377_MIN_VCO_FREQ
Definition: adf4377.h:576
ADF4377_PD_VCO_N_OP
#define ADF4377_PD_VCO_N_OP
Definition: adf4377.h:300
no_os_gpio_desc
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
ADF4377_DCLK_DIV2_MSK
#define ADF4377_DCLK_DIV2_MSK
Definition: adf4377.h:131
ADF4377_EN_DRCLK_OFF
#define ADF4377_EN_DRCLK_OFF
Definition: adf4377.h:344
ADF4377_MUXOUT
#define ADF4377_MUXOUT(x)
Definition: adf4377.h:352
adf4377_soft_reset
int32_t adf4377_soft_reset(struct adf4377_dev *dev)
Software reset.
Definition: adf4377.c:245
ADF4377_EN_ADC_CLK
#define ADF4377_EN_ADC_CLK(x)
Definition: adf4377.h:401
adf4377_spi_write
int32_t adf4377_spi_write(struct adf4377_dev *dev, uint8_t reg_addr, uint8_t data)
Writes data to ADF4377 over SPI.
Definition: adf4377.c:54
ADF4377_R02C_RSV1
#define ADF4377_R02C_RSV1
Definition: adf4377.h:459
adf4377_init_param::spi_init
struct no_os_spi_init_param * spi_init
Definition: adf4377.h:615
ADF4377_LSB_FIRST
#define ADF4377_LSB_FIRST(x)
Definition: adf4377.h:61
ADF4377_R042_RSV1
#define ADF4377_R042_RSV1
Definition: adf4377.h:531
ADF4377_MUXOUT_MSK
#define ADF4377_MUXOUT_MSK
Definition: adf4377.h:351
ADF4377_SOFT_RESET_R_MSK
#define ADF4377_SOFT_RESET_R_MSK
Definition: adf4377.h:54
ADF4377_PD_PFDCP
#define ADF4377_PD_PFDCP(x)
Definition: adf4377.h:284
adf4377_check_scratchpad
int32_t adf4377_check_scratchpad(struct adf4377_dev *dev)
ADF4377 SPI Scratchpad check.
Definition: adf4377.c:133
ADF4377_R023_RSV1
#define ADF4377_R023_RSV1
Definition: adf4377.h:416
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
adf4377_dev::spi_desc
struct no_os_spi_desc * spi_desc
Definition: adf4377.h:646
ADF4377_R032_RSV1_MSK
#define ADF4377_R032_RSV1_MSK
Definition: adf4377.h:493
ADF4377_R01F_RSV1
#define ADF4377_R01F_RSV1(x)
Definition: adf4377.h:385
adf4377_spi_read
int32_t adf4377_spi_read(struct adf4377_dev *dev, uint8_t reg_addr, uint8_t *data)
Reads data from ADF4377 over SPI.
Definition: adf4377.c:103
ADF4378
@ ADF4378
Definition: adf4377.h:606
ADF4377_R_DIV_MSK
#define ADF4377_R_DIV_MSK
Definition: adf4377.h:151
adf4377_init_param::clkout_op
uint8_t clkout_op
Definition: adf4377.h:637
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
ADF4377_FREQ_PFD_250MHZ
#define ADF4377_FREQ_PFD_250MHZ
Definition: adf4377.h:586
ADF4377_ADDRESS_ASC
#define ADF4377_ADDRESS_ASC(x)
Definition: adf4377.h:65
ADF4377_R031_RSV1
#define ADF4377_R031_RSV1
Definition: adf4377.h:488
ADF4377_R025_RSV1
#define ADF4377_R025_RSV1(x)
Definition: adf4377.h:428
ADF4377_SOFT_RESET_MSK
#define ADF4377_SOFT_RESET_MSK
Definition: adf4377.h:56
ADF4377_MAX_FREQ_PFD
#define ADF4377_MAX_FREQ_PFD
Definition: adf4377.h:579
ADF4377_VCO_BAND_DIV
#define ADF4377_VCO_BAND_DIV(x)
Definition: adf4377.h:432
adf4377_init_param::spi4wire
bool spi4wire
Definition: adf4377.h:625
ADF4377_R00F_RSV1
#define ADF4377_R00F_RSV1
Definition: adf4377.h:120
adf4377_init_param::gpio_enclk2_param
struct no_os_gpio_init_param * gpio_enclk2_param
Definition: adf4377.h:621
adf4377_spi_write_mask
int32_t adf4377_spi_write_mask(struct adf4377_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t data)
Update ADF4377 register.
Definition: adf4377.c:80
ADF4377_VCO_ALC_TO_MSB
#define ADF4377_VCO_ALC_TO_MSB(x)
Definition: adf4377.h:456
ADF4377_EN_DNCLK_MSK
#define ADF4377_EN_DNCLK_MSK
Definition: adf4377.h:331
ADF4377_CHIP_TYPE
#define ADF4377_CHIP_TYPE
Definition: adf4377.h:98
ADF4377_FREQ_PFD_320MHZ
#define ADF4377_FREQ_PFD_320MHZ
Definition: adf4377.h:587
ADF4377_SPI_DUMMY_DATA
#define ADF4377_SPI_DUMMY_DATA
Definition: adf4377.h:592
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
ADF4377_ADDR_ASC_AUTO_DECR
#define ADF4377_ADDR_ASC_AUTO_DECR
Definition: adf4377.h:75
ADF4377_PD_CLKOUT1_N_OP
#define ADF4377_PD_CLKOUT1_N_OP
Definition: adf4377.h:309
no_os_gpio.h
Header file of GPIO Interface.
adf4377_dev::clkout_op
uint8_t clkout_op
Definition: adf4377.h:678
ADF4377_PD_RDIV_N_OP
#define ADF4377_PD_RDIV_N_OP
Definition: adf4377.h:294
ADF4377_DCLK_DIV1_2
#define ADF4377_DCLK_DIV1_2
Definition: adf4377.h:483
ADF4377_CP_I_MSK
#define ADF4377_CP_I_MSK
Definition: adf4377.h:193
ADF4377_PD_RDIV
#define ADF4377_PD_RDIV(x)
Definition: adf4377.h:276
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
adf4377_check_scratchpad
int32_t adf4377_check_scratchpad(struct adf4377_dev *dev)
ADF4377 SPI Scratchpad check.
Definition: adf4377.c:133
ADF4377_REG
#define ADF4377_REG(x)
Definition: adf4377.h:51
adf4377_remove
int32_t adf4377_remove(struct adf4377_dev *dev)
Free resoulces allocated for ADF4377.
Definition: adf4377.c:645
no_os_util.h
Header file of utility functions.
adf4377_init_param::gpio_enclk1_param
struct no_os_gpio_init_param * gpio_enclk1_param
Definition: adf4377.h:619
adf4377_set_freq
int32_t adf4377_set_freq(struct adf4377_dev *dev, uint64_t freq)
Definition: adf4377.c:275
adf4377_dev::f_clk
uint64_t f_clk
Definition: adf4377.h:660
ADF4377_SPI_WRITE_CMD
#define ADF4377_SPI_WRITE_CMD
Definition: adf4377.h:572
ADF4377_ADC_A_CONV_MSK
#define ADF4377_ADC_A_CONV_MSK
Definition: adf4377.h:470
adf4377_dev_id
adf4377_dev_id
ID of Devices supported by the driver.
Definition: adf4377.h:604
adf4377_init_param::dev_id
enum adf4377_dev_id dev_id
Definition: adf4377.h:623
ADF4377_R03A_RSV1
#define ADF4377_R03A_RSV1
Definition: adf4377.h:507
ADF4377_PD_PFDCP_N_OP
#define ADF4377_PD_PFDCP_N_OP
Definition: adf4377.h:306
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
ADF4377_DCLK_MODE
#define ADF4377_DCLK_MODE(x)
Definition: adf4377.h:420
adf4377_dev::ref_div_factor
uint32_t ref_div_factor
Definition: adf4377.h:672
ADF4377_SYNTH_LOCK_TO_LSB
#define ADF4377_SYNTH_LOCK_TO_LSB(x)
Definition: adf4377.h:440
no_os_bit_swap_constant_8
#define no_os_bit_swap_constant_8(x)
Definition: no_os_util.h:102
ADF4377_SPI_READ_CMD
#define ADF4377_SPI_READ_CMD
Definition: adf4377.h:573
ADF4377_PD_NDIV_N_OP
#define ADF4377_PD_NDIV_N_OP
Definition: adf4377.h:297
ADF4377_EN_ADC
#define ADF4377_EN_ADC(x)
Definition: adf4377.h:469
ADF4377_DCLK_DIV1_MSK
#define ADF4377_DCLK_DIV1_MSK
Definition: adf4377.h:478
adf4377_set_freq
int32_t adf4377_set_freq(struct adf4377_dev *dev, uint64_t freq)
Definition: adf4377.c:275
ADF4377_EN_DNCLK
#define ADF4377_EN_DNCLK(x)
Definition: adf4377.h:332
ADF4377_VCO_CALIB_EN
#define ADF4377_VCO_CALIB_EN
Definition: adf4377.h:138
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
ADF4377_VCO_ALC_TO_LSB
#define ADF4377_VCO_ALC_TO_LSB(x)
Definition: adf4377.h:450
ADF4377_ADC_A_CONV
#define ADF4377_ADC_A_CONV(x)
Definition: adf4377.h:471
ADF4377_DCLK_MODE_MSK
#define ADF4377_DCLK_MODE_MSK
Definition: adf4377.h:419
no_os_gpio_get_optional
int32_t no_os_gpio_get_optional(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Get the value of an optional GPIO.
Definition: no_os_gpio.c:75
adf4377_init_param::gpio_ce_param
struct no_os_gpio_init_param * gpio_ce_param
Definition: adf4377.h:617