Go to the documentation of this file.
48 #define ADF4153_LE_OUT no_os_gpio_direction_output(dev->gpio_le, \
50 #define ADF4153_LE_LOW no_os_gpio_set_value(dev->gpio_le, \
52 #define ADF4153_LE_HIGH no_os_gpio_set_value(dev->gpio_le, \
55 #define ADF4153_CE_OUT no_os_gpio_direction_output(dev->gpio_ce, \
57 #define ADF4153_CE_LOW no_os_gpio_set_value(dev->gpio_ce, \
59 #define ADF4153_CE_HIGH no_os_gpio_set_value(dev->gpio_ce, \
62 #define ADF4153_LE2_OUT no_os_gpio_direction_output(dev->gpio_le2, \
64 #define ADF4153_LE2_LOW no_os_gpio_set_value(dev->gpio_le2, \
66 #define ADF4153_LE2_HIGH no_os_gpio_set_value(dev->gpio_le2, \
69 #define ADF4153_CE2_OUT no_os_gpio_direction_output(dev->gpio_ce2, \
71 #define ADF4153_CE2_LOW no_os_gpio_set_value(dev->gpio_ce2, \
73 #define ADF4153_CE2_HIGH no_os_gpio_set_value(dev->gpio_ce2, \
77 #define ADF4153_CTRL_MASK 0x3
79 #define ADF4153_CTRL_N_DIVIDER 0
80 #define ADF4153_CTRL_R_DIVIDER 1
81 #define ADF4153_CTRL_CONTROL 2
82 #define ADF4153_CTRL_NOISE_SPUR 3
87 #define ADF4153_R0_FRAC_OFFSET 2
88 #define ADF4153_R0_FRAC_MASK 0xFFFul
89 #define ADF4153_R0_FRAC(x) ((x) & ADF4153_R0_FRAC_MASK) \
90 << ADF4153_R0_FRAC_OFFSET
92 #define ADF4153_R0_INT_OFFSET 14
93 #define ADF4153_R0_INT_MASK 0x1FFul
94 #define ADF4153_R0_INT(x) ((x) & ADF4153_R0_INT_MASK) \
95 << ADF4153_R0_INT_OFFSET
98 #define ADF4153_R0_FASTLOCK_OFFSET 23
99 #define ADF4153_R0_FASTLOCK_MASK 0x1
100 #define ADF4153_R0_FASTLOCK(x) ((x) & ADF4153_R0_FASTLOCK_MASK) \
101 << ADF4153_R0_FASTLOCK_OFFSET
106 #define ADF4153_R1_MOD_OFFSET 2
107 #define ADF4153_R1_MOD_MASK 0xFFFul
108 #define ADF4153_R1_MOD(x) ((x) & ADF4153_R1_MOD_MASK) \
109 << ADF4153_R1_MOD_OFFSET
111 #define ADF4153_R1_RCOUNTER_OFFSET 14
112 #define ADF4153_R1_RCOUNTER_MASK 0xFul
113 #define ADF4153_R1_RCOUNTER(x) ((x) & ADF4153_R1_RCOUNTER_MASK) \
114 << ADF4153_R1_RCOUNTER_OFFSET
116 #define ADF4153_R1_PRESCALE_OFFSET 18
117 #define ADF4153_R1_PRESCALE_MASK 0x1ul
118 #define ADF4153_R1_PRESCALE(x) ((x) & ADF4153_R1_PRESCALE_MASK) \
119 << ADF4153_R1_PRESCALE_OFFSET
121 #define ADF4153_R1_MUXOUT_OFFSET 20
122 #define ADF4153_R1_MUXOUT_MASK 0x7
123 #define ADF4153_R1_MUXOUT(x) ((x) & ADF4153_R1_MUXOUT_MASK) \
124 << ADF4153_R1_MUXOUT_OFFSET
126 #define ADF4153_R1_LOAD_OFFSET 23
127 #define ADF4153_R1_LOAD_MASK 0x1
128 #define ADF4153_R1_LOAD(x) ((x) & ADF4153_R1_LOAD_MASK) \
129 << ADF4153_R1_LOAD_OFFSET
134 #define ADF4153_R2_COUNTER_RST_OFFSET 2
135 #define ADF4153_R2_COUNTER_RST_MASK 0x1ul
136 #define ADF4153_R2_COUNTER_RST(x) ((x) & ADF4153_R2_COUNTER_RST_MASK)\
137 << ADF4153_R2_COUNTER_RST_OFFSET
139 #define ADF4153_R2_CP_3STATE_OFFSET 3
140 #define ADF4153_R2_CP_3STATE_MASK 0x1
141 #define ADF4153_R2_CP_3STATE(x) ((x) & ADF4153_R2_CP_3STATE_MASK) \
142 << ADF4153_R2_CP_3STATE_OFFSET
144 #define ADF4153_R2_POWER_DOWN_OFFSET 4
145 #define ADF4153_R2_POWER_DOWN_MASK 0x1
146 #define ADF4153_R2_POWER_DOWN(x) ((x) & ADF4153_R2_POWER_DOWN_MASK) \
147 << ADF4153_R2_POWER_DOWN_OFFSET
149 #define ADF4153_R2_LDP_OFFSET 5
150 #define ADF4153_R2_LDP_MASK 0x1
151 #define ADF4153_R2_LDP(x) ((x) & ADF4153_R2_LDP_MASK) \
152 << ADF4153_R2_LDP_OFFSET
154 #define ADF4153_R2_PD_POL_OFFSET 6
155 #define ADF4153_R2_PD_POL_MASK 0x1
156 #define ADF4153_R2_PD_POL(x) ((x) & ADF4153_R2_PD_POL_MASK) \
157 << ADF4153_R2_PD_POL_OFFSET
159 #define ADF4153_R2_CP_CURRENT_OFFSET 7
160 #define ADF4153_R2_CP_CURRENT_MASK 0xF
161 #define ADF4153_R2_CP_CURRENT(x) ((x) & ADF4153_R2_CP_CURRENT_MASK) \
162 << ADF4153_R2_CP_CURRENT_OFFSET
164 #define ADF4153_R2_REF_DOUBLER_OFFSET 11
165 #define ADF4153_R2_REF_DOUBLER_MASK 0x1
166 #define ADF4153_R2_REF_DOUBLER(x) ((x) & ADF4153_R2_REF_DOUBLER_MASK)\
167 << ADF4153_R2_REF_DOUBLER_OFFSET
169 #define ADF4153_R2_RESYNC_OFFSET 12
170 #define ADF4153_R2_RESYNC_MASK 0x7
171 #define ADF4153_R2_RESYNC(x) ((x) & ADF4153_R2_RESYNC_MASK) \
172 << ADF4153_R2_RESYNC_OFFSET
177 #define ADF4153_R3_NOISE_SPURG_MASK 0x3C4
178 #define ADF4153_R3_NOISE_SPURG(x) ( (((x) << 0x2) & 0x7) | \
179 (((x) >> 0x1) << 0x6) ) &\
180 ADF4153_R3_NOISE_SPURG_MASK
183 #define ADF4153_FASTLOCK_DISABLED 0
184 #define ADF4153_FASTLOCK_ENABLED 1
186 #define ADF4153_PRESCALER_4_5 0
187 #define ADF4153_PRESCALER_8_9 1
189 #define ADF4153_MUXOUT_THREESTATE 0
190 #define ADF4153_MUXOUT_DIGITAL_LOCK 1
191 #define ADF4153_MUXOUT_NDIV_OUTPUT 2
192 #define ADF4153_MUXOUT_LOGICHIGH 3
193 #define ADF4153_MUXOUT_RDIV_OUTPUT 4
194 #define ADF4153_MUXOUT_ANALOG_LOCK 5
195 #define ADF4153_MUXOUT_FASTLOCK 6
196 #define ADF4153_MUXOUT_LOGICLOW 7
198 #define ADF4153_LOAD_NORMAL 0
199 #define ADF4153_LOAD_RESYNC 1
201 #define ADF4153_CR_DISABLED 0
202 #define ADF4153_CR_ENABLED 1
204 #define ADF4153_CP_DISABLED 0
205 #define ADF4153_CP_THREE_STATE 1
207 #define ADF4153_PD_DISABLED 0
208 #define ADF4153_PD_ENABLED 1
210 #define ADF4153_LDP_24 0
211 #define ADF4153_LDP_40 1
213 #define ADF4153_PD_POL_NEGATIV 0
214 #define ADF4153_PD_POL_POSITIVE 1
216 #define ADF4153_CP_CURRENT_0_63 0
217 #define ADF4153_CP_CURRENT_1_25 1
218 #define ADF4153_CP_CURRENT_1_88 2
219 #define ADF4153_CP_CURRENT_2_50 3
220 #define ADF4153_CP_CURRENT_3_13 4
221 #define ADF4153_CP_CURRENT_3_75 5
222 #define ADF4153_CP_CURRENT_4_38 6
223 #define ADF4153_CP_CURRENT_5_00 7
224 #define ADF4153_CP2_CURRENT_0_31 8
225 #define ADF4153_CP2_CURRENT_0_63 9
226 #define ADF4153_CP2_CURRENT_0_94 10
227 #define ADF4153_CP2_CURRENT_1_25 11
228 #define ADF4153_CP2_CURRENT_1_57 12
229 #define ADF4153_CP2_CURRENT_1_88 13
230 #define ADF4153_CP2_CURRENT_2_19 14
231 #define ADF4153_CP2_CURRENT_2_50 15
234 #define ADF4153_REF_DOUBLER_DIS 0
235 #define ADF4153_REF_DOUBLER_EN 1
237 #define ADF4153_LOW_SPUR_MODE 0b00000
238 #define ADF4153_LOW_NOISE_SPUR 0b11100
239 #define ADF4153_LOWEST_NOISE 0b11111
379 uint32_t latch_data);
392 #endif // __ADF4153_H__
#define ADF4153_R1_MOD(x)
Definition: adf4153.h:108
#define ADF4153_R2_RESYNC_MASK
Definition: adf4153.h:170
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
uint16_t mod_value
Definition: adf4153.h:274
int8_t adf4153_init(struct adf4153_dev **device, struct adf4153_init_param init_param)
Initialize SPI and Initial Values for ADF4106 Board.
Definition: adf4153.c:67
uint32_t adf4153_get_channel_spacing(struct adf4153_dev *dev)
Return the value of the channel spacing.
Definition: adf4153.c:401
uint32_t adf4153_read_latch(struct adf4153_dev *dev, uint8_t latch_type)
Return the value of a desired latch.
Definition: adf4153.c:246
uint8_t power_down
Definition: adf4153.h:301
#define ADF4153_R1_MOD_MASK
Definition: adf4153.h:107
struct no_os_gpio_init_param gpio_ce2
Definition: adf4153.h:362
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
#define ADF4153_LE_HIGH
Definition: adf4153.h:52
#define ADF4153_R2_COUNTER_RST_MASK
Definition: adf4153.h:135
#define DATA_MASK_LSB8
Definition: adf4153.c:48
Header file of SPI Interface.
uint8_t load_control
Definition: adf4153.h:291
#define ADF4153_R1_RCOUNTER(x)
Definition: adf4153.h:113
void adf4153_update_latch(struct adf4153_dev *dev, uint32_t latch_data)
Update one of the latch via the SPI interface.
Definition: adf4153.c:199
struct no_os_gpio_desc * gpio_le2
Definition: adf4153.h:333
uint32_t r3
Definition: adf4153.h:352
uint32_t channel_spacing
Definition: adf4153.h:256
struct no_os_gpio_desc * gpio_ce
Definition: adf4153.h:332
#define ADF4153_CTRL_N_DIVIDER
Definition: adf4153.h:79
Header file of adf4153 driver.
#define ADF4153_CR_DISABLED
Definition: adf4153.h:201
#define ADF4153_R0_FASTLOCK(x)
Definition: adf4153.h:100
uint16_t int_value
Definition: adf4153.h:266
uint32_t r0
Definition: adf4153.h:349
uint16_t frac_value
Definition: adf4153.h:262
Definition: ad9361_util.h:69
uint8_t noise_spur
Definition: adf4153.h:323
struct no_os_gpio_init_param gpio_le2
Definition: adf4153.h:361
#define ADF4153_CR_ENABLED
Definition: adf4153.h:202
#define ADF4153_R2_CP_CURRENT(x)
Definition: adf4153.h:161
#define DATA_OFFSET_MSB8
Definition: adf4153.c:45
uint32_t adf4153_pfd_max_frq
Definition: adf4153.h:341
uint16_t adf4153_mod_max
Definition: adf4153.h:346
Definition: adf4153.h:251
int8_t adf4153_init(struct adf4153_dev **device, struct adf4153_init_param init_param)
Initialize SPI and Initial Values for ADF4106 Board.
Definition: adf4153.c:67
#define ADF4153_LOAD_RESYNC
Definition: adf4153.h:199
#define ADF4153_R1_LOAD(x)
Definition: adf4153.h:128
#define ADF4153_R2_PD_POL(x)
Definition: adf4153.h:156
struct no_os_gpio_desc * gpio_le
Definition: adf4153.h:331
struct no_os_gpio_init_param gpio_le
Definition: adf4153.h:359
uint8_t counter_reset
Definition: adf4153.h:295
uint32_t adf4153_rfin_min_frq
Definition: adf4153.h:338
#define ADF4153_R2_CP_3STATE(x)
Definition: adf4153.h:141
#define ADF4153_R2_POWER_DOWN(x)
Definition: adf4153.h:146
#define ADF4153_CE_OUT
Definition: adf4153.h:55
uint8_t fastlock
Definition: adf4153.h:268
void adf4153_update_latch(struct adf4153_dev *dev, uint32_t latch_data)
Update one of the latch via the SPI interface.
Definition: adf4153.c:199
#define ADF4153_LE_LOW
Definition: adf4153.h:50
#define DATA_OFFSET_MID8
Definition: adf4153.c:47
#define ADF4153_R0_FRAC(x)
Definition: adf4153.h:89
uint32_t adf4153_vco_min_frq
Definition: adf4153.h:343
uint8_t ref_doubler
Definition: adf4153.h:313
uint64_t adf4153_set_frequency(struct adf4153_dev *dev, uint64_t frequency)
Sets the output frequency.
Definition: adf4153.c:301
struct adf4153_settings_t adf4153_st
Definition: adf4153.h:364
struct no_os_gpio_desc * gpio_ce2
Definition: adf4153.h:334
uint32_t ref_in
Definition: adf4153.h:254
uint8_t ldp
Definition: adf4153.h:303
#define ADF4153_PRESCALER_4_5
Definition: adf4153.h:186
#define DATA_MASK_MSB8
Definition: adf4153.c:44
#define ADF4153_R2_REF_DOUBLER_OFFSET
Definition: adf4153.h:164
#define ADF4153_CTRL_R_DIVIDER
Definition: adf4153.h:80
#define ADF4153_R2_COUNTER_RST(x)
Definition: adf4153.h:136
#define ADF4153_R1_PRESCALE_MASK
Definition: adf4153.h:117
Definition: adf4153.h:327
#define ADF4153_PRESCALER_8_9
Definition: adf4153.h:187
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
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
#define ADF4153_R0_INT(x)
Definition: adf4153.h:94
uint32_t adf4153_read_latch(struct adf4153_dev *dev, uint8_t latch_type)
Return the value of a desired latch.
Definition: adf4153.c:246
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
uint8_t cp_three_state
Definition: adf4153.h:299
#define ADF4153_R2_RESYNC(x)
Definition: adf4153.h:171
uint32_t adf4153_get_channel_spacing(struct adf4153_dev *dev)
Return the value of the channel spacing.
Definition: adf4153.c:401
#define ADF4153_CTRL_NOISE_SPUR
Definition: adf4153.h:82
#define CEIL(a, b)
Definition: adf4153.c:42
#define ADF4153_LOAD_NORMAL
Definition: adf4153.h:198
#define ADF4153_CE_HIGH
Definition: adf4153.h:59
uint8_t pd_polarity
Definition: adf4153.h:305
int32_t no_os_gpio_get(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Obtain the GPIO decriptor.
Definition: no_os_gpio.c:49
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:43
#define ADF4153_R1_PRESCALE(x)
Definition: adf4153.h:118
uint32_t adf4153_rfin_max_frq
Definition: adf4153.h:339
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 adf4153_remove(struct adf4153_dev *dev)
Free the resources allocated by adf4153_init().
Definition: adf4153.c:175
#define ADF4153_R1_MUXOUT(x)
Definition: adf4153.h:123
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
uint32_t adf4153_tune_rcounter(struct adf4153_dev *dev, uint16_t *r_counter)
Increases the R counter value until the ADF4106_PDF_MAX_FREQ is greater than PFD frequency.
Definition: adf4153.c:276
#define DATA_MASK_MID8
Definition: adf4153.c:46
uint8_t cp_current
Definition: adf4153.h:309
#define ADF4153_R2_REF_DOUBLER(x)
Definition: adf4153.h:166
uint8_t r_counter
Definition: adf4153.h:279
uint8_t resync
Definition: adf4153.h:317
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
uint64_t adf4153_set_frequency(struct adf4153_dev *dev, uint64_t frequency)
Sets the output frequency.
Definition: adf4153.c:301
Header file of GPIO Interface.
uint32_t r1
Definition: adf4153.h:350
#define ADF4153_R1_RCOUNTER_MASK
Definition: adf4153.h:112
#define ADF4153_LE_OUT
Definition: adf4153.h:48
uint8_t muxout
Definition: adf4153.h:286
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 ADF4153_R2_LDP(x)
Definition: adf4153.h:151
struct no_os_spi_desc * spi_desc
Definition: adf4153.h:329
#define ADF4153_CTRL_CONTROL
Definition: adf4153.h:81
struct adf4153_settings_t adf4153_st
Definition: adf4153.h:336
#define FREQ_2_GHZ
Definition: adf4153.c:52
#define DATA_OFFSET_LSB8
Definition: adf4153.c:49
struct no_os_spi_init_param spi_init
Definition: adf4153.h:357
#define ADF4153_R0_INT_MASK
Definition: adf4153.h:93
struct no_os_gpio_init_param gpio_ce
Definition: adf4153.h:360
uint64_t adf4153_vco_max_frq
Definition: adf4153.h:344
int32_t adf4153_remove(struct adf4153_dev *dev)
Free the resources allocated by adf4153_init().
Definition: adf4153.c:175
uint8_t prescaler
Definition: adf4153.h:284
Definition: adf4153.h:355
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
uint32_t r2
Definition: adf4153.h:351
#define ADF4153_R0_FRAC_MASK
Definition: adf4153.h:88