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