Go to the documentation of this file.
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)
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)
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)
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)
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)
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)
85 #define AD9528_SYSREF_RESAMPLE_CTRL AD9528_2B(0x32D)
87 #define AD9528_SYSREF_K_DIVIDER AD9528_2B(0x400)
88 #define AD9528_SYSREF_CTRL AD9528_2B(0x402)
90 #define AD9528_PD_EN AD9528_1B(0x500)
91 #define AD9528_CHANNEL_PD_EN AD9528_2B(0x501)
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)
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))
105 #define AD9528_SER_CONF_READ_BUFFERED (1 << 5)
106 #define AD9528_SER_CONF_RESET_SANS_REGMAP (1 << 2)
109 #define AD9528_IO_UPDATE_EN (1 << 0)
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)
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)
139 #define AD9528_PLL2_CHARGE_PUMP_CURRENT_nA(x) ((x) / 3500)
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))
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)
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)
161 #define AD9528_PLL2_VCO_DIV_M1_PWR_DOWN_EN (1 << 3)
162 #define AD9528_PLL2_VCO_DIV_M1(x) (((x) & 0x7) << 0)
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)
171 #define AD9528_PLL2_R1_DIV(x) (((x) & 0x1F) << 0)
174 #define AD9528_PLL2_N2_DIV(x) ((((x) - 1) & 0xFF) << 0)
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)
192 #define AD9528_CLK_DIST_INV_DIV_OUTPUT_EN (1 << 7)
196 #define AD9528_CHANNEL_SYNC_SET (1 << 0)
199 #define AD9528_CHANNEL_IGNORE_MASK(x) (((x) & 0x3FFF) << 0)
200 #define AD9528_CHANNEL_IGNORE_MASK_REV(x) (((x) >> 0) & 0x3FFF)
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)
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)
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)
227 #define AD9528_CHANNEL_PD_MASK(x) (((x) & 0x3FFF) << 0)
228 #define AD9528_CHANNEL_PD_MASK_REV(x) (((x) >> 0) & 0x3FFF)
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)
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)
248 #define AD9528_NUM_CHAN 14
250 #define AD9528_SPI_MAGIC 0x00FF05
253 #define DRIVER_MODE_LVDS 0
254 #define DRIVER_MODE_LVDS_BOOST 1
255 #define DRIVER_MODE_HSTL 2
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
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
273 #define SYSREF_SRC_EXTERNAL 0
274 #define SYSREF_SRC_EXTERNAL_RESAMPLED 1
275 #define SYSREF_SRC_INTERNAL 2
278 #define SYSREF_PATTERN_NSHOT 0
279 #define SYSREF_PATTERN_CONTINUOUS 1
280 #define SYSREF_PATTERN_PRBS 2
281 #define SYSREF_PATTERN_STOP 3
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
293 #define SYSREF_LEVEL_HIGH 0
294 #define SYSREF_EDGE_RISING 2
295 #define SYSREF_EDGE_FALLING 3
298 #define RPOLE2_900_OHM 0
299 #define RPOLE2_450_OHM 1
300 #define RPOLE2_300_OHM 2
301 #define RPOLE2_225_OHM 3
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
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
508 #define AD_IFE(_pde, _a, _b) ((dev->pdata->_pde) ? _a : _b)
509 #define AD_IF(_pde, _a) AD_IFE(_pde, _a, 0)
543 #endif // __AD9528_H__
#define SYSREF_SRC_INTERNAL
Definition: ad9528.h:275
ADI_ERR
Definition: common.h:34
#define AD9528_CLK_DIST_CTRL_MASK
Definition: ad9528.h:187
#define AD9528_ADDR_STATUS0_CTRL
Definition: t_ad9528.h:69
@ DIFFERENTIAL
Definition: t_ad9528.h:94
JESD204 link configuration settings.
Definition: jesd204.h:105
uint16_t channel_divider
Definition: ad9528.h:345
uint32_t timeout
Definition: ad413x.c:49
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
#define AD9528_CHANNEL_PD_EN
Definition: ad9528.h:91
@ ADIERR_OK
Definition: common.h:35
@ AD9528_STAT_PLL2_LD
Definition: ad9528.h:458
struct ad9528_platform_data * pdata
Definition: ad9528.h:488
#define AD9528_ADDR_STATUS1_CTRL
Definition: t_ad9528.h:70
#define AD9528_ADDR_INPUT_RECEIVERS1
Definition: t_ad9528.h:33
#define AD9528_ADDR_CH_POWERDOWN1
Definition: t_ad9528.h:65
uint32_t jdev_lmfc_lemc_gcd
Definition: ad9528.h:494
@ NSHOT
Definition: t_ad9528.h:144
#define AD9528_PLL2_LOOP_FILTER_RPOLE2(x)
Definition: ad9528.h:166
#define AD9528_PLL1_CHARGE_PUMP_MODE_NORMAL
Definition: ad9528.h:113
#define AD9528_ADDR_MASK_SYNC2
Definition: t_ad9528.h:54
#define AD9528_IO_UPDATE_EN
Definition: ad9528.h:109
@ CHANNEL_DIV
Definition: t_ad9528.h:80
#define AD9528_PD_BIAS
Definition: ad9528.h:220
#define AD9528_PLL2_VCO_CTRL
Definition: ad9528.h:75
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
Definition: jesd204.h:148
#define AD9528_CLK_DIST_DIV(x)
Definition: ad9528.h:179
#define AD9528_SYSREF_K_DIV_MIN
Definition: ad9528.h:204
const struct no_os_clk_platform_ops * platform_ops
Definition: no_os_clk.h:50
#define AD9528_IS_CALIBRATING
Definition: ad9528.h:232
#define AD9528_PLL1_CTRL
Definition: ad9528.h:70
commonErr_t CMB_writeToLog(ADI_LOGLEVEL level, uint8_t deviceIndex, uint32_t errorCode, const char *comment)
Definition: common.c:250
sysrefNshotMode_t
Enum to select the SYSREF output # of pulses for NSHOT mode.
Definition: t_ad9528.h:154
#define AD9528_PLL2_VCO_DIV_M1_PWR_DOWN_EN
Definition: ad9528.h:161
Header file of SPI Interface.
#define AD9528_ADDR_STATUS_READBACK0
Definition: t_ad9528.h:72
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
Definition: ad9523.h:336
Output channel configuration.
Definition: ad9528.h:330
#define AD9528_ADDR_PLL2_LF_CTRL1
Definition: t_ad9528.h:43
@ AD9528_STAT_REFB
Definition: ad9528.h:460
#define AD9528_SYSREF_RESAMPLE_CTRL
Definition: ad9528.h:85
@ ONE_PULSE
Definition: t_ad9528.h:156
int32_t ad9528_reset(struct ad9528_dev *dev)
Performs a hard reset on the AD9528.
Definition: ad9528.c:1292
@ ADIHAL_LOG_ERROR
Definition: common.h:51
#define AD9528_ADDR_SYSERF_DIV_MSB
Definition: t_ad9528.h:59
#define AD9528_ADDR_PLL2_REPLICA_DIV_PHASE
Definition: t_ad9528.h:47
@ AD9528_VCXO
Definition: ad9528.h:470
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
Definition: jesd204.h:176
Header file of Delay functions.
const char * name
Definition: no_os_clk.h:46
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
Definition: jesd204.h:147
#define AD9528_ADDR_SYSERF_DIV_LSB
Definition: t_ad9528.h:58
#define AD9528_STAT1_PIN_EN
Definition: ad9528.h:244
#define AD9528_PLL2_VCO_DIVIDER
Definition: ad9528.h:76
#define AD9528_SYSREF_CTRL
Definition: ad9528.h:88
int32_t no_os_clk_init(struct no_os_clk_desc **desc, const struct no_os_clk_init_param *param)
#define AD9528_ADDR_MASK_SYNC1
Definition: t_ad9528.h:53
#define AD9528_PLL1_CHARGE_PUMP_CURRENT_nA(x)
Definition: ad9528.h:118
#define AD9528_PLL2_DOUBLER_R1_EN
Definition: ad9528.h:155
#define AD9528_TRANSF_LEN(x)
Definition: ad9528.h:59
commonErr_t CMB_hasTimeoutExpired()
Definition: common.c:319
int32_t ad9528_clk_set_rate(struct ad9528_dev *dev, uint32_t chan, uint32_t rate)
Set channel rate.
Definition: ad9528.c:1222
Definition: ad9361_util.h:69
#define AD9528_ADDR_PLL2_REPLICA_CHDIV
Definition: t_ad9528.h:46
@ ADIERR_INV_PARM
Definition: common.h:36
@ AD9528_SYSREF
Definition: ad9528.h:471
#define AD9528_CLK_DIST_DRIVER_MODE(x)
Definition: ad9528.h:182
commonErr_t CMB_setTimeout_ms(uint32_t timeOut_ms)
Definition: common.c:301
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
#define AD9528_ADDR_SYSREF_CTRL5
Definition: t_ad9528.h:62
#define AD9528_PLL2_N2_DIVIDER
Definition: ad9528.h:79
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
uint8_t subclass
Definition: jesd204.h:125
int jesd204_dev_unregister(struct jesd204_dev *jdev)
#define AD9528_ADDR_PLL2_VCO_CTRL
Definition: t_ad9528.h:41
struct no_os_gpio_desc * sysref_req_gpio
Definition: ad9528.h:485
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
Definition: ad9528.h:459
uint32_t ad9528_clk_round_rate(struct ad9528_dev *dev, uint32_t chan, uint32_t rate)
Calculate closest possible rate.
Definition: ad9528.c:1186
#define AD9528_IO_UPDATE
Definition: ad9528.h:64
#define DRIVER_MODE_LVDS
Definition: ad9528.h:253
int32_t ad9528_sync(struct ad9528_dev *dev)
Updates the AD9528 configuration.
Definition: ad9528.c:250
#define AD9528_PLL1_REFB_BYPASS_EN
Definition: ad9528.h:124
#define AD9528_ADDR_LDO_ENABLES1
Definition: t_ad9528.h:67
#define AD9528_ADDR_PLL1_CHARGEPUMP
Definition: t_ad9528.h:31
@ CPOLE1_16_PF
Definition: ad9523.h:356
@ ADIHAL_LOG_MESSAGE
Definition: common.h:49
@ JESD204_OP_CLK_SYNC_STAGE1
Definition: jesd204.h:201
#define AD9528_SYSREF_PATTERN_TRIGGER_CTRL(x)
Definition: ad9528.h:213
#define AD9528_PLL2_LOCKED
Definition: ad9528.h:239
#define AD9528_SYSREF_K_DIVIDER
Definition: ad9528.h:87
#define AD9528_PLL1_REF_MODE(x)
Definition: ad9528.h:122
@ AD9528_NUM_CLK_SRC
Definition: ad9528.h:472
#define AD9528_ADDR_CH_OUT0_CHDIV
Definition: t_ad9528.h:51
void * jesd204_dev_priv(struct jesd204_dev *jdev)
#define AD9528_PLL2_R1_DIV(x)
Definition: ad9528.h:171
#define AD9528_ADDR_PLL2_CTRL
Definition: t_ad9528.h:40
@ ADIERR_FAILED
Definition: common.h:37
@ LEVEL_ACTIVE_HIGH
Definition: t_ad9528.h:150
commonErr_t CMB_SPIWriteByte(spiSettings_t *spiSettings, uint16_t addr, uint8_t data)
Definition: common.c:173
Header file of Clock Driver.
#define AD9528_CHIP_ID
Definition: ad9528.h:63
#define AD9528_PLL2_FB_NDIV_B_CNT(x)
Definition: ad9528.h:143
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
#define AD9528_PLL2_CHARGE_PUMP
Definition: ad9528.h:72
#define AD9528_PLL1_CHARGE_PUMP_AUTO_TRISTATE_DIS
Definition: ad9528.h:112
int32_t ad9528_poll(struct ad9528_dev *dev, uint32_t reg_addr, uint32_t mask, uint32_t data)
Poll register.
Definition: ad9528.c:206
uint32_t jdev_lmfc_lemc_rate
Definition: ad9528.h:493
#define no_os_min(x, y)
Definition: no_os_util.h:59
#define AD_IF(_pde, _a)
Definition: ad9523.c:45
#define AD9528_SPI_MAGIC
Definition: ad9528.h:250
#define AD9528_ADDR_CH_POWERDOWN2
Definition: t_ad9528.h:66
uint32_t ad9528_calc_out_div(uint32_t rate, uint32_t parent_rate)
Calculate the output channel divider.
Definition: ad9528.c:1162
#define AD9528_ADDR_INPUT_RECEIVERS3
Definition: t_ad9528.h:35
#define AD9528_SER_CONF_READ_BUFFERED
Definition: ad9528.h:105
#define pr_debug(fmt, args...)
Definition: no_os_print_log.h:129
#define AD9528_PLL2_LOOP_FILTER_RZERO_BYPASS_EN
Definition: ad9528.h:165
#define AD9528_PLL2_CHARGE_PUMP_CURRENT_nA(x)
Definition: ad9528.h:139
#define AD9528_PLL2_R1_DIVIDER
Definition: ad9528.h:78
#define AD9528_VCXO_OK
Definition: ad9528.h:235
Structure to hold AD9528 settings.
Definition: t_ad9528.h:179
struct ad9528_dev * device
Definition: ad9528.c:49
#define AD9528_PLL2_CHARGE_PUMP_MODE_TRISTATE
Definition: ad9528.h:152
@ AD9528_STAT_PLL1_FB_CLK
Definition: ad9528.h:463
struct no_os_gpio_init_param * gpio_resetb
Definition: ad9528.h:501
#define AD9528_PLL2_LOOP_FILTER_CPOLE1(x)
Definition: ad9528.h:168
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
#define AD9528_ADDR_REF_B_DIVIDER_MSB
Definition: t_ad9528.h:28
int jesd204_link_get_lmfc_lemc_rate(struct jesd204_link *lnk, unsigned long *rate_hz)
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
#define AD9528_PLL2_VCO_DIV_M1(x)
Definition: ad9528.h:162
#define AD9528_SER_CONF_SDO_ACTIVE
Definition: ad9528.h:102
@ AD9528_STAT_PLL2_FB_CLK
Definition: ad9528.h:464
uint8_t hw_ch_num
Definition: no_os_clk.h:79
#define AD9528_ADDR_PLL2_VCO_DIV
Definition: t_ad9528.h:42
int32_t ad9528_poll(struct ad9528_dev *dev, uint32_t reg_addr, uint32_t mask, uint32_t data)
Poll register.
Definition: ad9528.c:206
uint32_t ad9528_clk_round_rate(struct ad9528_dev *dev, uint32_t chan, uint32_t rate)
Calculate closest possible rate.
Definition: ad9528.c:1186
#define AD9528_ADDR_REF_A_DIVIDER_LSB
Definition: t_ad9528.h:25
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
#define AD9528_PLL1_FEEDBACK_DIVIDER
Definition: ad9528.h:68
int32_t ad9528_sync(struct ad9528_dev *dev)
Updates the AD9528 configuration.
Definition: ad9528.c:250
Structure holding CLK descriptor.
Definition: no_os_clk.h:75
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
struct jesd204_dev * jdev
Definition: ad9528.h:492
#define SYSREF_PATTERN_CONTINUOUS
Definition: ad9528.h:279
#define AD9528_PLL1_OSC_IN_CMOS_NEG_INP_EN
Definition: ad9528.h:135
int8_t extended_name[16]
Definition: ad9528.h:347
#define AD9528_CLK_DIST_DIV_PHASE(x)
Definition: ad9528.h:184
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
#define AD9528_CLK_DIST_DIV_MAX
Definition: ad9528.h:178
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
#define AD9528_ADDR_PLL2_CHARGEPUMP
Definition: t_ad9528.h:38
#define AD9528_PLL1_REFA_BYPASS_EN
Definition: ad9528.h:125
void * dev_desc
Definition: no_os_clk.h:52
#define no_os_clamp(val, min_val, max_val)
Definition: no_os_util.h:69
int32_t ad9528_reset(struct ad9528_dev *dev)
Performs a hard reset on the AD9528.
Definition: ad9528.c:1292
#define AD9528_ADDR_PLL2_RDIV
Definition: t_ad9528.h:45
uint64_t no_os_div_u64_rem(uint64_t dividend, uint32_t divisor, uint32_t *remainder)
uint32_t vco_out_freq[AD9528_NUM_CLK_SRC]
Definition: ad9528.h:476
@ AD9528_VCO
Definition: ad9528.h:469
#define AD9528_ADDR_ADI_SPI_CONFIG_B
Definition: t_ad9528.h:22
#define AD9528_ADDR_PLL1_N_DIV_LSB
Definition: t_ad9528.h:29
struct no_os_spi_init_param spi_init
Definition: ad9528.h:499
uint32_t no_os_greatest_common_divisor(uint32_t a, uint32_t b)
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
int32_t ad9528_init(struct ad9528_init_param *init_param)
Initializes the AD9528.
Definition: ad9528.c:299
#define AD9528_PLL2_FREQ_DOUBLER_EN
Definition: ad9528.h:148
#define AD9528_PLL2_FEEDBACK_DIVIDER_AB
Definition: ad9528.h:73
#define AD9528_ADDR_PLL1_CP_CTRL2
Definition: t_ad9528.h:32
Definition: no_os_clk.h:44
#define AD9528_ADDR_EN_OUTPUT_PATH_SEL1
Definition: t_ad9528.h:55
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)
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
#define AD9528_SYSREF_K_DIV(x)
Definition: ad9528.h:203
#define AD9528_ADDR_PLL1_N_DIV_MSB
Definition: t_ad9528.h:30
@ JESD204_OP_LINK_PRE_SETUP
Definition: jesd204.h:200
#define AD9528_PD_PLL1
Definition: ad9528.h:222
@ SINGLE_ENDED
Definition: t_ad9528.h:94
uint32_t link_id
Definition: jesd204.h:106
ADI_ERR AD9528_resetDevice(ad9528Device_t *device)
Performs a hard reset on the AD9528 DUT.
Definition: ad9528.c:26
@ JESD204_SUBCLASS_0
Definition: jesd204.h:16
#define AD_IFE(_pde, _a, _b)
Definition: ad9523.c:44
ADI_ERR AD9528_setSpiSettings(ad9528Device_t *device)
Sets the AD9528 device SPI settings (3wire/4wire, MSBFirst, etc).
Definition: ad9528.c:56
#define AD9528_ADDR_LDO_ENABLES2
Definition: t_ad9528.h:68
#define AD9528_PD_PLL2
Definition: ad9528.h:221
#define AD9528_ADDR_SYSREF_CTRL4
Definition: t_ad9528.h:61
#define AD9528_CLK_DIST_DIV_MASK
Definition: ad9528.h:180
#define AD9528_CHANNEL_OUTPUT(ch)
Definition: ad9528.h:81
#define SYSREF_SRC_EXTERNAL
Definition: ad9528.h:273
#define AD9528_ADDR_INPUT_RECEIVERS2
Definition: t_ad9528.h:34
#define no_os_clamp_t(type, val, min_val, max_val)
Definition: no_os_util.h:71
#define AD9528_PLL1_CHARGE_PUMP_CTRL
Definition: ad9528.h:69
#define SOURCE_VCO
Definition: ad9528.h:258
bool export_no_os_clk
Definition: ad9528.h:504
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
#define AD9528_CHANNEL_SYNC_IGNORE
Definition: ad9528.h:83
#define AD9528_CHANNEL_SYNC
Definition: ad9528.h:82
#define AD9528_PLL1_REFB_RCV_EN
Definition: ad9528.h:132
#define AD9528_ADDR_REF_B_DIVIDER_LSB
Definition: t_ad9528.h:27
#define AD9528_CLK_DIST_DIV_REV(x)
Definition: ad9528.h:181
commonErr_t CMB_hardReset(uint8_t spiChipSelectIndex)
Definition: common.c:138
#define NO_OS_BIT(x)
Definition: no_os_util.h:45
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
int32_t ad9528_remove(struct ad9528_dev *dev)
Free the resources allocated by ad9528_setup().
Definition: ad9528.c:1123
#define AD9528_PLL1_REF_B_DIVIDER
Definition: ad9528.h:67
#define AD9528_PLL1_REF_A_DIVIDER
Definition: ad9528.h:66
#define AD9528_ADDR_PLL2_N_DIV
Definition: t_ad9528.h:39
int jesd204_dev_register(struct jesd204_dev **jdev, const struct jesd204_dev_data *dev_data)
#define AD9528_ADDR_PLL2_LF_CTRL2
Definition: t_ad9528.h:44
Contains function declarations and ad9528Device_t structure typedef for ad9528.c.
uint8_t divider_phase
Definition: ad9528.h:343
uint8_t driver_mode
Definition: ad9528.h:338
@ AD9528_STAT_REFAB_MISSING
Definition: ad9528.h:461
commonErr_t CMB_SPIReadByte(spiSettings_t *spiSettings, uint16_t addr, uint8_t *readdata)
Definition: common.c:202
@ INTERNAL
Definition: t_ad9528.h:138
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
#define NULL
Definition: wrapper.h:64
@ SYSREF
Definition: t_ad9528.h:81
#define AD9528_PLL2_VCO_CALIBRATE
Definition: ad9528.h:158
@ AD9528_STAT_PLL1_LD
Definition: ad9528.h:457
#define AD9528_ADDR_SYSREF_CTRL3
Definition: t_ad9528.h:60
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
struct no_os_gpio_desc * gpio_resetb
Definition: ad9528.h:484
#define AD9528_SYSREF_NSHOT_MODE(x)
Definition: ad9528.h:210
#define AD9528_SER_CONF_SOFT_RESET
Definition: ad9528.h:99
#define AD9528_STAT_MON0
Definition: ad9528.h:93
#define AD9528_ADDR_ADI_SPI_CONFIG_A
Definition: t_ad9528.h:21
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
#define AD9528_PLL1_REFA_RCV_EN
Definition: ad9528.h:133
struct ad9528_platform_data * pdata
Definition: ad9528.h:503
#define AD9528_SERIAL_PORT_CONFIG
Definition: ad9528.h:61
#define AD9528_PLL1_REFA_CMOS_NEG_INP_EN
Definition: ad9528.h:128
@ JESD204_STATE_CHANGE_DONE
Definition: jesd204.h:46
#define AD9528_ADDR_STATUS_OE
Definition: t_ad9528.h:71
void * dev_desc
Definition: no_os_clk.h:83
int32_t ad9528_io_update(struct ad9528_dev *dev)
Updates the AD9528 configuration.
Definition: ad9528.c:236
#define AD9528_PLL1_CHARGE_PUMP_TRISTATE
Definition: ad9528.h:117
uint8_t hw_ch_num
Definition: no_os_clk.h:48
@ AD9528_STAT_VCXO
Definition: ad9528.h:462
#define AD9528_CLK_DIST_CTRL(x)
Definition: ad9528.h:186
int32_t ad9528_init(struct ad9528_init_param *init_param)
Initializes the AD9528.
Definition: ad9528.c:299
#define AD9528_PLL1_OSC_IN_DIFF_EN
Definition: ad9528.h:136
@ NEG_SINGLE_ENDED
Definition: t_ad9528.h:94
sysrefPatternMode_t
Enum to choose the SYSREF pattern mode.
Definition: t_ad9528.h:142
@ DISABLED
Definition: t_ad9528.h:94
#define AD9528_ADDR_PLL1_FASTLOCK
Definition: t_ad9528.h:36
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
Header file of AD9528 Driver.
uint32_t sysref_src_pll2
Definition: ad9528.h:477
#define AD9528_PLL1_SOURCE_VCXO
Definition: ad9528.h:126
#define AD9528_PLL1_REFA_DIFF_RCV_EN
Definition: ad9528.h:131
#define AD9528_ADDR_CH_OUT0_CTRL2
Definition: t_ad9528.h:50
#define AD9528_PLL2_CTRL
Definition: ad9528.h:74
Header file of GPIO Interface.
int32_t ad9528_io_update(struct ad9528_dev *dev)
Updates the AD9528 configuration.
Definition: ad9528.c:236
#define AD9528_PLL2_LOOP_FILTER_CTRL
Definition: ad9528.h:77
#define AD9528_STAT_PIN_EN
Definition: ad9528.h:95
struct ad9528_state ad9528_st
Definition: ad9528.h:487
#define AD9528_ADDR_OUTPUT_SYNC
Definition: t_ad9528.h:52
#define AD9528_ADDR_IO_UPDATE
Definition: t_ad9528.h:23
uint8_t output_dis
Definition: ad9528.h:336
int32_t ad9528_remove(struct ad9528_dev *dev)
Free the resources allocated by ad9528_setup().
Definition: ad9528.c:1123
@ JESD204_OP_LINK_SUPPORTED
Definition: jesd204.h:199
#define AD9528_NUM_CHAN
Definition: ad9528.h:248
#define AD9528_ADDR_REF_A_DIVIDER_MSB
Definition: t_ad9528.h:26
#define AD9528_PLL2_LOOP_FILTER_RZERO(x)
Definition: ad9528.h:167
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
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
#define AD9528_SERIAL_PORT_CONFIG_B
Definition: ad9528.h:62
#define AD9528_ADDR_POWERDOWN_CTRL
Definition: t_ad9528.h:64
#define AD9528_PLL1_REFB_DIFF_RCV_EN
Definition: ad9528.h:130
@ AD9528_SYNC
Definition: ad9528.h:465
#define AD9528_SYSREF_K_DIV_MAX
Definition: ad9528.h:205
#define AD9528_SYSREF_REQUEST_BY_PIN
Definition: ad9528.h:212
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
#define AD9528_SYSREF_PATTERN_REQ
Definition: ad9528.h:211
#define AD9528_SYSREF_PATTERN_MODE(x)
Definition: ad9528.h:209
Header file of utility functions.
#define AD9528_PLL1_REFB_CMOS_NEG_INP_EN
Definition: ad9528.h:127
#define AD9528_PLL2_CHARGE_PUMP_MODE_NORMAL
Definition: ad9528.h:149
@ SPI
Definition: adxl372.h:316
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
#define AD9528_STAT0_PIN_EN
Definition: ad9528.h:243
uint8_t signal_source
Definition: ad9528.h:339
#define AD9528_ADDR_EN_OUTPUT_PATH_SEL2
Definition: t_ad9528.h:56
#define AD9528_CHANNEL_PD_MASK(x)
Definition: ad9528.h:227
uint8_t sync_ignore_en
Definition: ad9528.h:334
uint8_t channel_num
Definition: ad9528.h:332
#define AD9528_CHANNEL_IGNORE_MASK(x)
Definition: ad9528.h:199
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
#define AD9528_PLL2_N2_DIV(x)
Definition: ad9528.h:174
jesd204_sysref_cb sysref_cb
Definition: jesd204.h:228
#define AD9528_ADDR_CH_OUT0_CTRL1
Definition: t_ad9528.h:49
#define AD9528_PLL1_OSC_CTRL_FAIL_VCC_BY2_EN
Definition: ad9528.h:121
#define AD9528_PD_EN
Definition: ad9528.h:90
#define AD9528_READBACK
Definition: ad9528.h:96
JESD204 device initialization data.
Definition: jesd204.h:227
struct no_os_clk_desc ** clk_desc
Definition: ad9528.h:490
int32_t ad9528_setup(struct ad9528_dev **device, struct ad9528_init_param init_param)
Initializes the AD9528.
Definition: ad9528.c:702
#define AD9528_SYSREF_SOURCE(x)
Definition: ad9528.h:208
ADI_ERR AD9528_reportClockRates(ad9528Device_t *device)
Debug function to print out summary of AD9528 setup.
Definition: ad9528.c:281
#define AD9528_CLK_DIST_DIV_MIN
Definition: ad9528.h:177
@ RZERO_1850_OHM
Definition: ad9523.h:350
@ LVDS
Definition: ad9517.h:365
#define AD9528_PLL2_FB_NDIV_A_CNT(x)
Definition: ad9528.h:142
ADI_ERR AD9528_initialize(ad9528Device_t *device)
Initializes the AD9528 by writing all SPI registers.
Definition: ad9528.c:303
ADI_ERR AD9528_enableClockOutputs(ad9528Device_t *device, uint16_t clkEnable)
Update the AD9528 clock outputs that are enabled.
Definition: ad9528.c:573
#define NO_OS_DIV_ROUND_CLOSEST(x, y)
Definition: no_os_util.h:54
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
#define AD9528_CHANNEL_SYNC_SET
Definition: ad9528.h:196
#define AD9528_STAT_MON1
Definition: ad9528.h:94
struct no_os_spi_desc * spi_desc
Definition: ad9528.h:482
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
#define AD9528_PLL1_FEEDBACK_BYPASS_EN
Definition: ad9528.h:123
uint64_t no_os_div_u64(uint64_t dividend, uint32_t divisor)
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