48#define AD738X_REG_NOP 0x00
49#define AD738X_REG_CONFIG1 0x01
50#define AD738X_REG_CONFIG2 0x02
51#define AD738X_REG_ALERT 0x03
52#define AD738X_REG_ALERT_LOW_TH 0x04
53#define AD738X_REG_ALERT_HIGH_TH 0x05
58#define AD738X_CONFIG1_CH_SEQ_MSK NO_OS_GENMASK(11, 10)
59#define AD738X_CONFIG1_CH_SEQ(x) (((x) & 0x3) << 10)
60#define AD738X_CONFIG1_OS_MODE_MSK NO_OS_BIT(9)
61#define AD738X_CONFIG1_OS_MODE(x) (((x) & 0x1) << 9)
62#define AD738X_CONFIG1_OSR_MSK NO_OS_GENMASK(8, 6)
63#define AD738X_CONFIG1_OSR(x) (((x) & 0x7) << 6)
64#define AD738X_CONFIG1_CRC_W_MSK NO_OS_BIT(5)
65#define AD738X_CONFIG1_CRC_W(x) (((x) & 0x1) << 5)
66#define AD738X_CONFIG1_CRC_R_MSK NO_OS_BIT(4)
67#define AD738X_CONFIG1_CRC_R(x) (((x) & 0x1) << 4)
68#define AD738X_CONFIG1_ALERTEN_MSK NO_OS_BIT(3)
69#define AD738X_CONFIG1_ALERTEN(x) (((x) & 0x1) << 3)
70#define AD738X_CONFIG1_RES_MSK NO_OS_BIT(2)
71#define AD738X_CONFIG1_RES(x) (((x) & 0x1) << 2)
72#define AD738X_CONFIG1_REFSEL_MSK NO_OS_BIT(1)
73#define AD738X_CONFIG1_REFSEL(x) (((x) & 0x1) << 1)
74#define AD738X_CONFIG1_PMODE_MSK NO_OS_BIT(0)
75#define AD738X_CONFIG1_PMODE(x) (((x) & 0x1) << 0)
80#define AD738X_CONFIG2_SDO2_MSK NO_OS_BIT(8)
81#define AD738X_CONFIG2_SDO2(x) (((x) & 0x1) << 8)
82#define AD738X_CONFIG2_SDO4_MSK NO_OS_GENMASK(9, 8)
83#define AD738X_CONFIG2_SDO4(x) (((x) & 0x3) << 8)
84#define AD738X_CONFIG2_RESET_MSK NO_OS_GENMASK(7, 0)
85#define AD738X_CONFIG2_RESET(x) (((x) & 0xFF) << 0)
90#define AD738X_ALERT_LOW_MSK NO_OS_GENMASK(11, 0)
91#define AD738X_ALERT_LOW(x) (((x) & 0xFFF) << 0)
96#define AD738X_ALERT_HIGH_MSK NO_OS_GENMASK(11, 0)
97#define AD738X_ALERT_HIGH(x) (((x) & 0xFFF) << 0)
100#define AD738X_REG_WRITE(x) ((1 << 7) | ((x & 0x7) << 4))
102#define AD738X_REG_READ(x) ((x & 0x7) << 4)
104#define AD738X_FLAG_STANDARD_SPI_DMA NO_OS_BIT(0)
105#define AD738X_FLAG_OFFLOAD NO_OS_BIT(1)
106#define AD738X_FLAG_NO_PWM NO_OS_BIT(2)
161#ifdef XILINX_PLATFORM
180#ifdef XILINX_PLATFORM
182 uint32_t axi_clkgen_rate;
184#if !defined(USE_STANDARD_SPI)
struct axi_clkgen_init clkgen_init
Definition common_data.c:74
int32_t ad738x_spi_write_mask(struct ad738x_dev *dev, uint8_t reg_addr, uint32_t mask, uint16_t data)
Definition ad738x.c:107
ad738x_pwd_mode
Definition ad738x.h:147
@ NORMAL_PWDM
Definition ad738x.h:148
@ FULL_PWDM
Definition ad738x.h:149
int32_t ad738x_remove(struct ad738x_dev *dev)
Free the resources allocated by ad738x_init().
Definition ad738x.c:502
int32_t ad738x_power_down_mode(struct ad738x_dev *dev, enum ad738x_pwd_mode pmode)
Definition ad738x.c:240
int32_t ad738x_init(struct ad738x_dev **device, struct ad738x_init_param *init_param)
Definition ad738x.c:425
int32_t ad738x_read_data(struct ad738x_dev *dev, uint32_t *buf, uint16_t samples)
Read from device. Enter register mode to read/write registers.
Definition ad738x.c:393
ad738x_conv_mode
Definition ad738x.h:108
@ TWO_WIRE_MODE
Definition ad738x.h:109
@ FOUR_WIRE_MODE
Definition ad738x.h:111
@ ONE_WIRE_MODE
Definition ad738x.h:110
int32_t ad738x_set_conversion_mode(struct ad738x_dev *dev, enum ad738x_conv_mode mode)
Definition ad738x.c:133
ad738x_ref_sel
Definition ad738x.h:152
@ INT_REF
Definition ad738x.h:153
@ EXT_REF
Definition ad738x.h:154
int32_t ad738x_reference_sel(struct ad738x_dev *dev, enum ad738x_ref_sel ref_sel)
Definition ad738x.c:257
ad738x_ch_seq_sel
Definition ad738x.h:114
@ FIRST_FOUR
Definition ad738x.h:116
@ SECOND_FOUR
Definition ad738x.h:120
ad738x_reset_type
Definition ad738x.h:142
@ HARD_RESET
Definition ad738x.h:144
int32_t ad738x_spi_reg_write(struct ad738x_dev *dev, uint8_t reg_addr, uint16_t reg_data)
Definition ad738x.c:87
ad738x_resolution
Definition ad738x.h:137
@ RES_16_BIT
Definition ad738x.h:138
@ RES_18_BIT
Definition ad738x.h:139
int32_t ad738x_oversampling_config(struct ad738x_dev *dev, enum ad738x_os_mode os_mode, enum ad738x_os_ratio os_ratio, enum ad738x_resolution res)
Definition ad738x.c:203
int32_t ad738x_reset(struct ad738x_dev *dev, enum ad738x_reset_type reset)
Definition ad738x.c:175
int32_t ad738x_spi_single_conversion(struct ad738x_dev *dev, uint32_t *adc_data)
Definition ad738x.c:272
ad738x_os_mode
Definition ad738x.h:123
@ ROLLING_OS_MODE
Definition ad738x.h:125
@ NORMAL_OS_MODE
Definition ad738x.h:124
int32_t ad738x_spi_reg_read(struct ad738x_dev *dev, uint8_t reg_addr, uint16_t *reg_data)
Definition ad738x.c:54
ad738x_os_ratio
Definition ad738x.h:128
@ OSR_X32
Definition ad738x.h:134
@ OSR_X16
Definition ad738x.h:133
@ OSR_DISABLED
Definition ad738x.h:129
@ OSR_X4
Definition ad738x.h:131
@ OSR_X8
Definition ad738x.h:132
@ OSR_X2
Definition ad738x.h:130
struct ad7616_init_param init_param
Definition ad7616_sdz.c:106
#define SOFT_RESET
Definition ad9361.h:568
#define ALL
Definition api_def.h:26
Driver for the Analog Devices AXI CLKGEN.
Header file of SPI Interface.
Header file of utility functions.
struct no_os_spi_desc * spi_desc
Definition ad738x.h:159
void(* dcache_invalidate_range)(uint32_t address, uint32_t bytes_count)
Definition ad738x.h:173
uint32_t ref_voltage_mv
Definition ad738x.h:170
enum ad738x_resolution resolution
Definition ad738x.h:171
enum ad738x_ch_seq_sel ch_seq_sel
Definition ad738x.h:168
enum ad738x_conv_mode conv_mode
Definition ad738x.h:167
uint32_t flags
Definition ad738x.h:174
struct no_os_pwm_desc * pwm_desc
Definition ad738x.h:164
enum ad738x_ref_sel ref_sel
Definition ad738x.h:169
void(* dcache_invalidate_range)(uint32_t address, uint32_t bytes_count)
Definition ad738x.h:195
uint32_t flags
Definition ad738x.h:196
struct spi_engine_offload_init_param * offload_init_param
Definition ad738x.h:185
enum ad738x_ch_seq_sel ch_seq_sel
Definition ad738x.h:191
uint32_t ref_voltage_mv
Definition ad738x.h:193
enum ad738x_conv_mode conv_mode
Definition ad738x.h:190
struct no_os_pwm_init_param * pwm_init
Definition ad738x.h:187
struct no_os_spi_init_param * spi_param
Definition ad738x.h:179
enum ad738x_ref_sel ref_sel
Definition ad738x.h:192
Definition clk_axi_clkgen.h:44
Definition clk_axi_clkgen.h:38
Definition ad9361_util.h:63
Structure representing an PWM generator device.
Definition no_os_pwm.h:83
Structure containing the init parameters needed by the PWM generator.
Definition no_os_pwm.h:56
Structure holding SPI descriptor.
Definition no_os_spi.h:180
Structure holding the parameters for SPI initialization.
Definition no_os_spi.h:128
Structure containing the init parameters needed by the offload module.
Definition spi_engine.h:127