Go to the documentation of this file.
55 #define ADF4156_MUXOUT_Z (0x00 << 27)
56 #define ADF4156_MUXOUT_DVdd (0x01 << 27)
57 #define ADF4156_MUXOUT_DGND (0x02 << 27)
58 #define ADF4156_MUXOUT_RDIV (0x03 << 27)
59 #define ADF4156_MUXOUT_NDIV (0x04 << 27)
60 #define ADF4156_MUXOUT_ALOCK (0x05 << 27)
61 #define ADF4156_MUXOUT_DLOCK (0x06 << 27)
62 #define ADF4156_MUXOUT_SDO (0x07 << 27)
63 #define ADF4156_MUXOUT_CLKDIV (0x0A << 27)
64 #define ADF4156_MUXOUT_FLS (0x0C << 27)
65 #define ADF4156_MUXOUT_RDIV2 (0x0D << 27)
66 #define ADF4156_MUXOUT_NDIV2 (0x0E << 27)
67 #define ADF4156_MUXOUT_RESERVED (0x0F << 27)
69 #define ADF4156_INT_VAL(x) ((x & 0xFFF) << 15)
71 #define ADF4156_FRAC_VAL(x) ((x & 0xFFF) << 3)
73 #define ADF4156_R0_CTRL 0x00
76 #define ADF4156_PHASE_VAL(x) ((x & 0xFFF) << 3)
77 #define ADF4156_R1_CTRL 0x01
81 #define ADF4156_LOW_NOISE (0x00 << 29)
82 #define ADF4156_LOW_SPUR (0x03 << 29)
84 #define ADF4156_CSR_EN(x) ((x & 0x1) << 28)
86 #define ADF4156_CURR_SET(x) ((x & 0xF) << 24)
88 #define ADF4156_PRESCALER(x) ((x & 0x1) << 22)
90 #define ADF4156_RDIV2(x) ((x & 0x1) << 21)
92 #define ADF4156_REF_DBL(x) ((x & 0x1) << 20)
94 #define ADF4156_R_CNT(x) ((x & 0x1F) << 15)
96 #define ADF4156_MOD_WORD(x) ((x & 0xFFF) << 3)
98 #define ADF4156_R2_CTRL 0x02
102 #define ADF4156_SIG_DEL_RST(x) ((x & 0x1) << 14)
104 #define ADF4156_LDP(x) ((x & 0x1) << 7)
106 #define ADF4156_PD_POL(x) ((x & 0x1) << 6)
108 #define ADF4156_PD ((x & 0x1) << 5)
110 #define ADF4156_CP_Z(x) ((x & 0x1) << 4)
112 #define ADF4156_CNT_RST(x) ((x & 0x1) << 3)
114 #define ADF4156_R3_CTRL 0x03
118 #define ADF4156_CLK_DIV_OFF (0x00 << 19)
119 #define ADF4156_CLK_FAST_LOCK (0x01 << 19)
120 #define ADF4156_CLK_RESYNC_EN (0x02 << 19)
122 #define ADF4156_CLK_DIV_VAL(x) ((x & 0xFFF) << 7)
124 #define ADF4156_R4_CTRL 0x04
127 #define ADF4156_LE_OUT no_os_gpio_direction_output(dev->gpio_le, \
129 #define ADF4156_LE_LOW no_os_gpio_set_value(dev->gpio_le, \
131 #define ADF4156_LE_HIGH no_os_gpio_set_value(dev->gpio_le, \
134 #define ADF4156_MUX_OUT no_os_gpio_direction_output(dev->gpio_mux, \
136 #define ADF4156_MUX_LOW no_os_gpio_set_value(dev->gpio_mux, \
138 #define ADF4156_MUX_HIGH no_os_gpio_set_value(dev->gpio_mux, \
141 #define ADF4156_CE_OUT no_os_gpio_direction_output(dev->gpio_ce, \
143 #define ADF4156_CE_LOW no_os_gpio_set_value(dev->gpio_ce, \
145 #define ADF4156_CE_HIGH no_os_gpio_set_value(dev->gpio_ce, \
148 #define ADF4156_LE2_OUT no_os_gpio_direction_output(dev->gpio_le2, \
150 #define ADF4156_LE2_LOW no_os_gpio_set_value(dev->gpio_le2, \
152 #define ADF4156_LE2_HIGH no_os_gpio_set_value(dev->gpio_le2, \
155 #define ADF4156_CE2_OUT no_os_gpio_direction_output(dev->gpio_ce2, \
157 #define ADF4156_CE2_LOW no_os_gpio_set_value(dev->gpio_ce2, \
159 #define ADF4156_CE2_HIGH no_os_gpio_set_value(dev->gpio_ce2, \
163 #define ADF4156_MAX_OUT_FREQ 6200
164 #define ADF4156_MIN_OUT_FREQ 500
165 #define ADF4156_MAX_FREQ_45_PRESC 3000
166 #define ADF4156_MAX_FREQ_PFD 32000000
167 #define ADF4156_MAX_FREQ_REFIN 250000000
168 #define ADF4156_MIN_FREQ_REFIN 10000000
169 #define ADF4156_MAX_MODULUS 4095
170 #define ADF4156_MAX_R_CNT 32
171 #define ADF4156_MAX_REG_VAL 0x1FFFFFFF
174 #define ADF4156_REG0 0
175 #define ADF4156_REG1 1
176 #define ADF4156_REG2 2
177 #define ADF4156_REG3 3
178 #define ADF4156_REG4 4
248 uint32_t
gcd(uint32_t x, uint32_t y);
#define ADF4156_REG2
Definition: adf4156.h:176
#define ADF4156_FRAC_VAL(x)
Definition: adf4156.h:71
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:85
double adf4156_set_freq(struct adf4156_dev *dev, double freq)
Sets the ADF4156 output frequency.
Definition: adf4156.c:236
struct no_os_gpio_init_param gpio_le
Definition: adf4156.h:224
uint32_t r2_mod
Definition: adf4156.h:206
int8_t adf4156_set(struct adf4156_dev *dev, uint32_t value)
Transmits 32 bits on SPI.
Definition: adf4156.c:162
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:165
#define ADF4156_MAX_R_CNT
Definition: adf4156.h:170
Header file of SPI Interface.
struct adf4156_platform_data * pdata
Definition: adf4156.h:201
uint32_t gcd(uint32_t x, uint32_t y)
Computes the greatest common divider of two numbers.
Definition: adf4156.c:215
#define ADF4156_MAX_FREQ_45_PRESC
Definition: adf4156.h:165
#define ADF4156_INT_VAL(x)
Definition: adf4156.h:69
#define ADF4156_MAX_MODULUS
Definition: adf4156.h:169
int8_t adf4156_init(struct adf4156_dev **device, struct adf4156_init_param init_param)
Initialize the SPI communication with the device.
Definition: adf4156.c:60
#define ADF4156_MAX_FREQ_PFD
Definition: adf4156.h:166
Definition: ad9361_util.h:75
uint32_t fpfd
Definition: adf4156.h:202
#define ADF4156_REF_DBL(x)
Definition: adf4156.h:92
#define ADF4156_R0_CTRL
Definition: adf4156.h:73
#define ADF4156_MAX_OUT_FREQ
Definition: adf4156.h:163
#define ADF4156_R1_CTRL
Definition: adf4156.h:77
#define ADF4156_REG3
Definition: adf4156.h:177
#define ADF4156_R2_CTRL
Definition: adf4156.h:98
#define ADF4156_RDIV2(x)
Definition: adf4156.h:90
#define ADF4156_MIN_FREQ_REFIN
Definition: adf4156.h:168
struct no_os_gpio_desc * gpio_le
Definition: adf4156.h:214
#define ADF4156_REG1
Definition: adf4156.h:175
uint32_t r0_fract
Definition: adf4156.h:204
int8_t adf4156_set(struct adf4156_dev *dev, uint32_t value)
Transmits 32 bits on SPI.
Definition: adf4156.c:162
struct adf4156_state adf4156_st
Definition: adf4156.h:217
#define ADF4156_MIN_OUT_FREQ
Definition: adf4156.h:164
double adf4156_set_freq(struct adf4156_dev *dev, double freq)
Sets the ADF4156 output frequency.
Definition: adf4156.c:236
Definition: adf4156.h:220
Header file of ADF4156 Driver for Microblaze processor.
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:110
#define ADF4156_R4_CTRL
Definition: adf4156.h:124
Structure holding SPI descriptor.
Definition: no_os_spi.h:177
#define ADF4156_REG0
Definition: adf4156.h:174
#define ADF4156_CE_HIGH
Definition: adf4156.h:145
#define ADF4156_LE_HIGH
Definition: adf4156.h:131
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:102
#define ADF4156_MAX_FREQ_REFIN
Definition: adf4156.h:167
uint32_t r0_int
Definition: adf4156.h:205
int32_t adf4156_tune_r_cnt(struct adf4156_dev *dev, int32_t r_cnt)
Increases the R counter value until the PFD frequency is smaller than ADF4351_MAX_FREQ_PFD.
Definition: adf4156.c:195
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:55
uint16_t r_cnt
Definition: adf4156.h:203
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:49
#define ADF4156_PHASE_VAL(x)
Definition: adf4156.h:76
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:75
#define ADF4156_REG4
Definition: adf4156.h:178
#define ADF4156_LE_OUT
Definition: adf4156.h:127
uint32_t reg_val[5]
Definition: adf4156.h:207
uint32_t gcd(uint32_t x, uint32_t y)
Computes the greatest common divider of two numbers.
Definition: adf4156.c:215
#define ADF4156_MOD_WORD(x)
Definition: adf4156.h:96
struct no_os_spi_desc * spi_desc
Definition: adf4156.h:212
#define ADF4156_R_CNT(x)
Definition: adf4156.h:94
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:119
int32_t adf4156_remove(struct adf4156_dev *dev)
Free the resources allocated by adf4156_init().
Definition: adf4156.c:140
struct no_os_gpio_init_param gpio_ce
Definition: adf4156.h:225
int8_t adf4156_init(struct adf4156_dev **device, struct adf4156_init_param init_param)
Initialize the SPI communication with the device.
Definition: adf4156.c:60
#define ADF4156_CE_OUT
Definition: adf4156.h:141
#define ADF4156_R3_CTRL
Definition: adf4156.h:114
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:122
Header file of GPIO Interface.
int32_t adf4156_tune_r_cnt(struct adf4156_dev *dev, int32_t r_cnt)
Increases the R counter value until the PFD frequency is smaller than ADF4351_MAX_FREQ_PFD.
Definition: adf4156.c:195
int32_t adf4156_remove(struct adf4156_dev *dev)
Free the resources allocated by adf4156_init().
Definition: adf4156.c:140
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:58
#define ADF4156_LE_LOW
Definition: adf4156.h:129
Definition: adf4156.h:200
#define ADF4156_PRESCALER(x)
Definition: adf4156.h:88
Definition: adf4156.h:210
struct no_os_gpio_desc * gpio_ce
Definition: adf4156.h:215
Header file of ADF4156 Driver Configuration.
#define ADF4156_CNT_RST(x)
Definition: adf4156.h:112
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:131
struct no_os_spi_init_param spi_init
Definition: adf4156.h:222