no-OS
Functions
adf4377.c File Reference

Implementation of adf4377 Driver. More...

#include <malloc.h>
#include "adf4377.h"
#include "no_os_error.h"
#include "no_os_delay.h"
Include dependency graph for adf4377.c:

Functions

int32_t adf4377_spi_write (struct adf4377_dev *dev, uint8_t reg_addr, uint8_t data)
 Writes data to ADF4377 over SPI. More...
 
int32_t adf4377_spi_write_mask (struct adf4377_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t data)
 Update ADF4377 register. More...
 
int32_t adf4377_spi_read (struct adf4377_dev *dev, uint8_t reg_addr, uint8_t *data)
 Reads data from ADF4377 over SPI. More...
 
int32_t adf4377_check_scratchpad (struct adf4377_dev *dev)
 ADF4377 SPI Scratchpad check. More...
 
int32_t adf4377_soft_reset (struct adf4377_dev *dev)
 Software reset. More...
 
int32_t adf4377_set_freq (struct adf4377_dev *dev, uint64_t freq)
 
int32_t adf4377_init (struct adf4377_dev **device, struct adf4377_init_param *init_param)
 Initializes the ADF4377. More...
 
int32_t adf4377_remove (struct adf4377_dev *dev)
 Free resoulces allocated for ADF4377. More...
 

Detailed Description

Implementation of adf4377 Driver.

Author
Antoniu Miclaus (anton.nosp@m.iu.m.nosp@m.iclau.nosp@m.s@an.nosp@m.alog..nosp@m.com)

Copyright 2021(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.

Function Documentation

◆ adf4377_check_scratchpad()

int32_t adf4377_check_scratchpad ( struct adf4377_dev dev)

ADF4377 SPI Scratchpad check.

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

◆ adf4377_init()

int32_t adf4377_init ( struct adf4377_dev **  device,
struct adf4377_init_param init_param 
)

Initializes the ADF4377.

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:

◆ adf4377_remove()

int32_t adf4377_remove ( struct adf4377_dev dev)

Free resoulces allocated for ADF4377.

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

◆ adf4377_set_freq()

int32_t adf4377_set_freq ( struct adf4377_dev dev,
uint64_t  freq 
)

Set the output frequency.

Parameters
dev- The device structure.
freq- The output frequency.
Returns
0 in case of success, negative error code otherwise.

Wait for VCO calibration to finish

◆ adf4377_soft_reset()

int32_t adf4377_soft_reset ( struct adf4377_dev dev)

Software reset.

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

◆ adf4377_spi_read()

int32_t adf4377_spi_read ( struct adf4377_dev dev,
uint8_t  reg_addr,
uint8_t *  data 
)

Reads data from ADF4377 over SPI.

Parameters
dev- The device structure.
reg_addr- The register address.
data- Data read from the device.
Returns
Returns 0 in case of success or negative error code otherwise.
Here is the caller graph for this function:

◆ adf4377_spi_write()

int32_t adf4377_spi_write ( struct adf4377_dev dev,
uint8_t  reg_addr,
uint8_t  data 
)

Writes data to ADF4377 over SPI.

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

◆ adf4377_spi_write_mask()

int32_t adf4377_spi_write_mask ( struct adf4377_dev dev,
uint8_t  reg_addr,
uint8_t  mask,
uint8_t  data 
)

Update ADF4377 register.

Parameters
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).
Returns
Returns 0 in case of success or negative error code otherwise.
Here is the caller graph for this function: