Go to the documentation of this file.
48 #define ADF4156_MUXOUT_Z (0x00 << 27)
49 #define ADF4156_MUXOUT_DVdd (0x01 << 27)
50 #define ADF4156_MUXOUT_DGND (0x02 << 27)
51 #define ADF4156_MUXOUT_RDIV (0x03 << 27)
52 #define ADF4156_MUXOUT_NDIV (0x04 << 27)
53 #define ADF4156_MUXOUT_ALOCK (0x05 << 27)
54 #define ADF4156_MUXOUT_DLOCK (0x06 << 27)
55 #define ADF4156_MUXOUT_SDO (0x07 << 27)
56 #define ADF4156_MUXOUT_CLKDIV (0x0A << 27)
57 #define ADF4156_MUXOUT_FLS (0x0C << 27)
58 #define ADF4156_MUXOUT_RDIV2 (0x0D << 27)
59 #define ADF4156_MUXOUT_NDIV2 (0x0E << 27)
60 #define ADF4156_MUXOUT_RESERVED (0x0F << 27)
62 #define ADF4156_INT_VAL(x) ((x & 0xFFF) << 15)
64 #define ADF4156_FRAC_VAL(x) ((x & 0xFFF) << 3)
66 #define ADF4156_R0_CTRL 0x00
69 #define ADF4156_PHASE_VAL(x) ((x & 0xFFF) << 3)
70 #define ADF4156_R1_CTRL 0x01
74 #define ADF4156_LOW_NOISE (0x00 << 29)
75 #define ADF4156_LOW_SPUR (0x03 << 29)
77 #define ADF4156_CSR_EN(x) ((x & 0x1) << 28)
79 #define ADF4156_CURR_SET(x) ((x & 0xF) << 24)
81 #define ADF4156_PRESCALER(x) ((x & 0x1) << 22)
83 #define ADF4156_RDIV2(x) ((x & 0x1) << 21)
85 #define ADF4156_REF_DBL(x) ((x & 0x1) << 20)
87 #define ADF4156_R_CNT(x) ((x & 0x1F) << 15)
89 #define ADF4156_MOD_WORD(x) ((x & 0xFFF) << 3)
91 #define ADF4156_R2_CTRL 0x02
95 #define ADF4156_SIG_DEL_RST(x) ((x & 0x1) << 14)
97 #define ADF4156_LDP(x) ((x & 0x1) << 7)
99 #define ADF4156_PD_POL(x) ((x & 0x1) << 6)
101 #define ADF4156_PD ((x & 0x1) << 5)
103 #define ADF4156_CP_Z(x) ((x & 0x1) << 4)
105 #define ADF4156_CNT_RST(x) ((x & 0x1) << 3)
107 #define ADF4156_R3_CTRL 0x03
111 #define ADF4156_CLK_DIV_OFF (0x00 << 19)
112 #define ADF4156_CLK_FAST_LOCK (0x01 << 19)
113 #define ADF4156_CLK_RESYNC_EN (0x02 << 19)
115 #define ADF4156_CLK_DIV_VAL(x) ((x & 0xFFF) << 7)
117 #define ADF4156_R4_CTRL 0x04
120 #define ADF4156_LE_OUT no_os_gpio_direction_output(dev->gpio_le, \
122 #define ADF4156_LE_LOW no_os_gpio_set_value(dev->gpio_le, \
124 #define ADF4156_LE_HIGH no_os_gpio_set_value(dev->gpio_le, \
127 #define ADF4156_MUX_OUT no_os_gpio_direction_output(dev->gpio_mux, \
129 #define ADF4156_MUX_LOW no_os_gpio_set_value(dev->gpio_mux, \
131 #define ADF4156_MUX_HIGH no_os_gpio_set_value(dev->gpio_mux, \
134 #define ADF4156_CE_OUT no_os_gpio_direction_output(dev->gpio_ce, \
136 #define ADF4156_CE_LOW no_os_gpio_set_value(dev->gpio_ce, \
138 #define ADF4156_CE_HIGH no_os_gpio_set_value(dev->gpio_ce, \
141 #define ADF4156_LE2_OUT no_os_gpio_direction_output(dev->gpio_le2, \
143 #define ADF4156_LE2_LOW no_os_gpio_set_value(dev->gpio_le2, \
145 #define ADF4156_LE2_HIGH no_os_gpio_set_value(dev->gpio_le2, \
148 #define ADF4156_CE2_OUT no_os_gpio_direction_output(dev->gpio_ce2, \
150 #define ADF4156_CE2_LOW no_os_gpio_set_value(dev->gpio_ce2, \
152 #define ADF4156_CE2_HIGH no_os_gpio_set_value(dev->gpio_ce2, \
156 #define ADF4156_MAX_OUT_FREQ 6200
157 #define ADF4156_MIN_OUT_FREQ 500
158 #define ADF4156_MAX_FREQ_45_PRESC 3000
159 #define ADF4156_MAX_FREQ_PFD 32000000
160 #define ADF4156_MAX_FREQ_REFIN 250000000
161 #define ADF4156_MIN_FREQ_REFIN 10000000
162 #define ADF4156_MAX_MODULUS 4095
163 #define ADF4156_MAX_R_CNT 32
164 #define ADF4156_MAX_REG_VAL 0x1FFFFFFF
167 #define ADF4156_REG0 0
168 #define ADF4156_REG1 1
169 #define ADF4156_REG2 2
170 #define ADF4156_REG3 3
171 #define ADF4156_REG4 4
241 uint32_t
gcd(uint32_t x, uint32_t y);
#define ADF4156_REG2
Definition: adf4156.h:169
#define ADF4156_FRAC_VAL(x)
Definition: adf4156.h:64
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
double adf4156_set_freq(struct adf4156_dev *dev, double freq)
Sets the ADF4156 output frequency.
Definition: adf4156.c:229
struct no_os_gpio_init_param gpio_le
Definition: adf4156.h:217
uint32_t r2_mod
Definition: adf4156.h:199
int8_t adf4156_set(struct adf4156_dev *dev, uint32_t value)
Transmits 32 bits on SPI.
Definition: adf4156.c:155
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 ADF4156_MAX_R_CNT
Definition: adf4156.h:163
Header file of SPI Interface.
struct adf4156_platform_data * pdata
Definition: adf4156.h:194
uint32_t gcd(uint32_t x, uint32_t y)
Computes the greatest common divider of two numbers.
Definition: adf4156.c:208
#define ADF4156_MAX_FREQ_45_PRESC
Definition: adf4156.h:158
#define ADF4156_INT_VAL(x)
Definition: adf4156.h:62
#define ADF4156_MAX_MODULUS
Definition: adf4156.h:162
int8_t adf4156_init(struct adf4156_dev **device, struct adf4156_init_param init_param)
Initialize the SPI communication with the device.
Definition: adf4156.c:53
#define ADF4156_MAX_FREQ_PFD
Definition: adf4156.h:159
Definition: ad9361_util.h:69
uint32_t fpfd
Definition: adf4156.h:195
#define ADF4156_REF_DBL(x)
Definition: adf4156.h:85
#define ADF4156_R0_CTRL
Definition: adf4156.h:66
#define ADF4156_MAX_OUT_FREQ
Definition: adf4156.h:156
#define ADF4156_R1_CTRL
Definition: adf4156.h:70
#define ADF4156_REG3
Definition: adf4156.h:170
#define ADF4156_R2_CTRL
Definition: adf4156.h:91
#define ADF4156_RDIV2(x)
Definition: adf4156.h:83
#define ADF4156_MIN_FREQ_REFIN
Definition: adf4156.h:161
struct no_os_gpio_desc * gpio_le
Definition: adf4156.h:207
#define ADF4156_REG1
Definition: adf4156.h:168
uint32_t r0_fract
Definition: adf4156.h:197
int8_t adf4156_set(struct adf4156_dev *dev, uint32_t value)
Transmits 32 bits on SPI.
Definition: adf4156.c:155
struct adf4156_state adf4156_st
Definition: adf4156.h:210
#define ADF4156_MIN_OUT_FREQ
Definition: adf4156.h:157
double adf4156_set_freq(struct adf4156_dev *dev, double freq)
Sets the ADF4156 output frequency.
Definition: adf4156.c:229
Definition: adf4156.h:213
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:104
#define ADF4156_R4_CTRL
Definition: adf4156.h:117
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
#define ADF4156_REG0
Definition: adf4156.h:167
#define ADF4156_CE_HIGH
Definition: adf4156.h:138
#define ADF4156_LE_HIGH
Definition: adf4156.h:124
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
#define ADF4156_MAX_FREQ_REFIN
Definition: adf4156.h:160
uint32_t r0_int
Definition: adf4156.h:198
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:188
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
uint16_t r_cnt
Definition: adf4156.h:196
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:43
#define ADF4156_PHASE_VAL(x)
Definition: adf4156.h:69
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 ADF4156_REG4
Definition: adf4156.h:171
#define ADF4156_LE_OUT
Definition: adf4156.h:120
uint32_t reg_val[5]
Definition: adf4156.h:200
uint32_t gcd(uint32_t x, uint32_t y)
Computes the greatest common divider of two numbers.
Definition: adf4156.c:208
#define ADF4156_MOD_WORD(x)
Definition: adf4156.h:89
struct no_os_spi_desc * spi_desc
Definition: adf4156.h:205
#define ADF4156_R_CNT(x)
Definition: adf4156.h:87
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
int32_t adf4156_remove(struct adf4156_dev *dev)
Free the resources allocated by adf4156_init().
Definition: adf4156.c:133
struct no_os_gpio_init_param gpio_ce
Definition: adf4156.h:218
int8_t adf4156_init(struct adf4156_dev **device, struct adf4156_init_param init_param)
Initialize the SPI communication with the device.
Definition: adf4156.c:53
#define ADF4156_CE_OUT
Definition: adf4156.h:134
#define ADF4156_R3_CTRL
Definition: adf4156.h:107
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
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:188
int32_t adf4156_remove(struct adf4156_dev *dev)
Free the resources allocated by adf4156_init().
Definition: adf4156.c:133
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 ADF4156_LE_LOW
Definition: adf4156.h:122
Definition: adf4156.h:193
#define ADF4156_PRESCALER(x)
Definition: adf4156.h:81
Definition: adf4156.h:203
struct no_os_gpio_desc * gpio_ce
Definition: adf4156.h:208
Header file of ADF4156 Driver Configuration.
#define ADF4156_CNT_RST(x)
Definition: adf4156.h:105
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
struct no_os_spi_init_param spi_init
Definition: adf4156.h:215