Go to the documentation of this file.
49 #define ADMV8818_REG_SPI_CONFIG_A 0x0
50 #define ADMV8818_REG_SPI_CONFIG_B 0x1
51 #define ADMV8818_REG_CHIPTYPE 0x3
52 #define ADMV8818_REG_PRODUCT_ID_L 0x4
53 #define ADMV8818_REG_PRODUCT_ID_H 0x5
54 #define ADMV8818_REG_FAST_LATCH_POINTER 0x10
55 #define ADMV8818_REG_FAST_LATCH_STOP 0x11
56 #define ADMV8818_REG_FAST_LATCH_START 0x12
57 #define ADMV8818_REG_FAST_LATCH_DIRECTION 0x13
58 #define ADMV8818_REG_FAST_LATCH_STATE 0x14
59 #define ADMV8818_REG_WR0_SW 0x20
60 #define ADMV8818_REG_WR0_FILTER 0x21
61 #define ADMV8818_REG_WR1_SW 0x22
62 #define ADMV8818_REG_WR1_FILTER 0x23
63 #define ADMV8818_REG_WR2_SW 0x24
64 #define ADMV8818_REG_WR2_FILTER 0x25
65 #define ADMV8818_REG_WR3_SW 0x26
66 #define ADMV8818_REG_WR3_FILTER 0x27
67 #define ADMV8818_REG_WR4_SW 0x28
68 #define ADMV8818_REG_WR4_FILTER 0x29
69 #define ADMV8818_REG_LUT0_SW 0x100
70 #define ADMV8818_REG_LUT0_FILTER 0x101
71 #define ADMV8818_REG_LUT127_SW 0x1FE
72 #define ADMV8818_REG_LUT127_FILTER 0x1FF
75 #define ADMV8818_SOFTRESET_N_MSK NO_OS_BIT(7)
76 #define ADMV8818_LSB_FIRST_N_MSK NO_OS_BIT(6)
77 #define ADMV8818_ENDIAN_N_MSK NO_OS_BIT(5)
78 #define ADMV8818_SDOACTIVE_N_MSK NO_OS_BIT(4)
79 #define ADMV8818_SDOACTIVE_MSK NO_OS_BIT(3)
80 #define ADMV8818_ENDIAN_MSK NO_OS_BIT(2)
81 #define ADMV8818_LSBFIRST_MSK NO_OS_BIT(1)
82 #define ADMV8818_SOFTRESET_MSK NO_OS_BIT(0)
85 #define ADMV8818_SINGLE_INSTRUCTION_MSK NO_OS_BIT(7)
86 #define ADMV8818_CSB_STALL_MSK NO_OS_BIT(6)
87 #define ADMV8818_MASTER_SLAVE_RB_MSK NO_OS_BIT(5)
88 #define ADMV8818_MASTER_SLAVE_TRANSFER_MSK NO_OS_BIT(0)
91 #define ADMV8818_SW_IN_SET_WR0_MSK NO_OS_BIT(7)
92 #define ADMV8818_SW_OUT_SET_WR0_MSK NO_OS_BIT(6)
93 #define ADMV8818_SW_IN_WR0_MSK NO_OS_GENMASK(5, 3)
94 #define ADMV8818_SW_OUT_WR0_MSK NO_OS_GENMASK(2, 0)
97 #define ADMV8818_HPF_WR0_MSK NO_OS_GENMASK(7, 4)
98 #define ADMV8818_LPF_WR0_MSK NO_OS_GENMASK(3, 0)
101 #define ADMV8818_BUFF_SIZE_BYTES 3
102 #define ADMV8818_CHIP_ID NO_OS_BIT(0)
103 #define ADMV8818_SPI_READ_CMD NO_OS_BIT(7)
150 uint8_t mask, uint8_t data);
unsigned long long rf_in
Definition: admv8818.h:126
int admv8818_spi_write(struct admv8818_dev *dev, uint16_t reg_addr, uint8_t data)
Writes data to ADMV8818 over SPI.
Definition: admv8818.c:72
int admv8818_spi_read(struct admv8818_dev *dev, uint16_t reg_addr, uint8_t *data)
Reads data from ADMV8818 over SPI.
Definition: admv8818.c:92
int admv8818_init(struct admv8818_dev **device, struct admv8818_init_param *init_param)
Initializes the admv8818.
Definition: admv8818.c:341
#define ADMV8818_BUFF_SIZE_BYTES
Definition: admv8818.h:101
int admv8818_lpf_select(struct admv8818_dev *dev, unsigned long long freq)
Set the LPF Frequency.
Definition: admv8818.c:238
int admv8818_rfin_select(struct admv8818_dev *dev)
Set the RF Input Band Select.
Definition: admv8818.c:324
#define NO_OS_GENMASK(h, l)
Definition: no_os_util.h:82
int32_t no_os_spi_write_and_read(struct no_os_spi_desc *desc, uint8_t *data, uint16_t bytes_number)
Write and read data to/from SPI.
Definition: no_os_spi.c:159
#define ADMV8818_REG_WR0_FILTER
Definition: admv8818.h:60
int admv8818_spi_update_bits(struct admv8818_dev *dev, uint16_t reg_addr, uint8_t mask, uint8_t data)
Update ADMV8818 register.
Definition: admv8818.c:120
Header file of SPI Interface.
int admv8818_read_lpf_freq(struct admv8818_dev *dev, unsigned long long *freq)
Get the HPF Frequency.
Definition: admv8818.c:289
int admv8818_init(struct admv8818_dev **device, struct admv8818_init_param *init_param)
Initializes the admv8818.
Definition: admv8818.c:341
ADMV8818 Initialization Parameters structure.
Definition: admv8818.h:122
enum admv8818_filter_mode mode
Definition: admv8818.h:128
Definition: ad9361_util.h:69
#define ADMV8818_SOFTRESET_N_MSK
Definition: admv8818.h:75
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:54
enum ad7616_mode mode
Definition: ad7616.h:226
#define ADMV8818_LPF_WR0_MSK
Definition: admv8818.h:98
#define ADMV8818_REG_SPI_CONFIG_B
Definition: admv8818.h:50
#define ADMV8818_SW_IN_WR0_MSK
Definition: admv8818.h:93
enum admv8818_filter_mode mode
Definition: admv8818.h:141
int admv8818_remove(struct admv8818_dev *dev)
ADMV8818 Resources Deallocation.
Definition: admv8818.c:415
#define ADMV8818_SDOACTIVE_N_MSK
Definition: admv8818.h:78
int admv8818_read_lpf_freq(struct admv8818_dev *dev, unsigned long long *freq)
Get the HPF Frequency.
Definition: admv8818.c:289
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
unsigned long long rf_in
Definition: admv8818.h:139
#define ADMV8818_HPF_WR0_MSK
Definition: admv8818.h:97
int admv8818_hpf_select(struct admv8818_dev *dev, unsigned long long freq)
Set the HPF Frequency.
Definition: admv8818.c:142
struct no_os_spi_desc * spi_desc
Definition: admv8818.h:137
#define HZ_PER_MHZ
Definition: no_os_units.h:56
@ ADMV8818_MANUAL
Definition: admv8818.h:115
int admv8818_hpf_select(struct admv8818_dev *dev, unsigned long long freq)
Set the HPF Frequency.
Definition: admv8818.c:142
ADMV8818 Device Descriptor.
Definition: admv8818.h:135
admv8818_filter_mode
Filter Modes of the ADMV8818.
Definition: admv8818.h:113
int admv8818_read_hpf_freq(struct admv8818_dev *dev, unsigned long long *freq)
Get the HPF Frequency.
Definition: admv8818.c:202
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
#define ADMV8818_SPI_READ_CMD
Definition: admv8818.h:103
struct no_os_spi_init_param * spi_init
Definition: admv8818.h:124
#define ADMV8818_CHIP_ID
Definition: admv8818.h:102
#define ADMV8818_SINGLE_INSTRUCTION_MSK
Definition: admv8818.h:85
int admv8818_read_hpf_freq(struct admv8818_dev *dev, unsigned long long *freq)
Get the HPF Frequency.
Definition: admv8818.c:202
int admv8818_rfin_select(struct admv8818_dev *dev)
Set the RF Input Band Select.
Definition: admv8818.c:324
#define ADMV8818_REG_WR0_SW
Definition: admv8818.h:59
uint32_t no_os_field_get(uint32_t mask, uint32_t word)
#define ADMV8818_SDOACTIVE_MSK
Definition: admv8818.h:79
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:69
int admv8818_spi_update_bits(struct admv8818_dev *dev, uint16_t reg_addr, uint8_t mask, uint8_t data)
Update ADMV8818 register.
Definition: admv8818.c:120
#define ADMV8818_SW_OUT_WR0_MSK
Definition: admv8818.h:94
#define ADMV8818_REG_CHIPTYPE
Definition: admv8818.h:51
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
#define ADMV8818_SW_OUT_SET_WR0_MSK
Definition: admv8818.h:92
@ ADMV8818_AUTO
Definition: admv8818.h:114
int32_t no_os_spi_remove(struct no_os_spi_desc *desc)
Free the resources allocated by no_os_spi_init().
Definition: no_os_spi.c:116
Header file for admv8818 Driver.
#define ADMV8818_SW_IN_SET_WR0_MSK
Definition: admv8818.h:91
#define ADMV8818_REG_SPI_CONFIG_A
Definition: admv8818.h:49
int32_t no_os_spi_init(struct no_os_spi_desc **desc, const struct no_os_spi_init_param *param)
Initialize the SPI communication peripheral.
Definition: no_os_spi.c:52
Header file of utility functions.
int admv8818_remove(struct admv8818_dev *dev)
ADMV8818 Resources Deallocation.
Definition: admv8818.c:415
int admv8818_lpf_select(struct admv8818_dev *dev, unsigned long long freq)
Set the LPF Frequency.
Definition: admv8818.c:238
int admv8818_spi_write(struct admv8818_dev *dev, uint16_t reg_addr, uint8_t data)
Writes data to ADMV8818 over SPI.
Definition: admv8818.c:72
int admv8818_spi_read(struct admv8818_dev *dev, uint16_t reg_addr, uint8_t *data)
Reads data from ADMV8818 over SPI.
Definition: admv8818.c:92
#define ADMV8818_SOFTRESET_MSK
Definition: admv8818.h:82
chip_id
Definition: ad9172.h:51
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140