no-OS
ad9517.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef __AD9517_H__
34 #define __AD9517_H__
35 
36 /******************************************************************************/
37 /***************************** Include Files **********************************/
38 /******************************************************************************/
39 #include <stdint.h>
40 #include "no_os_spi.h"
41 
42 /******************************************************************************/
43 /****************************** AD9517 ****************************************/
44 /******************************************************************************/
45 #define AD9517_READ (1 << 15)
46 #define AD9517_WRITE (0 << 15)
47 #define AD9517_CNT(x) ((x - 1) << 13)
48 #define AD9517_ADDR(x) (x & 0x3FF)
49 
50 #define AD9517_T1B (1 << 16)
51 #define AD9517_T2B (2 << 16)
52 #define AD9517_T3B (3 << 16)
53 #define AD9517_TRANSF_LEN(x) ((uint32_t)x >> 16)
54 
55 /* SPI Register Map */
56 
57 /* Serial Port Configuration */
58 #define AD9517_REG_SERIAL_PORT_CONFIG (AD9517_T1B | 0x000)
59 #define AD9517_REG_PART_ID (AD9517_T1B | 0x003)
60 #define AD9517_REG_READBACK_CTRL (AD9517_T1B | 0x004)
61 
62 /* PLL */
63 #define AD9517_REG_PFD_CHARGE_PUMP (AD9517_T1B | 0x010)
64 #define AD9517_REG_R_COUNTER (AD9517_T2B | 0x012)
65 #define AD9517_REG_A_COUNTER (AD9517_T1B | 0x013)
66 #define AD9517_REG_B_COUNTER (AD9517_T2B | 0x015)
67 #define AD9517_REG_PLL_CTRL_1 (AD9517_T1B | 0x016)
68 #define AD9517_REG_PLL_CTRL_2 (AD9517_T1B | 0x017)
69 #define AD9517_REG_PLL_CTRL_3 (AD9517_T1B | 0x018)
70 #define AD9517_REG_PLL_CTRL_4 (AD9517_T1B | 0x019)
71 #define AD9517_REG_PLL_CTRL_5 (AD9517_T1B | 0x01A)
72 #define AD9517_REG_PLL_CTRL_6 (AD9517_T1B | 0x01B)
73 #define AD9517_REG_PLL_CTRL_7 (AD9517_T1B | 0x01C)
74 #define AD9517_REG_PLL_CTRL_8 (AD9517_T1B | 0x01D)
75 #define AD9517_REG_PLL_READBACK (AD9517_T1B | 0x01F)
76 
77 /* Fine Delay Adjust - OUT4 to OUT7 */
78 #define AD9517_REG_OUT4_DELAY_BYPASS (AD9517_T1B | 0x0A0)
79 #define AD9517_REG_OUT4_DELAY_FULL_SCALE (AD9517_T1B | 0x0A1)
80 #define AD9517_REG_OUT4_DELAY_FRACTION (AD9517_T1B | 0x0A2)
81 #define AD9517_REG_OUT5_DELAY_BYPASS (AD9517_T1B | 0x0A3)
82 #define AD9517_REG_OUT5_DELAY_FULL_SCALE (AD9517_T1B | 0x0A4)
83 #define AD9517_REG_OUT5_DELAY_FRACTION (AD9517_T1B | 0x0A5)
84 #define AD9517_REG_OUT6_DELAY_BYPASS (AD9517_T1B | 0x0A6)
85 #define AD9517_REG_OUT6_DELAY_FULL_SCALE (AD9517_T1B | 0x0A7)
86 #define AD9517_REG_OUT6_DELAY_FRACTION (AD9517_T1B | 0x0A8)
87 #define AD9517_REG_OUT7_DELAY_BYPASS (AD9517_T1B | 0x0A9)
88 #define AD9517_REG_OUT7_DELAY_FULL_SCALE (AD9517_T1B | 0x0AA)
89 #define AD9517_REG_OUT7_DELAY_FRACTION (AD9517_T1B | 0x0AB)
90 
91 /* LVPECL Outputs */
92 #define AD9517_REG_LVPECL_OUT0 (AD9517_T1B | 0x0F0)
93 #define AD9517_REG_LVPECL_OUT1 (AD9517_T1B | 0x0F1)
94 #define AD9517_REG_LVPECL_OUT2 (AD9517_T1B | 0x0F4)
95 #define AD9517_REG_LVPECL_OUT3 (AD9517_T1B | 0x0F5)
96 
97 /* LVDS/CMOS Outputs */
98 #define AD9517_REG_LVDS_CMOS_OUT4 (AD9517_T1B | 0x140)
99 #define AD9517_REG_LVDS_CMOS_OUT5 (AD9517_T1B | 0x141)
100 #define AD9517_REG_LVDS_CMOS_OUT6 (AD9517_T1B | 0x142)
101 #define AD9517_REG_LVDS_CMOS_OUT7 (AD9517_T1B | 0x143)
102 
103 /* LVPECL Channel Dividers */
104 #define AD9517_REG_DIVIDER_0_0 (AD9517_T1B | 0x190)
105 #define AD9517_REG_DIVIDER_0_1 (AD9517_T1B | 0x191)
106 #define AD9517_REG_DIVIDER_0_2 (AD9517_T1B | 0x192)
107 #define AD9517_REG_DIVIDER_1_0 (AD9517_T1B | 0x196)
108 #define AD9517_REG_DIVIDER_1_1 (AD9517_T1B | 0x197)
109 #define AD9517_REG_DIVIDER_1_2 (AD9517_T1B | 0x198)
110 
111 /* LVDS/CMOS Channel Dividers */
112 #define AD9517_REG_LVDS_CMOS_DIVIDER_2_0 (AD9517_T1B | 0x199)
113 #define AD9517_REG_LVDS_CMOS_DIVIDER_2_1 (AD9517_T1B | 0x19A)
114 #define AD9517_REG_LVDS_CMOS_DIVIDER_2_2 (AD9517_T1B | 0x19B)
115 #define AD9517_REG_LVDS_CMOS_DIVIDER_2_3 (AD9517_T1B | 0x19C)
116 #define AD9517_REG_LVDS_CMOS_DIVIDER_2_4 (AD9517_T1B | 0x19D)
117 #define AD9517_REG_LVDS_CMOS_DIVIDER_3_0 (AD9517_T1B | 0x19E)
118 #define AD9517_REG_LVDS_CMOS_DIVIDER_3_1 (AD9517_T1B | 0x19F)
119 #define AD9517_REG_LVDS_CMOS_DIVIDER_3_2 (AD9517_T1B | 0x1A0)
120 #define AD9517_REG_LVDS_CMOS_DIVIDER_3_3 (AD9517_T1B | 0x1A1)
121 #define AD9517_REG_LVDS_CMOS_DIVIDER_3_4 (AD9517_T1B | 0x1A2)
122 
123 /* VCO Divider and CLK Input */
124 #define AD9517_REG_VCO_DIVIDER (AD9517_T1B | 0x1E0)
125 #define AD9517_REG_INPUT_CLKS (AD9517_T1B | 0x1E1)
126 
127 /* System */
128 #define AD9517_REG_POWER_DOWN_SYNC (AD9517_T1B | 0x230)
129 
130 /* Update All Registers */
131 #define AD9517_REG_UPDATE_ALL_REGS (AD9517_T1B | 0x232)
132 
133 /* AD9517_REG_SERIAL_PORT_CONFIG Definition */
134 #define AD9517_SDO_ACTIVE ((1 << 7) | (1 << 0))
135 #define AD9517_LSB_FIRST ((1 << 6) | (1 << 1))
136 #define AD9517_SOFT_RESET ((1 << 5) | (1 << 2))
137 #define AD9517_LONG_INSTRUCTION ((1 << 4) | (1 << 3))
138 
139 /* AD9517_REG_READBACK_CTRL Definition */
140 #define AD9517_REG_BANK_SELECTION (1 << 0)
141 
142 /* AD9517_REG_PFD_CHARGE_PUMP Definition */
143 #define AD9517_PFD_POLARITY (1 << 7)
144 #define AD9517_CP_CURRENT(x) ((x & 0x7) << 4)
145 #define AD9517_CP_MODE(x) ((x & 0x3) << 2)
146 #define AD9517_PLL_POWER_DOWN(x) ((x & 0x3) << 0)
147 
148 /* AD9517_REG_R_COUNTER Definition */
149 #define AD9517_R_COUNTER(x) ((x & 0x3FFF) << 0)
150 
151 /* AD9517_REG_A_COUNTER Definition */
152 #define AD9517_A_COUNTER(x) ((x & 0x3F) << 0)
153 
154 /* AD9517_REG_B_COUNTER Definition */
155 #define AD9517_B_COUNTER(x) ((x & 0x1FFF) << 0)
156 
157 /* AD9517_REG_PLL_CTRL_1 Definition */
158 #define AD9517_CP_VCP_DIV2 (1 << 7)
159 #define AD9517_RESET_R_COUNTER (1 << 6)
160 #define AD9517_RESET_A_B_COUNTERS (1 << 5)
161 #define AD9517_RESET_ALL_COUNTERS (1 << 4)
162 #define AD9517_B_COUNTER_BYPASS (1 << 3)
163 #define AD9517_PRESCALER_P(x) ((x & 0x7) << 0)
164 
165 /* AD9517_REG_PLL_CTRL_2 Definition */
166 #define AD9517_STATUS_PIN_CTRL(x) ((x & 0x3F) << 2)
167 #define AD9517_ANTIBACKLASH_PULSE_WIDTH(x) ((x & 0x3) << 0)
168 
169 /* AD9517_REG_PLL_CTRL_3 Definition */
170 #define AD9517_LOCK_DETECT_COUNTER(x) ((x & 0x3) << 5)
171 #define AD9517_DIGITAL_LOCK_DETECT_WINDOW (1 << 4)
172 #define AD9517_DIS_DIGITAL_LOCK_DETECT (1 << 3)
173 #define AD9517_VCO_CAL_DIVIDER(x) ((x & 0x3) << 1)
174 #define AD9517_VCO_CAL_NOW (1 << 0)
175 
176 /* AD9517_REG_PLL_CTRL_4 Definition */
177 #define AD9517_SYNC_PIN_RESET(x) ((x & 0x3) << 6)
178 #define AD9517_R_PATH_DELAY(x) ((x & 0x7) << 3)
179 #define AD9517_N_PATH_DELAY(x) ((x & 0x7) << 0)
180 
181 /* AD9517_REG_PLL_CTRL_5 Definition */
182 #define AD9517_REF_FREQ_MONITOR_THRESHOLD (1 << 6)
183 #define AD9517_LD_PIN_CTRL(x) ((x & 0x3F) << 0)
184 
185 /* AD9517_REG_PLL_CTRL_6 Definition */
186 #define AD9517_VCO_FREQ_MONITOR (1 << 7)
187 #define AD9517_REF2_FREQ_MONITOR (1 << 6)
188 #define AD9517_REF1_FREQ_MONITOR (1 << 5)
189 #define AD9517_REFMON_PIN_CTRL(x) ((x & 0x1F) << 0)
190 
191 /* AD9517_REG_PLL_CTRL_7 Definition */
192 #define AD9517_DIS_SWITCHOVER_DEGLITCH (1 << 7)
193 #define AD9517_SELECT_REF2 (1 << 6)
194 #define AD9517_USE_REF_SEL_PIN (1 << 5)
195 #define AD9517_REF2_POWER_ON (1 << 2)
196 #define AD9517_REF1_POWER_ON (1 << 1)
197 #define AD9517_DIFF_REF (1 << 0)
198 
199 /* AD9517_REG_PLL_CTRL_8 Definition */
200 #define AD9517_PLL_STATUS_REG_DIS (1 << 4)
201 #define AD9517_LD_PIN_COMPARATOR_EN (1 << 3)
202 #define AD9517_HOLDOVER_EN ((1 << 2) | (1 << 0))
203 #define AD9517_EXT_HOLDOVER_CTRL (1 << 1)
204 
205 /* AD9517_REG_PLL_READBACK Definition */
206 #define AD9517_VCO_CAL_FINISHED (1 << 6)
207 #define AD9517_HOLDOVER_ACTIVE (1 << 5)
208 #define AD9517_REF2_SELECTED (1 << 4)
209 #define AD9517_VCO_FREQ_GREATER (1 << 3)
210 #define AD9517_REF2_FREQ_GREATER (1 << 2)
211 #define AD9517_REF1_FREQ_GREATER (1 << 1)
212 #define AD9517_DIGITAL_LOCK_DETECT (1 << 0)
213 
214 /* AD9517_REG_OUTn_DELAY_BYPASS Definition */
215 #define AD9517_OUT_DELAY_BYPASS (1 << 0)
216 
217 /* AD9517_REG_OUTn_DELAY_FULL_SCALE Definition */
218 #define AD9517_OUT_RAMP_CAPACITORS(x) ((x & 0x7) << 3)
219 #define AD9517_OUT_RAMP_CURRENT(x) ((x & 0x7) << 0)
220 
221 /* AD9517_REG_OUTn_DELAY_FRACTION Definition */
222 #define AD9517_OUT_DELAY_FRACTION(x) ((x & 0x3F) << 0)
223 
224 /* AD9517_REG_LVPECL_OUTn Definition */
225 #define AD9517_OUT_LVPECL_INVERT (1 << 4)
226 #define AD9517_OUT_LVPECL_DIFF_VOLTAGE(x) ((x & 0x3) << 2)
227 #define AD9517_OUT_LVPECL_POWER_DOWN(x) ((x & 0x3) << 0)
228 
229 /* AD9517_REG_LVDS_CMOS_OUTn Definition */
230 #define AD9517_OUT_LVDS_CMOS_INVERT(x) ((x & 0x7) << 5)
231 #define AD9517_OUT_CMOS_B (1 << 4)
232 #define AD9517_OUT_LVDS_CMOS (1 << 3)
233 #define AD9517_OUT_LVDS_OUTPUT_CURRENT(x) ((x & 0x3) << 1)
234 #define AD9517_OUT_LVDS_CMOS_POWER_DOWN (1 << 0)
235 
236 /* AD9517_REG_DIVIDER_n_0 Definition */
237 #define AD9517_DIVIDER_LOW_CYCLES(x) ((x & 0xF) << 4)
238 #define AD9517_DIVIDER_HIGH_CYCLES(x) ((x & 0xF) << 0)
239 
240 /* AD9517_REG_DIVIDER_n_1 Definition */
241 #define AD9517_DIVIDER_BYPASS (1 << 7)
242 #define AD9517_LVPECL_DIVIDER_NOSYNC (1 << 6)
243 #define AD9517_LVPECL_DIVIDER_FORCE_HIGH (1 << 5)
244 #define AD9517_DIVIDER_START_HIGH (1 << 4)
245 #define AD9517_DIVIDER_PHASE_OFFSET(x) ((x & 0xF) << 0)
246 
247 /* AD9517_REG_DIVIDER_n_2 Definition */
248 #define AD9517_DIVIDER_DIRECT_TO_OUTPUT (1 << 1)
249 #define AD9517_DIVIDER_DCCOFF (1 << 0)
250 
251 /* AD9517_REG_LVDS_CMOS_DIVIDER_n_0 Definition */
252 #define AD9517_LOW_CYCLES_DIVIDER_1(x) ((x & 0xF) << 4)
253 #define AD9517_HIGH_CYCLES_DIVIDER_1(x) ((x & 0xF) << 0)
254 
255 /* AD9517_REG_LVDS_CMOS_DIVIDER_n_1 Definition */
256 #define AD9517_PHASE_OFFSET_DIVIDER_2(x) ((x & 0xF) << 4)
257 #define AD9517_PHASE_OFFSET_DIVIDER_1(x) ((x & 0xF) << 0)
258 
259 /* AD9517_REG_LVDS_CMOS_DIVIDER_n_2 Definition */
260 #define AD9517_LOW_CYCLES_DIVIDER_2(x) ((x & 0xF) << 4)
261 #define AD9517_HIGH_CYCLES_DIVIDER_2(x) ((x & 0xF) << 0)
262 
263 /* AD9517_REG_LVDS_CMOS_DIVIDER_n_3 Definition */
264 #define AD9517_BYPASS_DIVIDER_2 (1 << 5)
265 #define AD9517_BYPASS_DIVIDER_1 (1 << 4)
266 #define AD9517_LVDS_CMOS_DIVIDER_NOSYNC (1 << 3)
267 #define AD9517_LVDS_CMOS_DIVIDER_FORCE_HIGH (1 << 2)
268 #define AD9517_START_HIGH_DIVIDER_2 (1 << 1)
269 #define AD9517_START_HIGH_DIVIDER_1 (1 << 0)
270 
271 /* AD9517_REG_LVDS_CMOS_DIVIDER_n_4 Definition */
272 #define AD9517_DIVIDER_DCCOFF (1 << 0)
273 
274 /* AD9517_REG_VCO_DIVIDER Definition */
275 #define AD9517_VCO_DIVIDER(x) ((x & 0x7) << 0)
276 
277 /* AD9517_REG_INPUT_CLKS Definition */
278 #define AD9517_POWER_DOWN_CLK_INPUT_SECTION (1 << 4)
279 #define AD9517_POWER_DOWN_VCO_CLK_INTERFACE (1 << 3)
280 #define AD9517_POWER_DOWN_VCO_CLK (1 << 2)
281 #define AD9517_SEL_VCO_CLK (1 << 1)
282 #define AD9517_BYPASS_VCO_DIVIDER (1 << 0)
283 
284 /* AD9517_REG_POWER_DOWN_SYNC Definition */
285 #define AD9517_POWER_DOWN_SYNC (1 << 2)
286 #define AD9517_POWER_DOWN_DIST_REF (1 << 1)
287 #define AD9517_SOFT_SYNC (1 << 0)
288 
289 /* AD9517_REG_UPDATE_ALL_REGS Definition */
290 #define AD9517_UPDATE_ALL_REGS (1 << 0)
291 
292 #define AD9517_1_MIN_VCO_FREQ 2300000000
293 #define AD9517_1_MAX_VCO_FREQ 2650000000
294 #define AD9517_2_MIN_VCO_FREQ 2050000000
295 #define AD9517_2_MAX_VCO_FREQ 2330000000
296 #define AD9517_3_MIN_VCO_FREQ 1750000000
297 #define AD9517_3_MAX_VCO_FREQ 2250000000
298 #define AD9517_4_MIN_VCO_FREQ 1450000000
299 #define AD9517_4_MAX_VCO_FREQ 1800000000
300 #define AD9517_MAX_PFD_FREQ 100000000
301 #define AD9517_MAX_PRESCLAER_OUT_FREQ 300000000
302 
303 /******************************************************************************/
304 /*************************** Types Declarations *******************************/
305 /******************************************************************************/
306 
307 /* Platform specific information */
309  /* PLL Reference */
310  int32_t ref_1_freq; // Frequency of the Reference 1.
311  int32_t ref_2_freq; // Frequency of the Reference 2.
312  uint8_t diff_ref_en; // Selects the differential PLL reference mode.
313  uint8_t ref_1_power_on; // Power on REF1.
314  uint8_t ref_2_power_on; // Power on REF2.
315  uint8_t ref_sel_pin_en; // Set method of PLL reference selection.
316  uint8_t ref_sel_pin; // State of the REF_SEL pin.
317  uint8_t ref_2_en; // Select Reference 2.
318 
319  /* External Clock */
320  int64_t ext_clk_freq; // Frequency of the external clock.
321 
322  /* VCO */
323  int64_t int_vco_freq; // Frequency of the internal VCO.
324 
325  /* External Clock or VCO selection */
326  int32_t vco_clk_sel;
327 
329  uint8_t name[16];
330 };
331 
332 /* LVPECL output channel configuration. */
334  uint8_t channel_num; // Output channel number.
335  uint8_t out_invert_en; // Invert the polarity of the output clock.
336  uint8_t out_diff_voltage; // LVPECL output differential voltage.
337  uint8_t name[16]; // Optional descriptive channel name.
338 };
339 
341  AD9517_1 = 0x51,
342  AD9517_2 = 0x91,
343  AD9517_3 = 0x53,
344  AD9517_4 = 0xd3
345 };
346 
352 };
353 
354 /* LVDS/CMOS output channel configuration. */
356  uint8_t channel_num; // Output channel number.
357  uint8_t out_invert; // Invert the polarity of the output clock.
358  uint8_t logic_level; // Select LVDS or CMOS logic levels.
359  uint8_t cmos_b_en; // In CMOS mode, turn on/off the CMOS B output
360  uint8_t out_lvds_current; // LVDS output current level.
361  uint8_t name[16]; // Optional descriptive channel name.
362 };
363 
367 };
368 
374 };
375 
376 struct ad9517_state {
380  uint32_t r_counter;
381  uint8_t a_counter;
382  uint16_t b_counter;
383  uint8_t vco_divider;
384  uint8_t prescaler_p;
386 };
387 
388 struct ad9517_dev {
389  /* SPI */
391  /* Device Settings */
394 };
395 
397  /* SPI */
399  /* Device Settings */
402 };
403 
404 /******************************************************************************/
405 /************************ Functions Declarations ******************************/
406 /******************************************************************************/
408 int32_t ad9517_setup(struct ad9517_dev **device,
411 int32_t ad9517_remove(struct ad9517_dev *dev);
413 int32_t ad9517_write(struct ad9517_dev *dev,
414  uint32_t reg_addr,
415  uint16_t reg_val);
417 int32_t ad9517_read(struct ad9517_dev *dev,
418  uint32_t reg_addr,
419  uint32_t *reg_value);
421 int32_t ad9517_update(struct ad9517_dev *dev);
423 int64_t ad9517_vco_frequency(struct ad9517_dev *dev,
424  int64_t frequency);
426 int64_t ad9517_frequency(struct ad9517_dev *dev,
427  int32_t channel,
428  int64_t frequency);
430 int32_t ad9517_phase(struct ad9517_dev *dev,
431  int32_t channel,
432  int32_t phase);
434 int32_t ad9517_power_mode(struct ad9517_dev *dev,
435  int32_t channel,
436  int32_t mode);
437 
438 #endif // __AD9517_H__
AD9517_R_COUNTER
#define AD9517_R_COUNTER(x)
Definition: ad9517.h:149
ad9517_platform_data::vco_clk_sel
int32_t vco_clk_sel
Definition: ad9517.h:326
out_diff_voltage_options
out_diff_voltage_options
Definition: ad9517.h:347
AD9517_OUT_LVDS_CMOS
#define AD9517_OUT_LVDS_CMOS
Definition: ad9517.h:232
AD9517_REG_LVDS_CMOS_OUT6
#define AD9517_REG_LVDS_CMOS_OUT6
Definition: ad9517.h:100
ad9517_dev
Definition: ad9517.h:388
no_os_alloc.h
AD9517_REG_VCO_DIVIDER
#define AD9517_REG_VCO_DIVIDER
Definition: ad9517.h:124
ad9517_write
int32_t ad9517_write(struct ad9517_dev *dev, uint32_t reg_addr, uint16_t reg_val)
Writes data into a register.
Definition: ad9517.c:240
ad9517_platform_data::ref_2_en
uint8_t ref_2_en
Definition: ad9517.h:317
AD9517_DIVIDER_LOW_CYCLES
#define AD9517_DIVIDER_LOW_CYCLES(x)
Definition: ad9517.h:237
ad9517_frequency
int64_t ad9517_frequency(struct ad9517_dev *dev, int32_t channel, int64_t frequency)
Sets the frequency on the specified channel.
Definition: ad9517.c:476
AD9517_SEL_VCO_CLK
#define AD9517_SEL_VCO_CLK
Definition: ad9517.h:281
AD9517_4_MIN_VCO_FREQ
#define AD9517_4_MIN_VCO_FREQ
Definition: ad9517.h:298
AD9517_DIFF_REF
#define AD9517_DIFF_REF
Definition: ad9517.h:197
AD9517_BYPASS_DIVIDER_1
#define AD9517_BYPASS_DIVIDER_1
Definition: ad9517.h:265
ad9517_lvds_cmos_channel_spec::name
uint8_t name[16]
Definition: ad9517.h:361
AD9517_ADDR
#define AD9517_ADDR(x)
Definition: ad9517.h:48
ad9517_state::r_counter
uint32_t r_counter
Definition: ad9517.h:380
AD9517_3_MAX_VCO_FREQ
#define AD9517_3_MAX_VCO_FREQ
Definition: ad9517.h:297
ad9517_platform_data::ref_2_power_on
uint8_t ref_2_power_on
Definition: ad9517.h:314
AD9517_REG_LVDS_CMOS_DIVIDER_3_3
#define AD9517_REG_LVDS_CMOS_DIVIDER_3_3
Definition: ad9517.h:120
ad9517_write
int32_t ad9517_write(struct ad9517_dev *dev, uint32_t reg_addr, uint16_t reg_val)
Writes data into a register.
Definition: ad9517.c:240
AD9517_CP_MODE
#define AD9517_CP_MODE(x)
Definition: ad9517.h:145
ad9517_init_param::ad9517_st
struct ad9517_state ad9517_st
Definition: ad9517.h:400
ad9517_lvds_cmos_channel_spec::out_invert
uint8_t out_invert
Definition: ad9517.h:357
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
ad9517_lvpecl_channel_spec
Definition: ad9517.h:333
AD9517_REG_LVPECL_OUT1
#define AD9517_REG_LVPECL_OUT1
Definition: ad9517.h:93
AD9517_TRANSF_LEN
#define AD9517_TRANSF_LEN(x)
Definition: ad9517.h:53
ad9517_remove
int32_t ad9517_remove(struct ad9517_dev *dev)
Free the resources allocated by ad9517_setup().
Definition: ad9517.c:220
ad9517_init_param
Definition: ad9517.h:396
no_os_spi.h
Header file of SPI Interface.
AD9517_B_COUNTER
#define AD9517_B_COUNTER(x)
Definition: ad9517.h:155
logic_level_options
logic_level_options
Definition: ad9517.h:364
ad9517_init_param::ad9517_type
enum ad9517_type ad9517_type
Definition: ad9517.h:401
LVDS_5_25mA
@ LVDS_5_25mA
Definition: ad9517.h:372
ad9517.h
Header file of AD9517 Driver.
AD9517_REG_DIVIDER_0_0
#define AD9517_REG_DIVIDER_0_0
Definition: ad9517.h:104
AD9517_PRESCALER_P
#define AD9517_PRESCALER_P(x)
Definition: ad9517.h:163
LVDS_3_5mA
@ LVDS_3_5mA
Definition: ad9517.h:371
ad9517_platform_data::ref_sel_pin
uint8_t ref_sel_pin
Definition: ad9517.h:316
AD9517_READ
#define AD9517_READ
Definition: ad9517.h:45
ad9517_lvds_cmos_channel_spec::logic_level
uint8_t logic_level
Definition: ad9517.h:358
ad9517_platform_data::power_down_vco_clk
uint8_t power_down_vco_clk
Definition: ad9517.h:328
LVPECL_600mV
@ LVPECL_600mV
Definition: ad9517.h:349
LVPECL_960mV
@ LVPECL_960mV
Definition: ad9517.h:351
no_os_delay.h
Header file of Delay functions.
ad9517_lvds_cmos_channel_spec
Definition: ad9517.h:355
dividers_checker
int8_t dividers_checker(int32_t number)
Checks if the number can be decomposed into a product of two numbers smaller or equal to 32 each one.
Definition: ad9517.c:450
AD9517_OUT_CMOS_B
#define AD9517_OUT_CMOS_B
Definition: ad9517.h:231
ad9517_lvpecl_channel_spec::out_diff_voltage
uint8_t out_diff_voltage
Definition: ad9517.h:336
AD9517_BYPASS_VCO_DIVIDER
#define AD9517_BYPASS_VCO_DIVIDER
Definition: ad9517.h:282
ad9517_state::vco_divider
uint8_t vco_divider
Definition: ad9517.h:383
ad9517_lvpecl_channel_spec::channel_num
uint8_t channel_num
Definition: ad9517.h:334
AD9517_REG_LVDS_CMOS_OUT4
#define AD9517_REG_LVDS_CMOS_OUT4
Definition: ad9517.h:98
AD9517_REG_R_COUNTER
#define AD9517_REG_R_COUNTER
Definition: ad9517.h:64
AD9517_SELECT_REF2
#define AD9517_SELECT_REF2
Definition: ad9517.h:193
device
Definition: ad9361_util.h:69
AD9517_DIVIDER_PHASE_OFFSET
#define AD9517_DIVIDER_PHASE_OFFSET(x)
Definition: ad9517.h:245
ad9517_read
int32_t ad9517_read(struct ad9517_dev *dev, uint32_t reg_addr, uint32_t *reg_value)
Reads data from a register.
Definition: ad9517.c:277
ad9517_state::pdata
struct ad9517_platform_data * pdata
Definition: ad9517.h:377
ad9517_remove
int32_t ad9517_remove(struct ad9517_dev *dev)
Free the resources allocated by ad9517_setup().
Definition: ad9517.c:220
AD9517_1_MAX_VCO_FREQ
#define AD9517_1_MAX_VCO_FREQ
Definition: ad9517.h:293
AD9517_LOW_CYCLES_DIVIDER_1
#define AD9517_LOW_CYCLES_DIVIDER_1(x)
Definition: ad9517.h:252
AD9517_DIVIDER_BYPASS
#define AD9517_DIVIDER_BYPASS
Definition: ad9517.h:241
AD9517_OUT_LVDS_CMOS_POWER_DOWN
#define AD9517_OUT_LVDS_CMOS_POWER_DOWN
Definition: ad9517.h:234
AD9517_REG_LVDS_CMOS_OUT7
#define AD9517_REG_LVDS_CMOS_OUT7
Definition: ad9517.h:101
AD9517_PFD_POLARITY
#define AD9517_PFD_POLARITY
Definition: ad9517.h:143
AD9517_VCO_CAL_NOW
#define AD9517_VCO_CAL_NOW
Definition: ad9517.h:174
ad9517_lvpecl_channel_spec::name
uint8_t name[16]
Definition: ad9517.h:337
AD9517_REG_B_COUNTER
#define AD9517_REG_B_COUNTER
Definition: ad9517.h:66
ad9517_lvpecl_channel_spec::out_invert_en
uint8_t out_invert_en
Definition: ad9517.h:335
AD9517_REF1_POWER_ON
#define AD9517_REF1_POWER_ON
Definition: ad9517.h:196
AD9517_3_MIN_VCO_FREQ
#define AD9517_3_MIN_VCO_FREQ
Definition: ad9517.h:296
AD9517_REG_LVDS_CMOS_DIVIDER_2_0
#define AD9517_REG_LVDS_CMOS_DIVIDER_2_0
Definition: ad9517.h:112
AD9517_REG_LVPECL_OUT3
#define AD9517_REG_LVPECL_OUT3
Definition: ad9517.h:95
ad9517_platform_data::diff_ref_en
uint8_t diff_ref_en
Definition: ad9517.h:312
ad9517_power_mode
int32_t ad9517_power_mode(struct ad9517_dev *dev, int32_t channel, int32_t mode)
Sets the power mode of the specified channel.
Definition: ad9517.c:825
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
ad9517_init_param::spi_init
struct no_os_spi_init_param spi_init
Definition: ad9517.h:398
AD9517_PLL_POWER_DOWN
#define AD9517_PLL_POWER_DOWN(x)
Definition: ad9517.h:146
ad9517_state::antibacklash_pulse_width
uint8_t antibacklash_pulse_width
Definition: ad9517.h:385
AD9517_SOFT_RESET
#define AD9517_SOFT_RESET
Definition: ad9517.h:136
ad9517_phase
int32_t ad9517_phase(struct ad9517_dev *dev, int32_t channel, int32_t phase)
Sets the phase on the specified channel.
Definition: ad9517.c:777
AD9517_USE_REF_SEL_PIN
#define AD9517_USE_REF_SEL_PIN
Definition: ad9517.h:194
AD9517_2
@ AD9517_2
Definition: ad9517.h:342
ad9517_power_mode
int32_t ad9517_power_mode(struct ad9517_dev *dev, int32_t channel, int32_t mode)
Sets the power mode of the specified channel.
Definition: ad9517.c:825
AD9517_REG_LVDS_CMOS_DIVIDER_3_0
#define AD9517_REG_LVDS_CMOS_DIVIDER_3_0
Definition: ad9517.h:117
ad9517_vco_frequency
int64_t ad9517_vco_frequency(struct ad9517_dev *dev, int64_t frequency)
Sets the VCO frequency.
Definition: ad9517.c:329
ad9517_platform_data::ext_clk_freq
int64_t ext_clk_freq
Definition: ad9517.h:320
ad9517_dev::ad9517_type
enum ad9517_type ad9517_type
Definition: ad9517.h:393
AD9517_REG_UPDATE_ALL_REGS
#define AD9517_REG_UPDATE_ALL_REGS
Definition: ad9517.h:131
ad9517_state::a_counter
uint8_t a_counter
Definition: ad9517.h:381
ad9517_frequency
int64_t ad9517_frequency(struct ad9517_dev *dev, int32_t channel, int64_t frequency)
Sets the frequency on the specified channel.
Definition: ad9517.c:476
AD9517_REG_LVDS_CMOS_DIVIDER_2_3
#define AD9517_REG_LVDS_CMOS_DIVIDER_2_3
Definition: ad9517.h:115
ad9517_platform_data::ref_1_freq
int32_t ref_1_freq
Definition: ad9517.h:310
AD9517_1
@ AD9517_1
Definition: ad9517.h:341
ad9517_platform_data::ref_1_power_on
uint8_t ref_1_power_on
Definition: ad9517.h:313
ad9517_setup
int32_t ad9517_setup(struct ad9517_dev **device, struct ad9517_init_param init_param)
Initializes the AD9517.
Definition: ad9517.c:52
LVDS_7mA
@ LVDS_7mA
Definition: ad9517.h:373
ad9517_read
int32_t ad9517_read(struct ad9517_dev *dev, uint32_t reg_addr, uint32_t *reg_value)
Reads data from a register.
Definition: ad9517.c:277
LVPECL_400mV
@ LVPECL_400mV
Definition: ad9517.h:348
AD9517_REG_LVDS_CMOS_DIVIDER_2_2
#define AD9517_REG_LVDS_CMOS_DIVIDER_2_2
Definition: ad9517.h:114
AD9517_CP_CURRENT
#define AD9517_CP_CURRENT(x)
Definition: ad9517.h:144
out_lvds_current_options
out_lvds_current_options
Definition: ad9517.h:369
ad9517_dev::spi_desc
struct no_os_spi_desc * spi_desc
Definition: ad9517.h:390
AD9517_REG_SERIAL_PORT_CONFIG
#define AD9517_REG_SERIAL_PORT_CONFIG
Definition: ad9517.h:58
AD9517_REG_PLL_CTRL_3
#define AD9517_REG_PLL_CTRL_3
Definition: ad9517.h:69
AD9517_OUT_LVPECL_DIFF_VOLTAGE
#define AD9517_OUT_LVPECL_DIFF_VOLTAGE(x)
Definition: ad9517.h:226
ad9517_platform_data
Definition: ad9517.h:308
AD9517_REG_A_COUNTER
#define AD9517_REG_A_COUNTER
Definition: ad9517.h:65
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
AD9517_MAX_PFD_FREQ
#define AD9517_MAX_PFD_FREQ
Definition: ad9517.h:300
LVDS_1_75mA
@ LVDS_1_75mA
Definition: ad9517.h:370
AD9517_REG_LVDS_CMOS_DIVIDER_3_1
#define AD9517_REG_LVDS_CMOS_DIVIDER_3_1
Definition: ad9517.h:118
ad9517_lvds_cmos_channel_spec::out_lvds_current
uint8_t out_lvds_current
Definition: ad9517.h:360
AD9517_UPDATE_ALL_REGS
#define AD9517_UPDATE_ALL_REGS
Definition: ad9517.h:290
AD9517_A_COUNTER
#define AD9517_A_COUNTER(x)
Definition: ad9517.h:152
ad9517_state::lvpecl_channels
struct ad9517_lvpecl_channel_spec * lvpecl_channels
Definition: ad9517.h:378
AD9517_REG_DIVIDER_0_1
#define AD9517_REG_DIVIDER_0_1
Definition: ad9517.h:105
AD9517_LOW_CYCLES_DIVIDER_2
#define AD9517_LOW_CYCLES_DIVIDER_2(x)
Definition: ad9517.h:260
AD9517_REG_LVDS_CMOS_OUT5
#define AD9517_REG_LVDS_CMOS_OUT5
Definition: ad9517.h:99
ad9517_phase
int32_t ad9517_phase(struct ad9517_dev *dev, int32_t channel, int32_t phase)
Sets the phase on the specified channel.
Definition: ad9517.c:777
ad9517_dev::ad9517_st
struct ad9517_state ad9517_st
Definition: ad9517.h:392
AD9517_REG_DIVIDER_1_1
#define AD9517_REG_DIVIDER_1_1
Definition: ad9517.h:108
ad9517_type
ad9517_type
Definition: ad9517.h:340
AD9517_2_MIN_VCO_FREQ
#define AD9517_2_MIN_VCO_FREQ
Definition: ad9517.h:294
AD9517_1_MIN_VCO_FREQ
#define AD9517_1_MIN_VCO_FREQ
Definition: ad9517.h:292
no_os_malloc
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:43
AD9517_VCO_DIVIDER
#define AD9517_VCO_DIVIDER(x)
Definition: ad9517.h:275
AD9517_REG_PLL_CTRL_7
#define AD9517_REG_PLL_CTRL_7
Definition: ad9517.h:73
ad9517_update
int32_t ad9517_update(struct ad9517_dev *dev)
Transfers the contents of the buffer registers into the active registers.
Definition: ad9517.c:313
ad9517_vco_frequency
int64_t ad9517_vco_frequency(struct ad9517_dev *dev, int64_t frequency)
Sets the VCO frequency.
Definition: ad9517.c:329
ad9517_lvds_cmos_channel_spec::channel_num
uint8_t channel_num
Definition: ad9517.h:356
AD9517_2_MAX_VCO_FREQ
#define AD9517_2_MAX_VCO_FREQ
Definition: ad9517.h:295
ad9517_platform_data::name
uint8_t name[16]
Definition: ad9517.h:329
AD9517_3
@ AD9517_3
Definition: ad9517.h:343
ad9517_setup
int32_t ad9517_setup(struct ad9517_dev **device, struct ad9517_init_param init_param)
Initializes the AD9517.
Definition: ad9517.c:52
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
ad9517_update
int32_t ad9517_update(struct ad9517_dev *dev)
Transfers the contents of the buffer registers into the active registers.
Definition: ad9517.c:313
AD9517_WRITE
#define AD9517_WRITE
Definition: ad9517.h:46
AD9517_REG_LVDS_CMOS_DIVIDER_3_2
#define AD9517_REG_LVDS_CMOS_DIVIDER_3_2
Definition: ad9517.h:119
AD9517_REG_LVDS_CMOS_DIVIDER_2_1
#define AD9517_REG_LVDS_CMOS_DIVIDER_2_1
Definition: ad9517.h:113
ad9517_platform_data::int_vco_freq
int64_t int_vco_freq
Definition: ad9517.h:323
AD9517_REF2_POWER_ON
#define AD9517_REF2_POWER_ON
Definition: ad9517.h:195
AD9517_REG_DIVIDER_1_0
#define AD9517_REG_DIVIDER_1_0
Definition: ad9517.h:107
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
CMOS
@ CMOS
Definition: ad9517.h:366
AD9517_4_MAX_VCO_FREQ
#define AD9517_4_MAX_VCO_FREQ
Definition: ad9517.h:299
AD9517_REG_INPUT_CLKS
#define AD9517_REG_INPUT_CLKS
Definition: ad9517.h:125
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
AD9517_REG_PLL_CTRL_1
#define AD9517_REG_PLL_CTRL_1
Definition: ad9517.h:67
LVPECL_780mV
@ LVPECL_780mV
Definition: ad9517.h:350
ad9517_state::prescaler_p
uint8_t prescaler_p
Definition: ad9517.h:384
ad9517_state::lvds_cmos_channels
struct ad9517_lvds_cmos_channel_spec * lvds_cmos_channels
Definition: ad9517.h:379
AD9517_BYPASS_DIVIDER_2
#define AD9517_BYPASS_DIVIDER_2
Definition: ad9517.h:264
AD9517_OUT_LVDS_OUTPUT_CURRENT
#define AD9517_OUT_LVDS_OUTPUT_CURRENT(x)
Definition: ad9517.h:233
ad9517_state
Definition: ad9517.h:376
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
AD9517_HIGH_CYCLES_DIVIDER_1
#define AD9517_HIGH_CYCLES_DIVIDER_1(x)
Definition: ad9517.h:253
AD9517_REG_PFD_CHARGE_PUMP
#define AD9517_REG_PFD_CHARGE_PUMP
Definition: ad9517.h:63
AD9517_POWER_DOWN_VCO_CLK
#define AD9517_POWER_DOWN_VCO_CLK
Definition: ad9517.h:280
ad9517_platform_data::ref_2_freq
int32_t ref_2_freq
Definition: ad9517.h:311
AD9517_DIVIDER_HIGH_CYCLES
#define AD9517_DIVIDER_HIGH_CYCLES(x)
Definition: ad9517.h:238
AD9517_OUT_LVDS_CMOS_INVERT
#define AD9517_OUT_LVDS_CMOS_INVERT(x)
Definition: ad9517.h:230
AD9517_OUT_LVPECL_INVERT
#define AD9517_OUT_LVPECL_INVERT
Definition: ad9517.h:225
AD9517_4
@ AD9517_4
Definition: ad9517.h:344
AD9517_OUT_LVPECL_POWER_DOWN
#define AD9517_OUT_LVPECL_POWER_DOWN(x)
Definition: ad9517.h:227
AD9517_HIGH_CYCLES_DIVIDER_2
#define AD9517_HIGH_CYCLES_DIVIDER_2(x)
Definition: ad9517.h:261
AD9517_PHASE_OFFSET_DIVIDER_2
#define AD9517_PHASE_OFFSET_DIVIDER_2(x)
Definition: ad9517.h:256
ad9517_lvds_cmos_channel_spec::cmos_b_en
uint8_t cmos_b_en
Definition: ad9517.h:359
AD9517_PHASE_OFFSET_DIVIDER_1
#define AD9517_PHASE_OFFSET_DIVIDER_1(x)
Definition: ad9517.h:257
errno.h
Error macro definition for ARM Compiler.
ad9517_platform_data::ref_sel_pin_en
uint8_t ref_sel_pin_en
Definition: ad9517.h:315
LVDS
@ LVDS
Definition: ad9517.h:365
AD9517_REG_LVPECL_OUT0
#define AD9517_REG_LVPECL_OUT0
Definition: ad9517.h:92
AD9517_LONG_INSTRUCTION
#define AD9517_LONG_INSTRUCTION
Definition: ad9517.h:137
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
AD9517_REG_LVPECL_OUT2
#define AD9517_REG_LVPECL_OUT2
Definition: ad9517.h:94
AD9517_REG_PART_ID
#define AD9517_REG_PART_ID
Definition: ad9517.h:59
ad9517_state::b_counter
uint16_t b_counter
Definition: ad9517.h:382