Go to the documentation of this file.
12 #ifndef __AD917X_REGISTERS_H__
13 #define __AD917X_REGISTERS_H__
21 const uint16_t address, uint8_t *data, uint32_t count);
24 #define AD917X_JESD_NOF_LANES 8
25 #define AD917X_JESD_NOF_LINKS 2
26 #define AD917X_JESD_NOF_SYNCOUTB 2
27 #define AD9171_ID 9171
28 #define AD9172_ID 9172
29 #define AD9173_ID 9173
32 #define AD917X_IF_CFG_A_REG 0x000
33 #define AD917X_IF_CFG_B_REG 0x001
34 #define AD917X_DEV_CFG_REG 0x002
35 #define AD917X_CHIP_TYPE_REG 0x003
36 #define AD917X_PROD_ID_LSB_REG 0x004
37 #define AD917X_PROD_ID_MSB_REG 0x005
38 #define AD917X_CHIP_GRADE_REG 0x006
39 #define AD917X_SPI_PAGEINDX_REG 0x008
40 #define AD917X_CHANNEL_PAGE_0 NO_OS_BIT(0)
41 #define AD917X_CHANNEL_PAGE_1 NO_OS_BIT(1)
42 #define AD917X_CHANNEL_PAGE_2 NO_OS_BIT(2)
43 #define AD917X_CHANNEL_PAGE_3 NO_OS_BIT(3)
44 #define AD917X_CHANNEL_PAGE_4 NO_OS_BIT(4)
45 #define AD917X_CHANNEL_PAGE_5 NO_OS_BIT(5)
46 #define AD917X_MAINDAC_PAGE_0 NO_OS_BIT(6)
47 #define AD917X_MAINDAC_PAGE_1 NO_OS_BIT(7)
49 #define AD917X_SYSREF_ROTATION_REG 0x03B
50 #define AD917X_SYNC_LOGIC_EN NO_OS_BIT(7)
51 #define AD917X_SYNC_RSV_EN NO_OS_BIT(6)
52 #define AD917X_PERIODIC_RST_EN NO_OS_BIT(5)
53 #define AD917X_NCORST_AFTER_ROTATION NO_OS_BIT(4)
54 #define AD917X_ROTATION_MODE(x) (((x) & 0x3) << 0)
58 #define AD917X_SYSREF_CTRL_REG 0x084
59 #define AD917X_SYSREF_PD NO_OS_BIT(0)
60 #define AD917X_SYSREF_DC_COUPLED NO_OS_BIT(6)
62 #define AD917X_PLL_VCO_CTRL_REG 0x094
63 #define AD917X_PLL_VCO_DIV_EN(x) (((x) & 0x3) << 0)
65 #define AD917X_PLL_BYPASS_REG 0x095
66 #define AD917X_PLL_BYPASS(x) ((x) ? NO_OS_BIT(0) : 0)
68 #define AD917X_DLL_CTRL0_REG 0x0C1
69 #define AD917X_DLL_CFG NO_OS_BIT(6) | NO_OS_BIT(3)
70 #define AD917X_DLL_HF NO_OS_BIT(5)
71 #define AD917X_DLL_RST NO_OS_BIT(0)
72 #define AD917X_DLL_STATUS_REG 0x0C3
73 #define AD917X_DLL_LOCK NO_OS_BIT(0)
75 #define AD917X_DIG_RESET_REG 0x100
76 #define AD917X_DIG_PATH_PDN(x) ((x) ? NO_OS_BIT(0) : 0)
78 #define AD917X_JESD_MODE_REG 0x110
79 #define AD917X_JESD_MODE_INVALID NO_OS_BIT(7)
80 #define AD917X_LINK_MODE NO_OS_BIT(5)
81 #define AD917X_JESD_MODE(x) (((x) & 0x1F) << 0)
83 #define AD917X_INTERP_MODE_REG 0x111
84 #define AD917X_CH_INTERP_MODE(x) (((x) & 0xF) << 0)
85 #define AD917X_DP_INTERP_MODE(x) (((x) & 0xF) << 4)
87 #define AD917X_DDSM_DATAPATH_CFG_REG 0x112
88 #define AD917X_DDSM_MODE(x) (((x) & 0x3) << 4)
89 #define AD917X_DDSM_NCO_EN NO_OS_BIT(3)
90 #define AD917X_DDSM_MODULUS_EN NO_OS_BIT(2)
91 #define AD917X_DDSM_SEL_SIDEBAND NO_OS_BIT(1)
92 #define AD917X_DDSM_EN_SYNC_ALL_CHNL_NCO_RESETS NO_OS_BIT(0)
94 #define AD917X_DDSM_FTW_UPDATE_REG 0x113
95 #define AD917X_DDSM_FTW_LOAD_SYSREF NO_OS_BIT(2)
96 #define AD917X_DDSM_FTW_LOAD_ACK NO_OS_BIT(1)
97 #define AD917X_DDSM_FTW_LOAD_REQ NO_OS_BIT(0)
99 #define AD917X_DDSM_FTW0_REG 0x114
100 #define AD917X_DDSM_FTW1_REG 0x115
101 #define AD917X_DDSM_FTW2_REG 0x116
102 #define AD917X_DDSM_FTW3_REG 0x117
103 #define AD917X_DDSM_FTW4_REG 0x118
104 #define AD917X_DDSM_FTW5_REG 0x119
106 #define AD917X_DDSM_PHASE_OFFSET0_REG 0x11C
107 #define AD917X_DDSM_PHASE_OFFSET1_REG 0x11D
109 #define AD917X_DDSM_ACC_MODULUS0_REG 0x124
110 #define AD917X_DDSM_ACC_MODULUS1_REG 0x125
111 #define AD917X_DDSM_ACC_MODULUS2_REG 0x126
112 #define AD917X_DDSM_ACC_MODULUS3_REG 0x127
113 #define AD917X_DDSM_ACC_MODULUS4_REG 0x128
114 #define AD917X_DDSM_ACC_MODULUS5_REG 0x129
116 #define AD917X_DDSM_ACC_DELTA0_REG 0x12A
117 #define AD917X_DDSM_ACC_DELTA1_REG 0x12B
118 #define AD917X_DDSM_ACC_DELTA2_REG 0x12C
119 #define AD917X_DDSM_ACC_DELTA3_REG 0x12D
120 #define AD917X_DDSM_ACC_DELTA4_REG 0x12E
121 #define AD917X_DDSM_ACC_DELTA5_REG 0x12F
123 #define AD917X_DDSC_DATAPATH_CFG_REG 0x130
124 #define AD917X_DDSC_NCO_EN NO_OS_BIT(6)
125 #define AD917X_DDSC_MODULUS_EN NO_OS_BIT(2)
126 #define AD917X_DDSC_SEL_SIDEBAND NO_OS_BIT(1)
127 #define AD917X_DDSC_TEST_TONE_EN NO_OS_BIT(0)
129 #define AD917X_DDSC_FTW_UPDATE_REG 0x131
130 #define AD917X_DDSC_FTW_LOAD_SYSREF NO_OS_BIT(2)
131 #define AD917X_DDSC_FTW_LOAD_ACK NO_OS_BIT(1)
132 #define AD917X_DDSC_FTW_LOAD_REQ NO_OS_BIT(0)
134 #define AD917X_DDSC_FTW0_REG 0x132
135 #define AD917X_DDSC_FTW1_REG 0x133
136 #define AD917X_DDSC_FTW2_REG 0x134
137 #define AD917X_DDSC_FTW3_REG 0x135
138 #define AD917X_DDSC_FTW4_REG 0x136
139 #define AD917X_DDSC_FTW5_REG 0x137
141 #define AD917X_DDSC_PHASE_OFFSET0_REG 0x138
142 #define AD917X_DDSC_PHASE_OFFSET1_REG 0x139
144 #define AD917X_DDSC_ACC_MODULUS0_REG 0x13A
145 #define AD917X_DDSC_ACC_MODULUS1_REG 0x13B
146 #define AD917X_DDSC_ACC_MODULUS2_REG 0x13C
147 #define AD917X_DDSC_ACC_MODULUS3_REG 0x13D
148 #define AD917X_DDSC_ACC_MODULUS4_REG 0x13E
149 #define AD917X_DDSC_ACC_MODULUS5_REG 0x13F
151 #define AD917X_DDSC_ACC_DELTA0_REG 0x140
152 #define AD917X_DDSC_ACC_DELTA1_REG 0x141
153 #define AD917X_DDSC_ACC_DELTA2_REG 0x142
154 #define AD917X_DDSC_ACC_DELTA3_REG 0x143
155 #define AD917X_DDSC_ACC_DELTA4_REG 0x144
156 #define AD917X_DDSC_ACC_DELTA5_REG 0x145
158 #define AD917X_X_FTW_UPDATE_REG(x) ((x)==AD917X_DDSM?0x113:0x131)
160 #define AD917X_X_FTW0_REG(x) ((x)==AD917X_DDSM?0x114:0x132)
161 #define AD917X_X_FTW1_REG(x) ((x)==AD917X_DDSM?0x115:0x133)
162 #define AD917X_X_FTW2_REG(x) ((x)==AD917X_DDSM?0x116:0x134)
163 #define AD917X_X_FTW3_REG(x) ((x)==AD917X_DDSM?0x117:0x135)
164 #define AD917X_X_FTW4_REG(x) ((x)==AD917X_DDSM?0x118:0x136)
165 #define AD917X_X_FTW5_REG(x) ((x)==AD917X_DDSM?0x119:0x137)
167 #define AD917X_X_PHASE_OFFSET0_REG(x) ((x)==AD917X_DDSM?0x11C:0x138)
168 #define AD917X_X_PHASE_OFFSET1_REG(x) ((x)==AD917X_DDSM?0x11D:0x139)
170 #define AD917X_X_ACC_MODULUS0_REG(x) ((x)==AD917X_DDSM?0x124:0x13A)
171 #define AD917X_X_ACC_MODULUS1_REG(x) ((x)==AD917X_DDSM?0x125:0x13B)
172 #define AD917X_X_ACC_MODULUS2_REG(x) ((x)==AD917X_DDSM?0x126:0x13C)
173 #define AD917X_X_ACC_MODULUS3_REG(x) ((x)==AD917X_DDSM?0x127:0x13D)
174 #define AD917X_X_ACC_MODULUS4_REG(x) ((x)==AD917X_DDSM?0x128:0x13E)
175 #define AD917X_X_ACC_MODULUS5_REG(x) ((x)==AD917X_DDSM?0x129:0x13F)
177 #define AD917X_X_ACC_DELTA0_REG(x) ((x)==AD917X_DDSM?0x12A:0x140)
178 #define AD917X_X_ACC_DELTA1_REG(x) ((x)==AD917X_DDSM?0x12B:0x141)
179 #define AD917X_X_ACC_DELTA2_REG(x) ((x)==AD917X_DDSM?0x12C:0x142)
180 #define AD917X_X_ACC_DELTA3_REG(x) ((x)==AD917X_DDSM?0x12D:0x143)
181 #define AD917X_X_ACC_DELTA4_REG(x) ((x)==AD917X_DDSM?0x12E:0x144)
182 #define AD917X_X_ACC_DELTA5_REG(x) ((x)==AD917X_DDSM?0x12F:0x145)
184 #define AD917X_CHNL_GAIN0_REG 0x146
185 #define AD917X_CHNL_GAIN1_REG 0x147
186 #define CHANNEL_GAIN0(x) (uint8_t)((x) & 0xFF)
187 #define CHANNEL_GAIN1(x) (uint8_t)(((x) >> 8) & 0x0F)
188 #define CHANNEL_GAIN(g0, g1) (uint16_t)(((uint16_t)((g1) << 8) | (g0)) & 0xFFF)
190 #define AD917X_DC_CAL_TONE0_REG 0x148
191 #define AD917X_DC_CAL_TONE1_REG 0x149
193 #define AD917X_DDSM_CAL_MODE_DEF_REG 0x1E6
194 #define AD917X_DDSM_EN_CAL_ACC NO_OS_BIT(2)
195 #define AD917X_DDSM_EN_CAL_DC_INPUT NO_OS_BIT(1)
196 #define AD917X_DDSM_EN_CAL_FREQ_TUNE NO_OS_BIT(0)
199 #define AD917X_MASTER_PD_REG 0x200
200 #define AD917X_SERDES_PDN(x) ((x) ? NO_OS_BIT(0) : 0)
201 #define AD917X_PHY_PD_REG 0x201
202 #define AD917X_PLL_EN_CTRL_REG 0x280
203 #define AD917X_SERDES_PLL_STARTUP NO_OS_BIT(0)
205 #define AD917X_GEN_PD_REG 0x203
206 #define AD917X_SYNCOUTB_0_PD NO_OS_BIT(1)
207 #define AD917X_SYNCOUTB_1_PD NO_OS_BIT(0)
208 #define AD917X_SYNCOUTB_PD(x) (((x) & 0x3) << 0)
210 #define AD917X_SYNCOUTB_CTRL_0_REG 0x253
211 #define AD917X_SYNCOUTB_CTRL_1_REG 0x254
212 #define AD917X_SYNCOUTB_MODE(x) ((x) ? NO_OS_BIT(0) : 0)
214 #define AD917X_PLL_STATUS_REG 0x281
216 #define AD917X_JESD_RX_CTL_REG 0x300
217 #define AD917X_DUAL_MODE NO_OS_BIT(3)
218 #define AD917X_LINK_PAGE(x) ((x) ? NO_OS_BIT(2) : 0)
219 #define AD917X_LINK_EN(x) (((x) & 0x3) << 0)
220 #define AD917X_LINK_0_EN NO_OS_BIT(0)
221 #define AD917X_LINK_1_EN NO_OS_BIT(1)
223 #define AD917X_JESD_LMFC_DELAY0_REG 0x304
224 #define AD917X_JESD_LMFC_DELAY1_REG 0x305
225 #define AD917X_JESD_LMFC_DELAY(x) (((x) & 0x3F) << 0)
226 #define AD917X_JESD_LMFC_VAR0_REG 0x306
227 #define AD917X_JESD_LMFC_VAR1_REG 0x307
228 #define AD917X_JESD_LMFC_VAR(x) (((x) & 0x3F) << 0)
230 #define AD917X_JESD_XBAR_LANE_REG 0x308
231 #define AD917X_JESD_XBAR_LANE_REG 0x308
232 #define AD917X_JESD_XBAR_LANE_REG 0x308
234 #define AD917X_JESD_XBAR_LANE_REG 0x308
235 #define AD917X_XBAR_LANE_EVEN(x) (((x) & 0x7) << 0)
236 #define AD917X_XBAR_LANE_ODD(x) (((x) & 0x7) << 3)
238 #define AD917X_JESD_INVERT_LANE_REG 0x334
239 #define AD917X_JESD_INVERT_LANE(x) NO_OS_BIT(x)
241 #define AD917X_JESD_PARAM_REG_BASE 0x450
242 #define AD917X_JESD_PARAM_REG_LEN 0xB
243 #define AD917X_JESD_L_GET(x) ((x[3] & 0xF) + 1)
244 #define AD917X_JESD_F_GET(x) ((x[4]) + 1)
245 #define AD917X_JESD_K_GET(x) ((x[5] & 0x1F) + 1)
246 #define AD917X_JESD_M_GET(x) ((x[6]) + 1)
247 #define AD917X_JESD_N_GET(x) ((x[7] & 0xF) + 1)
248 #define AD917X_JESD_NP_GET(x) ((x[8] & 0xF) + 1)
249 #define AD917X_JESD_S_GET(x) ((x[9] & 0xF) + 1)
250 #define AD917X_JESD_HD_GET(x) ((x[10] & 0x80) >> 7)
251 #define AD917X_JESD_DID_GET(x) (x[0])
252 #define AD917X_JESD_BID_GET(x) (x[1])
253 #define AD917X_JESD_LID0_GET(x) (x[2] & 0xF)
254 #define AD917X_JESD_V_GET(x) ((x[9] & 0xF8) >> 5)
255 #define AD917X_JESD_L(x) (((x) & 0xF) << 0)
256 #define AD917X_JESD_NP(x) (((x) & 0xF) << 0)
258 #define AD917X_JESD_ILS_SCR_L_REG 0x453
259 #define AD917X_JESD_SCR NO_OS_BIT(7)
260 #define AD917X_JESD_ILS_NP_REG 0x458
261 #define AD917X_JESD_JESDV NO_OS_BIT(5)
263 #define AD917X_JESD_CODE_GRP_SYNC_REG 0x470
264 #define AD917X_JESD_FRAME_SYNC_REG 0x471
265 #define AD917X_JESD_GOOD_CHECKSUM_REG 0x472
266 #define AD917X_JESD_INIT_LANE_SYNC_REG 0x473
268 #define AD917X_JESD_CTRL0_REG 0x475
269 #define AD917X_JESD_QBD_SOFT_RST NO_OS_BIT(3)
273 #define AD917X_NVM_LOADER_REG 0x705
274 #define AD917X_NVM_BLR_DONE NO_OS_BIT(1)
277 #define AD917X_DACPLL_CTRLX_REG 0x790
278 #define AD917X_DACPLL_CTRLY_REG 0x791
279 #define AD917X_DACPLL_CTRL0_REG 0x792
280 #define AD917X_RESET_VCO_DIV NO_OS_BIT(1)
282 #define AD917X_DACPLL_CTRL1_REG 0x793
283 #define AD917X_M_DIV(x) (((x) & 0x3) << 0)
285 #define AD917X_DACPLL_CTRL7_REG 0x799
286 #define AD917X_L_DIV(x) (((x) & 0x3) << 6)
287 #define AD917X_N_DIV(x) (((x) & 0x3F) << 0)
290 #define AD917X_DACPLL_STATUS_REG 0x7B5
291 #define AD917X_DACPLL_LOCK NO_OS_BIT(0)
@ SYNCOUTB_0
Definition: api_def.h:215
#define AD917X_X_ACC_DELTA2_REG(x)
Definition: ad917x_reg.h:179
@ SPI_SDO
Definition: api_def.h:182
#define AD917X_JESD_BID_GET(x)
Definition: ad917x_reg.h:252
#define AD917X_JESD_PARAM_REG_BASE
Definition: ad917x_reg.h:241
int32_t ad917x_deinit(ad917x_handle_t *h)
De-initialize the AD917X Device.
Definition: ad917x_api.c:199
#define AD917X_JESD_L_GET(x)
Definition: ad917x_reg.h:243
#define AD917X_DDSM_DATAPATH_CFG_REG
Definition: ad917x_reg.h:87
#define AD917X_X_FTW_UPDATE_REG(x)
Definition: ad917x_reg.h:158
#define API_ERROR_INVALID_HANDLE_PTR
Definition: api_errors.h:29
#define AD917X_DDSM_FTW_LOAD_ACK
Definition: ad917x_reg.h:96
hw_open_t hw_open
Definition: AD917x.h:96
Definition: api_def.h:155
int32_t ad917x_jesd_set_sysref_enable(ad917x_handle_t *h, uint8_t en)
Enable SysRef Input.
Definition: ad917x_jesd_api.c:245
uint8_t jesd_CS
Definition: api_def.h:241
#define AD917X_X_ACC_MODULUS1_REG(x)
Definition: ad917x_reg.h:171
#define API_ERROR_INVALID_XFER_PTR
Definition: api_errors.h:31
#define AD917X_LINK_1_EN
Definition: ad917x_reg.h:221
#define AD917X_CHNL_GAIN0_REG
Definition: ad917x_reg.h:184
#define AD917X_DDSM_NCO_EN
Definition: ad917x_reg.h:89
@ AD917X_CH_0
Definition: AD917x.h:50
int32_t ad917x_init(ad917x_handle_t *h)
Initialize AD917X Device This API must be called first before any other API calls....
Definition: ad917x_api.c:167
#define AD917X_DACPLL_CTRLY_REG
Definition: ad917x_reg.h:278
#define AD917X_JESD_INIT_LANE_SYNC_REG
Definition: ad917x_reg.h:266
int32_t ad917x_jesd_set_lane_xbar(ad917x_handle_t *h, uint8_t logical_lane, uint8_t physical_lane)
Configure the Lane Cross Bar in the JESD datalink layer.
Definition: ad917x_jesd_api.c:486
#define API_ERROR_INIT_SEQ_FAIL
Definition: api_errors.h:45
#define AD917X_JESD_V_GET(x)
Definition: ad917x_reg.h:254
#define AD917X_PLL_STATUS_REG
Definition: ad917x_reg.h:214
int32_t ad917x_jesd_invert_lane(ad917x_handle_t *h, uint8_t logical_lane, uint8_t invert)
Invert or un-invert logical lanes.
Definition: ad917x_jesd_api.c:520
#define IN_OUT_BUFF_SZ
Definition: ad917x_reg.c:20
#define AD917X_DIG_PATH_PDN(x)
Definition: ad917x_reg.h:76
#define AD917X_SERDES_PLL_STARTUP
Definition: ad917x_reg.h:203
#define AD917X_NVM_BLR_DONE
Definition: ad917x_reg.h:274
#define AD917X_DACPLL_CTRL7_REG
Definition: ad917x_reg.h:285
#define CS_DEFAULT
Definition: ad917x_jesd_api.c:34
#define AD917X_X_ACC_DELTA4_REG(x)
Definition: ad917x_reg.h:181
#define AD917X_PLL_BYPASS_REG
Definition: ad917x_reg.h:65
@ AD917X_CH_5
Definition: AD917x.h:60
#define SYNCOUTB_INDEX(x)
Definition: ad917x_jesd_api.c:26
#define AD917X_DDSM_CAL_MODE_DEF_REG
Definition: ad917x_reg.h:193
int32_t ad917x_reset(ad917x_handle_t *h, uint8_t hw_reset)
Reset the AD917X.
Definition: ad917x_api.c:245
uint8_t jesd_L
Definition: api_def.h:231
#define AD917X_X_ACC_MODULUS4_REG(x)
Definition: ad917x_reg.h:174
#define AD917X_N_DIV(x)
Definition: ad917x_reg.h:287
#define AD917X_DLL_RST
Definition: ad917x_reg.h:71
int32_t ad917x_jesd_get_cfg_status(ad917x_handle_t *h, uint8_t *cfg_valid)
Get JESD Configuration Status.
Definition: ad917x_jesd_api.c:191
@ AD917X_CH_4
Definition: AD917x.h:58
#define AD917X_PROD_ID_MSB_REG
Definition: ad917x_reg.h:37
@ COUPLING_DC
Definition: api_def.h:202
uint8_t jesd_N
Definition: api_def.h:238
int32_t ad917x_set_dac_clk_freq(ad917x_handle_t *h, uint64_t dac_clk_freq_hz)
Set the DAC CLK Frequency.
Definition: ad917x_api.c:421
int32_t ad917x_jesd_get_cfg_param(ad917x_handle_t *h, jesd_param_t *jesd_param)
Read back all current JESD parameter settings.
Definition: ad917x_jesd_api.c:210
#define AD917X_SYSREF_PD
Definition: ad917x_reg.h:59
#define API_ERROR_INVALID_DELAYUS_PTR
Definition: api_errors.h:33
#define AD917X_X_ACC_DELTA0_REG(x)
Definition: ad917x_reg.h:177
#define LINK_INDEX(x)
Definition: ad917x_jesd_api.c:24
AD917X API interface header file.
#define AD917X_X_FTW2_REG(x)
Definition: ad917x_reg.h:162
uint8_t val
Definition: api_def.h:159
#define AD917X_JESD_MODE_REG
Definition: ad917x_reg.h:78
int32_t ad917x_jesd_set_lmfc_delay(ad917x_handle_t *h, jesd_link_t link, uint8_t delay, uint8_t var)
Set the LMFC Delay and Variance for the JESD Links.
Definition: ad917x_jesd_api.c:636
#define AD917X_IF_CFG_A_REG
Definition: ad917x_reg.h:32
#define NO_OS_S16_MAX
Definition: no_os_util.h:113
API error codes header file.
@ SYNCOUTB_1
Definition: api_def.h:216
#define AD917X_PLL_EN_CTRL_REG
Definition: ad917x_reg.h:202
#define AD917X_JESD_S_GET(x)
Definition: ad917x_reg.h:249
ad917x_dac_select_t
Definition: AD917x.h:36
ad917x_dds_select_t
Definition: AD917x.h:28
#define AD917X_DDSC_DATAPATH_CFG_REG
Definition: ad917x_reg.h:123
hw_close_t hw_close
Definition: AD917x.h:98
#define AD917X_GEN_PD_REG
Definition: ad917x_reg.h:205
#define API_ERROR_US_DELAY
Definition: api_errors.h:51
#define AD917X_JESD_MODE_INVALID
Definition: ad917x_reg.h:79
@ JESD_LINK_0
Definition: api_def.h:208
#define AD917X_XBAR_LANE_EVEN(x)
Definition: ad917x_reg.h:235
@ SIGNAL_LVDS
Definition: api_def.h:195
int32_t ad917x_get_dac_clk_status(ad917x_handle_t *h, uint8_t *pll_lock_stat, uint8_t *dll_lock_stat)
Get DAC CLK Status.
Definition: ad917x_api.c:472
#define AD917X_JESD_LMFC_VAR0_REG
Definition: ad917x_reg.h:226
#define AD917X_DDSM_EN_CAL_DC_INPUT
Definition: ad917x_reg.h:195
#define AD917X_ROTATION_MODE(x)
Definition: ad917x_reg.h:54
#define NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:49
#define AD917X_JESD_RX_CTL_REG
Definition: ad917x_reg.h:216
#define NVRAM_RESET_PERIOD_US
Definition: ad917x_api.c:22
#define AD917X_CHNL_GAIN1_REG
Definition: ad917x_reg.h:185
#define AD917X_RESET_VCO_DIV
Definition: ad917x_reg.h:280
#define AD917X_PHY_PD_REG
Definition: ad917x_reg.h:201
#define AD917X_DACPLL_CTRL1_REG
Definition: ad917x_reg.h:282
int32_t ad917x_jesd_set_scrambler_enable(ad917x_handle_t *h, uint8_t en)
Enable the de-scrambler for the JESD Interface.
Definition: ad917x_jesd_api.c:306
delay_us_t delay_us
Definition: AD917x.h:91
#define API_ERROR_SPI_XFER
Definition: api_errors.h:49
#define AD917X_X_ACC_DELTA3_REG(x)
Definition: ad917x_reg.h:180
#define CHANNEL_GAIN0(x)
Definition: ad917x_reg.h:186
#define AD917X_DACPLL_LOCK
Definition: ad917x_reg.h:291
#define DP_INTERPOLATION_MAX
Definition: ad917x_jesd_api.c:39
#define AD917X_DDSM_PHASE_OFFSET1_REG
Definition: ad917x_reg.h:107
#define AD917X_DDSM_MODE(x)
Definition: ad917x_reg.h:88
uint8_t jesd_S
Definition: api_def.h:234
#define ADI_POW2_48
Definition: api_def.h:19
#define AD917X_SYNCOUTB_1_PD
Definition: ad917x_reg.h:207
#define AD917X_JESD_MODE(x)
Definition: ad917x_reg.h:81
@ AD917X_CH_1
Definition: AD917x.h:52
#define AD917X_X_FTW3_REG(x)
Definition: ad917x_reg.h:163
signal_coupling_t sysref
Definition: AD917x.h:88
#define AD917X_JESD_ILS_NP_REG
Definition: ad917x_reg.h:260
#define SYNCOUTB_INDEX_MAX
Definition: ad917x_jesd_api.c:25
#define AD917X_X_FTW0_REG(x)
Definition: ad917x_reg.h:160
uint8_t jesd_NP
Definition: api_def.h:239
uint8_t init_lane_sync_stat
Definition: AD917x.h:72
#define AD917X_DDSC_PHASE_OFFSET1_REG
Definition: ad917x_reg.h:142
#define AD917X_JESD_CODE_GRP_SYNC_REG
Definition: ad917x_reg.h:263
Definition: api_def.h:230
@ AD917X_DDSM
Definition: AD917x.h:30
int32_t ad917x_get_page_idx(ad917x_handle_t *h, int32_t *dac, int32_t *channel)
Get select page index.
Definition: ad917x_api.c:620
#define DAC_CLK_FREQ_MAX_HZ
Definition: ad917x_api.c:32
@ AD917X_DAC1
Definition: AD917x.h:42
#define AD917X_X_FTW4_REG(x)
Definition: ad917x_reg.h:164
int32_t ad917x_jesd_get_lane_xbar(ad917x_handle_t *h, uint8_t *phy_log_map)
Get current Lane Cross Bar configuration for the JESD datalink layer.
Definition: ad917x_jesd_api.c:548
#define AD917X_DACPLL_CTRLX_REG
Definition: ad917x_reg.h:277
#define LANE_INDEX_MAX
Definition: ad917x_jesd_api.c:22
#define API_ERROR_HW_OPEN
Definition: api_errors.h:59
uint64_t dac_freq_hz
Definition: AD917x.h:89
#define AD917X_JESD_N_GET(x)
Definition: ad917x_reg.h:247
#define DAC_9171_CLK_FREQ_MAX_HZ
Definition: ad917x_api.c:31
#define AD917X_JESD_INVERT_LANE_REG
Definition: ad917x_reg.h:238
#define AD917X_PLL_BYPASS(x)
Definition: ad917x_reg.h:66
@ SPI_CONFIG_MAX
Definition: api_def.h:189
#define N(x)
Definition: ad9144.h:1269
uint8_t jesd_F
Definition: api_def.h:232
#define AD917X_NVM_LOADER_REG
Definition: ad917x_reg.h:273
#define SPI_RESET_PERIOD_US
Definition: ad917x_api.c:21
#define AD917X_SYNC_RSV_EN
Definition: ad917x_reg.h:51
#define AD917X_DIG_RESET_REG
Definition: ad917x_reg.h:75
int32_t ad917x_register_write_tbl(ad917x_handle_t *h, struct adi_reg_data *tbl, uint32_t count)
Definition: ad917x_reg.c:79
@ JESD_LINK_1
Definition: api_def.h:209
#define PFD_CLK_FREQ_MHZ_MIN
Definition: ad917x_api.c:28
int32_t ad917x_jesd_set_syncoutb_enable(ad917x_handle_t *h, jesd_syncoutb_t syncoutb, uint8_t en)
Enable the SYNCOUTB Output Signal.
Definition: ad917x_jesd_api.c:435
#define REF_CLK_FREQ_MHZ_MIN
Definition: ad917x_api.c:26
#define NO_OS_DIV_U64(x, y)
Definition: no_os_util.h:115
int32_t ad917x_set_page_idx(ad917x_handle_t *h, const uint32_t dac, const uint32_t channel)
Select Page.
Definition: ad917x_api.c:610
#define AD917X_LMFC_VAR_MAX
Definition: ad917x_jesd_api.c:46
#define AD917X_DACPLL_STATUS_REG
Definition: ad917x_reg.h:290
int32_t ad917x_register_read_block(ad917x_handle_t *h, const uint16_t address, uint8_t *data, uint32_t count)
Definition: ad917x_reg.c:64
int32_t ad917x_set_clkout_config(ad917x_handle_t *h, uint8_t l_div)
Set CLKOUT configuration.
Definition: ad917x_api.c:497
int32_t ad917x_nco_set_phase_offset(ad917x_handle_t *h, const ad917x_dac_select_t dacs, const uint16_t dacs_po, const ad917x_channel_select_t channels, const uint16_t ch_po)
Set NCO phase offset.
Definition: ad917x_nco_api.c:262
#define AD917X_DC_CAL_TONE0_REG
Definition: ad917x_reg.h:190
@ AD917X_DDSC
Definition: AD917x.h:32
int32_t ad917x_register_write_tbl(ad917x_handle_t *h, struct adi_reg_data *tbl, uint32_t count)
Definition: ad917x_reg.c:79
#define AD917X_JESD_JESDV
Definition: ad917x_reg.h:261
#define ALL
Definition: api_def.h:26
#define CHANNEL_GAIN(g0, g1)
Definition: ad917x_reg.h:188
#define CHANNEL_GAIN1(x)
Definition: ad917x_reg.h:187
int32_t ad917x_register_read(ad917x_handle_t *h, const uint16_t address, uint8_t *data)
Perform SPI register read access to AD917X Device.
Definition: ad917x_reg.c:42
#define AD917X_MASTER_PD_REG
Definition: ad917x_reg.h:199
uint8_t jesd_HD
Definition: api_def.h:236
#define AD917X_MAINDAC_PAGE_1
Definition: ad917x_reg.h:47
int32_t ad917x_dc_test_tone_set(ad917x_handle_t *h, int32_t dc_test_tone_en)
Set DC Test Tone enable status.
Definition: ad917x_nco_api.c:689
int32_t ad917x_set_dac_clk(ad917x_handle_t *h, uint64_t dac_clk_freq_hz, uint8_t dac_pll_en, uint64_t ref_clk_freq_hz)
Configure the DAC Clock Input path based on a the desired dac clock frequency, the applied reference ...
Definition: ad917x_api.c:518
uint8_t jesd_BID
Definition: api_def.h:244
#define DAC_CLK_FREQ_MIN_HZ
Definition: ad917x_api.c:33
int32_t ad917x_get_revision(ad917x_handle_t *h, uint8_t *rev_major, uint8_t *rev_minor, uint8_t *rev_rc)
Get API Revision Data.
Definition: ad917x_api.c:303
#define AD917X_JESD_LMFC_VAR(x)
Definition: ad917x_reg.h:228
#define API_ERROR_HW_CLOSE
Definition: api_errors.h:61
#define AD917X_CHIP_TYPE_REG
Definition: ad917x_reg.h:35
#define AD917X_JESD_HD_GET(x)
Definition: ad917x_reg.h:250
uint8_t jesd_JESDV
Definition: api_def.h:246
int32_t ad917x_get_channel_gain(ad917x_handle_t *h, uint16_t *gain)
Get Channel gain.
Definition: ad917x_nco_api.c:606
#define AD917X_JESD_F_GET(x)
Definition: ad917x_reg.h:244
int32_t ad917x_jesd_get_pll_status(ad917x_handle_t *h, uint8_t *pll_status)
Get SERDES PLL Status.
Definition: ad917x_jesd_api.c:471
#define AD917X_JESD_FRAME_SYNC_REG
Definition: ad917x_reg.h:264
#define API_ERROR_FTW_LOAD_ACK
Definition: api_errors.h:41
#define AD917X_X_ACC_DELTA1_REG(x)
Definition: ad917x_reg.h:178
int32_t ad917x_register_read_block(ad917x_handle_t *h, const uint16_t address, uint8_t *data, uint32_t count)
Definition: ad917x_reg.c:64
#define AD917X_X_ACC_MODULUS3_REG(x)
Definition: ad917x_reg.h:173
#define AD917X_SYNCOUTB_0_PD
Definition: ad917x_reg.h:206
int32_t ad917x_jesd_enable_datapath(ad917x_handle_t *h, uint8_t lanes_msk, uint8_t run_cal, uint8_t en)
Enable the JESD Interface.
Definition: ad917x_jesd_api.c:340
#define AD917X_M_DIV(x)
Definition: ad917x_reg.h:283
#define AD917X_LINK_MODE
Definition: ad917x_reg.h:80
#define API_ERROR_SPI_SDO
Definition: api_errors.h:27
#define AD917X_DLL_CTRL0_REG
Definition: ad917x_reg.h:68
#define ADI_GET_BYTE(w, p)
Definition: api_def.h:25
int32_t ad917x_nco_get_ftw(ad917x_handle_t *h, const ad917x_dds_select_t dds, uint64_t *ftw, uint64_t *acc_modulus, uint64_t *acc_delta)
Get FTW, ACC and MOD values.
Definition: ad917x_nco_api.c:466
int32_t ad917x_jesd_get_link_status(ad917x_handle_t *h, jesd_link_t link, ad917x_jesd_link_stat_t *link_status)
Get JESD Link Status.
Definition: ad917x_jesd_api.c:597
AD917x SPI Register Definition Header File.
#define AD917X_JESD_LMFC_DELAY(x)
Definition: ad917x_reg.h:225
#define AD917X_INTERP_MODE_REG
Definition: ad917x_reg.h:83
#define AD917X_DACPLL_CTRL0_REG
Definition: ad917x_reg.h:279
#define AD917X_DDSC_PHASE_OFFSET0_REG
Definition: ad917x_reg.h:141
#define AD917X_SYNCOUTB_MODE(x)
Definition: ad917x_reg.h:212
#define AD917X_DDSC_MODULUS_EN
Definition: ad917x_reg.h:125
int32_t ad917x_nco_set_ftw(ad917x_handle_t *h, const ad917x_dds_select_t dds, const uint64_t ftw, const uint64_t acc_modulus, const uint64_t acc_delta)
Set FTW, ACC and MOD values.
Definition: ad917x_nco_api.c:363
@ SYNCOUTB_ALL
Definition: api_def.h:217
API definitions header file.
#define AD917X_DDSM_PHASE_OFFSET0_REG
Definition: ad917x_reg.h:106
#define AD917X_JESD_NOF_LANES
Definition: ad917x_reg.h:24
int32_t ad917x_ddsm_cal_dc_input_set(ad917x_handle_t *h, int32_t ddsm_cal_dc_input_en)
Set Main DAC Cal DC Input.
Definition: ad917x_nco_api.c:728
spi_sdo_config_t sdo
Definition: AD917x.h:86
int32_t ad917x_set_channel_gain(ad917x_handle_t *h, const uint16_t gain)
Set Channel gain.
Definition: ad917x_nco_api.c:576
uint8_t frame_sync_stat
Definition: AD917x.h:68
#define API_ERROR_INVALID_PARAM
Definition: api_errors.h:35
#define PFD_CLK_FREQ_MHZ_MAX
Definition: ad917x_api.c:29
uint8_t code_grp_sync_stat
Definition: AD917x.h:66
#define AD917X_SPI_PAGEINDX_REG
Definition: ad917x_reg.h:39
#define CF_DEFAULT
Definition: ad917x_jesd_api.c:33
#define AD917X_PLL_VCO_CTRL_REG
Definition: ad917x_reg.h:62
#define AD917X_CH_INTERP_MODE(x)
Definition: ad917x_reg.h:84
#define AD917X_CHANNEL_PAGE_0
Definition: ad917x_reg.h:40
#define HW_RESET_PERIOD_US
Definition: ad917x_api.c:20
int32_t ad917x_jesd_get_sysref_enable(ad917x_handle_t *h, uint8_t *en)
Get the current SYSREF Input.
Definition: ad917x_jesd_api.c:287
uint8_t jesd_K
Definition: api_def.h:237
#define AD917X_CHIP_GRADE_REG
Definition: ad917x_reg.h:38
@ AD917X_CH_2
Definition: AD917x.h:54
int32_t ad917x_nco_channel_freq_get(ad917x_handle_t *h, ad917x_channel_select_t channel, int64_t *carrier_freq_hz)
Get Channel NCO frequency.
Definition: ad917x_nco_api.c:967
#define AD917X_SYSREF_CTRL_REG
Definition: ad917x_reg.h:58
#define AD917X_JESD_K_GET(x)
Definition: ad917x_reg.h:245
uint32_t gcd(uint32_t x, uint32_t y)
Computes the greatest common divider of two numbers.
Definition: adf4156.c:208
#define AD9171_ID
Definition: ad917x_reg.h:27
#define AD917X_JESD_PARAM_REG_LEN
Definition: ad917x_reg.h:242
int32_t ad917x_get_chip_id(ad917x_handle_t *h, adi_chip_id_t *chip_id)
Get Chip Identification Data.
Definition: ad917x_api.c:212
#define NULL
Definition: wrapper.h:64
#define REF_CLK_FREQ_MHZ_MAX
Definition: ad917x_api.c:27
@ JESD_LINK_ALL
Definition: api_def.h:210
int32_t ad917x_nco_set(ad917x_handle_t *h, const ad917x_dac_select_t dacs, const ad917x_channel_select_t channels, const int64_t carrier_freq_hz, const uint16_t amplitude, int32_t dc_test_tone_en, int32_t ddsm_cal_dc_input_en)
Set NCO.
Definition: ad917x_nco_api.c:772
#define LINK_INDEX_MAX
Definition: ad917x_jesd_api.c:23
#define AD917X_JESD_XBAR_LANE_REG
Definition: ad917x_reg.h:234
#define INTERPOLATION_MIN
Definition: ad917x_jesd_api.c:38
#define AD917X_JESD_GOOD_CHECKSUM_REG
Definition: ad917x_reg.h:265
spi_xfer_t dev_xfer
Definition: AD917x.h:90
#define AD917X_PLL_VCO_DIV_EN(x)
Definition: ad917x_reg.h:63
#define AD917X_X_FTW5_REG(x)
Definition: ad917x_reg.h:165
@ AD917X_DAC0
Definition: AD917x.h:40
#define AD917X_JESD_LMFC_DELAY1_REG
Definition: ad917x_reg.h:224
#define AD917X_JESD_M_GET(x)
Definition: ad917x_reg.h:246
#define AD917X_DDSC_NCO_EN
Definition: ad917x_reg.h:124
#define AD917X_JESD_INVERT_LANE(x)
Definition: ad917x_reg.h:239
Definition: api_def.h:163
int32_t ad917x_get_dac_clk_freq(ad917x_handle_t *h, uint64_t *dac_clk_freq_hz)
Get the DAC CLK Frequency.
Definition: ad917x_api.c:461
int32_t ad917x_set_dc_cal_tone_amp(ad917x_handle_t *h, const uint16_t amp)
Set DC Calibration tone.
Definition: ad917x_nco_api.c:591
#define ADI_MAXUINT48
Definition: api_def.h:20
int32_t ad917x_nco_get_phase_offset(ad917x_handle_t *h, const ad917x_dac_select_t dacs, uint16_t *dacs_po, const ad917x_channel_select_t channels, uint16_t *ch_po)
Get NCO phase offset.
Definition: ad917x_nco_api.c:311
@ AD917X_CH_3
Definition: AD917x.h:56
#define AD917X_SYNCOUTB_CTRL_0_REG
Definition: ad917x_reg.h:210
#define AD917X_JESD_DID_GET(x)
Definition: ad917x_reg.h:251
#define AD917X_X_ACC_MODULUS2_REG(x)
Definition: ad917x_reg.h:172
uint8_t jesd_M
Definition: api_def.h:233
#define AD917X_PERIODIC_RST_EN
Definition: ad917x_reg.h:52
#define AD917X_JESD_NP_GET(x)
Definition: ad917x_reg.h:248
int32_t ad917x_nco_main_freq_get(ad917x_handle_t *h, ad917x_dac_select_t dac, int64_t *carrier_freq_hz)
Get Main DAC NCO frequency.
Definition: ad917x_nco_api.c:949
int32_t ad917x_dc_test_tone_get(ad917x_handle_t *h, int32_t *dc_test_tone_en)
Get DC Test Tone enable status.
Definition: ad917x_nco_api.c:709
#define AD917X_DP_INTERP_MODE(x)
Definition: ad917x_reg.h:85
#define AD917X_X_ACC_MODULUS0_REG(x)
Definition: ad917x_reg.h:170
#define AD917X_L_DIV(x)
Definition: ad917x_reg.h:286
#define API_ERROR_OK
Definition: api_errors.h:25
#define DLL_CLK_FREQ_THRES_HZ
Definition: ad917x_api.c:30
reset_pin_ctrl_t reset_pin_ctrl
Definition: AD917x.h:95
uint8_t jesd_CF
Definition: api_def.h:240
void * user_data
Definition: AD917x.h:85
#define AD917X_JESD_ILS_SCR_L_REG
Definition: ad917x_reg.h:258
#define JESD_MODE_INVALID
Definition: ad917x_jesd_api.c:45
signal_type_t syncoutb
Definition: AD917x.h:87
#define AD917X_XBAR_LANE_ODD(x)
Definition: ad917x_reg.h:236
#define API_ERROR_RESET_PIN_CTRL
Definition: api_errors.h:55
int32_t ad917x_nco_enable(ad917x_handle_t *h, const ad917x_dac_select_t dacs, const ad917x_channel_select_t channels)
NCO Enable.
Definition: ad917x_nco_api.c:624
#define CH_INTERPOLATION_MAX
Definition: ad917x_jesd_api.c:40
#define AD917X_SYSREF_ROTATION_REG
Definition: ad917x_reg.h:49
jesd_link_t
Definition: api_def.h:207
#define AD917X_X_FTW1_REG(x)
Definition: ad917x_reg.h:161
#define AD917X_DDSM_MODULUS_EN
Definition: ad917x_reg.h:90
int32_t ad917x_set_dac_pll_config(ad917x_handle_t *h, uint8_t dac_pll_en, uint8_t m_div, uint8_t n_div, uint8_t vco_div)
Configure the On Chip DAC PLL.
Definition: ad917x_api.c:325
#define AD917X_DDSM_FTW_LOAD_REQ
Definition: ad917x_reg.h:97
#define AD917X_JESD_SCR
Definition: ad917x_reg.h:259
uint8_t jesd_DID
Definition: api_def.h:243
int32_t ad917x_register_write(ad917x_handle_t *h, const uint16_t address, const uint8_t data)
Perform SPI register write access to AD917X Device.
Definition: ad917x_reg.c:22
#define AD917X_JESD_LMFC_VAR1_REG
Definition: ad917x_reg.h:227
uint16_t reg
Definition: api_def.h:157
#define AD917X_LINK_PAGE(x)
Definition: ad917x_reg.h:218
uint16_t prod_id
Definition: api_def.h:167
#define AD917X_JESD_LMFC_DELAY0_REG
Definition: ad917x_reg.h:223
#define AD917X_LINK_0_EN
Definition: ad917x_reg.h:220
int32_t ad917x_ddsm_cal_dc_input_get(ad917x_handle_t *h, int32_t *ddsm_cal_dc_input_en)
Get Main DAC Cal DC Input.
Definition: ad917x_nco_api.c:749
uint8_t good_checksum_stat
Definition: AD917x.h:70
#define AD917X_DC_CAL_TONE1_REG
Definition: ad917x_reg.h:191
#define AD917X_PROD_ID_LSB_REG
Definition: ad917x_reg.h:36
#define AD917X_X_ACC_MODULUS5_REG(x)
Definition: ad917x_reg.h:175
#define AD917X_DLL_STATUS_REG
Definition: ad917x_reg.h:72
int32_t ad917x_jesd_enable_link(ad917x_handle_t *h, jesd_link_t link, uint8_t en)
Enable JESD Link.
Definition: ad917x_jesd_api.c:571
#define AD917X_DDSC_TEST_TONE_EN
Definition: ad917x_reg.h:127
#define SERDES_PWRUP_DELAY
Definition: ad917x_jesd_api.c:20
#define AD917X_SERDES_PDN(x)
Definition: ad917x_reg.h:200
#define AD917X_DLL_LOCK
Definition: ad917x_reg.h:73
#define NO_OS_DIV_ROUND_CLOSEST(x, y)
Definition: no_os_util.h:54
int32_t ad917x_jesd_config_datapath(ad917x_handle_t *h, uint8_t dual_en, uint8_t jesd_mode, uint8_t ch_intpl, uint8_t dp_intpl)
Configure the JESD Datapath for AD917X.
Definition: ad917x_jesd_api.c:134
#define U64MSB
Definition: ad9208_adc_api.c:53
#define AD917X_MAINDAC_PAGE_0
Definition: ad917x_reg.h:46
chip_id
Definition: ad9172.h:51
#define AD917X_LINK_EN(x)
Definition: ad917x_reg.h:219
@ SPI_SDIO
Definition: api_def.h:187
jesd_syncoutb_t
Definition: api_def.h:214
ad917x_channel_select_t
Definition: AD917x.h:46
#define AD917X_X_ACC_DELTA5_REG(x)
Definition: ad917x_reg.h:182