no-OS
Functions
adrf6780.c File Reference

Implementation of adrf6780 Driver. More...

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

Functions

int adrf6780_spi_write (struct adrf6780_dev *dev, uint8_t reg_addr, uint16_t data)
 Writes data to ADRF6780 over SPI. More...
 
int adrf6780_spi_read (struct adrf6780_dev *dev, uint8_t reg_addr, uint16_t *data)
 Reads data from ADRF6780 over SPI. More...
 
int adrf6780_spi_update_bits (struct adrf6780_dev *dev, uint8_t reg_addr, uint16_t mask, uint16_t data)
 Update ADRF6780 register. More...
 
int adrf6780_set_rdac_linearize (struct adrf6780_dev *dev, uint8_t rdac_lin)
 Set IMD Performance Improvement. More...
 
int adrf6780_get_rdac_linearize (struct adrf6780_dev *dev, uint8_t *rdac_lin)
 Get IMD Performance Improvement. More...
 
int adrf6780_set_cdac_iq_phase_accuracy (struct adrf6780_dev *dev, uint8_t i_data, uint8_t q_data)
 Set I/Q Phase Accuracy. More...
 
int adrf6780_get_cdac_iq_phase_accuracy (struct adrf6780_dev *dev, uint8_t *i_data, uint8_t *q_data)
 Get I/Q Phase Accuracy. More...
 
int adrf6780_read_adc_raw (struct adrf6780_dev *dev, uint16_t *data)
 Read ADC raw data. More...
 
int adrf6780_soft_reset (struct adrf6780_dev *dev)
 Software Reset. More...
 
int adrf6780_init (struct adrf6780_dev **device, struct adrf6780_init_param *init_param)
 Initializes the adrf6780. More...
 
int adrf6780_remove (struct adrf6780_dev *dev)
 ADRF6780 Resources Deallocation. More...
 

Detailed Description

Implementation of adrf6780 Driver.

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

Copyright 2022(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

◆ adrf6780_get_cdac_iq_phase_accuracy()

int adrf6780_get_cdac_iq_phase_accuracy ( struct adrf6780_dev dev,
uint8_t *  i_data,
uint8_t *  q_data 
)

Get I/Q Phase Accuracy.

Parameters
dev- The device structure.
i_data- I Phase Accuracy.
q_data- Q Phase Accuracy.
Returns
Returns 0 in case of success or negative error code otherwise.

◆ adrf6780_get_rdac_linearize()

int adrf6780_get_rdac_linearize ( struct adrf6780_dev dev,
uint8_t *  rdac_lin 
)

Get IMD Performance Improvement.

Parameters
dev- The device structure.
rdac_lin- RDAC 8bits data.
Returns
Returns 0 in case of success or negative error code otherwise.

◆ adrf6780_init()

int adrf6780_init ( struct adrf6780_dev **  device,
struct adrf6780_init_param init_param 
)

Initializes the adrf6780.

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.

◆ adrf6780_read_adc_raw()

int adrf6780_read_adc_raw ( struct adrf6780_dev dev,
uint16_t *  data 
)

Read ADC raw data.

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

◆ adrf6780_remove()

int adrf6780_remove ( struct adrf6780_dev dev)

ADRF6780 Resources Deallocation.

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

◆ adrf6780_set_cdac_iq_phase_accuracy()

int adrf6780_set_cdac_iq_phase_accuracy ( struct adrf6780_dev dev,
uint8_t  i_data,
uint8_t  q_data 
)

Set I/Q Phase Accuracy.

Parameters
dev- The device structure.
i_data- I Phase Accuracy.
q_data- Q Phase Accuracy.
Returns
Returns 0 in case of success or negative error code otherwise.

◆ adrf6780_set_rdac_linearize()

int adrf6780_set_rdac_linearize ( struct adrf6780_dev dev,
uint8_t  rdac_lin 
)

Set IMD Performance Improvement.

Parameters
dev- The device structure.
rdac_lin- RDAC 8bits data.
Returns
Returns 0 in case of success or negative error code otherwise.

◆ adrf6780_soft_reset()

int adrf6780_soft_reset ( struct adrf6780_dev dev)

Software Reset.

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

◆ adrf6780_spi_read()

int adrf6780_spi_read ( struct adrf6780_dev dev,
uint8_t  reg_addr,
uint16_t *  data 
)

Reads data from ADRF6780 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:

◆ adrf6780_spi_update_bits()

int adrf6780_spi_update_bits ( struct adrf6780_dev dev,
uint8_t  reg_addr,
uint16_t  mask,
uint16_t  data 
)

Update ADRF6780 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:

◆ adrf6780_spi_write()

int adrf6780_spi_write ( struct adrf6780_dev dev,
uint8_t  reg_addr,
uint16_t  data 
)

Writes data to ADRF6780 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: