no-OS
Classes | Macros | Functions
adf4350.h File Reference

Header file of ADF4350 Driver. More...

#include <stdint.h>
#include "no-os/spi.h"
Include dependency graph for adf4350.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  adf4350_platform_data
 
struct  adf4350_init_param
 
struct  adf4350_dev
 

Macros

#define ADF4350_RX_CHANNEL   0
 
#define ADF4350_TX_CHANNEL   1
 
#define ADF4350_REG0   0
 
#define ADF4350_REG1   1
 
#define ADF4350_REG2   2
 
#define ADF4350_REG3   3
 
#define ADF4350_REG4   4
 
#define ADF4350_REG5   5
 
#define ADF4350_REG0_FRACT(x)   (((x) & 0xFFF) << 3)
 
#define ADF4350_REG0_INT(x)   (((x) & 0xFFFF) << 15)
 
#define ADF4350_REG1_MOD(x)   (((x) & 0xFFF) << 3)
 
#define ADF4350_REG1_PHASE(x)   (((x) & 0xFFF) << 15)
 
#define ADF4350_REG1_PRESCALER   (1 << 27)
 
#define ADF4350_REG2_COUNTER_RESET_EN   (1 << 3)
 
#define ADF4350_REG2_CP_THREESTATE_EN   (1 << 4)
 
#define ADF4350_REG2_POWER_DOWN_EN   (1 << 5)
 
#define ADF4350_REG2_PD_POLARITY_POS   (1 << 6)
 
#define ADF4350_REG2_LDP_6ns   (1 << 7)
 
#define ADF4350_REG2_LDP_10ns   (0 << 7)
 
#define ADF4350_REG2_LDF_FRACT_N   (0 << 8)
 
#define ADF4350_REG2_LDF_INT_N   (1 << 8)
 
#define ADF4350_REG2_CHARGE_PUMP_CURR_uA(x)   (((((x)-312) / 312) & 0xF) << 9)
 
#define ADF4350_REG2_DOUBLE_BUFF_EN   (1 << 13)
 
#define ADF4350_REG2_10BIT_R_CNT(x)   ((x) << 14)
 
#define ADF4350_REG2_RDIV2_EN   (1 << 24)
 
#define ADF4350_REG2_RMULT2_EN   (1 << 25)
 
#define ADF4350_REG2_MUXOUT(x)   ((x) << 26)
 
#define ADF4350_REG2_NOISE_MODE(x)   (((x) & 0x3) << 29)
 
#define ADF4350_REG3_12BIT_CLKDIV(x)   ((x) << 3)
 
#define ADF4350_REG3_12BIT_CLKDIV_MODE(x)   ((x) << 16)
 
#define ADF4350_REG3_12BIT_CSR_EN   (1 << 18)
 
#define ADF4351_REG3_CHARGE_CANCELLATION_EN   (1 << 21)
 
#define ADF4351_REG3_ANTI_BACKLASH_3ns_EN   (1 << 22)
 
#define ADF4351_REG3_BAND_SEL_CLOCK_MODE_HIGH   (1 << 23)
 
#define ADF4350_REG4_OUTPUT_PWR(x)   ((x) << 3)
 
#define ADF4350_REG4_RF_OUT_EN   (1 << 5)
 
#define ADF4350_REG4_AUX_OUTPUT_PWR(x)   ((x) << 6)
 
#define ADF4350_REG4_AUX_OUTPUT_EN   (1 << 8)
 
#define ADF4350_REG4_AUX_OUTPUT_FUND   (1 << 9)
 
#define ADF4350_REG4_AUX_OUTPUT_DIV   (0 << 9)
 
#define ADF4350_REG4_MUTE_TILL_LOCK_EN   (1 << 10)
 
#define ADF4350_REG4_VCO_PWRDOWN_EN   (1 << 11)
 
#define ADF4350_REG4_8BIT_BAND_SEL_CLKDIV(x)   ((x) << 12)
 
#define ADF4350_REG4_RF_DIV_SEL(x)   ((x) << 20)
 
#define ADF4350_REG4_FEEDBACK_DIVIDED   (0 << 23)
 
#define ADF4350_REG4_FEEDBACK_FUND   (1 << 23)
 
#define ADF4350_REG5_LD_PIN_MODE_LOW   (0 << 22)
 
#define ADF4350_REG5_LD_PIN_MODE_DIGITAL   (1 << 22)
 
#define ADF4350_REG5_LD_PIN_MODE_HIGH   (3 << 22)
 
#define ADF4350_MAX_OUT_FREQ   4400000000ULL /* Hz */
 
#define ADF4350_MIN_OUT_FREQ   34375000 /* Hz */
 
#define ADF4350_MIN_VCO_FREQ   2200000000ULL /* Hz */
 
#define ADF4350_MAX_FREQ_45_PRESC   3000000000ULL /* Hz */
 
#define ADF4350_MAX_FREQ_PFD   32000000 /* Hz */
 
#define ADF4350_MAX_BANDSEL_CLK   125000 /* Hz */
 
#define ADF4350_MAX_FREQ_REFIN   250000000 /* Hz */
 
#define ADF4350_MAX_MODULUS   4095
 
#define ADF4350_MAX_R_CNT   1023
 

Functions

int32_t adf4350_setup (adf4350_dev **device, adf4350_init_param init_param)
 Initializes the ADF4350. More...
 
int32_t adf4350_write (adf4350_dev *dev, uint32_t data)
 Writes 4 bytes of data to ADF4350. More...
 
int64_t adf4350_out_altvoltage0_frequency (adf4350_dev *dev, int64_t Hz)
 Stores PLL 0 frequency in Hz. More...
 
int32_t adf4350_out_altvoltage0_frequency_resolution (adf4350_dev *dev, int32_t Hz)
 Stores PLL 0 frequency resolution/channel spacing in Hz. More...
 
int64_t adf4350_out_altvoltage0_refin_frequency (adf4350_dev *dev, int64_t Hz)
 Sets PLL 0 REFin frequency in Hz. More...
 
int32_t adf4350_out_altvoltage0_powerdown (adf4350_dev *dev, int32_t pwd)
 Powers down the PLL. More...
 

Detailed Description

Header file of ADF4350 Driver.

Author
DBogdan (drago.nosp@m.s.bo.nosp@m.gdan@.nosp@m.anal.nosp@m.og.co.nosp@m.m)

Copyright 2012-2015(c) Analog Devices, Inc.

All rights reserved.

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 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, 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.

Macro Definition Documentation

◆ ADF4350_MAX_BANDSEL_CLK

#define ADF4350_MAX_BANDSEL_CLK   125000 /* Hz */

◆ ADF4350_MAX_FREQ_45_PRESC

#define ADF4350_MAX_FREQ_45_PRESC   3000000000ULL /* Hz */

◆ ADF4350_MAX_FREQ_PFD

#define ADF4350_MAX_FREQ_PFD   32000000 /* Hz */

◆ ADF4350_MAX_FREQ_REFIN

#define ADF4350_MAX_FREQ_REFIN   250000000 /* Hz */

◆ ADF4350_MAX_MODULUS

#define ADF4350_MAX_MODULUS   4095

◆ ADF4350_MAX_OUT_FREQ

#define ADF4350_MAX_OUT_FREQ   4400000000ULL /* Hz */

◆ ADF4350_MAX_R_CNT

#define ADF4350_MAX_R_CNT   1023

◆ ADF4350_MIN_OUT_FREQ

#define ADF4350_MIN_OUT_FREQ   34375000 /* Hz */

◆ ADF4350_MIN_VCO_FREQ

#define ADF4350_MIN_VCO_FREQ   2200000000ULL /* Hz */

◆ ADF4350_REG0

#define ADF4350_REG0   0

◆ ADF4350_REG0_FRACT

#define ADF4350_REG0_FRACT (   x)    (((x) & 0xFFF) << 3)

◆ ADF4350_REG0_INT

#define ADF4350_REG0_INT (   x)    (((x) & 0xFFFF) << 15)

◆ ADF4350_REG1

#define ADF4350_REG1   1

◆ ADF4350_REG1_MOD

#define ADF4350_REG1_MOD (   x)    (((x) & 0xFFF) << 3)

◆ ADF4350_REG1_PHASE

#define ADF4350_REG1_PHASE (   x)    (((x) & 0xFFF) << 15)

◆ ADF4350_REG1_PRESCALER

#define ADF4350_REG1_PRESCALER   (1 << 27)

◆ ADF4350_REG2

#define ADF4350_REG2   2

◆ ADF4350_REG2_10BIT_R_CNT

#define ADF4350_REG2_10BIT_R_CNT (   x)    ((x) << 14)

◆ ADF4350_REG2_CHARGE_PUMP_CURR_uA

#define ADF4350_REG2_CHARGE_PUMP_CURR_uA (   x)    (((((x)-312) / 312) & 0xF) << 9)

◆ ADF4350_REG2_COUNTER_RESET_EN

#define ADF4350_REG2_COUNTER_RESET_EN   (1 << 3)

◆ ADF4350_REG2_CP_THREESTATE_EN

#define ADF4350_REG2_CP_THREESTATE_EN   (1 << 4)

◆ ADF4350_REG2_DOUBLE_BUFF_EN

#define ADF4350_REG2_DOUBLE_BUFF_EN   (1 << 13)

◆ ADF4350_REG2_LDF_FRACT_N

#define ADF4350_REG2_LDF_FRACT_N   (0 << 8)

◆ ADF4350_REG2_LDF_INT_N

#define ADF4350_REG2_LDF_INT_N   (1 << 8)

◆ ADF4350_REG2_LDP_10ns

#define ADF4350_REG2_LDP_10ns   (0 << 7)

◆ ADF4350_REG2_LDP_6ns

#define ADF4350_REG2_LDP_6ns   (1 << 7)

◆ ADF4350_REG2_MUXOUT

#define ADF4350_REG2_MUXOUT (   x)    ((x) << 26)

◆ ADF4350_REG2_NOISE_MODE

#define ADF4350_REG2_NOISE_MODE (   x)    (((x) & 0x3) << 29)

◆ ADF4350_REG2_PD_POLARITY_POS

#define ADF4350_REG2_PD_POLARITY_POS   (1 << 6)

◆ ADF4350_REG2_POWER_DOWN_EN

#define ADF4350_REG2_POWER_DOWN_EN   (1 << 5)

◆ ADF4350_REG2_RDIV2_EN

#define ADF4350_REG2_RDIV2_EN   (1 << 24)

◆ ADF4350_REG2_RMULT2_EN

#define ADF4350_REG2_RMULT2_EN   (1 << 25)

◆ ADF4350_REG3

#define ADF4350_REG3   3

◆ ADF4350_REG3_12BIT_CLKDIV

#define ADF4350_REG3_12BIT_CLKDIV (   x)    ((x) << 3)

◆ ADF4350_REG3_12BIT_CLKDIV_MODE

#define ADF4350_REG3_12BIT_CLKDIV_MODE (   x)    ((x) << 16)

◆ ADF4350_REG3_12BIT_CSR_EN

#define ADF4350_REG3_12BIT_CSR_EN   (1 << 18)

◆ ADF4350_REG4

#define ADF4350_REG4   4

◆ ADF4350_REG4_8BIT_BAND_SEL_CLKDIV

#define ADF4350_REG4_8BIT_BAND_SEL_CLKDIV (   x)    ((x) << 12)

◆ ADF4350_REG4_AUX_OUTPUT_DIV

#define ADF4350_REG4_AUX_OUTPUT_DIV   (0 << 9)

◆ ADF4350_REG4_AUX_OUTPUT_EN

#define ADF4350_REG4_AUX_OUTPUT_EN   (1 << 8)

◆ ADF4350_REG4_AUX_OUTPUT_FUND

#define ADF4350_REG4_AUX_OUTPUT_FUND   (1 << 9)

◆ ADF4350_REG4_AUX_OUTPUT_PWR

#define ADF4350_REG4_AUX_OUTPUT_PWR (   x)    ((x) << 6)

◆ ADF4350_REG4_FEEDBACK_DIVIDED

#define ADF4350_REG4_FEEDBACK_DIVIDED   (0 << 23)

◆ ADF4350_REG4_FEEDBACK_FUND

#define ADF4350_REG4_FEEDBACK_FUND   (1 << 23)

◆ ADF4350_REG4_MUTE_TILL_LOCK_EN

#define ADF4350_REG4_MUTE_TILL_LOCK_EN   (1 << 10)

◆ ADF4350_REG4_OUTPUT_PWR

#define ADF4350_REG4_OUTPUT_PWR (   x)    ((x) << 3)

◆ ADF4350_REG4_RF_DIV_SEL

#define ADF4350_REG4_RF_DIV_SEL (   x)    ((x) << 20)

◆ ADF4350_REG4_RF_OUT_EN

#define ADF4350_REG4_RF_OUT_EN   (1 << 5)

◆ ADF4350_REG4_VCO_PWRDOWN_EN

#define ADF4350_REG4_VCO_PWRDOWN_EN   (1 << 11)

◆ ADF4350_REG5

#define ADF4350_REG5   5

◆ ADF4350_REG5_LD_PIN_MODE_DIGITAL

#define ADF4350_REG5_LD_PIN_MODE_DIGITAL   (1 << 22)

◆ ADF4350_REG5_LD_PIN_MODE_HIGH

#define ADF4350_REG5_LD_PIN_MODE_HIGH   (3 << 22)

◆ ADF4350_REG5_LD_PIN_MODE_LOW

#define ADF4350_REG5_LD_PIN_MODE_LOW   (0 << 22)

◆ ADF4350_RX_CHANNEL

#define ADF4350_RX_CHANNEL   0

◆ ADF4350_TX_CHANNEL

#define ADF4350_TX_CHANNEL   1

◆ ADF4351_REG3_ANTI_BACKLASH_3ns_EN

#define ADF4351_REG3_ANTI_BACKLASH_3ns_EN   (1 << 22)

◆ ADF4351_REG3_BAND_SEL_CLOCK_MODE_HIGH

#define ADF4351_REG3_BAND_SEL_CLOCK_MODE_HIGH   (1 << 23)

◆ ADF4351_REG3_CHARGE_CANCELLATION_EN

#define ADF4351_REG3_CHARGE_CANCELLATION_EN   (1 << 21)

Function Documentation

◆ adf4350_out_altvoltage0_frequency()

int64_t adf4350_out_altvoltage0_frequency ( adf4350_dev dev,
int64_t  Hz 
)

Stores PLL 0 frequency in Hz.

Stores PLL 0 frequency in Hz.

Parameters
dev- The device structure.
Hz- The selected frequency.
Returns
Returns the selected frequency.
Here is the caller graph for this function:

◆ adf4350_out_altvoltage0_frequency_resolution()

int32_t adf4350_out_altvoltage0_frequency_resolution ( adf4350_dev dev,
int32_t  Hz 
)

Stores PLL 0 frequency resolution/channel spacing in Hz.

Stores PLL 0 frequency resolution/channel spacing in Hz.

Parameters
dev- The device structure.
Hz- The selected frequency.
Returns
Returns the selected frequency.
Here is the caller graph for this function:

◆ adf4350_out_altvoltage0_powerdown()

int32_t adf4350_out_altvoltage0_powerdown ( adf4350_dev dev,
int32_t  pwd 
)

Powers down the PLL.

Powers down the PLL.

Parameters
dev- The device structure.
pwd- Power option. Example: 0 - Power up the PLL. 1 - Power down the PLL.
Returns
Returns the PLL's power status.

◆ adf4350_out_altvoltage0_refin_frequency()

int64_t adf4350_out_altvoltage0_refin_frequency ( adf4350_dev dev,
int64_t  Hz 
)

Sets PLL 0 REFin frequency in Hz.

Sets PLL 0 REFin frequency in Hz.

Parameters
dev- The device structure.
Hz- The selected frequency.
Returns
Returns the selected frequency.
Here is the caller graph for this function:

◆ adf4350_setup()

int32_t adf4350_setup ( adf4350_dev **  device,
adf4350_init_param  init_param 
)

Initializes the ADF4350.

Initializes the ADF4350.

Parameters
device- The device structure.
init_param- The structure containing the device initial parameters.
Returns
Returns 0 in case of success or negative error code.
Here is the caller graph for this function:

◆ adf4350_write()

int32_t adf4350_write ( adf4350_dev dev,
uint32_t  data 
)

Writes 4 bytes of data to ADF4350.

Writes 4 bytes of data to ADF4350.

Parameters
dev- The device structure.
data- Data value to write.
Returns
Returns 0 in case of success or negative error code..
Here is the caller graph for this function: