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

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

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