no-OS
|
Header file for admv8818 Driver. More...
Go to the source code of this file.
Classes | |
struct | admv8818_init_param |
ADMV8818 Initialization Parameters structure. More... | |
struct | admv8818_dev |
ADMV8818 Device Descriptor. More... | |
Enumerations | |
enum | admv8818_filter_mode { ADMV8818_AUTO, ADMV8818_MANUAL } |
Filter Modes of the ADMV8818. More... | |
Functions | |
int | admv8818_spi_write (struct admv8818_dev *dev, uint16_t reg_addr, uint8_t data) |
Writes data to ADMV8818 over SPI. More... | |
int | admv8818_spi_update_bits (struct admv8818_dev *dev, uint16_t reg_addr, uint8_t mask, uint8_t data) |
Update ADMV8818 register. More... | |
int | admv8818_spi_read (struct admv8818_dev *dev, uint16_t reg_addr, uint8_t *data) |
Reads data from ADMV8818 over SPI. More... | |
int | admv8818_hpf_select (struct admv8818_dev *dev, unsigned long long freq) |
Set the HPF Frequency. More... | |
int | admv8818_read_hpf_freq (struct admv8818_dev *dev, unsigned long long *freq) |
Get the HPF Frequency. More... | |
int | admv8818_lpf_select (struct admv8818_dev *dev, unsigned long long freq) |
Set the LPF Frequency. More... | |
int | admv8818_read_lpf_freq (struct admv8818_dev *dev, unsigned long long *freq) |
Get the HPF Frequency. More... | |
int | admv8818_rfin_select (struct admv8818_dev *dev) |
Set the RF Input Band Select. More... | |
int | admv8818_init (struct admv8818_dev **device, struct admv8818_init_param *init_param) |
Initializes the admv8818. More... | |
int | admv8818_remove (struct admv8818_dev *dev) |
ADMV8818 Resources Deallocation. More... | |
Header file for admv8818 Driver.
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:
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.
#define ADMV8818_BUFF_SIZE_BYTES 3 |
#define ADMV8818_CHIP_ID NO_OS_BIT(0) |
#define ADMV8818_CSB_STALL_MSK NO_OS_BIT(6) |
#define ADMV8818_ENDIAN_MSK NO_OS_BIT(2) |
#define ADMV8818_ENDIAN_N_MSK NO_OS_BIT(5) |
#define ADMV8818_HPF_WR0_MSK NO_OS_GENMASK(7, 4) |
#define ADMV8818_LPF_WR0_MSK NO_OS_GENMASK(3, 0) |
#define ADMV8818_LSB_FIRST_N_MSK NO_OS_BIT(6) |
#define ADMV8818_LSBFIRST_MSK NO_OS_BIT(1) |
#define ADMV8818_MASTER_SLAVE_RB_MSK NO_OS_BIT(5) |
#define ADMV8818_MASTER_SLAVE_TRANSFER_MSK NO_OS_BIT(0) |
#define ADMV8818_REG_CHIPTYPE 0x3 |
#define ADMV8818_REG_FAST_LATCH_DIRECTION 0x13 |
#define ADMV8818_REG_FAST_LATCH_POINTER 0x10 |
#define ADMV8818_REG_FAST_LATCH_START 0x12 |
#define ADMV8818_REG_FAST_LATCH_STATE 0x14 |
#define ADMV8818_REG_FAST_LATCH_STOP 0x11 |
#define ADMV8818_REG_LUT0_FILTER 0x101 |
#define ADMV8818_REG_LUT0_SW 0x100 |
#define ADMV8818_REG_LUT127_FILTER 0x1FF |
#define ADMV8818_REG_LUT127_SW 0x1FE |
#define ADMV8818_REG_PRODUCT_ID_H 0x5 |
#define ADMV8818_REG_PRODUCT_ID_L 0x4 |
#define ADMV8818_REG_SPI_CONFIG_A 0x0 |
#define ADMV8818_REG_SPI_CONFIG_B 0x1 |
#define ADMV8818_REG_WR0_FILTER 0x21 |
#define ADMV8818_REG_WR0_SW 0x20 |
#define ADMV8818_REG_WR1_FILTER 0x23 |
#define ADMV8818_REG_WR1_SW 0x22 |
#define ADMV8818_REG_WR2_FILTER 0x25 |
#define ADMV8818_REG_WR2_SW 0x24 |
#define ADMV8818_REG_WR3_FILTER 0x27 |
#define ADMV8818_REG_WR3_SW 0x26 |
#define ADMV8818_REG_WR4_FILTER 0x29 |
#define ADMV8818_REG_WR4_SW 0x28 |
#define ADMV8818_SDOACTIVE_MSK NO_OS_BIT(3) |
#define ADMV8818_SDOACTIVE_N_MSK NO_OS_BIT(4) |
#define ADMV8818_SINGLE_INSTRUCTION_MSK NO_OS_BIT(7) |
#define ADMV8818_SOFTRESET_MSK NO_OS_BIT(0) |
#define ADMV8818_SOFTRESET_N_MSK NO_OS_BIT(7) |
#define ADMV8818_SPI_READ_CMD NO_OS_BIT(7) |
#define ADMV8818_SW_IN_SET_WR0_MSK NO_OS_BIT(7) |
#define ADMV8818_SW_IN_WR0_MSK NO_OS_GENMASK(5, 3) |
#define ADMV8818_SW_OUT_SET_WR0_MSK NO_OS_BIT(6) |
#define ADMV8818_SW_OUT_WR0_MSK NO_OS_GENMASK(2, 0) |
enum admv8818_filter_mode |
int admv8818_hpf_select | ( | struct admv8818_dev * | dev, |
unsigned long long | freq | ||
) |
Set the HPF Frequency.
Set the HPF Frequency
dev | - The device structure. |
freq | - The HPF Frequency to be set. |
int admv8818_init | ( | struct admv8818_dev ** | device, |
struct admv8818_init_param * | init_param | ||
) |
Initializes the admv8818.
ADMV8818 Initialization
device | - The device structure. |
init_param | - The structure containing the device initial parameters. |
int admv8818_lpf_select | ( | struct admv8818_dev * | dev, |
unsigned long long | freq | ||
) |
Set the LPF Frequency.
Set the LPF Frequency
dev | - The device structure. |
freq | - The LPF Frequency to be set. |
int admv8818_read_hpf_freq | ( | struct admv8818_dev * | dev, |
unsigned long long * | freq | ||
) |
Get the HPF Frequency.
Get the HPF Frequency
dev | - The device structure. |
freq | - The HPF Frequency. |
int admv8818_read_lpf_freq | ( | struct admv8818_dev * | dev, |
unsigned long long * | freq | ||
) |
Get the HPF Frequency.
Get the LPF Frequency
dev | - The device structure. |
freq | - The HPF Frequency. |
int admv8818_remove | ( | struct admv8818_dev * | dev | ) |
ADMV8818 Resources Deallocation.
ADMV8818 Resources Deallocation
dev | - The device structure. |
int admv8818_rfin_select | ( | struct admv8818_dev * | dev | ) |
Set the RF Input Band Select.
Set the RF Input Band Select
dev | - The device structure. |
int admv8818_spi_read | ( | struct admv8818_dev * | dev, |
uint16_t | reg_addr, | ||
uint8_t * | data | ||
) |
Reads data from ADMV8818 over SPI.
ADMV8818 SPI Read
dev | - The device structure. |
reg_addr | - The register address. |
data | - Data read from the device. |
int admv8818_spi_update_bits | ( | struct admv8818_dev * | dev, |
uint16_t | reg_addr, | ||
uint8_t | mask, | ||
uint8_t | data | ||
) |
Update ADMV8818 register.
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). |
int admv8818_spi_write | ( | struct admv8818_dev * | dev, |
uint16_t | reg_addr, | ||
uint8_t | data | ||
) |
Writes data to ADMV8818 over SPI.
ADMV8818 SPI write
dev | - The device structure. |
reg_addr | - The register address. |
data | - Data value to write. |