no-OS
Loading...
Searching...
No Matches
admv8818.c File Reference

Implementation of admv8818 Driver. More...

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

Functions

int admv8818_spi_write (struct admv8818_dev *dev, uint16_t reg_addr, uint8_t data)
 Writes data to ADMV8818 over SPI.
 
int admv8818_spi_read (struct admv8818_dev *dev, uint16_t reg_addr, uint8_t *data)
 Reads data from ADMV8818 over SPI.
 
int admv8818_spi_update_bits (struct admv8818_dev *dev, uint16_t reg_addr, uint8_t mask, uint8_t data)
 Update ADMV8818 register.
 
int admv8818_hpf_select (struct admv8818_dev *dev, unsigned long long freq)
 Set the HPF Frequency.
 
int admv8818_read_hpf_freq (struct admv8818_dev *dev, unsigned long long *freq)
 Get the HPF Frequency.
 
int admv8818_lpf_select (struct admv8818_dev *dev, unsigned long long freq)
 Set the LPF Frequency.
 
int admv8818_read_lpf_freq (struct admv8818_dev *dev, unsigned long long *freq)
 Get the HPF Frequency.
 
int admv8818_rfin_select (struct admv8818_dev *dev)
 Set the RF Input Band Select.
 
int admv8818_init (struct admv8818_dev **device, struct admv8818_init_param *init_param)
 Initializes the admv8818.
 
int admv8818_remove (struct admv8818_dev *dev)
 ADMV8818 Resources Deallocation.
 

Detailed Description

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

SPDX-License-Identifier: BSD-3-Clause

Function Documentation

◆ admv8818_hpf_select()

int admv8818_hpf_select ( struct admv8818_dev * dev,
unsigned long long freq )

Set the HPF Frequency.

Parameters
dev- The device structure.
freq- The HPF Frequency to be set.
Returns
Returns 0 in case of success or negative error code.

◆ admv8818_init()

int admv8818_init ( struct admv8818_dev ** device,
struct admv8818_init_param * init_param )

Initializes the admv8818.

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.

◆ admv8818_lpf_select()

int admv8818_lpf_select ( struct admv8818_dev * dev,
unsigned long long freq )

Set the LPF Frequency.

Parameters
dev- The device structure.
freq- The LPF Frequency to be set.
Returns
Returns 0 in case of success or negative error code.

◆ admv8818_read_hpf_freq()

int admv8818_read_hpf_freq ( struct admv8818_dev * dev,
unsigned long long * freq )

Get the HPF Frequency.

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

◆ admv8818_read_lpf_freq()

int admv8818_read_lpf_freq ( struct admv8818_dev * dev,
unsigned long long * freq )

Get the HPF Frequency.

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

◆ admv8818_remove()

int admv8818_remove ( struct admv8818_dev * dev)

ADMV8818 Resources Deallocation.

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

◆ admv8818_rfin_select()

int admv8818_rfin_select ( struct admv8818_dev * dev)

Set the RF Input Band Select.

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

◆ admv8818_spi_read()

int admv8818_spi_read ( struct admv8818_dev * dev,
uint16_t reg_addr,
uint8_t * data )

Reads data from ADMV8818 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.

◆ admv8818_spi_update_bits()

int admv8818_spi_update_bits ( struct admv8818_dev * dev,
uint16_t reg_addr,
uint8_t mask,
uint8_t data )

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

◆ admv8818_spi_write()

int admv8818_spi_write ( struct admv8818_dev * dev,
uint16_t reg_addr,
uint8_t data )

Writes data to ADMV8818 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.