no-OS
Functions
admv1014.c File Reference

Implementation of admv1014 Driver. More...

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

Functions

int admv1014_spi_write (struct admv1014_dev *dev, uint8_t reg_addr, uint16_t data)
 Writes data to ADMV1014 over SPI. More...
 
int admv1014_spi_read (struct admv1014_dev *dev, uint8_t reg_addr, uint16_t *data)
 Reads data from ADMV1014 over SPI. More...
 
int admv1014_spi_update_bits (struct admv1014_dev *dev, uint8_t reg_addr, uint16_t mask, uint16_t data)
 Update ADMV1014 register. More...
 
int admv1014_set_det_prog (struct admv1014_dev *dev, enum admv1014_det_prog det_prog)
 Set Digital Rx Detector. More...
 
int admv1014_get_det_prog (struct admv1014_dev *dev, enum admv1014_det_prog *det_prog)
 Get Digital Rx Detector. More...
 
int admv1014_set_bb_amp_gain (struct admv1014_dev *dev, uint8_t gain)
 Set Baseband Amp Gain. More...
 
int admv1014_get_bb_amp_gain (struct admv1014_dev *dev, uint8_t *gain)
 Get Baseband Amp Gain. More...
 
int admv1014_set_phase (struct admv1014_dev *dev, uint8_t i_phase, uint8_t q_phase)
 Set LO Amp Phase. More...
 
int admv1014_get_phase (struct admv1014_dev *dev, uint8_t *i_phase, uint8_t *q_phase)
 Get LO Amp Phase. More...
 
int admv1014_set_if_amp_gain (struct admv1014_dev *dev, uint8_t i_coarse_gain, uint8_t q_coarse_gain, uint8_t i_fine_gain, uint8_t q_fine_gain)
 Set IF Amp Gain. More...
 
int admv1014_get_if_amp_gain (struct admv1014_dev *dev, uint8_t *i_coarse_gain, uint8_t *q_coarse_gain, uint8_t *i_fine_gain, uint8_t *q_fine_gain)
 Get IF Amp Gain. More...
 
int admv1014_init (struct admv1014_dev **device, struct admv1014_init_param *init_param)
 Initializes the admv1014. More...
 
int admv1014_remove (struct admv1014_dev *dev)
 ADMV1014 Resources Deallocation. More...
 

Detailed Description

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

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

◆ admv1014_get_bb_amp_gain()

int admv1014_get_bb_amp_gain ( struct admv1014_dev dev,
uint8_t *  gain 
)

Get Baseband Amp Gain.

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

◆ admv1014_get_det_prog()

int admv1014_get_det_prog ( struct admv1014_dev dev,
enum admv1014_det_prog det_prog 
)

Get Digital Rx Detector.

Parameters
dev- The device structure.
det_prog- Digital Rx Detector gain.
Returns
Returns 0 in case of success or negative error code.

◆ admv1014_get_if_amp_gain()

int admv1014_get_if_amp_gain ( struct admv1014_dev dev,
uint8_t *  i_coarse_gain,
uint8_t *  q_coarse_gain,
uint8_t *  i_fine_gain,
uint8_t *  q_fine_gain 
)

Get IF Amp Gain.

Parameters
dev- The device structure.
i_coarse_gain- The I coarse gain value.
q_coarse_gain- The I coarse gain value.
i_fine_gain- The Q fine gain value.
q_fine_gain- The Q fine gain value.
Returns
Returns 0 in case of success or negative error code.

◆ admv1014_get_phase()

int admv1014_get_phase ( struct admv1014_dev dev,
uint8_t *  i_phase,
uint8_t *  q_phase 
)

Get LO Amp Phase.

Parameters
dev- The device structure.
i_phase- The I phase adjust value.
q_phase- The Q phase adjust value.
Returns
Returns 0 in case of success or negative error code.

◆ admv1014_init()

int admv1014_init ( struct admv1014_dev **  device,
struct admv1014_init_param init_param 
)

Initializes the admv1014.

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.

◆ admv1014_remove()

int admv1014_remove ( struct admv1014_dev dev)

ADMV1014 Resources Deallocation.

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

◆ admv1014_set_bb_amp_gain()

int admv1014_set_bb_amp_gain ( struct admv1014_dev dev,
uint8_t  gain 
)

Set Baseband Amp Gain.

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

◆ admv1014_set_det_prog()

int admv1014_set_det_prog ( struct admv1014_dev dev,
enum admv1014_det_prog  det_prog 
)

Set Digital Rx Detector.

Parameters
dev- The device structure.
det_prog- Digital Rx Detector gain.
Returns
Returns 0 in case of success or negative error code.

◆ admv1014_set_if_amp_gain()

int admv1014_set_if_amp_gain ( struct admv1014_dev dev,
uint8_t  i_coarse_gain,
uint8_t  q_coarse_gain,
uint8_t  i_fine_gain,
uint8_t  q_fine_gain 
)

Set IF Amp Gain.

Parameters
dev- The device structure.
i_coarse_gain- The I coarse gain value.
q_coarse_gain- The I coarse gain value.
i_fine_gain- The Q fine gain value.
q_fine_gain- The Q fine gain value.
Returns
Returns 0 in case of success or negative error code.

◆ admv1014_set_phase()

int admv1014_set_phase ( struct admv1014_dev dev,
uint8_t  i_phase,
uint8_t  q_phase 
)

Set LO Amp Phase.

Parameters
dev- The device structure.
i_phase- The I phase adjust value.
q_phase- The Q phase adjust value.
Returns
Returns 0 in case of success or negative error code.

◆ admv1014_spi_read()

int admv1014_spi_read ( struct admv1014_dev dev,
uint8_t  reg_addr,
uint16_t *  data 
)

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

◆ admv1014_spi_update_bits()

int admv1014_spi_update_bits ( struct admv1014_dev dev,
uint8_t  reg_addr,
uint16_t  mask,
uint16_t  data 
)

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

◆ admv1014_spi_write()

int admv1014_spi_write ( struct admv1014_dev dev,
uint8_t  reg_addr,
uint16_t  data 
)

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