Header file for adf4377 Driver. More...
#include <stdint.h>
#include <stdbool.h>
#include "no_os_spi.h"
#include "no_os_gpio.h"
#include "no_os_util.h"
Go to the source code of this file.
Classes | |
struct | adf4377_init_param |
ADF4377 Initialization Parameters structure. More... | |
struct | adf4377_dev |
ADF4377 Device Descriptor. More... | |
Enumerations | |
enum | adf4377_dev_id { ADF4377 = 0x05 , ADF4378 = 0x06 } |
ID of Devices supported by the driver. More... | |
Functions | |
int | adf4377_spi_write (struct adf4377_dev *dev, uint8_t reg_addr, uint8_t data) |
Writes data to ADF4377 over SPI. | |
int | adf4377_spi_update_bit (struct adf4377_dev *dev, uint16_t reg_addr, uint8_t mask, uint8_t data) |
Update ADF4377 register. | |
int | adf4377_spi_read (struct adf4377_dev *dev, uint8_t reg_addr, uint8_t *data) |
Reads data from ADF4377 over SPI. | |
int | adf4377_set_ref_clk (struct adf4377_dev *dev, uint64_t val) |
Set the desired reference frequency and reset everything over to maximum supported value of 5GHz to the max. value and everything under the minimum supported value of 10MHz to the min. value. | |
int | adf4377_get_ref_clk (struct adf4377_dev *dev, uint64_t *val) |
Gets the user proposed reference frequency. | |
int | adf4377_set_en_ref_doubler (struct adf4377_dev *dev, bool en) |
Set the reference doubler to enable or disable based on the passed parameter. If the parameter is different then 0 it will set the doubler to enable. | |
int | adf4377_get_en_ref_doubler (struct adf4377_dev *dev, bool *en) |
Gets the value the doubler if it is enabled or disable and stores it it the dev structure. | |
int | adf4377_set_ref_div (struct adf4377_dev *dev, int32_t div) |
Set the reference divider value and reset everything over to maximum supported value of 63 to the max. value. | |
int | adf4377_get_ref_div (struct adf4377_dev *dev, int32_t *div) |
Gets the value the reference divider. | |
int | adf4377_set_cp_i (struct adf4377_dev *dev, int32_t reg_val) |
Set the charge pump value which will be written to the register. The value will be between 0 and 15 on 8 bits. For more information please consult the Datasheet. | |
int | adf4377_get_cp_i (struct adf4377_dev *dev, int32_t *reg_val) |
Gets the charge pump value from the register. The value will be between 0 and 15 on 8 bits. For more information please consult the Datasheet. | |
int | adf4377_set_bleed_word (struct adf4377_dev *dev, int32_t word) |
Set the bleed word, which represents the value of the bleed current written to the register space. | |
int | adf4377_get_bleed_word (struct adf4377_dev *dev, int32_t *word) |
Gets the value of the set bleed word. | |
int | adf4377_set_rfout (struct adf4377_dev *dev, uint64_t val) |
Set the desired output frequency and reset everything over to maximum supported value of 12.8GHz to the max. value and everything under the minimum supported value of 800MHz to the min. value. | |
int | adf4377_get_rfout (struct adf4377_dev *dev, uint64_t *val) |
Gets the user proposed output frequency. | |
int | adf4377_set_en_chan (struct adf4377_dev *dev, uint8_t ch, bool en) |
Set the output channel to enable or disable based on the passed parameter. If the parameter is different then 0 it will set the doubler to enable. | |
int | adf4377_get_en_chan (struct adf4377_dev *dev, uint8_t ch, bool *en) |
Gets the value the output channel if it is enabled or disable. | |
int | adf4377_set_out_power (struct adf4377_dev *dev, uint8_t ch, int8_t pwr) |
Set the output power register value of a channel and reset everything over to maximum supported value of 15 to the max. value. | |
int | adf4377_get_out_power (struct adf4377_dev *dev, uint8_t ch, int8_t *pwr) |
Gets the output power register value. | |
int | adf4377_set_rfout_divider (struct adf4377_dev *dev, uint8_t div) |
Set the rfout frequency divider register value and reset everything over to maximum supported value of /128 to the max. value. | |
int | adf4377_get_rfout_divider (struct adf4377_dev *dev, int8_t *div) |
Gets the rfout divider register value. | |
int | adf4377_check_scratchpad (struct adf4377_dev *dev) |
ADF4377 SPI Scratchpad check. | |
int | adf4377_set_sr_del_adj (struct adf4377_dev *dev, int32_t val) |
Set the value of SR_DEL Adjustment Feature Translated to Pico Seconds on the output. Reset to Max value of 127. | |
int | adf4377_get_sr_del_adj (struct adf4377_dev *dev, int32_t *val) |
Gets the value of the set SR_DEL Adjustment Feature Translated to Pico Seconds on the output. | |
int | adf4377_set_en_sr_inv_adj (struct adf4377_dev *dev, bool en) |
Set the value of SR_INV_ADJ Adjustment to enable or disable which adds a constant value to the skew adjustment output. | |
int | adf4377_get_en_sr_inv_adj (struct adf4377_dev *dev, bool *en) |
Gets the value of the set SR_INV_ADJ Adjustment to enable or disable which adds a constant value to the skew adjustment output. | |
int | adf4377_set_en_sysref_monitor (struct adf4377_dev *dev, bool en) |
Set enable/disable sysref monitoring. | |
int | adf4377_get_en_sysref_monitor (struct adf4377_dev *dev, bool *en) |
Gets the value of the set sysref monitoring. | |
int | adf4377_set_freq (struct adf4377_dev *dev) |
int32_t | adf4377_init (struct adf4377_dev **device, struct adf4377_init_param *init_param) |
Initializes the ADF4377. | |
int32_t | adf4377_remove (struct adf4377_dev *dev) |
Free resoulces allocated for ADF4377. | |
Header file for adf4377 Driver.
Copyright 2025(c) Analog Devices, Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define ADF4377_1V8_LOGIC 0x0 |
#define ADF4377_3V3_LOGIC 0x1 |
#define ADF4377_ADC_A_CONV | ( | x | ) |
#define ADF4377_ADC_A_CONV_ADC_ST_CNV 0x0 |
#define ADF4377_ADC_A_CONV_MSK NO_OS_BIT(0) |
#define ADF4377_ADC_A_CONV_VCO_CALIB 0x1 |
#define ADF4377_ADC_BUSY | ( | x | ) |
#define ADF4377_ADC_BUSY_MSK NO_OS_BIT(2) |
#define ADF4377_ADC_CLK_DIV | ( | x | ) |
#define ADF4377_ADC_CLK_DIV_MSK NO_OS_GENMASK(7, 0) |
#define ADF4377_ADC_CLK_SEL | ( | x | ) |
#define ADF4377_ADC_CLK_SEL_MSK NO_OS_BIT(6) |
#define ADF4377_ADC_CLK_SEL_N_OP 0x0 |
#define ADF4377_ADC_CLK_SEL_SPI_CLK 0x1 |
#define ADF4377_ADC_ST_CNV | ( | x | ) |
#define ADF4377_ADC_ST_CNV_MSK NO_OS_BIT(0) |
#define ADF4377_ADDR_ASC_AUTO_DECR 0x0 |
#define ADF4377_ADDR_ASC_AUTO_INCR 0x1 |
#define ADF4377_ADDRESS_ASC | ( | x | ) |
#define ADF4377_ADDRESS_ASC_MSK NO_OS_BIT(2) |
#define ADF4377_ADDRESS_ASC_R | ( | x | ) |
#define ADF4377_ADDRESS_ASC_R_MSK NO_OS_BIT(5) |
#define ADF4377_BLEED_I_LSB | ( | x | ) |
#define ADF4377_BLEED_I_LSB_MSK NO_OS_GENMASK(7, 6) |
#define ADF4377_BLEED_I_MSB | ( | x | ) |
#define ADF4377_BLEED_I_MSB_MSK NO_OS_GENMASK(7, 0) |
#define ADF4377_BLEED_POL | ( | x | ) |
#define ADF4377_BLEED_POL_MSK NO_OS_BIT(5) |
#define ADF4377_BLEED_WORD_MAX 1023 |
#define ADF4377_BST_LARGE_REF_IN 0x0 |
#define ADF4377_BST_REF | ( | x | ) |
#define ADF4377_BST_REF_MSK NO_OS_BIT(7) |
#define ADF4377_BST_SMALL_REF_IN 0x1 |
#define ADF4377_BUFF_SIZE_BYTES 3 |
#define ADF4377_CHECK_RANGE | ( | freq, | |
range ) |
#define ADF4377_CHIP_TEMP_LSB | ( | x | ) |
#define ADF4377_CHIP_TEMP_LSB_MSK NO_OS_GENMASK(7, 0) |
#define ADF4377_CHIP_TEMP_MSB | ( | x | ) |
#define ADF4377_CHIP_TEMP_MSB_MSK NO_OS_BIT(0) |
#define ADF4377_CHIP_TYPE 0x06 |
#define ADF4377_CHIP_VERSION | ( | x | ) |
#define ADF4377_CHIP_VERSION_MSK NO_OS_GENMASK(7, 0) |
#define ADF4377_CLKIN_REF_MAX 10000000000U |
#define ADF4377_CLKIN_REF_MIN 10000000 |
#define ADF4377_CLKODIV_DB | ( | x | ) |
#define ADF4377_CLKODIV_DB_MSK NO_OS_BIT(7) |
#define ADF4377_CLKOUT1_OP | ( | x | ) |
#define ADF4377_CLKOUT1_OP_MSK NO_OS_GENMASK(5, 4) |
#define ADF4377_CLKOUT2_OP | ( | x | ) |
#define ADF4377_CLKOUT2_OP_MSK NO_OS_GENMASK(7, 6) |
#define ADF4377_CLKOUT_320MV 0x0 |
#define ADF4377_CLKOUT_420MV 0x1 |
#define ADF4377_CLKOUT_530MV 0x2 |
#define ADF4377_CLKOUT_640MV 0x3 |
#define ADF4377_CLKOUT_DIV | ( | x | ) |
#define ADF4377_CLKOUT_DIV_1 0x0 |
#define ADF4377_CLKOUT_DIV_2 0x1 |
#define ADF4377_CLKOUT_DIV_4 0x2 |
#define ADF4377_CLKOUT_DIV_8 0x3 |
#define ADF4377_CLKOUT_DIV_MSK NO_OS_GENMASK(7, 6) |
#define ADF4377_CLKOUT_DIV_REG_VAL_MAX 3 |
#define ADF4377_CMOS_OV | ( | x | ) |
#define ADF4377_CMOS_OV_MSK NO_OS_BIT(7) |
#define ADF4377_CP_0MA7 0x0 |
#define ADF4377_CP_0MA9 0x1 |
#define ADF4377_CP_10MA1 0xF |
#define ADF4377_CP_1MA1 0x2 |
#define ADF4377_CP_1MA3 0x3 |
#define ADF4377_CP_1MA4 0x4 |
#define ADF4377_CP_1MA8 0x5 |
#define ADF4377_CP_2MA2 0x6 |
#define ADF4377_CP_2MA5 0x7 |
#define ADF4377_CP_2MA9 0x8 |
#define ADF4377_CP_3MA6 0x9 |
#define ADF4377_CP_4MA3 0xA |
#define ADF4377_CP_5MA0 0xB |
#define ADF4377_CP_5MA7 0xC |
#define ADF4377_CP_7MA2 0xD |
#define ADF4377_CP_8MA6 0xE |
#define ADF4377_CP_DOWN | ( | x | ) |
#define ADF4377_CP_DOWN_MSK NO_OS_BIT(1) |
#define ADF4377_CP_DOWN_OFF 0x0 |
#define ADF4377_CP_DOWN_ON 0x1 |
#define ADF4377_CP_I | ( | x | ) |
#define ADF4377_CP_I_MSK NO_OS_GENMASK(3, 0) |
#define ADF4377_CP_UP | ( | x | ) |
#define ADF4377_CP_UP_MSK NO_OS_BIT(0) |
#define ADF4377_CP_UP_OFF 0x0 |
#define ADF4377_CP_UP_ON 0x1 |
#define ADF4377_CPI_VAL_MAX 15 |
#define ADF4377_CURRENT_SINK 0x0 |
#define ADF4377_CURRENT_SOURCE 0x1 |
#define ADF4377_DCLK_DB | ( | x | ) |
#define ADF4377_DCLK_DB_MSK NO_OS_BIT(6) |
#define ADF4377_DCLK_DIV1 | ( | x | ) |
#define ADF4377_DCLK_DIV1_1 0x0 |
#define ADF4377_DCLK_DIV1_2 0x1 |
#define ADF4377_DCLK_DIV1_32 0x3 |
#define ADF4377_DCLK_DIV1_8 0x2 |
#define ADF4377_DCLK_DIV1_MSK NO_OS_GENMASK(1, 0) |
#define ADF4377_DCLK_DIV2 | ( | x | ) |
#define ADF4377_DCLK_DIV2_1 0x0 |
#define ADF4377_DCLK_DIV2_2 0x1 |
#define ADF4377_DCLK_DIV2_4 0x2 |
#define ADF4377_DCLK_DIV2_8 0x3 |
#define ADF4377_DCLK_DIV2_MSK NO_OS_GENMASK(5,4) |
#define ADF4377_DCLK_MODE | ( | x | ) |
#define ADF4377_DCLK_MODE_MSK NO_OS_BIT(2) |
#define ADF4377_DEL_CTRL_DB | ( | x | ) |
#define ADF4377_DEL_CTRL_DB_MSK NO_OS_BIT(7) |
#define ADF4377_EN_ADC | ( | x | ) |
#define ADF4377_EN_ADC_CLK | ( | x | ) |
#define ADF4377_EN_ADC_CLK_MSK NO_OS_BIT(3) |
#define ADF4377_EN_ADC_CNV | ( | x | ) |
#define ADF4377_EN_ADC_CNV_MSK NO_OS_BIT(7) |
#define ADF4377_EN_ADC_MSK NO_OS_BIT(1) |
#define ADF4377_EN_AUTOCAL | ( | x | ) |
#define ADF4377_EN_AUTOCAL_MSK NO_OS_BIT(7) |
#define ADF4377_EN_BLEED | ( | x | ) |
#define ADF4377_EN_BLEED_MSK NO_OS_BIT(4) |
#define ADF4377_EN_CLK1 | ( | x | ) |
#define ADF4377_EN_CLK1_MSK NO_OS_BIT(6) |
#define ADF4377_EN_CLK2 | ( | x | ) |
#define ADF4377_EN_CLK2_MSK NO_OS_BIT(7) |
#define ADF4377_EN_CPTEST | ( | x | ) |
#define ADF4377_EN_CPTEST_MSK NO_OS_BIT(2) |
#define ADF4377_EN_CPTEST_OFF 0x0 |
#define ADF4377_EN_CPTEST_ON 0x1 |
#define ADF4377_EN_DNCLK | ( | x | ) |
#define ADF4377_EN_DNCLK_MSK NO_OS_BIT(7) |
#define ADF4377_EN_DNCLK_OFF 0x0 |
#define ADF4377_EN_DNCLK_ON 0x1 |
#define ADF4377_EN_DRCLK | ( | x | ) |
#define ADF4377_EN_DRCLK_MSK NO_OS_BIT(6) |
#define ADF4377_EN_DRCLK_OFF 0x0 |
#define ADF4377_EN_DRCLK_ON 0x1 |
#define ADF4377_EN_LDWIN | ( | x | ) |
#define ADF4377_EN_LDWIN_MSK NO_OS_BIT(5) |
#define ADF4377_EN_LOL | ( | x | ) |
#define ADF4377_EN_LOL_MSK NO_OS_BIT(7) |
#define ADF4377_EN_RDBLR | ( | x | ) |
#define ADF4377_EN_RDBLR_MSK NO_OS_BIT(6) |
#define ADF4377_FILT_REF | ( | x | ) |
#define ADF4377_FILT_REF_MSK NO_OS_BIT(6) |
#define ADF4377_FILT_REF_OFF 0x0 |
#define ADF4377_FILT_REF_ON 0x1 |
#define ADF4377_FREQ_PFD_125MHZ 125000000 |
#define ADF4377_FREQ_PFD_160MHZ 160000000 |
#define ADF4377_FREQ_PFD_250MHZ 250000000 |
#define ADF4377_FREQ_PFD_320MHZ 320000000 |
#define ADF4377_FREQ_PFD_80MHZ 80000000 |
#define ADF4377_FSM_BUSY | ( | x | ) |
#define ADF4377_FSM_BUSY_MSK NO_OS_BIT(1) |
#define ADF4377_INV_CLKOUT | ( | x | ) |
#define ADF4377_INV_CLKOUT_MSK NO_OS_BIT(7) |
#define ADF4377_INV_SR | ( | x | ) |
#define ADF4377_INV_SR_MSK NO_OS_BIT(7) |
#define ADF4377_LD_COUNT | ( | x | ) |
#define ADF4377_LD_COUNT_MSK NO_OS_GENMASK(4, 0) |
#define ADF4377_LDWIN_PW | ( | x | ) |
#define ADF4377_LDWIN_PW_MSK NO_OS_BIT(6) |
#define ADF4377_LDWIN_PW_NARROW 0x0 |
#define ADF4377_LDWIN_PW_WIDE 0x1 |
#define ADF4377_LKD_DELAY_US 5000 |
#define ADF4377_LOCKED | ( | x | ) |
#define ADF4377_LOCKED_MSK NO_OS_BIT(0) |
#define ADF4377_LSB_FIRST | ( | x | ) |
#define ADF4377_LSB_FIRST_LSB 0x1 |
#define ADF4377_LSB_FIRST_MSB 0x0 |
#define ADF4377_LSB_FIRST_MSK NO_OS_BIT(1) |
#define ADF4377_LSB_FIRST_R | ( | x | ) |
#define ADF4377_LSB_FIRST_R_MSK NO_OS_BIT(6) |
#define ADF4377_M_VCO_0 0x0 |
#define ADF4377_M_VCO_1 0x1 |
#define ADF4377_M_VCO_2 0x2 |
#define ADF4377_M_VCO_3 0x3 |
#define ADF4377_M_VCO_BAND | ( | x | ) |
#define ADF4377_M_VCO_BAND_MSK NO_OS_GENMASK(7,0) |
#define ADF4377_M_VCO_BIAS | ( | x | ) |
#define ADF4377_M_VCO_BIAS_MSK NO_OS_GENMASK(3,0) |
#define ADF4377_M_VCO_CORE | ( | x | ) |
#define ADF4377_M_VCO_CORE_MSK NO_OS_GENMASK(5,4) |
#define ADF4377_MASTER_RB_CTRL | ( | x | ) |
#define ADF4377_MASTER_RB_CTRL_MSK NO_OS_BIT(5) |
#define ADF4377_MAX_CLKPN_FREQ ADF4377_MAX_VCO_FREQ /* Hz */ |
#define ADF4377_MAX_FREQ_PFD 500000000 /* Hz */ |
#define ADF4377_MAX_REFIN_FREQ 1000000000 /* Hz */ |
#define ADF4377_MAX_VCO_FREQ 12800000000ull /* Hz */ |
#define ADF4377_MIN_CLKPN_FREQ (ADF4377_MIN_VCO_FREQ / 8) /* Hz */ |
#define ADF4377_MIN_FREQ_PFD 3000000 /* Hz */ |
#define ADF4377_MIN_R_DIV 0x00 |
#define ADF4377_MIN_REFIN_FREQ 10000000 /* Hz */ |
#define ADF4377_MIN_VCO_FREQ 6400000000ull /* Hz */ |
#define ADF4377_MUXOUT | ( | x | ) |
#define ADF4377_MUXOUT_DIV_NCLK_2 0x5 |
#define ADF4377_MUXOUT_DIV_RCLK_2 0x4 |
#define ADF4377_MUXOUT_HIGH 0x8 |
#define ADF4377_MUXOUT_HIGH_Z 0x0 |
#define ADF4377_MUXOUT_LKDET 0x1 |
#define ADF4377_MUXOUT_LOW 0x2 |
#define ADF4377_MUXOUT_MSK NO_OS_GENMASK(7, 4) |
#define ADF4377_N_DEL | ( | x | ) |
#define ADF4377_N_DEL_MSK NO_OS_GENMASK(6, 0) |
#define ADF4377_N_INT_LSB | ( | x | ) |
#define ADF4377_N_INT_LSB_MSK NO_OS_GENMASK(7, 0) |
#define ADF4377_N_INT_MSB | ( | x | ) |
#define ADF4377_N_INT_MSB_MSK NO_OS_GENMASK(3,0) |
#define ADF4377_O_VCO_BAND | ( | x | ) |
#define ADF4377_O_VCO_BAND_M_VCO 0x1 |
#define ADF4377_O_VCO_BAND_MSK NO_OS_BIT(3) |
#define ADF4377_O_VCO_BAND_VCO_CALIB 0x0 |
#define ADF4377_O_VCO_BIAS | ( | x | ) |
#define ADF4377_O_VCO_BIAS_M_VCO 0x1 |
#define ADF4377_O_VCO_BIAS_MSK NO_OS_BIT(1) |
#define ADF4377_O_VCO_BIAS_VCO_CALIB 0x0 |
#define ADF4377_O_VCO_CORE | ( | x | ) |
#define ADF4377_O_VCO_CORE_M_VCO 0x1 |
#define ADF4377_O_VCO_CORE_MSK NO_OS_BIT(2) |
#define ADF4377_O_VCO_CORE_VCO_CALIB 0x0 |
#define ADF4377_O_VCO_DB | ( | x | ) |
#define ADF4377_O_VCO_DB_MSK NO_OS_BIT(7) |
#define ADF4377_OUT_PWR_MAX ADF4377_CLKOUT_DIV_REG_VAL_MAX |
#define ADF4377_PD_ADC | ( | x | ) |
#define ADF4377_PD_ADC_MSK NO_OS_BIT(1) |
#define ADF4377_PD_ADC_N_OP 0x0 |
#define ADF4377_PD_ADC_PD 0x1 |
#define ADF4377_PD_ALL | ( | x | ) |
#define ADF4377_PD_ALL_MSK NO_OS_BIT(7) |
#define ADF4377_PD_ALL_N_OP 0x0 |
#define ADF4377_PD_ALL_PD 0x1 |
#define ADF4377_PD_CALADC | ( | x | ) |
#define ADF4377_PD_CALADC_MSK NO_OS_BIT(0) |
#define ADF4377_PD_CALADC_N_OP 0x0 |
#define ADF4377_PD_CALADC_PD 0x1 |
#define ADF4377_PD_CLK | ( | x | ) |
#define ADF4377_PD_CLK_MSK NO_OS_BIT(3) |
#define ADF4377_PD_CLK_N_OP 0x0 |
#define ADF4377_PD_CLK_PD 0x1 |
#define ADF4377_PD_CLKOUT1 | ( | x | ) |
#define ADF4377_PD_CLKOUT1_MSK NO_OS_BIT(1) |
#define ADF4377_PD_CLKOUT1_N_OP 0x0 |
#define ADF4377_PD_CLKOUT1_PD 0x1 |
#define ADF4377_PD_CLKOUT2 | ( | x | ) |
#define ADF4377_PD_CLKOUT2_MSK NO_OS_BIT(0) |
#define ADF4377_PD_CLKOUT2_N_OP 0x0 |
#define ADF4377_PD_CLKOUT2_PD 0x1 |
#define ADF4377_PD_LD | ( | x | ) |
#define ADF4377_PD_LD_MSK NO_OS_BIT(3) |
#define ADF4377_PD_LD_N_OP 0x0 |
#define ADF4377_PD_LD_PD 0x1 |
#define ADF4377_PD_NDIV | ( | x | ) |
#define ADF4377_PD_NDIV_MSK NO_OS_BIT(5) |
#define ADF4377_PD_NDIV_N_OP 0x0 |
#define ADF4377_PD_NDIV_PD 0x1 |
#define ADF4377_PD_PFDCP | ( | x | ) |
#define ADF4377_PD_PFDCP_MSK NO_OS_BIT(2) |
#define ADF4377_PD_PFDCP_N_OP 0x0 |
#define ADF4377_PD_PFDCP_PD 0x1 |
#define ADF4377_PD_RDET | ( | x | ) |
#define ADF4377_PD_RDET_MSK NO_OS_BIT(2) |
#define ADF4377_PD_RDET_N_OP 0x0 |
#define ADF4377_PD_RDET_PD 0x1 |
#define ADF4377_PD_RDIV | ( | x | ) |
#define ADF4377_PD_RDIV_MSK NO_OS_BIT(6) |
#define ADF4377_PD_RDIV_N_OP 0x0 |
#define ADF4377_PD_RDIV_PD 0x1 |
#define ADF4377_PD_SR_MON | ( | x | ) |
#define ADF4377_PD_SR_MON_MSK NO_OS_BIT(6) |
#define ADF4377_PD_VCO | ( | x | ) |
#define ADF4377_PD_VCO_MSK NO_OS_BIT(4) |
#define ADF4377_PD_VCO_N_OP 0x0 |
#define ADF4377_PD_VCO_PD 0x1 |
#define ADF4377_POR_DELAY_US 200 |
#define ADF4377_PRODUCT_ID_LSB 0x0005 |
#define ADF4377_PRODUCT_ID_MSB 0x0005 |
#define ADF4377_R00F_RSV1 0x14 |
#define ADF4377_R01C_RSV1 | ( | x | ) |
#define ADF4377_R01C_RSV1_MSK NO_OS_BIT(0) |
#define ADF4377_R01F_RSV1 | ( | x | ) |
#define ADF4377_R01F_RSV1_MSK NO_OS_GENMASK(2, 0) |
#define ADF4377_R020_RSV1 | ( | x | ) |
#define ADF4377_R020_RSV1_MSK NO_OS_BIT(0) |
#define ADF4377_R021_RSV1 0xD3 |
#define ADF4377_R022_RSV1 0x32 |
#define ADF4377_R023_RSV1 0x18 |
#define ADF4377_R025_RSV1 | ( | x | ) |
#define ADF4377_R02C_RSV1 0xC0 |
#define ADF4377_R031_RSV1 0x09 |
#define ADF4377_R032_RSV1 | ( | x | ) |
#define ADF4377_R033_RSV1 0x18 |
#define ADF4377_R034_RSV1 0x08 |
#define ADF4377_R03A_RSV1 0x5C |
#define ADF4377_R03B_RSV1 0x2B |
#define ADF4377_R042_RSV1 0x05 |
#define ADF4377_R042_RSV1_MSK NO_OS_GENMASK(3, 0) |
#define ADF4377_R042_RSV5_MSK NO_OS_BIT(7) |
#define ADF4377_R_DEL | ( | x | ) |
#define ADF4377_R_DEL_MAX 0x7F |
#define ADF4377_R_DEL_MIN 0x00 |
#define ADF4377_R_DEL_MSK NO_OS_GENMASK(6, 0) |
#define ADF4377_R_DIV | ( | x | ) |
#define ADF4377_R_DIV_MSK NO_OS_GENMASK(5, 0) |
#define ADF4377_RB_MASTER_REG 0x1 |
#define ADF4377_RB_SLAVE_REG 0x0 |
#define ADF4377_REF_DBLR_DIS 0x0 |
#define ADF4377_REF_DBLR_EN 0x1 |
#define ADF4377_REF_DIV_MAX 63 |
#define ADF4377_REF_OK | ( | x | ) |
#define ADF4377_REF_OK_MSK NO_OS_BIT(3) |
#define ADF4377_REF_SEL | ( | x | ) |
#define ADF4377_REF_SEL_DMA 0x0 |
#define ADF4377_REF_SEL_LNA 0x1 |
#define ADF4377_REF_SEL_MSK NO_OS_BIT(5) |
#define ADF4377_REG | ( | x | ) |
#define ADF4377_RESET_CMD 0x81 |
#define ADF4377_RFOUT_MAX 12800000000U |
#define ADF4377_RFOUT_MIN 800000000U |
#define ADF4377_RST_LD | ( | x | ) |
#define ADF4377_RST_LD_ACTIVE 0x1 |
#define ADF4377_RST_LD_INACTIVE 0x0 |
#define ADF4377_RST_LD_MSK NO_OS_BIT(2) |
#define ADF4377_RST_SR_MON | ( | x | ) |
#define ADF4377_RST_SR_MON_MSK NO_OS_BIT(4) |
#define ADF4377_RST_SYS | ( | x | ) |
#define ADF4377_RST_SYS_ACTIVE 0x1 |
#define ADF4377_RST_SYS_INACTIVE 0x0 |
#define ADF4377_RST_SYS_MSK NO_OS_BIT(4) |
#define ADF4377_SCRATCHPAD | ( | x | ) |
#define ADF4377_SCRATCHPAD_MSK NO_OS_GENMASK(7, 0) |
#define ADF4377_SDO_ACTIVE | ( | x | ) |
#define ADF4377_SDO_ACTIVE_MSK NO_OS_BIT(3) |
#define ADF4377_SDO_ACTIVE_R | ( | x | ) |
#define ADF4377_SDO_ACTIVE_R_MSK NO_OS_BIT(4) |
#define ADF4377_SDO_ACTIVE_SPI_3W 0x0 |
#define ADF4377_SDO_ACTIVE_SPI_4W 0x1 |
#define ADF4377_SINGLE_INSTR | ( | x | ) |
#define ADF4377_SINGLE_INSTR_MSK NO_OS_BIT(7) |
#define ADF4377_SOFT_RESET | ( | x | ) |
#define ADF4377_SOFT_RESET_EN 0x1 |
#define ADF4377_SOFT_RESET_MSK NO_OS_BIT(0) |
#define ADF4377_SOFT_RESET_N_OP 0x0 |
#define ADF4377_SOFT_RESET_R | ( | x | ) |
#define ADF4377_SOFT_RESET_R_MSK NO_OS_BIT(7) |
#define ADF4377_SPI_4W_CFG | ( | x | ) |
#define ADF4377_SPI_DUMMY_DATA 0x00 |
#define ADF4377_SPI_LSB_CFG | ( | x | ) |
#define ADF4377_SPI_READ_CMD NO_OS_BIT(7) |
#define ADF4377_SPI_REVISION 0x01 |
#define ADF4377_SPI_SCRATCHPAD_TEST_A 0xA5u |
#define ADF4377_SPI_SCRATCHPAD_TEST_B 0x5Au |
#define ADF4377_SPI_STREAM_DIS 0x1 |
#define ADF4377_SPI_STREAM_EN 0x0 |
#define ADF4377_SPI_WRITE_CMD 0x0 |
#define ADF4377_SR_DEL | ( | x | ) |
#define ADF4377_SR_DEL_MAX 127 |
#define ADF4377_SR_DEL_MSK NO_OS_GENMASK(6, 0) |
#define ADF4377_SR_MON_DELAY_US 100U |
#define ADF4377_SR_SEL | ( | x | ) |
#define ADF4377_SR_SEL_MSK NO_OS_BIT(5) |
#define ADF4377_SYNTH_LOCK_TO_LSB | ( | x | ) |
#define ADF4377_SYNTH_LOCK_TO_LSB_MSK NO_OS_GENMASK(7, 0) |
#define ADF4377_SYNTH_LOCK_TO_MSB | ( | x | ) |
#define ADF4377_SYNTH_LOCK_TO_MSB_MSK NO_OS_GENMASK(6, 0) |
#define ADF4377_VCO_ALC_TO_LSB | ( | x | ) |
#define ADF4377_VCO_ALC_TO_LSB_MSK NO_OS_GENMASK(7, 0) |
#define ADF4377_VCO_ALC_TO_MSB | ( | x | ) |
#define ADF4377_VCO_ALC_TO_MSB_MSK NO_OS_GENMASK(6, 0) |
#define ADF4377_VCO_BAND | ( | x | ) |
#define ADF4377_VCO_BAND_DIV | ( | x | ) |
#define ADF4377_VCO_BAND_DIV_MAX 0xFF |
#define ADF4377_VCO_BAND_DIV_MIN 0x00 |
#define ADF4377_VCO_BAND_DIV_MSK NO_OS_GENMASK(7, 0) |
#define ADF4377_VCO_BAND_MAX 0x00 |
#define ADF4377_VCO_BAND_MIN 0xFF |
#define ADF4377_VCO_BAND_MSK NO_OS_GENMASK(7, 0) |
#define ADF4377_VCO_CALIB_DIS 0x0 |
#define ADF4377_VCO_CALIB_EN 0x1 |
#define ADF4377_VCO_CORE | ( | x | ) |
#define ADF4377_VCO_CORE_MSK NO_OS_GENMASK(1, 0) |
#define ADF4377_VENDOR_ID_LSB 0x456 |
#define ADF4377_VENDOR_ID_MSB 0x456 |
#define ADF4378_MAX_R_DIV 0x3F |
#define M_VCO_BIAS_MAX 0x0 |
#define M_VCO_BIAS_MIN 0xF |
enum adf4377_dev_id |
int adf4377_check_scratchpad | ( | struct adf4377_dev * | dev | ) |
ADF4377 SPI Scratchpad check.
dev | - The device structure. |
int adf4377_get_bleed_word | ( | struct adf4377_dev * | dev, |
int32_t * | bleed_word ) |
Gets the value of the set bleed word.
adf4377 Get bleed current attribute
dev | - The device structure. |
bleed_word | - The read bleed current register value. |
int adf4377_get_cp_i | ( | struct adf4377_dev * | dev, |
int32_t * | reg_val ) |
Gets the charge pump value from the register. The value will be between 0 and 15 on 8 bits. For more information please consult the Datasheet.
adf4377 Get charge pump current attribute
dev | - The device structure. |
reg_val | - The read charge pump register value. |
int adf4377_get_en_chan | ( | struct adf4377_dev * | dev, |
uint8_t | ch, | ||
bool * | en ) |
Gets the value the output channel if it is enabled or disable.
ADF4377 Get channel enable attributes
dev | - The device structure. |
ch | - The channel to get state. |
en | - The status of the output channel. |
int adf4377_get_en_ref_doubler | ( | struct adf4377_dev * | dev, |
bool * | en ) |
Gets the value the doubler if it is enabled or disable and stores it it the dev structure.
adf4377 Get reference doubler attribute
dev | - The device structure. |
en | - The read value of the reference doubler. |
int adf4377_get_en_sr_inv_adj | ( | struct adf4377_dev * | dev, |
bool * | en ) |
Gets the value of the set SR_INV_ADJ Adjustment to enable or disable which adds a constant value to the skew adjustment output.
ADF4377 Get INV_SR Adjustment attribute
dev | - The device structure. |
en | - The read value of SR_INV. |
int adf4377_get_en_sysref_monitor | ( | struct adf4377_dev * | dev, |
bool * | en ) |
Gets the value of the set sysref monitoring.
ADF4377 Get sysref Monitoring attribute
dev | - The device structure. |
en | - The read value of the sysref monitor. |
int adf4377_get_out_power | ( | struct adf4377_dev * | dev, |
uint8_t | ch, | ||
int8_t * | pwr ) |
Gets the output power register value.
ADF4377 Get output power attributes
dev | - The device structure. |
ch | - The channel to get the power off. |
pwr | - The output power register value. |
int adf4377_get_ref_clk | ( | struct adf4377_dev * | dev, |
uint64_t * | val ) |
Gets the user proposed reference frequency.
ADF4377 Get Reference Clock attribute
dev | - The device structure. |
val | - The set value of the reference frequency in Hz. |
int adf4377_get_ref_div | ( | struct adf4377_dev * | dev, |
int32_t * | div ) |
Gets the value the reference divider.
adf4377 Get reference divider attribute
dev | - The device structure. |
div | - The read reference divider value. |
int adf4377_get_rfout | ( | struct adf4377_dev * | dev, |
uint64_t * | val ) |
Gets the user proposed output frequency.
ADF4377 Get output frequency attribute
dev | - The device structure. |
val | - The set value of the output frequency in Hz. |
int adf4377_get_rfout_divider | ( | struct adf4377_dev * | dev, |
int8_t * | div ) |
Gets the rfout divider register value.
ADF4377 Get the rfout divider attribute
dev | - The device structure. |
div | - The rfoutdiv divider register value. |
int adf4377_get_sr_del_adj | ( | struct adf4377_dev * | dev, |
int32_t * | val ) |
Gets the value of the set SR_DEL Adjustment Feature Translated to Pico Seconds on the output.
ADF4377 Get SR_DEL Adjustment attribute
dev | - The device structure. |
val | - The read SR_DEL register value. |
int32_t adf4377_init | ( | struct adf4377_dev ** | device, |
struct adf4377_init_param * | init_param ) |
Initializes the ADF4377.
ADF4377 Initialization
device | - The device structure. |
init_param | - The structure containing the device initial parameters. |
int32_t adf4377_remove | ( | struct adf4377_dev * | dev | ) |
Free resoulces allocated for ADF4377.
ADF4377 Resources Deallocation
dev | - The device structure. |
int adf4377_set_bleed_word | ( | struct adf4377_dev * | dev, |
int32_t | word ) |
Set the bleed word, which represents the value of the bleed current written to the register space.
adf4377 Set bleed current attribute
dev | - The device structure. |
word | - The bleed current register value. |
int adf4377_set_cp_i | ( | struct adf4377_dev * | dev, |
int32_t | reg_val ) |
Set the charge pump value which will be written to the register. The value will be between 0 and 15 on 8 bits. For more information please consult the Datasheet.
adf4377 Set charge pump current attribute
dev | - The device structure. |
reg_val | - The desired charge pump register value. |
int adf4377_set_en_chan | ( | struct adf4377_dev * | dev, |
uint8_t | ch, | ||
bool | en ) |
Set the output channel to enable or disable based on the passed parameter. If the parameter is different then 0 it will set the doubler to enable.
ADF4377 Set channel enable attributes
dev | - The device structure. |
ch | - The channel to set state. |
en | - The enable or disable value of the output channel. |
int adf4377_set_en_ref_doubler | ( | struct adf4377_dev * | dev, |
bool | en ) |
Set the reference doubler to enable or disable based on the passed parameter. If the parameter is different then 0 it will set the doubler to enable.
ADF477 Set reference doubler attribute
dev | - The device structure. |
en | - The enable or disable value of the reference doubler. |
int adf4377_set_en_sr_inv_adj | ( | struct adf4377_dev * | dev, |
bool | en ) |
Set the value of SR_INV_ADJ Adjustment to enable or disable which adds a constant value to the skew adjustment output.
ADF4377 Set INV_SR Adjustment attribute
dev | - The device structure. |
en | - The enable or disable value of SR_INV. |
int adf4377_set_en_sysref_monitor | ( | struct adf4377_dev * | dev, |
bool | en ) |
Set enable/disable sysref monitoring.
ADF4377 Set sysref Monitoring attribute
dev | - The device structure. |
en | - The enable or disable value of the sysref monitor. |
int adf4377_set_freq | ( | struct adf4377_dev * | dev | ) |
Set the output frequency.
dev | - The device structure. |
int adf4377_set_out_power | ( | struct adf4377_dev * | dev, |
uint8_t | ch, | ||
int8_t | pwr ) |
Set the output power register value of a channel and reset everything over to maximum supported value of 15 to the max. value.
ADF4377 Set output power attributes
dev | - The device structure. |
ch | - The channel to set the power off. |
pwr | - The output power register value. |
int adf4377_set_ref_clk | ( | struct adf4377_dev * | dev, |
uint64_t | val ) |
Set the desired reference frequency and reset everything over to maximum supported value of 5GHz to the max. value and everything under the minimum supported value of 10MHz to the min. value.
ADF4377 Set Reference Clock attribute
dev | - The device structure. |
val | - The desired reference frequency in Hz. |
int adf4377_set_ref_div | ( | struct adf4377_dev * | dev, |
int32_t | div ) |
Set the reference divider value and reset everything over to maximum supported value of 63 to the max. value.
adf4377 Set reference divider attribute
dev | - The device structure. |
div | - The reference divider value. |
int adf4377_set_rfout | ( | struct adf4377_dev * | dev, |
uint64_t | val ) |
Set the desired output frequency and reset everything over to maximum supported value of 12.8GHz to the max. value and everything under the minimum supported value of 800MHz to the min. value.
ADF4377 Set output frequency attribute
dev | - The device structure. |
val | - The desired output frequency in Hz. |
int adf4377_set_rfout_divider | ( | struct adf4377_dev * | dev, |
uint8_t | div ) |
Set the rfout frequency divider register value and reset everything over to maximum supported value of /128 to the max. value.
ADF4377 Set the rfout divider attribute
dev | - The device structure. |
div | - The rfoutdiv divider register value. |
int adf4377_set_sr_del_adj | ( | struct adf4377_dev * | dev, |
int32_t | val ) |
Set the value of SR_DEL Adjustment Feature Translated to Pico Seconds on the output. Reset to Max value of 127.
ADF4377 Set SR_DEL Adjustment attribute
dev | - The device structure. |
val | - The desired SR_DEL register value. |
int adf4377_spi_read | ( | struct adf4377_dev * | dev, |
uint8_t | reg_addr, | ||
uint8_t * | data ) |
Reads data from ADF4377 over SPI.
ADF4377 SPI Read
dev | - The device structure. |
reg_addr | - The register address. |
data | - Data read from the device. |
int adf4377_spi_update_bit | ( | struct adf4377_dev * | dev, |
uint16_t | reg_addr, | ||
uint8_t | mask, | ||
uint8_t | data ) |
Update ADF4377 register.
dev | - The device structure. |
reg_addr | - The register address. |
mask | - Mask for specific register bits to be updated. |
data | - Data written to the device (requires prior bit shifting). |
int adf4377_spi_write | ( | struct adf4377_dev * | dev, |
uint8_t | reg_addr, | ||
uint8_t | data ) |
Writes data to ADF4377 over SPI.
ADF4377 SPI write
dev | - The device structure. |
reg_addr | - The register address. |
data | - Data value to write. |