no-OS
adf5355.h
Go to the documentation of this file.
1 /***************************************************************************/
34 /* Register Definition */
35 #define ADF5355_REG(x) (x)
36 
37 /* REG0 Bit Definitions */
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)
41 
42 /* REG1 Bit Definitions */
43 #define ADF5355_REG1_FRACT(x) (((x) & 0xFFFFFF) << 4)
44 
45 /* REG2 Bit Definitions */
46 #define ADF5355_REG2_MOD2(x) (((x) & 0x3FFF) << 4)
47 #define ADF5355_REG2_FRAC2(x) (((x) & 0x3FFF) << 18)
48 
49 /* REG3 Bit Definitions */
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)
54 
55 /* REG4 Bit Definitions */
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)
68 
69 /* REG5 Bit Definitions */
70 #define ADF5355_REG5_DEFAULT 0x00800025
71 
72 /* REG6 Bit Definitions */
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
87 
88 /* REG7 Bit Definitions */
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
97 
98 /* REG8 Bit Definitions */
99 #define ADF5355_REG8_DEFAULT 0x102D0428
100 #define ADF5356_REG8_DEFAULT 0x15596568
101 
102 /* REG9 Bit Definitions */
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)
107 
108 /* REG10 Bit Definitions */
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
113 
114 /* REG11 Bit Definitions */
115 #define ADF5356_REG11_VCO_BAND_HOLD_EN(x) ((x) << 24)
116 #define ADF5355_REG11_DEFAULT 0x0061300B
117 #define ADF5356_REG11_DEFAULT 0x0061200B
118 
119 /* REG12 Bit Definitions */
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
124 
125 /* REG13 Bit Definitions (ADF5356) */
126 #define ADF5356_REG13_MOD2_MSB(x) (((x) & 0x3FFF) << 4)
127 #define ADF5356_REG13_FRAC2_MSB(x) (((x) & 0x3FFF) << 18)
128 
129 /* Specifications */
130 #define ADF5355_MIN_VCO_FREQ 3400000000ULL /* Hz */
131 #define ADF5355_MAX_VCO_FREQ 6800000000ULL /* Hz */
132 #define ADF5355_MAX_OUT_FREQ ADF5355_MAX_VCO_FREQ /* Hz */
133 #define ADF5355_MIN_OUT_FREQ (ADF5355_MIN_VCO_FREQ / 64) /* Hz */
134 #define ADF5355_MAX_OUTB_FREQ (ADF5355_MAX_VCO_FREQ * 2) /* Hz */
135 #define ADF5355_MIN_OUTB_FREQ (ADF5355_MIN_VCO_FREQ * 2) /* Hz */
136 
137 #define ADF4356_MIN_VCO_FREQ ADF5355_MIN_VCO_FREQ /* Hz */
138 #define ADF4356_MAX_VCO_FREQ ADF5355_MAX_VCO_FREQ /* Hz */
139 
140 #define ADF4355_MIN_VCO_FREQ 3400000000ULL /* Hz */
141 #define ADF4355_MAX_VCO_FREQ 6800000000ULL /* Hz */
142 #define ADF4355_MAX_OUT_FREQ ADF4355_MAX_VCO_FREQ /* Hz */
143 #define ADF4355_MIN_OUT_FREQ (ADF4355_MIN_VCO_FREQ / 64) /* Hz */
144 
145 #define ADF4355_3_MIN_VCO_FREQ 3300000000ULL /* Hz */
146 #define ADF4355_3_MAX_VCO_FREQ 6600000000ULL /* Hz */
147 #define ADF4355_3_MAX_OUT_FREQ ADF4355_3_MAX_VCO_FREQ /* Hz */
148 #define ADF4355_3_MIN_OUT_FREQ (ADF4355_3_MIN_VCO_FREQ / 64) /* Hz */
149 
150 #define ADF4355_2_MIN_VCO_FREQ 3400000000ULL /* Hz */
151 #define ADF4355_2_MAX_VCO_FREQ 6800000000ULL /* Hz */
152 #define ADF4355_2_MAX_OUT_FREQ 4400000000ULL /* Hz */
153 #define ADF4355_2_MIN_OUT_FREQ (ADF4355_2_MIN_VCO_FREQ / 64) /* Hz */
154 
155 #define ADF5355_MAX_FREQ_PFD 75000000UL /* Hz */
156 #define ADF5355_MAX_FREQ_REFIN 600000000UL /* Hz */
157 #define ADF5355_MAX_MODULUS2 16384
158 #define ADF5356_MAX_MODULUS2 268435456
159 #define ADF5355_MAX_R_CNT 1023
160 
161 #define ADF5355_MODULUS1 16777216ULL
162 #define ADF5355_MIN_INT_PRESCALER_89 75
163 
164 #define ADF5355_REG_NUM 14
165 
166 #define ADF5355_SPI_NO_BYTES 4
167 
168 /******************************************************************************/
169 /***************************** Include Files **********************************/
170 /******************************************************************************/
171 #include <stdint.h>
172 #include "no_os_spi.h"
173 
174 /******************************************************************************/
175 /*************************** Types Declarations *******************************/
176 /******************************************************************************/
177 
189 };
190 
203 };
204 
209 struct adf5355_dev {
214  uint64_t freq_req;
215  uint8_t freq_req_chan;
216  uint8_t num_channels;
217  uint32_t clkin_freq;
218  uint64_t max_out_freq;
219  uint64_t min_out_freq;
220  uint64_t min_vco_freq;
221  uint32_t fpfd;
222  uint32_t integer;
223  uint32_t fract1;
224  uint32_t fract2;
225  uint32_t mod2;
226  uint32_t cp_ua;
231  bool outa_en;
232  bool outb_en;
233  uint8_t outa_power;
234  uint8_t outb_power;
239  uint8_t ref_doubler_en;
240  uint8_t ref_div2_en;
241  uint8_t rf_div_sel;
242  uint16_t ref_div_factor;
244  uint32_t delay_us;
245 };
246 
254  uint64_t freq_req;
255  uint8_t freq_req_chan;
256  uint32_t clkin_freq;
257  uint32_t cp_ua;
262  bool outa_en;
263  bool outb_en;
264  uint8_t outa_power;
265  uint8_t outb_power;
269  uint8_t ref_doubler_en;
270  uint8_t ref_div2_en;
273 };
274 
275 /******************************************************************************/
276 /************************ Functions Declarations ******************************/
277 /******************************************************************************/
278 
279 /* Recalculate rate corresponding to a channel. */
280 int32_t adf5355_clk_recalc_rate(struct adf5355_dev *dev, uint32_t chan,
281  uint64_t *rate);
282 
283 /* Set channel rate. */
284 int32_t adf5355_clk_set_rate(struct adf5355_dev *dev, uint32_t chan,
285  uint64_t rate);
286 
287 /* Calculate closest possible rate */
288 int32_t adf5355_clk_round_rate(struct adf5355_dev *dev, uint64_t rate,
289  uint64_t *rounded_rate);
290 
291 /* Initializes the ADF5355. */
292 int32_t adf5355_init(struct adf5355_dev **device,
293  const struct adf5355_init_param *init_param);
294 
295 /* Remove the device. */
296 int32_t adf5355_remove(struct adf5355_dev *device);
ADF5355_REG0_INT
#define ADF5355_REG0_INT(x)
Definition: adf5355.h:38
ADF5356_REG12_PHASE_RESYNC_CLK_DIV
#define ADF5356_REG12_PHASE_RESYNC_CLK_DIV(x)
Definition: adf5355.h:122
adf5355_init_param::ref_div2_en
uint8_t ref_div2_en
Definition: adf5355.h:270
adf5355_clk_round_rate
int32_t adf5355_clk_round_rate(struct adf5355_dev *dev, uint64_t rate, uint64_t *rounded_rate)
Definition: adf5355.c:361
adf5355_init
int32_t adf5355_init(struct adf5355_dev **device, const struct adf5355_init_param *init_param)
Initializes the ADF5355.
Definition: adf5355.c:458
no_os_alloc.h
ADF5355_REG6_RF_OUTB_EN
#define ADF5355_REG6_RF_OUTB_EN(x)
Definition: adf5355.h:78
adf5355_dev::all_synced
bool all_synced
Definition: adf5355.h:212
adf5355_init_param::outb_power
uint8_t outb_power
Definition: adf5355.h:265
ADF4356
@ ADF4356
Definition: adf5355.h:187
ADF5355_REG9_SYNTH_LOCK_TIMEOUT
#define ADF5355_REG9_SYNTH_LOCK_TIMEOUT(x)
Definition: adf5355.h:103
ADF5355_REG7_LD_MODE_INT_N_EN
#define ADF5355_REG7_LD_MODE_INT_N_EN(x)
Definition: adf5355.h:89
ADF5355_REG6_NEG_BLEED_EN
#define ADF5355_REG6_NEG_BLEED_EN(x)
Definition: adf5355.h:83
adf5355_init_param::spi_init
struct no_os_spi_init_param * spi_init
Definition: adf5355.h:252
adf5355_dev::mux_out_sel
enum adf5355_mux_out_sel mux_out_sel
Definition: adf5355.h:243
adf5355_dev::ref_diff_en
bool ref_diff_en
Definition: adf5355.h:236
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
adf5355_dev
Device descriptor.
Definition: adf5355.h:209
adf5355_dev::num_channels
uint8_t num_channels
Definition: adf5355.h:216
adf5355_dev::delay_us
uint32_t delay_us
Definition: adf5355.h:244
adf5355_dev::freq_req
uint64_t freq_req
Definition: adf5355.h:214
no_os_spi.h
Header file of SPI Interface.
ADF5355_REG2_FRAC2
#define ADF5355_REG2_FRAC2(x)
Definition: adf5355.h:47
adf5355_init_param
Definition: adf5355.h:251
ADF5355_REG0_PRESCALER
#define ADF5355_REG0_PRESCALER(x)
Definition: adf5355.h:39
ADF5355_REG7_FACT_N_LD_PRECISION
#define ADF5355_REG7_FACT_N_LD_PRECISION(x)
Definition: adf5355.h:90
ADF5355_REG4_COUNTER_RESET_EN
#define ADF5355_REG4_COUNTER_RESET_EN(x)
Definition: adf5355.h:56
adf5355_clk_set_rate
int32_t adf5355_clk_set_rate(struct adf5355_dev *dev, uint32_t chan, uint64_t rate)
Definition: adf5355.c:345
ADF5355_REG5_DEFAULT
#define ADF5355_REG5_DEFAULT
Definition: adf5355.h:70
adf5355_dev::clkin_freq
uint32_t clkin_freq
Definition: adf5355.h:217
adf5355_dev::ref_div2_en
uint8_t ref_div2_en
Definition: adf5355.h:240
adf5355_dev::ref_doubler_en
uint8_t ref_doubler_en
Definition: adf5355.h:239
ADF5355_MUXOUT_ANALOG_LOCK_DETECT
@ ADF5355_MUXOUT_ANALOG_LOCK_DETECT
Definition: adf5355.h:201
ADF5355_MUXOUT_GND
@ ADF5355_MUXOUT_GND
Definition: adf5355.h:198
no_os_delay.h
Header file of Delay functions.
ADF4355_REG6_RF_OUTB_EN
#define ADF4355_REG6_RF_OUTB_EN(x)
Definition: adf5355.h:74
adf5355_init_param::outb_sel_fund
bool outb_sel_fund
Definition: adf5355.h:272
ADF5355_REG4_POWER_DOWN_EN
#define ADF5355_REG4_POWER_DOWN_EN(x)
Definition: adf5355.h:58
ADF5355_REG6_MUTE_TILL_LOCK_EN
#define ADF5355_REG6_MUTE_TILL_LOCK_EN(x)
Definition: adf5355.h:79
adf5355_dev::dev_id
enum adf5355_device_id dev_id
Definition: adf5355.h:211
adf5355_device_id
adf5355_device_id
Devices supported by the drivers.
Definition: adf5355.h:182
ADF5355_REG6_FEEDBACK_FUND
#define ADF5355_REG6_FEEDBACK_FUND(x)
Definition: adf5355.h:82
ADF4355
@ ADF4355
Definition: adf5355.h:184
ADF4355_REG6_OUTPUTB_PWR
#define ADF4355_REG6_OUTPUTB_PWR(x)
Definition: adf5355.h:73
ADF5355_MUXOUT_N_DIV_OUT
@ ADF5355_MUXOUT_N_DIV_OUT
Definition: adf5355.h:200
ADF4355_MIN_OUT_FREQ
#define ADF4355_MIN_OUT_FREQ
Definition: adf5355.h:143
device
Definition: ad9361_util.h:69
adf5355_init_param::freq_req_chan
uint8_t freq_req_chan
Definition: adf5355.h:255
adf5355_dev::cp_gated_bleed_en
bool cp_gated_bleed_en
Definition: adf5355.h:228
ADF5355_MUXOUT_DIGITAL_LOCK_DETECT
@ ADF5355_MUXOUT_DIGITAL_LOCK_DETECT
Definition: adf5355.h:202
adf5355_init_param::cp_bleed_current_polarity_en
bool cp_bleed_current_polarity_en
Definition: adf5355.h:260
ADF5356
@ ADF5356
Definition: adf5355.h:188
ADF5355_REG6_DEFAULT
#define ADF5355_REG6_DEFAULT
Definition: adf5355.h:86
adf5355_dev::fpfd
uint32_t fpfd
Definition: adf5355.h:221
ADF5355_REG9_TIMEOUT
#define ADF5355_REG9_TIMEOUT(x)
Definition: adf5355.h:105
adf5355_init_param::outb_en
bool outb_en
Definition: adf5355.h:263
ADF5355_REG4_10BIT_R_CNT
#define ADF5355_REG4_10BIT_R_CNT(x)
Definition: adf5355.h:64
ADF5355_MAX_OUT_FREQ
#define ADF5355_MAX_OUT_FREQ
Definition: adf5355.h:132
adf5355_clk_recalc_rate
int32_t adf5355_clk_recalc_rate(struct adf5355_dev *dev, uint32_t chan, uint64_t *rate)
Definition: adf5355.c:327
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
NO_OS_ARRAY_SIZE
#define NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:49
ADF5355_REG10_DEFAULT
#define ADF5355_REG10_DEFAULT
Definition: adf5355.h:112
ADF5355_REG12_PHASE_RESYNC_CLK_DIV
#define ADF5355_REG12_PHASE_RESYNC_CLK_DIV(x)
Definition: adf5355.h:120
ADF4355_MIN_VCO_FREQ
#define ADF4355_MIN_VCO_FREQ
Definition: adf5355.h:140
adf5355_dev::max_out_freq
uint64_t max_out_freq
Definition: adf5355.h:218
ADF5355_REG0_AUTOCAL
#define ADF5355_REG0_AUTOCAL(x)
Definition: adf5355.h:40
ADF5355_REG10_ADC_CONV_EN
#define ADF5355_REG10_ADC_CONV_EN(x)
Definition: adf5355.h:110
ADF5356_REG7_DEFAULT
#define ADF5356_REG7_DEFAULT
Definition: adf5355.h:96
ADF5355_REG9_ALC_TIMEOUT
#define ADF5355_REG9_ALC_TIMEOUT(x)
Definition: adf5355.h:104
ADF5355_MUXOUT_THREESTATE
@ ADF5355_MUXOUT_THREESTATE
Definition: adf5355.h:196
adf5355_dev::rf_div_sel
uint8_t rf_div_sel
Definition: adf5355.h:241
adf5355_dev::regs
uint32_t regs[ADF5355_REG_NUM]
Definition: adf5355.h:213
no_os_do_div
uint64_t no_os_do_div(uint64_t *n, uint64_t base)
adf5355_dev::integer
uint32_t integer
Definition: adf5355.h:222
no_os_error.h
Error codes definition.
NO_OS_DIV_ROUND_UP
#define NO_OS_DIV_ROUND_UP(x, y)
Definition: no_os_util.h:52
adf5355_clk_set_rate
int32_t adf5355_clk_set_rate(struct adf5355_dev *dev, uint32_t chan, uint64_t rate)
Definition: adf5355.c:345
ADF5355_REG6_CP_BLEED_CURR
#define ADF5355_REG6_CP_BLEED_CURR(x)
Definition: adf5355.h:80
ADF5355
@ ADF5355
Definition: adf5355.h:183
adf5355_dev::fract1
uint32_t fract1
Definition: adf5355.h:223
adf5355_dev::cp_ua
uint32_t cp_ua
Definition: adf5355.h:226
adf4382_init_param::freq
uint64_t freq
Definition: adf4382.h:493
ADF4355_2_MIN_VCO_FREQ
#define ADF4355_2_MIN_VCO_FREQ
Definition: adf5355.h:150
adf5355.h
Header file for adf5355 Driver.
adf5355_init_param::cp_ua
uint32_t cp_ua
Definition: adf5355.h:257
ADF5355_MIN_VCO_FREQ
#define ADF5355_MIN_VCO_FREQ
Definition: adf5355.h:130
ADF5355_REG6_OUTPUT_PWR
#define ADF5355_REG6_OUTPUT_PWR(x)
Definition: adf5355.h:76
ADF4355_2
@ ADF4355_2
Definition: adf5355.h:185
ADF5355_REG4_RDIV2_EN
#define ADF5355_REG4_RDIV2_EN(x)
Definition: adf5355.h:65
ADF5355_REG1_FRACT
#define ADF5355_REG1_FRACT(x)
Definition: adf5355.h:43
ADF5355_REG_NUM
#define ADF5355_REG_NUM
Definition: adf5355.h:164
ADF5355_REG10_ADC_CLK_DIV
#define ADF5355_REG10_ADC_CLK_DIV(x)
Definition: adf5355.h:111
adf5355_clk_recalc_rate
int32_t adf5355_clk_recalc_rate(struct adf5355_dev *dev, uint32_t chan, uint64_t *rate)
Definition: adf5355.c:327
ADF5355_MAX_OUTB_FREQ
#define ADF5355_MAX_OUTB_FREQ
Definition: adf5355.h:134
adf5355_init_param::outa_en
bool outa_en
Definition: adf5355.h:262
adf5355_dev::mute_till_lock_en
bool mute_till_lock_en
Definition: adf5355.h:230
adf5355_mux_out_sel
adf5355_mux_out_sel
Muxout selection.
Definition: adf5355.h:195
adf5355_init_param::cp_neg_bleed_en
bool cp_neg_bleed_en
Definition: adf5355.h:258
ADF5355_REG4_DOUBLE_BUFF_EN
#define ADF5355_REG4_DOUBLE_BUFF_EN(x)
Definition: adf5355.h:63
adf5355_init_param::freq_req
uint64_t freq_req
Definition: adf5355.h:254
ADF5355_MIN_INT_PRESCALER_89
#define ADF5355_MIN_INT_PRESCALER_89
Definition: adf5355.h:162
ADF5355_REG4_MUX_LOGIC
#define ADF5355_REG4_MUX_LOGIC(x)
Definition: adf5355.h:60
ADF5355_REG9_VCO_BAND_DIV
#define ADF5355_REG9_VCO_BAND_DIV(x)
Definition: adf5355.h:106
ADF5356_REG8_DEFAULT
#define ADF5356_REG8_DEFAULT
Definition: adf5355.h:100
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
ADF5356_REG13_MOD2_MSB
#define ADF5356_REG13_MOD2_MSB(x)
Definition: adf5355.h:126
adf5355_init_param::mute_till_lock_en
bool mute_till_lock_en
Definition: adf5355.h:261
no_os_clamp
#define no_os_clamp(val, min_val, max_val)
Definition: no_os_util.h:69
ADF5355_SPI_NO_BYTES
#define ADF5355_SPI_NO_BYTES
Definition: adf5355.h:166
ADF5355_MUXOUT_DVDD
@ ADF5355_MUXOUT_DVDD
Definition: adf5355.h:197
adf5355_dev::mux_out_3v3_en
bool mux_out_3v3_en
Definition: adf5355.h:237
adf5355_dev::fract2
uint32_t fract2
Definition: adf5355.h:224
adf5355_init_param::outa_power
uint8_t outa_power
Definition: adf5355.h:264
adf5355_init_param::phase_detector_polarity_neg
bool phase_detector_polarity_neg
Definition: adf5355.h:266
no_os_greatest_common_divisor
uint32_t no_os_greatest_common_divisor(uint32_t a, uint32_t b)
adf5355_dev::outb_en
bool outb_en
Definition: adf5355.h:232
ADF5355_MUXOUT_R_DIV_OUT
@ ADF5355_MUXOUT_R_DIV_OUT
Definition: adf5355.h:199
adf5355_dev::phase_detector_polarity_neg
uint8_t phase_detector_polarity_neg
Definition: adf5355.h:235
adf5355_dev::spi_desc
struct no_os_spi_desc * spi_desc
Definition: adf5355.h:210
ADF5355_REG11_DEFAULT
#define ADF5355_REG11_DEFAULT
Definition: adf5355.h:116
ADF4355_3_MIN_OUT_FREQ
#define ADF4355_3_MIN_OUT_FREQ
Definition: adf5355.h:148
ADF5355_REG10_ADC_EN
#define ADF5355_REG10_ADC_EN(x)
Definition: adf5355.h:109
ADF5355_REG4_MUXOUT
#define ADF5355_REG4_MUXOUT(x)
Definition: adf5355.h:67
ADF5355_REG7_LD_CYCLE_CNT
#define ADF5355_REG7_LD_CYCLE_CNT(x)
Definition: adf5355.h:92
ADF4355_3_MAX_OUT_FREQ
#define ADF4355_3_MAX_OUT_FREQ
Definition: adf5355.h:147
ADF5355_REG12_DEFAULT
#define ADF5355_REG12_DEFAULT
Definition: adf5355.h:121
ADF5355_MIN_OUTB_FREQ
#define ADF5355_MIN_OUTB_FREQ
Definition: adf5355.h:135
adf5355_dev::min_vco_freq
uint64_t min_vco_freq
Definition: adf5355.h:220
adf5355_dev::freq_req_chan
uint8_t freq_req_chan
Definition: adf5355.h:215
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
ADF5355_REG7_LOL_MODE_EN
#define ADF5355_REG7_LOL_MODE_EN(x)
Definition: adf5355.h:91
adf5355_dev::mod2
uint32_t mod2
Definition: adf5355.h:225
ADF5355_MIN_OUT_FREQ
#define ADF5355_MIN_OUT_FREQ
Definition: adf5355.h:133
ADF4355_3
@ ADF4355_3
Definition: adf5355.h:186
adf5355_dev::outa_en
bool outa_en
Definition: adf5355.h:231
no_os_udelay
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:114
adf5355_init_param::clkin_freq
uint32_t clkin_freq
Definition: adf5355.h:256
ADF5355_MODULUS1
#define ADF5355_MODULUS1
Definition: adf5355.h:161
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
ADF5355_REG
#define ADF5355_REG(x)
Definition: adf5355.h:35
adf5355_dev::outb_power
uint8_t outb_power
Definition: adf5355.h:234
ADF5355_REG7_LE_SYNCED_REFIN_EN
#define ADF5355_REG7_LE_SYNCED_REFIN_EN(x)
Definition: adf5355.h:93
ADF4355_3_MIN_VCO_FREQ
#define ADF4355_3_MIN_VCO_FREQ
Definition: adf5355.h:145
ADF4355_2_MAX_OUT_FREQ
#define ADF4355_2_MAX_OUT_FREQ
Definition: adf5355.h:152
adf5355_dev::cp_neg_bleed_en
bool cp_neg_bleed_en
Definition: adf5355.h:227
adf5355_init_param::ref_doubler_en
uint8_t ref_doubler_en
Definition: adf5355.h:269
adf5355_dev::outb_sel_fund
bool outb_sel_fund
Definition: adf5355.h:238
ADF5355_REG8_DEFAULT
#define ADF5355_REG8_DEFAULT
Definition: adf5355.h:99
adf5355_clk_round_rate
int32_t adf5355_clk_round_rate(struct adf5355_dev *dev, uint64_t rate, uint64_t *rounded_rate)
Definition: adf5355.c:361
ADF5355_REG4_REFIN_MODE_DIFF
#define ADF5355_REG4_REFIN_MODE_DIFF(x)
Definition: adf5355.h:61
ADF5356_REG7_LE_SYNCE_EDGE_RISING_EN
#define ADF5356_REG7_LE_SYNCE_EDGE_RISING_EN(x)
Definition: adf5355.h:94
adf5355_dev::cp_bleed_current_polarity_en
bool cp_bleed_current_polarity_en
Definition: adf5355.h:229
adf5355_dev::ref_div_factor
uint16_t ref_div_factor
Definition: adf5355.h:242
ADF5355_MAX_MODULUS2
#define ADF5355_MAX_MODULUS2
Definition: adf5355.h:157
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
ADF5355_REG2_MOD2
#define ADF5355_REG2_MOD2(x)
Definition: adf5355.h:46
ADF5355_MAX_FREQ_PFD
#define ADF5355_MAX_FREQ_PFD
Definition: adf5355.h:155
ADF5355_REG4_CHARGE_PUMP_CURR
#define ADF5355_REG4_CHARGE_PUMP_CURR(x)
Definition: adf5355.h:62
ADF5356_REG13_FRAC2_MSB
#define ADF5356_REG13_FRAC2_MSB(x)
Definition: adf5355.h:127
adf5355_init_param::dev_id
enum adf5355_device_id dev_id
Definition: adf5355.h:253
ADF5355_REG6_GATED_BLEED_EN
#define ADF5355_REG6_GATED_BLEED_EN(x)
Definition: adf5355.h:84
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
ADF4355_MAX_OUT_FREQ
#define ADF4355_MAX_OUT_FREQ
Definition: adf5355.h:142
adf5355_remove
int32_t adf5355_remove(struct adf5355_dev *device)
Definition: adf5355.c:541
ADF5355_REG4_RMULT2_EN
#define ADF5355_REG4_RMULT2_EN(x)
Definition: adf5355.h:66
no_os_util.h
Header file of utility functions.
ADF5355_REG4_CP_THREESTATE_EN
#define ADF5355_REG4_CP_THREESTATE_EN(x)
Definition: adf5355.h:57
adf5355_init_param::mux_out_sel
enum adf5355_mux_out_sel mux_out_sel
Definition: adf5355.h:271
adf5355_dev::outa_power
uint8_t outa_power
Definition: adf5355.h:233
ADF5355_REG6_RF_OUT_EN
#define ADF5355_REG6_RF_OUT_EN(x)
Definition: adf5355.h:77
adf5355_remove
int32_t adf5355_remove(struct adf5355_dev *device)
Definition: adf5355.c:541
ADF5355_REG6_RF_DIV_SEL
#define ADF5355_REG6_RF_DIV_SEL(x)
Definition: adf5355.h:81
adf5355_dev::min_out_freq
uint64_t min_out_freq
Definition: adf5355.h:219
ADF4356_REG6_RF_OUTB_SEL
#define ADF4356_REG6_RF_OUTB_SEL(x)
Definition: adf5355.h:75
adf5355_init_param::cp_gated_bleed_en
bool cp_gated_bleed_en
Definition: adf5355.h:259
ADF5355_REG7_DEFAULT
#define ADF5355_REG7_DEFAULT
Definition: adf5355.h:95
ADF5356_REG12_DEFAULT
#define ADF5356_REG12_DEFAULT
Definition: adf5355.h:123
ADF5356_REG6_BLEED_POLARITY
#define ADF5356_REG6_BLEED_POLARITY(x)
Definition: adf5355.h:85
adf5355_init_param::mux_out_3v3_en
bool mux_out_3v3_en
Definition: adf5355.h:268
NO_OS_DIV_ROUND_CLOSEST
#define NO_OS_DIV_ROUND_CLOSEST(x, y)
Definition: no_os_util.h:54
adf5355_init
int32_t adf5355_init(struct adf5355_dev **device, const struct adf5355_init_param *init_param)
Initializes the ADF5355.
Definition: adf5355.c:458
ADF5355_REG4_PD_POLARITY_POS
#define ADF5355_REG4_PD_POLARITY_POS(x)
Definition: adf5355.h:59
ADF4355_2_MIN_OUT_FREQ
#define ADF4355_2_MIN_OUT_FREQ
Definition: adf5355.h:153
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
ADF5356_MAX_MODULUS2
#define ADF5356_MAX_MODULUS2
Definition: adf5355.h:158
adf5355_init_param::ref_diff_en
bool ref_diff_en
Definition: adf5355.h:267