no-OS
Loading...
Searching...
No Matches
adf4350.c File Reference

Implementation of ADF4350 Driver. More...

#include <malloc.h>
#include <stdio.h>
#include "adf4350.h"
#include "no_os_alloc.h"
Include dependency graph for adf4350.c:

Functions

int32_t adf4350_write (adf4350_dev *dev, uint32_t data)
 Writes 4 bytes of data to ADF4350.
 
int32_t adf4350_sync_config (adf4350_dev *dev)
 Updates the registers values.
 
int32_t adf4350_tune_r_cnt (adf4350_dev *dev, uint16_t r_cnt)
 Increases the R counter value until the ADF4350_MAX_FREQ_PFD is greater than PFD frequency.
 
uint32_t gcd (uint32_t x, uint32_t y)
 Computes the greatest common divider of two numbers.
 
int64_t adf4350_set_freq (adf4350_dev *dev, uint64_t freq)
 Sets the ADF4350 frequency.
 
int32_t adf4350_setup (adf4350_dev **device, adf4350_init_param init_param)
 Initializes the ADF4350.
 
int64_t adf4350_out_altvoltage0_frequency (adf4350_dev *dev, int64_t Hz)
 Stores PLL 0 frequency in Hz.
 
int32_t adf4350_out_altvoltage0_frequency_resolution (adf4350_dev *dev, int32_t Hz)
 Stores PLL 0 frequency resolution/channel spacing in Hz.
 
int64_t adf4350_out_altvoltage0_refin_frequency (adf4350_dev *dev, int64_t Hz)
 Sets PLL 0 REFin frequency in Hz.
 
int32_t adf4350_out_altvoltage0_powerdown (adf4350_dev *dev, int32_t pwd)
 Powers down the PLL.
 

Detailed Description

Implementation 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.

SPDX-License-Identifier: BSD-3-Clause

Function Documentation

◆ adf4350_out_altvoltage0_frequency()

int64_t adf4350_out_altvoltage0_frequency ( adf4350_dev * dev,
int64_t Hz )

Stores PLL 0 frequency in Hz.

Parameters
dev- The device structure.
Hz- The selected frequency.
Returns
Returns the selected frequency.

◆ 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.

Parameters
dev- The device structure.
Hz- The selected frequency.
Returns
Returns the selected frequency.

◆ adf4350_out_altvoltage0_powerdown()

int32_t adf4350_out_altvoltage0_powerdown ( adf4350_dev * dev,
int32_t pwd )

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.

Parameters
dev- The device structure.
Hz- The selected frequency.
Returns
Returns the selected frequency.

◆ adf4350_set_freq()

int64_t adf4350_set_freq ( adf4350_dev * dev,
uint64_t freq )

Sets the ADF4350 frequency.

Parameters
dev- The device structure.
freq- The desired frequency value.
Returns
calculatedFrequency - The actual frequency value that was set.

◆ adf4350_setup()

int32_t adf4350_setup ( adf4350_dev ** device,
adf4350_init_param init_param )

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.

◆ adf4350_sync_config()

int32_t adf4350_sync_config ( adf4350_dev * dev)

Updates the registers values.

Parameters
dev- The device structure.
Returns
Returns 0 in case of success or negative error code.

◆ adf4350_tune_r_cnt()

int32_t adf4350_tune_r_cnt ( adf4350_dev * dev,
uint16_t r_cnt )

Increases the R counter value until the ADF4350_MAX_FREQ_PFD is greater than PFD frequency.

Parameters
dev- The device structure.
r_cnt- Initial r_cnt value.
Returns
Returns 0 in case of success or negative error code.

◆ adf4350_write()

int32_t adf4350_write ( adf4350_dev * dev,
uint32_t data )

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..

◆ gcd()

uint32_t gcd ( uint32_t x,
uint32_t y )

Computes the greatest common divider of two numbers.

Returns
Returns the gcd.