Header file for admv8818 Driver.
More...
#include <stdint.h>
#include "no_os_spi.h"
#include "no_os_util.h"
|
| int | admv8818_spi_write (struct admv8818_dev *dev, uint16_t reg_addr, uint8_t data) |
| | Writes data to 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_spi_read (struct admv8818_dev *dev, uint16_t reg_addr, uint8_t *data) |
| | Reads data from ADMV8818 over SPI.
|
| |
| 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.
|
| |
Header file for 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
◆ ADMV8818_BUFF_SIZE_BYTES
| #define ADMV8818_BUFF_SIZE_BYTES 3 |
◆ ADMV8818_CHIP_ID
◆ ADMV8818_CSB_STALL_MSK
◆ ADMV8818_ENDIAN_MSK
◆ ADMV8818_ENDIAN_N_MSK
◆ ADMV8818_HPF_WR0_MSK
◆ ADMV8818_LPF_WR0_MSK
◆ ADMV8818_LSB_FIRST_N_MSK
| #define ADMV8818_LSB_FIRST_N_MSK NO_OS_BIT(6) |
◆ ADMV8818_LSBFIRST_MSK
◆ ADMV8818_MASTER_SLAVE_RB_MSK
| #define ADMV8818_MASTER_SLAVE_RB_MSK NO_OS_BIT(5) |
◆ ADMV8818_MASTER_SLAVE_TRANSFER_MSK
| #define ADMV8818_MASTER_SLAVE_TRANSFER_MSK NO_OS_BIT(0) |
◆ ADMV8818_REG_CHIPTYPE
| #define ADMV8818_REG_CHIPTYPE 0x3 |
◆ ADMV8818_REG_FAST_LATCH_DIRECTION
| #define ADMV8818_REG_FAST_LATCH_DIRECTION 0x13 |
◆ ADMV8818_REG_FAST_LATCH_POINTER
| #define ADMV8818_REG_FAST_LATCH_POINTER 0x10 |
◆ ADMV8818_REG_FAST_LATCH_START
| #define ADMV8818_REG_FAST_LATCH_START 0x12 |
◆ ADMV8818_REG_FAST_LATCH_STATE
| #define ADMV8818_REG_FAST_LATCH_STATE 0x14 |
◆ ADMV8818_REG_FAST_LATCH_STOP
| #define ADMV8818_REG_FAST_LATCH_STOP 0x11 |
◆ ADMV8818_REG_LUT0_FILTER
| #define ADMV8818_REG_LUT0_FILTER 0x101 |
◆ ADMV8818_REG_LUT0_SW
| #define ADMV8818_REG_LUT0_SW 0x100 |
◆ ADMV8818_REG_LUT127_FILTER
| #define ADMV8818_REG_LUT127_FILTER 0x1FF |
◆ ADMV8818_REG_LUT127_SW
| #define ADMV8818_REG_LUT127_SW 0x1FE |
◆ ADMV8818_REG_PRODUCT_ID_H
| #define ADMV8818_REG_PRODUCT_ID_H 0x5 |
◆ ADMV8818_REG_PRODUCT_ID_L
| #define ADMV8818_REG_PRODUCT_ID_L 0x4 |
◆ ADMV8818_REG_SPI_CONFIG_A
| #define ADMV8818_REG_SPI_CONFIG_A 0x0 |
◆ ADMV8818_REG_SPI_CONFIG_B
| #define ADMV8818_REG_SPI_CONFIG_B 0x1 |
◆ ADMV8818_REG_WR0_FILTER
| #define ADMV8818_REG_WR0_FILTER 0x21 |
◆ ADMV8818_REG_WR0_SW
| #define ADMV8818_REG_WR0_SW 0x20 |
◆ ADMV8818_REG_WR1_FILTER
| #define ADMV8818_REG_WR1_FILTER 0x23 |
◆ ADMV8818_REG_WR1_SW
| #define ADMV8818_REG_WR1_SW 0x22 |
◆ ADMV8818_REG_WR2_FILTER
| #define ADMV8818_REG_WR2_FILTER 0x25 |
◆ ADMV8818_REG_WR2_SW
| #define ADMV8818_REG_WR2_SW 0x24 |
◆ ADMV8818_REG_WR3_FILTER
| #define ADMV8818_REG_WR3_FILTER 0x27 |
◆ ADMV8818_REG_WR3_SW
| #define ADMV8818_REG_WR3_SW 0x26 |
◆ ADMV8818_REG_WR4_FILTER
| #define ADMV8818_REG_WR4_FILTER 0x29 |
◆ ADMV8818_REG_WR4_SW
| #define ADMV8818_REG_WR4_SW 0x28 |
◆ ADMV8818_SDOACTIVE_MSK
◆ ADMV8818_SDOACTIVE_N_MSK
| #define ADMV8818_SDOACTIVE_N_MSK NO_OS_BIT(4) |
◆ ADMV8818_SINGLE_INSTRUCTION_MSK
| #define ADMV8818_SINGLE_INSTRUCTION_MSK NO_OS_BIT(7) |
◆ ADMV8818_SOFTRESET_MSK
◆ ADMV8818_SOFTRESET_N_MSK
| #define ADMV8818_SOFTRESET_N_MSK NO_OS_BIT(7) |
◆ ADMV8818_SPI_READ_CMD
◆ ADMV8818_SW_IN_SET_WR0_MSK
| #define ADMV8818_SW_IN_SET_WR0_MSK NO_OS_BIT(7) |
◆ ADMV8818_SW_IN_WR0_MSK
◆ ADMV8818_SW_OUT_SET_WR0_MSK
| #define ADMV8818_SW_OUT_SET_WR0_MSK NO_OS_BIT(6) |
◆ ADMV8818_SW_OUT_WR0_MSK
◆ admv8818_filter_mode
Filter Modes of the ADMV8818.
| Enumerator |
|---|
| ADMV8818_AUTO | |
| ADMV8818_MANUAL | |
◆ admv8818_hpf_select()
| int admv8818_hpf_select |
( |
struct admv8818_dev * | dev, |
|
|
unsigned long long | freq ) |
Set the HPF Frequency.
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()
Initializes the admv8818.
ADMV8818 Initialization
- 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.
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.
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.
Get the LPF Frequency
- Parameters
-
| dev | - The device structure. |
| freq | - The HPF Frequency. |
- Returns
- Returns 0 in case of success or negative error code.
◆ admv8818_remove()
ADMV8818 Resources Deallocation.
ADMV8818 Resources Deallocation
- Parameters
-
| dev | - The device structure. |
- Returns
- Returns 0 in case of success or negative error code otherwise.
◆ admv8818_rfin_select()
Set the RF Input Band Select.
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.
ADMV8818 SPI Read
- 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.
ADMV8818 SPI write
- 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.