no-OS
ad9528.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef _AD9528_H_
34 #define _AD9528_H_
35 
36 /******************************************************************************/
37 /***************************** Include Files **********************************/
38 /******************************************************************************/
39 #include <stdint.h>
40 #include <stdbool.h>
41 #include "no_os_delay.h"
42 #include "no_os_spi.h"
43 #include "no_os_gpio.h"
44 
45 /******************************************************************************/
46 /****************************** AD9528 ****************************************/
47 /******************************************************************************/
48 /* Registers */
49 
50 #define AD9528_READ (1 << 15)
51 #define AD9528_WRITE (0 << 15)
52 #define AD9528_CNT(x) (((x) - 1) << 13)
53 #define AD9528_ADDR(x) ((x) & 0xFFF)
54 
55 #define AD9528_1B(x) ((1 << 16) | ((x) + 0))
56 #define AD9528_2B(x) ((2 << 16) | ((x) + 1))
57 #define AD9528_3B(x) ((3 << 16) | ((x) + 2))
58 #define AD9528_4B(x) ((4 << 16) | ((x) + 3))
59 #define AD9528_TRANSF_LEN(x) ((x) >> 16)
60 
61 #define AD9528_SERIAL_PORT_CONFIG AD9528_1B(0x0)
62 #define AD9528_SERIAL_PORT_CONFIG_B AD9528_1B(0x1)
63 #define AD9528_CHIP_ID AD9528_4B(0x3)
64 #define AD9528_IO_UPDATE AD9528_1B(0xF)
65 
66 #define AD9528_PLL1_REF_A_DIVIDER AD9528_2B(0x100)
67 #define AD9528_PLL1_REF_B_DIVIDER AD9528_2B(0x102)
68 #define AD9528_PLL1_FEEDBACK_DIVIDER AD9528_2B(0x104)
69 #define AD9528_PLL1_CHARGE_PUMP_CTRL AD9528_2B(0x106)
70 #define AD9528_PLL1_CTRL AD9528_3B(0x108)
71 
72 #define AD9528_PLL2_CHARGE_PUMP AD9528_1B(0x200)
73 #define AD9528_PLL2_FEEDBACK_DIVIDER_AB AD9528_1B(0x201)
74 #define AD9528_PLL2_CTRL AD9528_1B(0x202)
75 #define AD9528_PLL2_VCO_CTRL AD9528_1B(0x203)
76 #define AD9528_PLL2_VCO_DIVIDER AD9528_1B(0x204)
77 #define AD9528_PLL2_LOOP_FILTER_CTRL AD9528_2B(0x205)
78 #define AD9528_PLL2_R1_DIVIDER AD9528_1B(0x207)
79 #define AD9528_PLL2_N2_DIVIDER AD9528_1B(0x208)
80 
81 #define AD9528_CHANNEL_OUTPUT(ch) AD9528_3B(0x300 + 3 * ch)
82 #define AD9528_CHANNEL_SYNC AD9528_1B(0x32A)
83 #define AD9528_CHANNEL_SYNC_IGNORE AD9528_2B(0x32B)
84 
85 #define AD9528_SYSREF_RESAMPLE_CTRL AD9528_2B(0x32D)
86 
87 #define AD9528_SYSREF_K_DIVIDER AD9528_2B(0x400)
88 #define AD9528_SYSREF_CTRL AD9528_2B(0x402)
89 
90 #define AD9528_PD_EN AD9528_1B(0x500)
91 #define AD9528_CHANNEL_PD_EN AD9528_2B(0x501)
92 
93 #define AD9528_STAT_MON0 AD9528_1B(0x505)
94 #define AD9528_STAT_MON1 AD9528_1B(0x506)
95 #define AD9528_STAT_PIN_EN AD9528_1B(0x507)
96 #define AD9528_READBACK AD9528_2B(0x508)
97 
98 /* AD9528_SERIAL_PORT_CONFIG */
99 #define AD9528_SER_CONF_SOFT_RESET ((1 << 0) | (1 << 7))
100 #define AD9528_SER_CONF_LSB_FIRST ((1 << 1) | (1 << 6))
101 #define AD9528_SER_CONF_ADDR_INCREMENT ((1 << 2) | (1 << 5))
102 #define AD9528_SER_CONF_SDO_ACTIVE ((1 << 3) | (1 << 4))
103 
104 /* AD9528_SERIAL_PORT_CONFIG_B */
105 #define AD9528_SER_CONF_READ_BUFFERED (1 << 5)
106 #define AD9528_SER_CONF_RESET_SANS_REGMAP (1 << 2)
107 
108 /* AD9528_IO_UPDATE */
109 #define AD9528_IO_UPDATE_EN (1 << 0)
110 
111 /* AD9528_PLL1_CHARGE_PUMP_CTRL */
112 #define AD9528_PLL1_CHARGE_PUMP_AUTO_TRISTATE_DIS (1 << 12)
113 #define AD9528_PLL1_CHARGE_PUMP_MODE_NORMAL (3 << 8)
114 #define AD9528_PLL1_CHARGE_PUMP_MODE_PUMP_DOWN (2 << 8)
115 #define AD9528_PLL1_CHARGE_PUMP_MODE_PUMP_UP (1 << 8)
116 #define AD9528_PLL1_CHARGE_PUMP_MODE_TRISTATE (0 << 8)
117 #define AD9528_PLL1_CHARGE_PUMP_TRISTATE (1 << 7)
118 #define AD9528_PLL1_CHARGE_PUMP_CURRENT_nA(x) (((x) / 500) & 0x7F)
119 
120 /* AD9528_PLL1_CTRL */
121 #define AD9528_PLL1_OSC_CTRL_FAIL_VCC_BY2_EN (1 << 19)
122 #define AD9528_PLL1_REF_MODE(x) ((x) << 16)
123 #define AD9528_PLL1_FEEDBACK_BYPASS_EN (1 << 13)
124 #define AD9528_PLL1_REFB_BYPASS_EN (1 << 12)
125 #define AD9528_PLL1_REFA_BYPASS_EN (1 << 11)
126 #define AD9528_PLL1_SOURCE_VCXO (1 << 10)
127 #define AD9528_PLL1_REFB_CMOS_NEG_INP_EN (1 << 9)
128 #define AD9528_PLL1_REFA_CMOS_NEG_INP_EN (1 << 8)
129 #define AD9528_PLL1_FREQ_DETECTOR_PD_EN (1 << 7)
130 #define AD9528_PLL1_REFB_DIFF_RCV_EN (1 << 6)
131 #define AD9528_PLL1_REFA_DIFF_RCV_EN (1 << 5)
132 #define AD9528_PLL1_REFB_RCV_EN (1 << 4)
133 #define AD9528_PLL1_REFA_RCV_EN (1 << 3)
134 #define AD9528_PLL1_VCXO_RCV_PD_EN (1 << 2)
135 #define AD9528_PLL1_OSC_IN_CMOS_NEG_INP_EN (1 << 1)
136 #define AD9528_PLL1_OSC_IN_DIFF_EN (1 << 0)
137 
138 /* AD9528_PLL2_CHARGE_PUMP */
139 #define AD9528_PLL2_CHARGE_PUMP_CURRENT_nA(x) ((x) / 3500)
140 
141 /* AD9528_PLL2_FEEDBACK_DIVIDER_AB */
142 #define AD9528_PLL2_FB_NDIV_A_CNT(x) (((x) & 0x3) << 6)
143 #define AD9528_PLL2_FB_NDIV_B_CNT(x) (((x) & 0x3F) << 0)
144 #define AD9528_PLL2_FB_NDIV(a, b) (4 * (b) + (a))
145 
146 /* AD9528_PLL2_CTRL */
147 #define AD9528_PLL2_LOCK_DETECT_PWR_DOWN_EN (1 << 7)
148 #define AD9528_PLL2_FREQ_DOUBLER_EN (1 << 5)
149 #define AD9528_PLL2_CHARGE_PUMP_MODE_NORMAL (3 << 0)
150 #define AD9528_PLL2_CHARGE_PUMP_MODE_PUMP_DOWN (2 << 0)
151 #define AD9528_PLL2_CHARGE_PUMP_MODE_PUMP_UP (1 << 0)
152 #define AD9528_PLL2_CHARGE_PUMP_MODE_TRISTATE (0 << 0)
153 
154 /* AD9528_PLL2_VCO_CTRL */
155 #define AD9528_PLL2_DOUBLER_R1_EN (1 << 4)
156 #define AD9528_PLL2_FORCE_REFERENCE_VALID (1 << 2)
157 #define AD9528_PLL2_FORCE_VCO_MIDSCALE (1 << 1)
158 #define AD9528_PLL2_VCO_CALIBRATE (1 << 0)
159 
160 /* AD9528_PLL2_VCO_DIVIDER */
161 #define AD9528_PLL2_VCO_DIV_M1_PWR_DOWN_EN (1 << 3)
162 #define AD9528_PLL2_VCO_DIV_M1(x) (((x) & 0x7) << 0)
163 
164 /* AD9528_PLL2_LOOP_FILTER_CTRL */
165 #define AD9528_PLL2_LOOP_FILTER_RZERO_BYPASS_EN (1 << 8)
166 #define AD9528_PLL2_LOOP_FILTER_RPOLE2(x) (((x) & 0x3) << 6)
167 #define AD9528_PLL2_LOOP_FILTER_RZERO(x) (((x) & 0x7) << 3)
168 #define AD9528_PLL2_LOOP_FILTER_CPOLE1(x) (((x) & 0x7) << 0)
169 
170 /* AD9528_PLL2_R1_DIVIDER */
171 #define AD9528_PLL2_R1_DIV(x) (((x) & 0x1F) << 0)
172 
173 /* AD9528_PLL2_N2_DIVIDER */
174 #define AD9528_PLL2_N2_DIV(x) ((((x) - 1) & 0xFF) << 0)
175 
176 /* AD9528_CHANNEL_OUTPUT */
177 #define AD9528_CLK_DIST_DIV_MIN 1
178 #define AD9528_CLK_DIST_DIV_MAX 256
179 #define AD9528_CLK_DIST_DIV(x) ((((x) - 1) & 0xFF) << 16)
180 #define AD9528_CLK_DIST_DIV_MASK (0xFF << 16)
181 #define AD9528_CLK_DIST_DIV_REV(x) ((((x) >> 16) & 0xFF) + 1)
182 #define AD9528_CLK_DIST_DRIVER_MODE(x) (((x) & 0x3) << 14)
183 #define AD9528_CLK_DIST_DRIVER_MODE_REV(x) (((x) >> 14) & 0x3)
184 #define AD9528_CLK_DIST_DIV_PHASE(x) (((x) & 0x3F) << 8)
185 #define AD9528_CLK_DIST_DIV_PHASE_REV(x) (((x) >> 8) & 0x3F)
186 #define AD9528_CLK_DIST_CTRL(x) (((x) & 0x7) << 5)
187 #define AD9528_CLK_DIST_CTRL_MASK (0x7 << 5)
188 #define AD9528_CLK_DIST_CTRL_REV(x) (((x) >> 5) & 0x7)
189 
190 #if 0
191 /* Leftovers */
192 #define AD9528_CLK_DIST_INV_DIV_OUTPUT_EN (1 << 7)
193 #endif
194 
195 /* AD9528_CHANNEL_SYNC */
196 #define AD9528_CHANNEL_SYNC_SET (1 << 0)
197 
198 /* AD9528_CHANNEL_SYNC_IGNORE */
199 #define AD9528_CHANNEL_IGNORE_MASK(x) (((x) & 0x3FFF) << 0)
200 #define AD9528_CHANNEL_IGNORE_MASK_REV(x) (((x) >> 0) & 0x3FFF)
201 
202 /* AD9528_SYSREF_K_DIVIDER */
203 #define AD9528_SYSREF_K_DIV(x) (((x) & 0xFFFF) << 0)
204 #define AD9528_SYSREF_K_DIV_MIN (1u)
205 #define AD9528_SYSREF_K_DIV_MAX (65535u)
206 
207 /* AD9528_SYSREF_CTRL */
208 #define AD9528_SYSREF_SOURCE(x) (((x) & 0x3) << 14)
209 #define AD9528_SYSREF_PATTERN_MODE(x) (((x) & 0x3) << 12)
210 #define AD9528_SYSREF_NSHOT_MODE(x) (((x) & 0x7) << 9)
211 #define AD9528_SYSREF_PATTERN_REQ (1 << 8)
212 #define AD9528_SYSREF_REQUEST_BY_PIN (1 << 7)
213 #define AD9528_SYSREF_PATTERN_TRIGGER_CTRL(x) (((x) & 0x3) << 5)
214 #define AD9528_SYSREF_RESAMPLER_CLK_SRC_PLL1 (1 << 4)
215 #define AD9528_SYSREF_PATTERN_CLK_SRC_PLL1 (1 << 3)
216 #define AD9528_SYSREF_TEST_MODE(x) (((x) & 0x3) << 1)
217 #define AD9528_SYSREF_RESET (1 << 0)
218 
219 /* AD9528_PD_EN */
220 #define AD9528_PD_BIAS NO_OS_BIT(4)
221 #define AD9528_PD_PLL2 NO_OS_BIT(3)
222 #define AD9528_PD_PLL1 NO_OS_BIT(2)
223 #define AD9528_PD_OUT_CLOCKS NO_OS_BIT(1)
224 #define AD9528_PD_CHIP NO_OS_BIT(0)
225 
226 /* AD9528_CHANNEL_PD_EN */
227 #define AD9528_CHANNEL_PD_MASK(x) (((x) & 0x3FFF) << 0)
228 #define AD9528_CHANNEL_PD_MASK_REV(x) (((x) >> 0) & 0x3FFF)
229 
230 
231 /* AD9528_READBACK */
232 #define AD9528_IS_CALIBRATING (1 << 8)
233 #define AD9528_PLL2_OK (1 << 7)
234 #define AD9528_PLL1_OK (1 << 6)
235 #define AD9528_VCXO_OK (1 << 5)
236 #define AD9528_REFA_REFB_NOK (1 << 4)
237 #define AD9528_REFB_OK (1 << 3)
238 #define AD9528_REFA_OK (1 << 2)
239 #define AD9528_PLL2_LOCKED (1 << 1)
240 #define AD9528_PLL1_LOCKED (1 << 0)
241 
242 /* AD9528_STAT_PIN_EN */
243 #define AD9528_STAT0_PIN_EN (1 << 2)
244 #define AD9528_STAT1_PIN_EN (1 << 3)
245 #define AD9528_STAT0_DIV_EN (1 << 1)
246 #define AD9528_STAT1_DIV_EN (1 << 0)
247 
248 #define AD9528_NUM_CHAN 14
249 
250 #define AD9528_SPI_MAGIC 0x00FF05
251 
252 /* Output Driver Mode */
253 #define DRIVER_MODE_LVDS 0
254 #define DRIVER_MODE_LVDS_BOOST 1
255 #define DRIVER_MODE_HSTL 2
256 
257 /* Output Signal Source */
258 #define SOURCE_VCO 0
259 #define SOURCE_VCXO 1
260 #define SOURCE_SYSREF_VCO 2
261 #define SOURCE_SYSREF_VCXO 3
262 #define SOURCE_VCXO_INV 5
263 #define SOURCE_SYSREF_VCXO_INV 7
264 
265 /* Reference Selection Mode */
266 #define REF_MODE_STAY_ON_REFB 0
267 #define REF_MODE_REVERT_TO_REFA 1
268 #define REF_MODE_SELECT_REFA 2
269 #define REF_MODE_SELECT_REFB 3
270 #define REF_MODE_EXT_REF 4
271 
272 /* Sysref Source */
273 #define SYSREF_SRC_EXTERNAL 0
274 #define SYSREF_SRC_EXTERNAL_RESAMPLED 1
275 #define SYSREF_SRC_INTERNAL 2
276 
277 /* Sysref Pattern Mode */
278 #define SYSREF_PATTERN_NSHOT 0
279 #define SYSREF_PATTERN_CONTINUOUS 1
280 #define SYSREF_PATTERN_PRBS 2
281 #define SYSREF_PATTERN_STOP 3
282 
283 /* Sysref NSHOT Mode
284  * Use for adi,sysref-nshot-mode */
285 #define SYSREF_NSHOT_1_PULSE 1
286 #define SYSREF_NSHOT_2_PULSES 2
287 #define SYSREF_NSHOT_4_PULSES 3
288 #define SYSREF_NSHOT_6_PULSES 4
289 #define SYSREF_NSHOT_8_PULSES 5
290 
291 /* Sysref Trigger Mode
292  * Use for adi,sysref-request-trigger-mode */
293 #define SYSREF_LEVEL_HIGH 0
294 #define SYSREF_EDGE_RISING 2
295 #define SYSREF_EDGE_FALLING 3
296 
297 /* Rpole2 resistor */
298 #define RPOLE2_900_OHM 0
299 #define RPOLE2_450_OHM 1
300 #define RPOLE2_300_OHM 2
301 #define RPOLE2_225_OHM 3
302 
303 /* Rzero resistor */
304 #define RZERO_3250_OHM 0
305 #define RZERO_2750_OHM 1
306 #define RZERO_2250_OHM 2
307 #define RZERO_2100_OHM 3
308 #define RZERO_3000_OHM 4
309 #define RZERO_2500_OHM 5
310 #define RZERO_2000_OHM 6
311 #define RZERO_1850_OHM 7
312 
313 /* Cpole1 capacitor */
314 #define CPOLE1_0_PF 0
315 #define CPOLE1_8_PF 1
316 #define CPOLE1_16_PF 2
317 #define CPOLE1_24_PF 3
318 #define CPOLE1_32_PF 5
319 #define CPOLE1_40_PF 6
320 #define CPOLE1_48_PF 7
321 
322 /******************************************************************************/
323 /************************ Types Definitions ***********************************/
324 /******************************************************************************/
325 
332  uint8_t channel_num;
334  uint8_t sync_ignore_en;
336  uint8_t output_dis;
338  uint8_t driver_mode;
339  uint8_t signal_source;
343  uint8_t divider_phase;
345  uint16_t channel_divider;
347  int8_t extended_name[16];
348 };
349 
356  uint32_t vcxo_freq;
358  uint8_t spi3wire;
359 
361  uint8_t refa_en;
363  uint8_t refb_en;
364 
370  uint8_t osc_in_diff_en;
371 
372  /*
373  * Valid if differential input disabled
374  * if false defaults to pos input
375  */
382 
383  /* PLL1 Setting */
385  uint16_t refa_r_div;
387  uint16_t refb_r_div;
395  uint8_t pll1_bypass_en;
396 
397  /* Reference */
399  uint8_t ref_mode;
401  uint8_t sysref_src;
405  uint16_t sysref_k_div;
412 
415 
416  /* PLL2 Setting */
426  uint8_t pll2_r1_div;
428  uint8_t pll2_n2_div;
433 
434  /* Loop Filter PLL2 */
436  uint8_t rpole2;
438  uint8_t rzero;
440  uint8_t cpole1;
443 
444  /* Output Channel Configuration */
446  uint32_t num_channels;
449 
454 };
455 
456 enum {
466 };
467 
468 enum {
473 };
474 
475 struct ad9528_state {
477  uint32_t sysref_src_pll2;
478 };
479 
480 struct ad9528_dev {
481  /* SPI */
483  /* GPIO */
486  /* Device Settings */
489  /* CLK descriptors */
491 
492  struct jesd204_dev *jdev;
495 };
496 
498  /* SPI */
500  /* GPIO */
502  /* Device Settings */
505 };
506 
507 /* Helpers to avoid excess line breaks */
508 #define AD_IFE(_pde, _a, _b) ((dev->pdata->_pde) ? _a : _b)
509 #define AD_IF(_pde, _a) AD_IFE(_pde, _a, 0)
510 
511 /******************************************************************************/
512 /************************ Functions Declarations ******************************/
513 /******************************************************************************/
514 
515 int32_t ad9528_init(struct ad9528_init_param *init_param);
516 int32_t ad9528_setup(struct ad9528_dev **device,
518 int32_t ad9528_spi_read(struct ad9528_dev *dev,
519  uint32_t reg_addr,
520  uint32_t *reg_data);
521 int32_t ad9528_spi_write(struct ad9528_dev *dev,
522  uint32_t reg_addr,
523  uint32_t reg_data);
524 int32_t ad9528_spi_read_n(struct ad9528_dev *dev,
525  uint32_t reg_addr,
526  uint32_t *reg_data);
527 int32_t ad9528_spi_write_n(struct ad9528_dev *dev,
528  uint32_t reg_addr,
529  uint32_t reg_data);
530 int32_t ad9528_poll(struct ad9528_dev *dev,
531  uint32_t reg_addr,
532  uint32_t mask,
533  uint32_t data);
534 int32_t ad9528_io_update(struct ad9528_dev *dev);
535 int32_t ad9528_sync(struct ad9528_dev *dev);
536 uint32_t ad9528_clk_round_rate(struct ad9528_dev *dev, uint32_t chan,
537  uint32_t rate);
538 int32_t ad9528_clk_set_rate(struct ad9528_dev *dev, uint32_t chan,
539  uint32_t rate);
540 int32_t ad9528_reset(struct ad9528_dev *dev);
541 int32_t ad9528_remove(struct ad9528_dev *dev);
542 
543 #endif // __AD9528_H__
SYSREF_SRC_INTERNAL
#define SYSREF_SRC_INTERNAL
Definition: ad9528.h:275
ADI_ERR
ADI_ERR
Definition: common.h:34
AD9528_CLK_DIST_CTRL_MASK
#define AD9528_CLK_DIST_CTRL_MASK
Definition: ad9528.h:187
AD9528_ADDR_STATUS0_CTRL
#define AD9528_ADDR_STATUS0_CTRL
Definition: t_ad9528.h:69
ad9528_platform_data::jdev_max_sysref_freq
uint32_t jdev_max_sysref_freq
Definition: ad9528.h:413
DIFFERENTIAL
@ DIFFERENTIAL
Definition: t_ad9528.h:94
ad9528_platform_data::refb_cmos_neg_inp_en
uint8_t refb_cmos_neg_inp_en
Definition: ad9528.h:379
ad9528_channel_spec::channel_divider
uint16_t channel_divider
Definition: ad9528.h:345
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
ad9528_platform_data::rzero_bypass_en
uint8_t rzero_bypass_en
Definition: ad9528.h:442
AD9528_CHANNEL_PD_EN
#define AD9528_CHANNEL_PD_EN
Definition: ad9528.h:91
ADIERR_OK
@ ADIERR_OK
Definition: common.h:35
AD9528_STAT_PLL2_LD
@ AD9528_STAT_PLL2_LD
Definition: ad9528.h:458
ad9528_dev::pdata
struct ad9528_platform_data * pdata
Definition: ad9528.h:488
AD9528_ADDR_STATUS1_CTRL
#define AD9528_ADDR_STATUS1_CTRL
Definition: t_ad9528.h:70
AD9528_ADDR_INPUT_RECEIVERS1
#define AD9528_ADDR_INPUT_RECEIVERS1
Definition: t_ad9528.h:33
AD9528_ADDR_CH_POWERDOWN1
#define AD9528_ADDR_CH_POWERDOWN1
Definition: t_ad9528.h:65
ad9528_dev::jdev_lmfc_lemc_gcd
uint32_t jdev_lmfc_lemc_gcd
Definition: ad9528.h:494
ad9528_platform_data::refa_cmos_neg_inp_en
uint8_t refa_cmos_neg_inp_en
Definition: ad9528.h:377
NSHOT
@ NSHOT
Definition: t_ad9528.h:144
AD9528_PLL2_LOOP_FILTER_RPOLE2
#define AD9528_PLL2_LOOP_FILTER_RPOLE2(x)
Definition: ad9528.h:166
AD9528_PLL1_CHARGE_PUMP_MODE_NORMAL
#define AD9528_PLL1_CHARGE_PUMP_MODE_NORMAL
Definition: ad9528.h:113
AD9528_ADDR_MASK_SYNC2
#define AD9528_ADDR_MASK_SYNC2
Definition: t_ad9528.h:54
AD9528_IO_UPDATE_EN
#define AD9528_IO_UPDATE_EN
Definition: ad9528.h:109
CHANNEL_DIV
@ CHANNEL_DIV
Definition: t_ad9528.h:80
AD9528_PD_BIAS
#define AD9528_PD_BIAS
Definition: ad9528.h:220
AD9528_PLL2_VCO_CTRL
#define AD9528_PLL2_VCO_CTRL
Definition: ad9528.h:75
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
JESD204_STATE_OP_REASON_INIT
@ JESD204_STATE_OP_REASON_INIT
Definition: jesd204.h:148
AD9528_CLK_DIST_DIV
#define AD9528_CLK_DIST_DIV(x)
Definition: ad9528.h:179
AD9528_SYSREF_K_DIV_MIN
#define AD9528_SYSREF_K_DIV_MIN
Definition: ad9528.h:204
no_os_clk_init_param::platform_ops
const struct no_os_clk_platform_ops * platform_ops
Definition: no_os_clk.h:50
AD9528_IS_CALIBRATING
#define AD9528_IS_CALIBRATING
Definition: ad9528.h:232
AD9528_PLL1_CTRL
#define AD9528_PLL1_CTRL
Definition: ad9528.h:70
CMB_writeToLog
commonErr_t CMB_writeToLog(ADI_LOGLEVEL level, uint8_t deviceIndex, uint32_t errorCode, const char *comment)
Definition: common.c:250
sysrefNshotMode_t
sysrefNshotMode_t
Enum to select the SYSREF output # of pulses for NSHOT mode.
Definition: t_ad9528.h:154
AD9528_PLL2_VCO_DIV_M1_PWR_DOWN_EN
#define AD9528_PLL2_VCO_DIV_M1_PWR_DOWN_EN
Definition: ad9528.h:161
no_os_spi.h
Header file of SPI Interface.
AD9528_ADDR_STATUS_READBACK0
#define AD9528_ADDR_STATUS_READBACK0
Definition: t_ad9528.h:72
ad9528_spi_write_n
int32_t ad9528_spi_write_n(struct ad9528_dev *dev, uint32_t reg_addr, uint32_t reg_data)
Writes a value to the selected register.
Definition: ad9528.c:173
RPOLE2_900_OHM
@ RPOLE2_900_OHM
Definition: ad9523.h:336
ad9528_platform_data::pll2_charge_pump_current_nA
uint32_t pll2_charge_pump_current_nA
Definition: ad9528.h:418
ad9528_channel_spec
Output channel configuration.
Definition: ad9528.h:330
AD9528_ADDR_PLL2_LF_CTRL1
#define AD9528_ADDR_PLL2_LF_CTRL1
Definition: t_ad9528.h:43
AD9528_STAT_REFB
@ AD9528_STAT_REFB
Definition: ad9528.h:460
AD9528_SYSREF_RESAMPLE_CTRL
#define AD9528_SYSREF_RESAMPLE_CTRL
Definition: ad9528.h:85
ONE_PULSE
@ ONE_PULSE
Definition: t_ad9528.h:156
ad9528_platform_data::pll2_bypass_en
bool pll2_bypass_en
Definition: ad9528.h:432
ad9528_reset
int32_t ad9528_reset(struct ad9528_dev *dev)
Performs a hard reset on the AD9528.
Definition: ad9528.c:1292
ADIHAL_LOG_ERROR
@ ADIHAL_LOG_ERROR
Definition: common.h:51
AD9528_ADDR_SYSERF_DIV_MSB
#define AD9528_ADDR_SYSERF_DIV_MSB
Definition: t_ad9528.h:59
AD9528_ADDR_PLL2_REPLICA_DIV_PHASE
#define AD9528_ADDR_PLL2_REPLICA_DIV_PHASE
Definition: t_ad9528.h:47
ad9528_platform_data::num_channels
uint32_t num_channels
Definition: ad9528.h:446
AD9528_VCXO
@ AD9528_VCXO
Definition: ad9528.h:470
ad9528_setup
int32_t ad9528_setup(struct ad9528_dev **device, struct ad9528_init_param init_param)
Initializes the AD9528.
Definition: ad9528.c:702
JESD204_STATE_OP_MODE_PER_DEVICE
@ JESD204_STATE_OP_MODE_PER_DEVICE
Definition: jesd204.h:176
no_os_delay.h
Header file of Delay functions.
no_os_clk_init_param::name
const char * name
Definition: no_os_clk.h:46
ad9528_clk_set_rate
int32_t ad9528_clk_set_rate(struct ad9528_dev *dev, uint32_t chan, uint32_t rate)
Set channel rate.
Definition: ad9528.c:1222
jesd204_state_op_reason
jesd204_state_op_reason
Definition: jesd204.h:147
ad9528_platform_data::refa_en
uint8_t refa_en
Definition: ad9528.h:361
ad9528_platform_data::pll2_r1_div
uint8_t pll2_r1_div
Definition: ad9528.h:426
AD9528_ADDR_SYSERF_DIV_LSB
#define AD9528_ADDR_SYSERF_DIV_LSB
Definition: t_ad9528.h:58
AD9528_STAT1_PIN_EN
#define AD9528_STAT1_PIN_EN
Definition: ad9528.h:244
AD9528_PLL2_VCO_DIVIDER
#define AD9528_PLL2_VCO_DIVIDER
Definition: ad9528.h:76
AD9528_SYSREF_CTRL
#define AD9528_SYSREF_CTRL
Definition: ad9528.h:88
no_os_clk_init
int32_t no_os_clk_init(struct no_os_clk_desc **desc, const struct no_os_clk_init_param *param)
AD9528_ADDR_MASK_SYNC1
#define AD9528_ADDR_MASK_SYNC1
Definition: t_ad9528.h:53
AD9528_PLL1_CHARGE_PUMP_CURRENT_nA
#define AD9528_PLL1_CHARGE_PUMP_CURRENT_nA(x)
Definition: ad9528.h:118
AD9528_PLL2_DOUBLER_R1_EN
#define AD9528_PLL2_DOUBLER_R1_EN
Definition: ad9528.h:155
AD9528_TRANSF_LEN
#define AD9528_TRANSF_LEN(x)
Definition: ad9528.h:59
ad9528_platform_data::spi3wire
uint8_t spi3wire
Definition: ad9528.h:358
CMB_hasTimeoutExpired
commonErr_t CMB_hasTimeoutExpired()
Definition: common.c:319
ad9528_clk_set_rate
int32_t ad9528_clk_set_rate(struct ad9528_dev *dev, uint32_t chan, uint32_t rate)
Set channel rate.
Definition: ad9528.c:1222
device
Definition: ad9361_util.h:69
AD9528_ADDR_PLL2_REPLICA_CHDIV
#define AD9528_ADDR_PLL2_REPLICA_CHDIV
Definition: t_ad9528.h:46
ad9528_init_param
Definition: ad9528.h:497
no_os_print_log.h
Print messages helpers.
ADIERR_INV_PARM
@ ADIERR_INV_PARM
Definition: common.h:36
AD9528_SYSREF
@ AD9528_SYSREF
Definition: ad9528.h:471
AD9528_CLK_DIST_DRIVER_MODE
#define AD9528_CLK_DIST_DRIVER_MODE(x)
Definition: ad9528.h:182
CMB_setTimeout_ms
commonErr_t CMB_setTimeout_ms(uint32_t timeOut_ms)
Definition: common.c:301
ad9528_spi_write_n
int32_t ad9528_spi_write_n(struct ad9528_dev *dev, uint32_t reg_addr, uint32_t reg_data)
Writes a value to the selected register.
Definition: ad9528.c:173
AD9528_ADDR_SYSREF_CTRL5
#define AD9528_ADDR_SYSREF_CTRL5
Definition: t_ad9528.h:62
AD9528_PLL2_N2_DIVIDER
#define AD9528_PLL2_N2_DIVIDER
Definition: ad9528.h:79
ad9528_spi_write
int32_t ad9528_spi_write(struct ad9528_dev *dev, uint32_t reg_addr, uint32_t reg_data)
Writes a value to the selected register.
Definition: ad9528.c:108
no_os_clk_platform_ops::clk_recalc_rate
int(* clk_recalc_rate)(struct no_os_clk_desc *, uint64_t *)
Definition: no_os_clk.h:99
ad9528_platform_data::rpole2
uint8_t rpole2
Definition: ad9528.h:436
jesd204_dev_unregister
int jesd204_dev_unregister(struct jesd204_dev *jdev)
AD9528_ADDR_PLL2_VCO_CTRL
#define AD9528_ADDR_PLL2_VCO_CTRL
Definition: t_ad9528.h:41
ad9528_dev::sysref_req_gpio
struct no_os_gpio_desc * sysref_req_gpio
Definition: ad9528.h:485
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
AD9528_STAT_REFA
@ AD9528_STAT_REFA
Definition: ad9528.h:459
ad9528_clk_round_rate
uint32_t ad9528_clk_round_rate(struct ad9528_dev *dev, uint32_t chan, uint32_t rate)
Calculate closest possible rate.
Definition: ad9528.c:1186
AD9528_IO_UPDATE
#define AD9528_IO_UPDATE
Definition: ad9528.h:64
DRIVER_MODE_LVDS
#define DRIVER_MODE_LVDS
Definition: ad9528.h:253
ad9528_sync
int32_t ad9528_sync(struct ad9528_dev *dev)
Updates the AD9528 configuration.
Definition: ad9528.c:250
AD9528_PLL1_REFB_BYPASS_EN
#define AD9528_PLL1_REFB_BYPASS_EN
Definition: ad9528.h:124
AD9528_ADDR_LDO_ENABLES1
#define AD9528_ADDR_LDO_ENABLES1
Definition: t_ad9528.h:67
AD9528_ADDR_PLL1_CHARGEPUMP
#define AD9528_ADDR_PLL1_CHARGEPUMP
Definition: t_ad9528.h:31
CPOLE1_16_PF
@ CPOLE1_16_PF
Definition: ad9523.h:356
ADIHAL_LOG_MESSAGE
@ ADIHAL_LOG_MESSAGE
Definition: common.h:49
JESD204_OP_CLK_SYNC_STAGE1
@ JESD204_OP_CLK_SYNC_STAGE1
Definition: jesd204.h:201
AD9528_SYSREF_PATTERN_TRIGGER_CTRL
#define AD9528_SYSREF_PATTERN_TRIGGER_CTRL(x)
Definition: ad9528.h:213
AD9528_PLL2_LOCKED
#define AD9528_PLL2_LOCKED
Definition: ad9528.h:239
AD9528_SYSREF_K_DIVIDER
#define AD9528_SYSREF_K_DIVIDER
Definition: ad9528.h:87
ad9528_platform_data::sysref_req_en
bool sysref_req_en
Definition: ad9528.h:411
AD9528_PLL1_REF_MODE
#define AD9528_PLL1_REF_MODE(x)
Definition: ad9528.h:122
ad9528_platform_data::sysref_req_trigger_mode
uint8_t sysref_req_trigger_mode
Definition: ad9528.h:409
AD9528_NUM_CLK_SRC
@ AD9528_NUM_CLK_SRC
Definition: ad9528.h:472
AD9528_ADDR_CH_OUT0_CHDIV
#define AD9528_ADDR_CH_OUT0_CHDIV
Definition: t_ad9528.h:51
jesd204_dev_priv
void * jesd204_dev_priv(struct jesd204_dev *jdev)
AD9528_PLL2_R1_DIV
#define AD9528_PLL2_R1_DIV(x)
Definition: ad9528.h:171
AD9528_ADDR_PLL2_CTRL
#define AD9528_ADDR_PLL2_CTRL
Definition: t_ad9528.h:40
ADIERR_FAILED
@ ADIERR_FAILED
Definition: common.h:37
LEVEL_ACTIVE_HIGH
@ LEVEL_ACTIVE_HIGH
Definition: t_ad9528.h:150
CMB_SPIWriteByte
commonErr_t CMB_SPIWriteByte(spiSettings_t *spiSettings, uint16_t addr, uint8_t data)
Definition: common.c:173
no_os_clk.h
Header file of Clock Driver.
ad9528_platform_data::sysref_k_div
uint16_t sysref_k_div
Definition: ad9528.h:405
AD9528_CHIP_ID
#define AD9528_CHIP_ID
Definition: ad9528.h:63
AD9528_PLL2_FB_NDIV_B_CNT
#define AD9528_PLL2_FB_NDIV_B_CNT(x)
Definition: ad9528.h:143
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
AD9528_PLL2_CHARGE_PUMP
#define AD9528_PLL2_CHARGE_PUMP
Definition: ad9528.h:72
AD9528_PLL1_CHARGE_PUMP_AUTO_TRISTATE_DIS
#define AD9528_PLL1_CHARGE_PUMP_AUTO_TRISTATE_DIS
Definition: ad9528.h:112
ad9528_poll
int32_t ad9528_poll(struct ad9528_dev *dev, uint32_t reg_addr, uint32_t mask, uint32_t data)
Poll register.
Definition: ad9528.c:206
ad9528_dev::jdev_lmfc_lemc_rate
uint32_t jdev_lmfc_lemc_rate
Definition: ad9528.h:493
ad9528_platform_data::vcxo_freq
uint32_t vcxo_freq
Definition: ad9528.h:356
no_os_min
#define no_os_min(x, y)
Definition: no_os_util.h:59
AD_IF
#define AD_IF(_pde, _a)
Definition: ad9523.c:45
AD9528_SPI_MAGIC
#define AD9528_SPI_MAGIC
Definition: ad9528.h:250
AD9528_ADDR_CH_POWERDOWN2
#define AD9528_ADDR_CH_POWERDOWN2
Definition: t_ad9528.h:66
ad9528_platform_data::pll2_vco_div_m1
uint8_t pll2_vco_div_m1
Definition: ad9528.h:430
ad9528_calc_out_div
uint32_t ad9528_calc_out_div(uint32_t rate, uint32_t parent_rate)
Calculate the output channel divider.
Definition: ad9528.c:1162
ad9528_platform_data::osc_in_cmos_neg_inp_en
uint8_t osc_in_cmos_neg_inp_en
Definition: ad9528.h:381
no_os_error.h
Error codes definition.
AD9528_ADDR_INPUT_RECEIVERS3
#define AD9528_ADDR_INPUT_RECEIVERS3
Definition: t_ad9528.h:35
ad9528_platform_data::sysref_nshot_mode
uint8_t sysref_nshot_mode
Definition: ad9528.h:407
AD9528_SER_CONF_READ_BUFFERED
#define AD9528_SER_CONF_READ_BUFFERED
Definition: ad9528.h:105
pr_debug
#define pr_debug(fmt, args...)
Definition: no_os_print_log.h:129
AD9528_PLL2_LOOP_FILTER_RZERO_BYPASS_EN
#define AD9528_PLL2_LOOP_FILTER_RZERO_BYPASS_EN
Definition: ad9528.h:165
AD9528_PLL2_CHARGE_PUMP_CURRENT_nA
#define AD9528_PLL2_CHARGE_PUMP_CURRENT_nA(x)
Definition: ad9528.h:139
AD9528_PLL2_R1_DIVIDER
#define AD9528_PLL2_R1_DIVIDER
Definition: ad9528.h:78
ad9528_platform_data::refb_r_div
uint16_t refb_r_div
Definition: ad9528.h:387
AD9528_VCXO_OK
#define AD9528_VCXO_OK
Definition: ad9528.h:235
ad9528Device_t
Structure to hold AD9528 settings.
Definition: t_ad9528.h:179
ad9528_jesd204_priv::device
struct ad9528_dev * device
Definition: ad9528.c:49
ad9528_platform_data::refb_diff_rcv_en
uint8_t refb_diff_rcv_en
Definition: ad9528.h:368
AD9528_PLL2_CHARGE_PUMP_MODE_TRISTATE
#define AD9528_PLL2_CHARGE_PUMP_MODE_TRISTATE
Definition: ad9528.h:152
jesd204.h
ad9528_platform_data::pll2_ndiv_a_cnt
uint8_t pll2_ndiv_a_cnt
Definition: ad9528.h:420
AD9528_STAT_PLL1_FB_CLK
@ AD9528_STAT_PLL1_FB_CLK
Definition: ad9528.h:463
ad9528_init_param::gpio_resetb
struct no_os_gpio_init_param * gpio_resetb
Definition: ad9528.h:501
AD9528_PLL2_LOOP_FILTER_CPOLE1
#define AD9528_PLL2_LOOP_FILTER_CPOLE1(x)
Definition: ad9528.h:168
ad9528_spi_read_n
int32_t ad9528_spi_read_n(struct ad9528_dev *dev, uint32_t reg_addr, uint32_t *reg_data)
Reads the value of the selected register.
Definition: ad9528.c:137
AD9528_ADDR_REF_B_DIVIDER_MSB
#define AD9528_ADDR_REF_B_DIVIDER_MSB
Definition: t_ad9528.h:28
ad9528_platform_data::pll1_feedback_src_vcxo
uint8_t pll1_feedback_src_vcxo
Definition: ad9528.h:391
jesd204_link_get_lmfc_lemc_rate
int jesd204_link_get_lmfc_lemc_rate(struct jesd204_link *lnk, unsigned long *rate_hz)
ad9528_spi_read
int32_t ad9528_spi_read(struct ad9528_dev *dev, uint32_t reg_addr, uint32_t *reg_data)
Reads the value of the selected register.
Definition: ad9528.c:78
AD9528_PLL2_VCO_DIV_M1
#define AD9528_PLL2_VCO_DIV_M1(x)
Definition: ad9528.h:162
AD9528_SER_CONF_SDO_ACTIVE
#define AD9528_SER_CONF_SDO_ACTIVE
Definition: ad9528.h:102
ad9528_platform_data::osc_in_diff_en
uint8_t osc_in_diff_en
Definition: ad9528.h:370
AD9528_STAT_PLL2_FB_CLK
@ AD9528_STAT_PLL2_FB_CLK
Definition: ad9528.h:464
no_os_clk_desc::hw_ch_num
uint8_t hw_ch_num
Definition: no_os_clk.h:79
AD9528_ADDR_PLL2_VCO_DIV
#define AD9528_ADDR_PLL2_VCO_DIV
Definition: t_ad9528.h:42
ad9528_poll
int32_t ad9528_poll(struct ad9528_dev *dev, uint32_t reg_addr, uint32_t mask, uint32_t data)
Poll register.
Definition: ad9528.c:206
ad9528_clk_round_rate
uint32_t ad9528_clk_round_rate(struct ad9528_dev *dev, uint32_t chan, uint32_t rate)
Calculate closest possible rate.
Definition: ad9528.c:1186
AD9528_ADDR_REF_A_DIVIDER_LSB
#define AD9528_ADDR_REF_A_DIVIDER_LSB
Definition: t_ad9528.h:25
ad9528_platform_data
platform specific information
Definition: ad9528.h:354
AD9528_readPllStatus
ADI_ERR AD9528_readPllStatus(ad9528Device_t *device, uint8_t *status)
Reads the Lock Status of the PLLs and present detect of the reference clocks.
Definition: ad9528.c:629
AD9528_PLL1_FEEDBACK_DIVIDER
#define AD9528_PLL1_FEEDBACK_DIVIDER
Definition: ad9528.h:68
ad9528_sync
int32_t ad9528_sync(struct ad9528_dev *dev)
Updates the AD9528 configuration.
Definition: ad9528.c:250
no_os_clk_desc
Structure holding CLK descriptor.
Definition: no_os_clk.h:75
CMB_SPIWriteField
commonErr_t CMB_SPIWriteField(spiSettings_t *spiSettings, uint16_t addr, uint8_t field_val, uint8_t mask, uint8_t start_bit)
Definition: common.c:219
ad9528_dev::jdev
struct jesd204_dev * jdev
Definition: ad9528.h:492
SYSREF_PATTERN_CONTINUOUS
#define SYSREF_PATTERN_CONTINUOUS
Definition: ad9528.h:279
AD9528_PLL1_OSC_IN_CMOS_NEG_INP_EN
#define AD9528_PLL1_OSC_IN_CMOS_NEG_INP_EN
Definition: ad9528.h:135
ad9528_channel_spec::extended_name
int8_t extended_name[16]
Definition: ad9528.h:347
AD9528_CLK_DIST_DIV_PHASE
#define AD9528_CLK_DIST_DIV_PHASE(x)
Definition: ad9528.h:184
ad9528_platform_data::rzero
uint8_t rzero
Definition: ad9528.h:438
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
AD9528_CLK_DIST_DIV_MAX
#define AD9528_CLK_DIST_DIV_MAX
Definition: ad9528.h:178
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
ad9528_platform_data::ref_mode
uint8_t ref_mode
Definition: ad9528.h:399
AD9528_ADDR_PLL2_CHARGEPUMP
#define AD9528_ADDR_PLL2_CHARGEPUMP
Definition: t_ad9528.h:38
AD9528_PLL1_REFA_BYPASS_EN
#define AD9528_PLL1_REFA_BYPASS_EN
Definition: ad9528.h:125
no_os_clk_init_param::dev_desc
void * dev_desc
Definition: no_os_clk.h:52
no_os_clamp
#define no_os_clamp(val, min_val, max_val)
Definition: no_os_util.h:69
ad9528_reset
int32_t ad9528_reset(struct ad9528_dev *dev)
Performs a hard reset on the AD9528.
Definition: ad9528.c:1292
AD9528_ADDR_PLL2_RDIV
#define AD9528_ADDR_PLL2_RDIV
Definition: t_ad9528.h:45
no_os_div_u64_rem
uint64_t no_os_div_u64_rem(uint64_t dividend, uint32_t divisor, uint32_t *remainder)
ad9528_state::vco_out_freq
uint32_t vco_out_freq[AD9528_NUM_CLK_SRC]
Definition: ad9528.h:476
AD9528_VCO
@ AD9528_VCO
Definition: ad9528.h:469
ad9528_platform_data::sysref_pattern_mode
uint8_t sysref_pattern_mode
Definition: ad9528.h:403
AD9528_ADDR_ADI_SPI_CONFIG_B
#define AD9528_ADDR_ADI_SPI_CONFIG_B
Definition: t_ad9528.h:22
AD9528_ADDR_PLL1_N_DIV_LSB
#define AD9528_ADDR_PLL1_N_DIV_LSB
Definition: t_ad9528.h:29
ad9528_init_param::spi_init
struct no_os_spi_init_param spi_init
Definition: ad9528.h:499
no_os_greatest_common_divisor
uint32_t no_os_greatest_common_divisor(uint32_t a, uint32_t b)
no_os_gpio_desc
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
ad9528_init
int32_t ad9528_init(struct ad9528_init_param *init_param)
Initializes the AD9528.
Definition: ad9528.c:299
AD9528_PLL2_FREQ_DOUBLER_EN
#define AD9528_PLL2_FREQ_DOUBLER_EN
Definition: ad9528.h:148
AD9528_PLL2_FEEDBACK_DIVIDER_AB
#define AD9528_PLL2_FEEDBACK_DIVIDER_AB
Definition: ad9528.h:73
AD9528_ADDR_PLL1_CP_CTRL2
#define AD9528_ADDR_PLL1_CP_CTRL2
Definition: t_ad9528.h:32
no_os_clk_init_param
Definition: no_os_clk.h:44
ad9528_state
Definition: ad9528.h:475
AD9528_ADDR_EN_OUTPUT_PATH_SEL1
#define AD9528_ADDR_EN_OUTPUT_PATH_SEL1
Definition: t_ad9528.h:55
no_os_rational_best_approximation
void no_os_rational_best_approximation(uint32_t given_numerator, uint32_t given_denominator, uint32_t max_numerator, uint32_t max_denominator, uint32_t *best_numerator, uint32_t *best_denominator)
AD9528_waitForPllLock
ADI_ERR AD9528_waitForPllLock(ad9528Device_t *device)
Waits for PLL1 and PLL2 to lock and the REFA and VCXO clocks to be present.
Definition: ad9528.c:597
AD9528_SYSREF_K_DIV
#define AD9528_SYSREF_K_DIV(x)
Definition: ad9528.h:203
AD9528_ADDR_PLL1_N_DIV_MSB
#define AD9528_ADDR_PLL1_N_DIV_MSB
Definition: t_ad9528.h:30
JESD204_OP_LINK_PRE_SETUP
@ JESD204_OP_LINK_PRE_SETUP
Definition: jesd204.h:200
AD9528_PD_PLL1
#define AD9528_PD_PLL1
Definition: ad9528.h:222
SINGLE_ENDED
@ SINGLE_ENDED
Definition: t_ad9528.h:94
AD9528_resetDevice
ADI_ERR AD9528_resetDevice(ad9528Device_t *device)
Performs a hard reset on the AD9528 DUT.
Definition: ad9528.c:26
JESD204_SUBCLASS_0
@ JESD204_SUBCLASS_0
Definition: jesd204.h:16
AD_IFE
#define AD_IFE(_pde, _a, _b)
Definition: ad9523.c:44
AD9528_setSpiSettings
ADI_ERR AD9528_setSpiSettings(ad9528Device_t *device)
Sets the AD9528 device SPI settings (3wire/4wire, MSBFirst, etc).
Definition: ad9528.c:56
AD9528_ADDR_LDO_ENABLES2
#define AD9528_ADDR_LDO_ENABLES2
Definition: t_ad9528.h:68
AD9528_PD_PLL2
#define AD9528_PD_PLL2
Definition: ad9528.h:221
AD9528_ADDR_SYSREF_CTRL4
#define AD9528_ADDR_SYSREF_CTRL4
Definition: t_ad9528.h:61
AD9528_CLK_DIST_DIV_MASK
#define AD9528_CLK_DIST_DIV_MASK
Definition: ad9528.h:180
AD9528_CHANNEL_OUTPUT
#define AD9528_CHANNEL_OUTPUT(ch)
Definition: ad9528.h:81
SYSREF_SRC_EXTERNAL
#define SYSREF_SRC_EXTERNAL
Definition: ad9528.h:273
AD9528_ADDR_INPUT_RECEIVERS2
#define AD9528_ADDR_INPUT_RECEIVERS2
Definition: t_ad9528.h:34
ad9528_platform_data::cpole1
uint8_t cpole1
Definition: ad9528.h:440
ad9528_platform_data::pll2_n2_div
uint8_t pll2_n2_div
Definition: ad9528.h:428
no_os_clamp_t
#define no_os_clamp_t(type, val, min_val, max_val)
Definition: no_os_util.h:71
AD9528_PLL1_CHARGE_PUMP_CTRL
#define AD9528_PLL1_CHARGE_PUMP_CTRL
Definition: ad9528.h:69
SOURCE_VCO
#define SOURCE_VCO
Definition: ad9528.h:258
ad9528_init_param::export_no_os_clk
bool export_no_os_clk
Definition: ad9528.h:504
ad9528_spi_write
int32_t ad9528_spi_write(struct ad9528_dev *dev, uint32_t reg_addr, uint32_t reg_data)
Writes a value to the selected register.
Definition: ad9528.c:108
AD9528_CHANNEL_SYNC_IGNORE
#define AD9528_CHANNEL_SYNC_IGNORE
Definition: ad9528.h:83
ad9528_platform_data::jdev_desired_sysref_freq
uint32_t jdev_desired_sysref_freq
Definition: ad9528.h:414
AD9528_CHANNEL_SYNC
#define AD9528_CHANNEL_SYNC
Definition: ad9528.h:82
AD9528_PLL1_REFB_RCV_EN
#define AD9528_PLL1_REFB_RCV_EN
Definition: ad9528.h:132
AD9528_ADDR_REF_B_DIVIDER_LSB
#define AD9528_ADDR_REF_B_DIVIDER_LSB
Definition: t_ad9528.h:27
ad9528_platform_data::refa_r_div
uint16_t refa_r_div
Definition: ad9528.h:385
AD9528_CLK_DIST_DIV_REV
#define AD9528_CLK_DIST_DIV_REV(x)
Definition: ad9528.h:181
CMB_hardReset
commonErr_t CMB_hardReset(uint8_t spiChipSelectIndex)
Definition: common.c:138
NO_OS_BIT
#define NO_OS_BIT(x)
Definition: no_os_util.h:45
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
ad9528_dev
Definition: ad9528.h:480
ad9528_remove
int32_t ad9528_remove(struct ad9528_dev *dev)
Free the resources allocated by ad9528_setup().
Definition: ad9528.c:1123
AD9528_PLL1_REF_B_DIVIDER
#define AD9528_PLL1_REF_B_DIVIDER
Definition: ad9528.h:67
no_os_clk_platform_ops
Structure holding CLK function pointers that point to the platform specific function.
Definition: no_os_clk.h:91
AD9528_PLL1_REF_A_DIVIDER
#define AD9528_PLL1_REF_A_DIVIDER
Definition: ad9528.h:66
AD9528_ADDR_PLL2_N_DIV
#define AD9528_ADDR_PLL2_N_DIV
Definition: t_ad9528.h:39
jesd204_dev_register
int jesd204_dev_register(struct jesd204_dev **jdev, const struct jesd204_dev_data *dev_data)
AD9528_ADDR_PLL2_LF_CTRL2
#define AD9528_ADDR_PLL2_LF_CTRL2
Definition: t_ad9528.h:44
ad9528.h
Contains function declarations and ad9528Device_t structure typedef for ad9528.c.
ad9528_channel_spec::divider_phase
uint8_t divider_phase
Definition: ad9528.h:343
ad9528_channel_spec::driver_mode
uint8_t driver_mode
Definition: ad9528.h:338
AD9528_STAT_REFAB_MISSING
@ AD9528_STAT_REFAB_MISSING
Definition: ad9528.h:461
CMB_SPIReadByte
commonErr_t CMB_SPIReadByte(spiSettings_t *spiSettings, uint16_t addr, uint8_t *readdata)
Definition: common.c:202
INTERNAL
@ INTERNAL
Definition: t_ad9528.h:138
AD9528_requestSysref
ADI_ERR AD9528_requestSysref(ad9528Device_t *device, uint8_t enableSYSREF)
Send a SPI message to request a SYSREF pulse or continuous SYSREF from the AD9528.
Definition: ad9528.c:501
NULL
#define NULL
Definition: wrapper.h:64
ad9528_platform_data::sysref_src
uint8_t sysref_src
Definition: ad9528.h:401
SYSREF
@ SYSREF
Definition: t_ad9528.h:81
AD9528_PLL2_VCO_CALIBRATE
#define AD9528_PLL2_VCO_CALIBRATE
Definition: ad9528.h:158
ad9528_jesd204_priv
Definition: ad9528.c:48
AD9528_STAT_PLL1_LD
@ AD9528_STAT_PLL1_LD
Definition: ad9528.h:457
AD9528_ADDR_SYSREF_CTRL3
#define AD9528_ADDR_SYSREF_CTRL3
Definition: t_ad9528.h:60
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
ad9528_dev::gpio_resetb
struct no_os_gpio_desc * gpio_resetb
Definition: ad9528.h:484
AD9528_SYSREF_NSHOT_MODE
#define AD9528_SYSREF_NSHOT_MODE(x)
Definition: ad9528.h:210
AD9528_SER_CONF_SOFT_RESET
#define AD9528_SER_CONF_SOFT_RESET
Definition: ad9528.h:99
AD9528_STAT_MON0
#define AD9528_STAT_MON0
Definition: ad9528.h:93
AD9528_ADDR_ADI_SPI_CONFIG_A
#define AD9528_ADDR_ADI_SPI_CONFIG_A
Definition: t_ad9528.h:21
ad9528_platform_data::pll1_feedback_div
uint16_t pll1_feedback_div
Definition: ad9528.h:389
AD9528_setupSYSREF
ADI_ERR AD9528_setupSYSREF(ad9528Device_t *device, uint16_t divideFromPll1Out, sysrefPatternMode_t sysrefPatternMode, sysrefNshotMode_t nShotPulses)
Allow changing the 9528 SYSREF frequency and pattern mode(CONTINUOUS, PRBS vs NSHOT mode)
Definition: ad9528.c:535
AD9528_PLL1_REFA_RCV_EN
#define AD9528_PLL1_REFA_RCV_EN
Definition: ad9528.h:133
ad9528_init_param::pdata
struct ad9528_platform_data * pdata
Definition: ad9528.h:503
AD9528_SERIAL_PORT_CONFIG
#define AD9528_SERIAL_PORT_CONFIG
Definition: ad9528.h:61
AD9528_PLL1_REFA_CMOS_NEG_INP_EN
#define AD9528_PLL1_REFA_CMOS_NEG_INP_EN
Definition: ad9528.h:128
JESD204_STATE_CHANGE_DONE
@ JESD204_STATE_CHANGE_DONE
Definition: jesd204.h:46
AD9528_ADDR_STATUS_OE
#define AD9528_ADDR_STATUS_OE
Definition: t_ad9528.h:71
no_os_clk_desc::dev_desc
void * dev_desc
Definition: no_os_clk.h:83
ad9528_io_update
int32_t ad9528_io_update(struct ad9528_dev *dev)
Updates the AD9528 configuration.
Definition: ad9528.c:236
ad9528_platform_data::pll2_freq_doubler_en
uint8_t pll2_freq_doubler_en
Definition: ad9528.h:424
AD9528_PLL1_CHARGE_PUMP_TRISTATE
#define AD9528_PLL1_CHARGE_PUMP_TRISTATE
Definition: ad9528.h:117
no_os_clk_init_param::hw_ch_num
uint8_t hw_ch_num
Definition: no_os_clk.h:48
AD9528_STAT_VCXO
@ AD9528_STAT_VCXO
Definition: ad9528.h:462
AD9528_CLK_DIST_CTRL
#define AD9528_CLK_DIST_CTRL(x)
Definition: ad9528.h:186
ad9528_init
int32_t ad9528_init(struct ad9528_init_param *init_param)
Initializes the AD9528.
Definition: ad9528.c:299
AD9528_PLL1_OSC_IN_DIFF_EN
#define AD9528_PLL1_OSC_IN_DIFF_EN
Definition: ad9528.h:136
ad9528_platform_data::pll2_ndiv_b_cnt
uint8_t pll2_ndiv_b_cnt
Definition: ad9528.h:422
NEG_SINGLE_ENDED
@ NEG_SINGLE_ENDED
Definition: t_ad9528.h:94
sysrefPatternMode_t
sysrefPatternMode_t
Enum to choose the SYSREF pattern mode.
Definition: t_ad9528.h:142
ad9528_platform_data::stat0_pin_func_sel
uint8_t stat0_pin_func_sel
Definition: ad9528.h:451
ad9528_platform_data::refa_diff_rcv_en
uint8_t refa_diff_rcv_en
Definition: ad9528.h:366
DISABLED
@ DISABLED
Definition: t_ad9528.h:94
AD9528_ADDR_PLL1_FASTLOCK
#define AD9528_ADDR_PLL1_FASTLOCK
Definition: t_ad9528.h:36
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
ad9528.h
Header file of AD9528 Driver.
ad9528_state::sysref_src_pll2
uint32_t sysref_src_pll2
Definition: ad9528.h:477
ad9528_platform_data::channels
struct ad9528_channel_spec * channels
Definition: ad9528.h:448
AD9528_PLL1_SOURCE_VCXO
#define AD9528_PLL1_SOURCE_VCXO
Definition: ad9528.h:126
AD9528_PLL1_REFA_DIFF_RCV_EN
#define AD9528_PLL1_REFA_DIFF_RCV_EN
Definition: ad9528.h:131
ad9528_platform_data::stat1_pin_func_sel
uint8_t stat1_pin_func_sel
Definition: ad9528.h:453
AD9528_ADDR_CH_OUT0_CTRL2
#define AD9528_ADDR_CH_OUT0_CTRL2
Definition: t_ad9528.h:50
AD9528_PLL2_CTRL
#define AD9528_PLL2_CTRL
Definition: ad9528.h:74
no_os_gpio.h
Header file of GPIO Interface.
ad9528_io_update
int32_t ad9528_io_update(struct ad9528_dev *dev)
Updates the AD9528 configuration.
Definition: ad9528.c:236
AD9528_PLL2_LOOP_FILTER_CTRL
#define AD9528_PLL2_LOOP_FILTER_CTRL
Definition: ad9528.h:77
AD9528_STAT_PIN_EN
#define AD9528_STAT_PIN_EN
Definition: ad9528.h:95
ad9528_dev::ad9528_st
struct ad9528_state ad9528_st
Definition: ad9528.h:487
AD9528_ADDR_OUTPUT_SYNC
#define AD9528_ADDR_OUTPUT_SYNC
Definition: t_ad9528.h:52
AD9528_ADDR_IO_UPDATE
#define AD9528_ADDR_IO_UPDATE
Definition: t_ad9528.h:23
ad9528_channel_spec::output_dis
uint8_t output_dis
Definition: ad9528.h:336
ad9528_remove
int32_t ad9528_remove(struct ad9528_dev *dev)
Free the resources allocated by ad9528_setup().
Definition: ad9528.c:1123
JESD204_OP_LINK_SUPPORTED
@ JESD204_OP_LINK_SUPPORTED
Definition: jesd204.h:199
AD9528_NUM_CHAN
#define AD9528_NUM_CHAN
Definition: ad9528.h:248
AD9528_ADDR_REF_A_DIVIDER_MSB
#define AD9528_ADDR_REF_A_DIVIDER_MSB
Definition: t_ad9528.h:26
AD9528_PLL2_LOOP_FILTER_RZERO
#define AD9528_PLL2_LOOP_FILTER_RZERO(x)
Definition: ad9528.h:167
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
ad9528_spi_read_n
int32_t ad9528_spi_read_n(struct ad9528_dev *dev, uint32_t reg_addr, uint32_t *reg_data)
Reads the value of the selected register.
Definition: ad9528.c:137
AD9528_SERIAL_PORT_CONFIG_B
#define AD9528_SERIAL_PORT_CONFIG_B
Definition: ad9528.h:62
AD9528_ADDR_POWERDOWN_CTRL
#define AD9528_ADDR_POWERDOWN_CTRL
Definition: t_ad9528.h:64
AD9528_PLL1_REFB_DIFF_RCV_EN
#define AD9528_PLL1_REFB_DIFF_RCV_EN
Definition: ad9528.h:130
AD9528_SYNC
@ AD9528_SYNC
Definition: ad9528.h:465
AD9528_SYSREF_K_DIV_MAX
#define AD9528_SYSREF_K_DIV_MAX
Definition: ad9528.h:205
AD9528_SYSREF_REQUEST_BY_PIN
#define AD9528_SYSREF_REQUEST_BY_PIN
Definition: ad9528.h:212
ad9528_spi_read
int32_t ad9528_spi_read(struct ad9528_dev *dev, uint32_t reg_addr, uint32_t *reg_data)
Reads the value of the selected register.
Definition: ad9528.c:78
AD9528_SYSREF_PATTERN_REQ
#define AD9528_SYSREF_PATTERN_REQ
Definition: ad9528.h:211
AD9528_SYSREF_PATTERN_MODE
#define AD9528_SYSREF_PATTERN_MODE(x)
Definition: ad9528.h:209
no_os_util.h
Header file of utility functions.
AD9528_PLL1_REFB_CMOS_NEG_INP_EN
#define AD9528_PLL1_REFB_CMOS_NEG_INP_EN
Definition: ad9528.h:127
AD9528_PLL2_CHARGE_PUMP_MODE_NORMAL
#define AD9528_PLL2_CHARGE_PUMP_MODE_NORMAL
Definition: ad9528.h:149
ad9528_platform_data::refb_en
uint8_t refb_en
Definition: ad9528.h:363
SPI
@ SPI
Definition: adxl372.h:316
ad9528_clk_recalc_rate
int32_t ad9528_clk_recalc_rate(struct no_os_clk_desc *desc, uint64_t *rate)
Get the current frequency of the clock.
Definition: ad9528.c:360
AD9528_STAT0_PIN_EN
#define AD9528_STAT0_PIN_EN
Definition: ad9528.h:243
ad9528_channel_spec::signal_source
uint8_t signal_source
Definition: ad9528.h:339
ad9528_platform_data::pll1_charge_pump_current_nA
uint16_t pll1_charge_pump_current_nA
Definition: ad9528.h:393
ad9528_platform_data::pll1_bypass_en
uint8_t pll1_bypass_en
Definition: ad9528.h:395
AD9528_ADDR_EN_OUTPUT_PATH_SEL2
#define AD9528_ADDR_EN_OUTPUT_PATH_SEL2
Definition: t_ad9528.h:56
AD9528_CHANNEL_PD_MASK
#define AD9528_CHANNEL_PD_MASK(x)
Definition: ad9528.h:227
ad9528_channel_spec::sync_ignore_en
uint8_t sync_ignore_en
Definition: ad9528.h:334
ad9528_channel_spec::channel_num
uint8_t channel_num
Definition: ad9528.h:332
AD9528_CHANNEL_IGNORE_MASK
#define AD9528_CHANNEL_IGNORE_MASK(x)
Definition: ad9528.h:199
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
AD9528_PLL2_N2_DIV
#define AD9528_PLL2_N2_DIV(x)
Definition: ad9528.h:174
jesd204_dev_data::sysref_cb
jesd204_sysref_cb sysref_cb
Definition: jesd204.h:228
AD9528_ADDR_CH_OUT0_CTRL1
#define AD9528_ADDR_CH_OUT0_CTRL1
Definition: t_ad9528.h:49
AD9528_PLL1_OSC_CTRL_FAIL_VCC_BY2_EN
#define AD9528_PLL1_OSC_CTRL_FAIL_VCC_BY2_EN
Definition: ad9528.h:121
AD9528_PD_EN
#define AD9528_PD_EN
Definition: ad9528.h:90
AD9528_READBACK
#define AD9528_READBACK
Definition: ad9528.h:96
jesd204_dev_data
JESD204 device initialization data.
Definition: jesd204.h:227
ad9528_dev::clk_desc
struct no_os_clk_desc ** clk_desc
Definition: ad9528.h:490
ad9528_setup
int32_t ad9528_setup(struct ad9528_dev **device, struct ad9528_init_param init_param)
Initializes the AD9528.
Definition: ad9528.c:702
AD9528_SYSREF_SOURCE
#define AD9528_SYSREF_SOURCE(x)
Definition: ad9528.h:208
AD9528_reportClockRates
ADI_ERR AD9528_reportClockRates(ad9528Device_t *device)
Debug function to print out summary of AD9528 setup.
Definition: ad9528.c:281
AD9528_CLK_DIST_DIV_MIN
#define AD9528_CLK_DIST_DIV_MIN
Definition: ad9528.h:177
RZERO_1850_OHM
@ RZERO_1850_OHM
Definition: ad9523.h:350
LVDS
@ LVDS
Definition: ad9517.h:365
AD9528_PLL2_FB_NDIV_A_CNT
#define AD9528_PLL2_FB_NDIV_A_CNT(x)
Definition: ad9528.h:142
AD9528_initialize
ADI_ERR AD9528_initialize(ad9528Device_t *device)
Initializes the AD9528 by writing all SPI registers.
Definition: ad9528.c:303
AD9528_enableClockOutputs
ADI_ERR AD9528_enableClockOutputs(ad9528Device_t *device, uint16_t clkEnable)
Update the AD9528 clock outputs that are enabled.
Definition: ad9528.c:573
NO_OS_DIV_ROUND_CLOSEST
#define NO_OS_DIV_ROUND_CLOSEST(x, y)
Definition: no_os_util.h:54
AD9528_initDeviceDataStruct
ADI_ERR AD9528_initDeviceDataStruct(ad9528Device_t *device, uint32_t vcxoFrequency_Hz, uint32_t refAFrequency_Hz, uint32_t outputDeviceClock_Hz)
Helper function for ADI transceiver eval boards to init the AD9528 data structure.
Definition: ad9528.c:115
AD9528_CHANNEL_SYNC_SET
#define AD9528_CHANNEL_SYNC_SET
Definition: ad9528.h:196
AD9528_STAT_MON1
#define AD9528_STAT_MON1
Definition: ad9528.h:94
ad9528_dev::spi_desc
struct no_os_spi_desc * spi_desc
Definition: ad9528.h:482
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
AD9528_PLL1_FEEDBACK_BYPASS_EN
#define AD9528_PLL1_FEEDBACK_BYPASS_EN
Definition: ad9528.h:123
no_os_div_u64
uint64_t no_os_div_u64(uint64_t dividend, uint32_t divisor)
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