no-OS
Functions
adf5902.c File Reference

Implementation of adf5902 Driver. More...

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

Functions

int32_t adf5902_write (struct adf5902_dev *dev, uint8_t reg_addr, uint32_t data)
 Writes 4 bytes of data to ADF5902. More...
 
int32_t adf5902_readback (struct adf5902_dev *dev, uint8_t reg_addr, uint32_t *data)
 Readback data from ADF5902. More...
 
int32_t adf5902_init (struct adf5902_dev **device, struct adf5902_init_param *init_param)
 Initializes the ADF5902. More...
 
int32_t adf5902_recalibrate (struct adf5902_dev *dev)
 Recalibration procedure. More...
 
int32_t adf5902_read_temp (struct adf5902_dev *dev, float *temp)
 Free resoulces allocated for ADF5902. More...
 
int32_t adf5902f_compute_frequency (struct adf5902_dev *dev, uint64_t *freq)
 Measure output locked frequency. More...
 
int32_t adf5902_remove (struct adf5902_dev *dev)
 Free resoulces allocated for ADF5902. More...
 

Detailed Description

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

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

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.

Function Documentation

◆ adf5902_init()

int32_t adf5902_init ( struct adf5902_dev **  device,
struct adf5902_init_param init_param 
)

Initializes the ADF5902.

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:

◆ adf5902_read_temp()

int32_t adf5902_read_temp ( struct adf5902_dev dev,
float *  temp 
)

Free resoulces allocated for ADF5902.

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

◆ adf5902_readback()

int32_t adf5902_readback ( struct adf5902_dev dev,
uint8_t  reg_addr,
uint32_t *  data 
)

Readback data from ADF5902.

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

◆ adf5902_recalibrate()

int32_t adf5902_recalibrate ( struct adf5902_dev dev)

Recalibration procedure.

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

◆ adf5902_remove()

int32_t adf5902_remove ( struct adf5902_dev dev)

Free resoulces allocated for ADF5902.

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

◆ adf5902_write()

int32_t adf5902_write ( struct adf5902_dev dev,
uint8_t  reg_addr,
uint32_t  data 
)

Writes 4 bytes of data to ADF5902.

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:

◆ adf5902f_compute_frequency()

int32_t adf5902f_compute_frequency ( struct adf5902_dev dev,
uint64_t *  freq 
)

Measure output locked frequency.

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