Go to the documentation of this file.
35 #define ADF5355_REG(x) (x)
38 #define ADF5355_REG0_INT(x) (((x) & 0xFFFF) << 4)
39 #define ADF5355_REG0_PRESCALER(x) ((x) << 20)
40 #define ADF5355_REG0_AUTOCAL(x) ((x) << 21)
43 #define ADF5355_REG1_FRACT(x) (((x) & 0xFFFFFF) << 4)
46 #define ADF5355_REG2_MOD2(x) (((x) & 0x3FFF) << 4)
47 #define ADF5355_REG2_FRAC2(x) (((x) & 0x3FFF) << 18)
50 #define ADF5355_REG3_PHASE(x) (((x) & 0xFFFFFF) << 4)
51 #define ADF5355_REG3_PHASE_ADJUST(x) ((x) << 28)
52 #define ADF5355_REG3_PHASE_RESYNC(x) ((x) << 29)
53 #define ADF5355_REG3_EXACT_SDLOAD_RESET(x) ((x) << 30)
56 #define ADF5355_REG4_COUNTER_RESET_EN(x) ((x) << 4)
57 #define ADF5355_REG4_CP_THREESTATE_EN(x) ((x) << 5)
58 #define ADF5355_REG4_POWER_DOWN_EN(x) ((x) << 6)
59 #define ADF5355_REG4_PD_POLARITY_POS(x) ((x) << 7)
60 #define ADF5355_REG4_MUX_LOGIC(x) ((x) << 8)
61 #define ADF5355_REG4_REFIN_MODE_DIFF(x) ((x) << 9)
62 #define ADF5355_REG4_CHARGE_PUMP_CURR(x) (((x) & 0xF) << 10)
63 #define ADF5355_REG4_DOUBLE_BUFF_EN(x) ((x) << 14)
64 #define ADF5355_REG4_10BIT_R_CNT(x) (((x) & 0x3FF) << 15)
65 #define ADF5355_REG4_RDIV2_EN(x) ((x) << 25)
66 #define ADF5355_REG4_RMULT2_EN(x) ((x) << 26)
67 #define ADF5355_REG4_MUXOUT(x) (((x) & 0x7) << 27)
70 #define ADF5355_REG5_DEFAULT 0x00800025
73 #define ADF4355_REG6_OUTPUTB_PWR(x) (((x) & 0x3) << 7)
74 #define ADF4355_REG6_RF_OUTB_EN(x) ((x) << 9)
75 #define ADF4356_REG6_RF_OUTB_SEL(x) ((x) << 25)
76 #define ADF5355_REG6_OUTPUT_PWR(x) (((x) & 0x3) << 4)
77 #define ADF5355_REG6_RF_OUT_EN(x) ((x) << 6)
78 #define ADF5355_REG6_RF_OUTB_EN(x) ((x) << 10)
79 #define ADF5355_REG6_MUTE_TILL_LOCK_EN(x) ((x) << 11)
80 #define ADF5355_REG6_CP_BLEED_CURR(x) (((x) & 0xFF) << 13)
81 #define ADF5355_REG6_RF_DIV_SEL(x) (((x) & 0x7) << 21)
82 #define ADF5355_REG6_FEEDBACK_FUND(x) ((x) << 24)
83 #define ADF5355_REG6_NEG_BLEED_EN(x) ((x) << 29)
84 #define ADF5355_REG6_GATED_BLEED_EN(x) ((x) << 30)
85 #define ADF5356_REG6_BLEED_POLARITY(x) ((x) << 31)
86 #define ADF5355_REG6_DEFAULT 0x14000006
89 #define ADF5355_REG7_LD_MODE_INT_N_EN(x) ((x) << 4)
90 #define ADF5355_REG7_FACT_N_LD_PRECISION(x) (((x) & 0x3) << 5)
91 #define ADF5355_REG7_LOL_MODE_EN(x) ((x) << 7)
92 #define ADF5355_REG7_LD_CYCLE_CNT(x) (((x) & 0x3) << 8)
93 #define ADF5355_REG7_LE_SYNCED_REFIN_EN(x) ((x) << 25)
94 #define ADF5356_REG7_LE_SYNCE_EDGE_RISING_EN(x) ((x) << 27)
95 #define ADF5355_REG7_DEFAULT 0x10000007
96 #define ADF5356_REG7_DEFAULT 0x04000007
99 #define ADF5355_REG8_DEFAULT 0x102D0428
100 #define ADF5356_REG8_DEFAULT 0x15596568
103 #define ADF5355_REG9_SYNTH_LOCK_TIMEOUT(x) (((x) & 0x1F) << 4)
104 #define ADF5355_REG9_ALC_TIMEOUT(x) (((x) & 0x1F) << 9)
105 #define ADF5355_REG9_TIMEOUT(x) (((x) & 0x3FF) << 14)
106 #define ADF5355_REG9_VCO_BAND_DIV(x) (((x) & 0xFF) << 24)
109 #define ADF5355_REG10_ADC_EN(x) ((x) << 4)
110 #define ADF5355_REG10_ADC_CONV_EN(x) ((x) << 5)
111 #define ADF5355_REG10_ADC_CLK_DIV(x) (((x) & 0xFF) << 6)
112 #define ADF5355_REG10_DEFAULT 0x00C0000A
115 #define ADF5356_REG11_VCO_BAND_HOLD_EN(x) ((x) << 24)
116 #define ADF5355_REG11_DEFAULT 0x0061300B
117 #define ADF5356_REG11_DEFAULT 0x0061200B
120 #define ADF5355_REG12_PHASE_RESYNC_CLK_DIV(x) (((x) & 0xFFFF) << 16)
121 #define ADF5355_REG12_DEFAULT 0x0000041C
122 #define ADF5356_REG12_PHASE_RESYNC_CLK_DIV(x) (((x) & 0xFFFFF) << 12)
123 #define ADF5356_REG12_DEFAULT 0x000005FC
126 #define ADF5356_REG13_MOD2_MSB(x) (((x) & 0x3FFF) << 4)
127 #define ADF5356_REG13_FRAC2_MSB(x) (((x) & 0x3FFF) << 18)
130 #define ADF5355_MIN_VCO_FREQ 3400000000ULL
131 #define ADF5355_MAX_VCO_FREQ 6800000000ULL
132 #define ADF5355_MAX_OUT_FREQ ADF5355_MAX_VCO_FREQ
133 #define ADF5355_MIN_OUT_FREQ (ADF5355_MIN_VCO_FREQ / 64)
134 #define ADF5355_MAX_OUTB_FREQ (ADF5355_MAX_VCO_FREQ * 2)
135 #define ADF5355_MIN_OUTB_FREQ (ADF5355_MIN_VCO_FREQ * 2)
137 #define ADF4356_MIN_VCO_FREQ ADF5355_MIN_VCO_FREQ
138 #define ADF4356_MAX_VCO_FREQ ADF5355_MAX_VCO_FREQ
140 #define ADF4355_MIN_VCO_FREQ 3400000000ULL
141 #define ADF4355_MAX_VCO_FREQ 6800000000ULL
142 #define ADF4355_MAX_OUT_FREQ ADF4355_MAX_VCO_FREQ
143 #define ADF4355_MIN_OUT_FREQ (ADF4355_MIN_VCO_FREQ / 64)
145 #define ADF4355_3_MIN_VCO_FREQ 3300000000ULL
146 #define ADF4355_3_MAX_VCO_FREQ 6600000000ULL
147 #define ADF4355_3_MAX_OUT_FREQ ADF4355_3_MAX_VCO_FREQ
148 #define ADF4355_3_MIN_OUT_FREQ (ADF4355_3_MIN_VCO_FREQ / 64)
150 #define ADF4355_2_MIN_VCO_FREQ 3400000000ULL
151 #define ADF4355_2_MAX_VCO_FREQ 6800000000ULL
152 #define ADF4355_2_MAX_OUT_FREQ 4400000000ULL
153 #define ADF4355_2_MIN_OUT_FREQ (ADF4355_2_MIN_VCO_FREQ / 64)
155 #define ADF5355_MAX_FREQ_PFD 75000000UL
156 #define ADF5355_MAX_FREQ_REFIN 600000000UL
157 #define ADF5355_MAX_MODULUS2 16384
158 #define ADF5356_MAX_MODULUS2 268435456
159 #define ADF5355_MAX_R_CNT 1023
161 #define ADF5355_MODULUS1 16777216ULL
162 #define ADF5355_MIN_INT_PRESCALER_89 75
164 #define ADF5355_REG_NUM 14
166 #define ADF5355_SPI_NO_BYTES 4
289 uint64_t *rounded_rate);
#define ADF5355_REG0_INT(x)
Definition: adf5355.h:38
#define ADF5356_REG12_PHASE_RESYNC_CLK_DIV(x)
Definition: adf5355.h:122
uint8_t ref_div2_en
Definition: adf5355.h:270
int32_t adf5355_clk_round_rate(struct adf5355_dev *dev, uint64_t rate, uint64_t *rounded_rate)
Definition: adf5355.c:361
int32_t adf5355_init(struct adf5355_dev **device, const struct adf5355_init_param *init_param)
Initializes the ADF5355.
Definition: adf5355.c:458
#define ADF5355_REG6_RF_OUTB_EN(x)
Definition: adf5355.h:78
bool all_synced
Definition: adf5355.h:212
uint8_t outb_power
Definition: adf5355.h:265
@ ADF4356
Definition: adf5355.h:187
#define ADF5355_REG9_SYNTH_LOCK_TIMEOUT(x)
Definition: adf5355.h:103
#define ADF5355_REG7_LD_MODE_INT_N_EN(x)
Definition: adf5355.h:89
#define ADF5355_REG6_NEG_BLEED_EN(x)
Definition: adf5355.h:83
struct no_os_spi_init_param * spi_init
Definition: adf5355.h:252
enum adf5355_mux_out_sel mux_out_sel
Definition: adf5355.h:243
bool ref_diff_en
Definition: adf5355.h:236
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
Device descriptor.
Definition: adf5355.h:209
uint8_t num_channels
Definition: adf5355.h:216
uint32_t delay_us
Definition: adf5355.h:244
uint64_t freq_req
Definition: adf5355.h:214
Header file of SPI Interface.
#define ADF5355_REG2_FRAC2(x)
Definition: adf5355.h:47
Definition: adf5355.h:251
#define ADF5355_REG0_PRESCALER(x)
Definition: adf5355.h:39
#define ADF5355_REG7_FACT_N_LD_PRECISION(x)
Definition: adf5355.h:90
#define ADF5355_REG4_COUNTER_RESET_EN(x)
Definition: adf5355.h:56
int32_t adf5355_clk_set_rate(struct adf5355_dev *dev, uint32_t chan, uint64_t rate)
Definition: adf5355.c:345
#define ADF5355_REG5_DEFAULT
Definition: adf5355.h:70
uint32_t clkin_freq
Definition: adf5355.h:217
uint8_t ref_div2_en
Definition: adf5355.h:240
uint8_t ref_doubler_en
Definition: adf5355.h:239
@ ADF5355_MUXOUT_ANALOG_LOCK_DETECT
Definition: adf5355.h:201
@ ADF5355_MUXOUT_GND
Definition: adf5355.h:198
Header file of Delay functions.
#define ADF4355_REG6_RF_OUTB_EN(x)
Definition: adf5355.h:74
bool outb_sel_fund
Definition: adf5355.h:272
#define ADF5355_REG4_POWER_DOWN_EN(x)
Definition: adf5355.h:58
#define ADF5355_REG6_MUTE_TILL_LOCK_EN(x)
Definition: adf5355.h:79
enum adf5355_device_id dev_id
Definition: adf5355.h:211
adf5355_device_id
Devices supported by the drivers.
Definition: adf5355.h:182
#define ADF5355_REG6_FEEDBACK_FUND(x)
Definition: adf5355.h:82
@ ADF4355
Definition: adf5355.h:184
#define ADF4355_REG6_OUTPUTB_PWR(x)
Definition: adf5355.h:73
@ ADF5355_MUXOUT_N_DIV_OUT
Definition: adf5355.h:200
#define ADF4355_MIN_OUT_FREQ
Definition: adf5355.h:143
Definition: ad9361_util.h:69
uint8_t freq_req_chan
Definition: adf5355.h:255
bool cp_gated_bleed_en
Definition: adf5355.h:228
@ ADF5355_MUXOUT_DIGITAL_LOCK_DETECT
Definition: adf5355.h:202
bool cp_bleed_current_polarity_en
Definition: adf5355.h:260
@ ADF5356
Definition: adf5355.h:188
#define ADF5355_REG6_DEFAULT
Definition: adf5355.h:86
uint32_t fpfd
Definition: adf5355.h:221
#define ADF5355_REG9_TIMEOUT(x)
Definition: adf5355.h:105
bool outb_en
Definition: adf5355.h:263
#define ADF5355_REG4_10BIT_R_CNT(x)
Definition: adf5355.h:64
#define ADF5355_MAX_OUT_FREQ
Definition: adf5355.h:132
int32_t adf5355_clk_recalc_rate(struct adf5355_dev *dev, uint32_t chan, uint64_t *rate)
Definition: adf5355.c:327
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
#define NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:49
#define ADF5355_REG10_DEFAULT
Definition: adf5355.h:112
#define ADF5355_REG12_PHASE_RESYNC_CLK_DIV(x)
Definition: adf5355.h:120
#define ADF4355_MIN_VCO_FREQ
Definition: adf5355.h:140
uint64_t max_out_freq
Definition: adf5355.h:218
#define ADF5355_REG0_AUTOCAL(x)
Definition: adf5355.h:40
#define ADF5355_REG10_ADC_CONV_EN(x)
Definition: adf5355.h:110
#define ADF5356_REG7_DEFAULT
Definition: adf5355.h:96
#define ADF5355_REG9_ALC_TIMEOUT(x)
Definition: adf5355.h:104
@ ADF5355_MUXOUT_THREESTATE
Definition: adf5355.h:196
uint8_t rf_div_sel
Definition: adf5355.h:241
uint32_t regs[ADF5355_REG_NUM]
Definition: adf5355.h:213
uint64_t no_os_do_div(uint64_t *n, uint64_t base)
uint32_t integer
Definition: adf5355.h:222
#define NO_OS_DIV_ROUND_UP(x, y)
Definition: no_os_util.h:52
int32_t adf5355_clk_set_rate(struct adf5355_dev *dev, uint32_t chan, uint64_t rate)
Definition: adf5355.c:345
#define ADF5355_REG6_CP_BLEED_CURR(x)
Definition: adf5355.h:80
@ ADF5355
Definition: adf5355.h:183
uint32_t fract1
Definition: adf5355.h:223
uint32_t cp_ua
Definition: adf5355.h:226
uint64_t freq
Definition: adf4382.h:493
#define ADF4355_2_MIN_VCO_FREQ
Definition: adf5355.h:150
Header file for adf5355 Driver.
uint32_t cp_ua
Definition: adf5355.h:257
#define ADF5355_MIN_VCO_FREQ
Definition: adf5355.h:130
#define ADF5355_REG6_OUTPUT_PWR(x)
Definition: adf5355.h:76
@ ADF4355_2
Definition: adf5355.h:185
#define ADF5355_REG4_RDIV2_EN(x)
Definition: adf5355.h:65
#define ADF5355_REG1_FRACT(x)
Definition: adf5355.h:43
#define ADF5355_REG_NUM
Definition: adf5355.h:164
#define ADF5355_REG10_ADC_CLK_DIV(x)
Definition: adf5355.h:111
int32_t adf5355_clk_recalc_rate(struct adf5355_dev *dev, uint32_t chan, uint64_t *rate)
Definition: adf5355.c:327
#define ADF5355_MAX_OUTB_FREQ
Definition: adf5355.h:134
bool outa_en
Definition: adf5355.h:262
bool mute_till_lock_en
Definition: adf5355.h:230
adf5355_mux_out_sel
Muxout selection.
Definition: adf5355.h:195
bool cp_neg_bleed_en
Definition: adf5355.h:258
#define ADF5355_REG4_DOUBLE_BUFF_EN(x)
Definition: adf5355.h:63
uint64_t freq_req
Definition: adf5355.h:254
#define ADF5355_MIN_INT_PRESCALER_89
Definition: adf5355.h:162
#define ADF5355_REG4_MUX_LOGIC(x)
Definition: adf5355.h:60
#define ADF5355_REG9_VCO_BAND_DIV(x)
Definition: adf5355.h:106
#define ADF5356_REG8_DEFAULT
Definition: adf5355.h:100
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
#define ADF5356_REG13_MOD2_MSB(x)
Definition: adf5355.h:126
bool mute_till_lock_en
Definition: adf5355.h:261
#define no_os_clamp(val, min_val, max_val)
Definition: no_os_util.h:69
#define ADF5355_SPI_NO_BYTES
Definition: adf5355.h:166
@ ADF5355_MUXOUT_DVDD
Definition: adf5355.h:197
bool mux_out_3v3_en
Definition: adf5355.h:237
uint32_t fract2
Definition: adf5355.h:224
uint8_t outa_power
Definition: adf5355.h:264
bool phase_detector_polarity_neg
Definition: adf5355.h:266
uint32_t no_os_greatest_common_divisor(uint32_t a, uint32_t b)
bool outb_en
Definition: adf5355.h:232
@ ADF5355_MUXOUT_R_DIV_OUT
Definition: adf5355.h:199
uint8_t phase_detector_polarity_neg
Definition: adf5355.h:235
struct no_os_spi_desc * spi_desc
Definition: adf5355.h:210
#define ADF5355_REG11_DEFAULT
Definition: adf5355.h:116
#define ADF4355_3_MIN_OUT_FREQ
Definition: adf5355.h:148
#define ADF5355_REG10_ADC_EN(x)
Definition: adf5355.h:109
#define ADF5355_REG4_MUXOUT(x)
Definition: adf5355.h:67
#define ADF5355_REG7_LD_CYCLE_CNT(x)
Definition: adf5355.h:92
#define ADF4355_3_MAX_OUT_FREQ
Definition: adf5355.h:147
#define ADF5355_REG12_DEFAULT
Definition: adf5355.h:121
#define ADF5355_MIN_OUTB_FREQ
Definition: adf5355.h:135
uint64_t min_vco_freq
Definition: adf5355.h:220
uint8_t freq_req_chan
Definition: adf5355.h:215
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
#define ADF5355_REG7_LOL_MODE_EN(x)
Definition: adf5355.h:91
uint32_t mod2
Definition: adf5355.h:225
#define ADF5355_MIN_OUT_FREQ
Definition: adf5355.h:133
@ ADF4355_3
Definition: adf5355.h:186
bool outa_en
Definition: adf5355.h:231
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:114
uint32_t clkin_freq
Definition: adf5355.h:256
#define ADF5355_MODULUS1
Definition: adf5355.h:161
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
#define ADF5355_REG(x)
Definition: adf5355.h:35
uint8_t outb_power
Definition: adf5355.h:234
#define ADF5355_REG7_LE_SYNCED_REFIN_EN(x)
Definition: adf5355.h:93
#define ADF4355_3_MIN_VCO_FREQ
Definition: adf5355.h:145
#define ADF4355_2_MAX_OUT_FREQ
Definition: adf5355.h:152
bool cp_neg_bleed_en
Definition: adf5355.h:227
uint8_t ref_doubler_en
Definition: adf5355.h:269
bool outb_sel_fund
Definition: adf5355.h:238
#define ADF5355_REG8_DEFAULT
Definition: adf5355.h:99
int32_t adf5355_clk_round_rate(struct adf5355_dev *dev, uint64_t rate, uint64_t *rounded_rate)
Definition: adf5355.c:361
#define ADF5355_REG4_REFIN_MODE_DIFF(x)
Definition: adf5355.h:61
#define ADF5356_REG7_LE_SYNCE_EDGE_RISING_EN(x)
Definition: adf5355.h:94
bool cp_bleed_current_polarity_en
Definition: adf5355.h:229
uint16_t ref_div_factor
Definition: adf5355.h:242
#define ADF5355_MAX_MODULUS2
Definition: adf5355.h:157
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
#define ADF5355_REG2_MOD2(x)
Definition: adf5355.h:46
#define ADF5355_MAX_FREQ_PFD
Definition: adf5355.h:155
#define ADF5355_REG4_CHARGE_PUMP_CURR(x)
Definition: adf5355.h:62
#define ADF5356_REG13_FRAC2_MSB(x)
Definition: adf5355.h:127
enum adf5355_device_id dev_id
Definition: adf5355.h:253
#define ADF5355_REG6_GATED_BLEED_EN(x)
Definition: adf5355.h:84
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
#define ADF4355_MAX_OUT_FREQ
Definition: adf5355.h:142
int32_t adf5355_remove(struct adf5355_dev *device)
Definition: adf5355.c:541
#define ADF5355_REG4_RMULT2_EN(x)
Definition: adf5355.h:66
Header file of utility functions.
#define ADF5355_REG4_CP_THREESTATE_EN(x)
Definition: adf5355.h:57
enum adf5355_mux_out_sel mux_out_sel
Definition: adf5355.h:271
uint8_t outa_power
Definition: adf5355.h:233
#define ADF5355_REG6_RF_OUT_EN(x)
Definition: adf5355.h:77
int32_t adf5355_remove(struct adf5355_dev *device)
Definition: adf5355.c:541
#define ADF5355_REG6_RF_DIV_SEL(x)
Definition: adf5355.h:81
uint64_t min_out_freq
Definition: adf5355.h:219
#define ADF4356_REG6_RF_OUTB_SEL(x)
Definition: adf5355.h:75
bool cp_gated_bleed_en
Definition: adf5355.h:259
#define ADF5355_REG7_DEFAULT
Definition: adf5355.h:95
#define ADF5356_REG12_DEFAULT
Definition: adf5355.h:123
#define ADF5356_REG6_BLEED_POLARITY(x)
Definition: adf5355.h:85
bool mux_out_3v3_en
Definition: adf5355.h:268
#define NO_OS_DIV_ROUND_CLOSEST(x, y)
Definition: no_os_util.h:54
int32_t adf5355_init(struct adf5355_dev **device, const struct adf5355_init_param *init_param)
Initializes the ADF5355.
Definition: adf5355.c:458
#define ADF5355_REG4_PD_POLARITY_POS(x)
Definition: adf5355.h:59
#define ADF4355_2_MIN_OUT_FREQ
Definition: adf5355.h:153
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
#define ADF5356_MAX_MODULUS2
Definition: adf5355.h:158
bool ref_diff_en
Definition: adf5355.h:267