![]() |
no-OS
|
Implementation of ADF4371 Driver. More...
#include <stdlib.h>#include <stdbool.h>#include <inttypes.h>#include <stdio.h>#include "no_os_error.h"#include "no_os_util.h"#include "no_os_alloc.h"#include "no_os_clk.h"#include "adf4371.h"Classes | |
| struct | adf4371_pwrdown |
| struct | reg_sequence |
| ADF4382 register format structure for default values. More... | |
Enumerations | |
| enum | { ADF4371_FREQ , ADF4371_POWER_DOWN , ADF4371_CHANNEL_NAME , ADF4371_MUXOUT_ENABLE } |
| enum | { ADF4371_CH_RF8 , ADF4371_CH_RFAUX8 , ADF4371_CH_RF16 , ADF4371_CH_RF32 } |
| enum | adf4371_variant { ADF4371 , ADF4372 } |
| enum | adf4371_muxout { ADF4371_TRISTATE = 0x00 , ADF4371_DIG_LOCK = 0x01 , ADF4371_CH_PUMP_UP = 0x02 , ADF4371_CH_PUMP_DOWN = 0x03 , ADF4371_RDIV2 = 0x04 , ADF4371_N_DIV_OUT = 0x05 , ADF4371_VCO_TEST = 0x06 , ADF4371_HIGH = 0x08 , ADF4371_VCO_CALIB_R_BAND = 0x09 , ADF4371_VCO_CALIB_N_BAND = 0x0A } |
Functions | |
| int32_t | adf4371_clk_recalc_rate_chan (struct adf4371_dev *dev, uint32_t chan, uint64_t *rate) |
| int32_t | adf4371_clk_round_rate_dev (struct adf4371_dev *dev, uint64_t rate, uint64_t *rounded_rate) |
| int32_t | adf4371_clk_set_rate_chan (struct adf4371_dev *dev, uint32_t chan, uint64_t rate) |
| int32_t | adf4371_init (struct adf4371_dev **device, const struct adf4371_init_param *init_param) |
| int32_t | adf4371_remove (struct adf4371_dev *device) |
Variables | |
| const struct no_os_clk_platform_ops | adf4371_clk_ops |
| adf4371 clock ops | |
Implementation of ADF4371 Driver.
Copyright 2020(c) Analog Devices, Inc.
SPDX-License-Identifier: BSD-3-Clause
| #define ADF4371_ADDR | ( | x | ) |
| #define ADF4371_ADDR_ASC | ( | x | ) |
| #define ADF4371_ADDR_ASC_MSK NO_OS_BIT(2) |
| #define ADF4371_ADDR_ASC_R | ( | x | ) |
| #define ADF4371_ADDR_ASC_R_MSK NO_OS_BIT(5) |
| #define ADF4371_CHECK_RANGE | ( | freq, | |
| range ) |
| #define ADF4371_CP_CURRENT | ( | x | ) |
| #define ADF4371_CP_CURRENT_MSK NO_OS_GENMASK(7, 4) |
| #define ADF4371_FRAC1WORD | ( | x | ) |
| #define ADF4371_FRAC1WORD_MSK NO_OS_BIT(0) |
| #define ADF4371_FRAC2WORD_H | ( | x | ) |
| #define ADF4371_FRAC2WORD_H_MSK NO_OS_GENMASK(6, 0) |
| #define ADF4371_FRAC2WORD_L | ( | x | ) |
| #define ADF4371_FRAC2WORD_L_MSK NO_OS_GENMASK(7, 1) |
| #define ADF4371_MAX_FREQ_PFD 250000000UL /* Hz */ |
| #define ADF4371_MAX_FREQ_REFIN 600000000UL /* Hz */ |
| #define ADF4371_MAX_MODULUS2 NO_OS_BIT(14) |
| #define ADF4371_MAX_OUT_RF16_FREQ (ADF4371_MAX_VCO_FREQ * 2) /* Hz */ |
| #define ADF4371_MAX_OUT_RF32_FREQ (ADF4371_MAX_VCO_FREQ * 4) /* Hz */ |
| #define ADF4371_MAX_OUT_RF8_FREQ ADF4371_MAX_VCO_FREQ /* Hz */ |
| #define ADF4371_MAX_VCO_FREQ 8000000000ULL /* 8000 MHz */ |
| #define ADF4371_MIN_OUT_RF16_FREQ (ADF4371_MIN_VCO_FREQ * 2) /* Hz */ |
| #define ADF4371_MIN_OUT_RF32_FREQ (ADF4371_MIN_VCO_FREQ * 4) /* Hz */ |
| #define ADF4371_MIN_OUT_RF8_FREQ (ADF4371_MIN_VCO_FREQ / 64) /* Hz */ |
| #define ADF4371_MIN_VCO_FREQ 4000000000ULL /* 4000 MHz */ |
| #define ADF4371_MOD2WORD | ( | x | ) |
| #define ADF4371_MOD2WORD_MSK NO_OS_GENMASK(5, 0) |
| #define ADF4371_MODULUS1 33554432ULL |
| #define ADF4371_MUTE_LD | ( | x | ) |
| #define ADF4371_MUTE_LD_MSK NO_OS_BIT(7) |
| #define ADF4371_MUXOUT | ( | x | ) |
| #define ADF4371_MUXOUT_EN | ( | x | ) |
| #define ADF4371_MUXOUT_EN_MSK NO_OS_BIT(3) |
| #define ADF4371_MUXOUT_LVL | ( | x | ) |
| #define ADF4371_MUXOUT_LVL_MSK NO_OS_BIT(2) |
| #define ADF4371_MUXOUT_MSK NO_OS_GENMASK(7, 4) |
| #define ADF4371_PD_POL | ( | x | ) |
| #define ADF4371_PD_POL_MSK NO_OS_BIT(3) |
| #define ADF4371_READ (1 << 15) |
| #define ADF4371_REFIN_MODE | ( | x | ) |
| #define ADF4371_REFIN_MODE_MASK NO_OS_BIT(6) |
| #define ADF4371_REG | ( | x | ) |
| #define ADF4371_RESET_CMD 0x81 |
| #define ADF4371_RF_DIV_SEL | ( | x | ) |
| #define ADF4371_RF_DIV_SEL_MSK NO_OS_GENMASK(6, 4) |
| #define ADF4371_SDO_ACT | ( | x | ) |
| #define ADF4371_SDO_ACT_MSK NO_OS_BIT(3) |
| #define ADF4371_SDO_ACT_R | ( | x | ) |
| #define ADF4371_SDO_ACT_R_MSK NO_OS_BIT(4) |
| #define ADF4371_TIMEOUT | ( | x | ) |
| #define ADF4371_TIMEOUT_MSK NO_OS_GENMASK(1, 0) |
| #define ADF4371_VCO_ALC_TOUT | ( | x | ) |
| #define ADF4371_VCO_ALC_TOUT_MSK NO_OS_GENMASK(4, 0) |
| #define ADF4371_WRITE (0 << 15) |
| enum adf4371_muxout |
| enum adf4371_variant |
| int32_t adf4371_clk_recalc_rate_chan | ( | struct adf4371_dev * | dev, |
| uint32_t | chan, | ||
| uint64_t * | rate ) |
Recalculate rate corresponding to a channel.
| dev | - The device structure. |
| chan | - Channel number. |
| rate | - Channel rate. |
| int32_t adf4371_clk_round_rate_dev | ( | struct adf4371_dev * | dev, |
| uint64_t | rate, | ||
| uint64_t * | rounded_rate ) |
Calculate closest possible rate
| dev | - The device structure |
| rate | - The desired rate. |
| rounded_rate | - The closest possible rate of desired rate. |
| int32_t adf4371_clk_set_rate_chan | ( | struct adf4371_dev * | dev, |
| uint32_t | chan, | ||
| uint64_t | rate ) |
Set channel rate.
| dev | - The device structure. |
| chan | - Channel number. |
| rate | - Channel rate. |
| int32_t adf4371_init | ( | struct adf4371_dev ** | device, |
| const struct adf4371_init_param * | init_param ) |
Initialize the device.
| device | - The device structure. |
| init_param | - The structure that contains the device initial parameters. |
| int32_t adf4371_remove | ( | struct adf4371_dev * | device | ) |
Remove the device - release resources.
| device | - The device structure. |
| const struct no_os_clk_platform_ops adf4371_clk_ops |
adf4371 clock ops