46#if !defined(USE_STANDARD_SPI)
57#define AD469x_REG_IF_CONFIG_A 0x000
58#define AD469x_REG_IF_CONFIG_B 0x001
59#define AD469x_REG_DEVICE_TYPE 0x003
60#define AD469x_REG_DEVICE_ID_L 0x004
61#define AD469x_REG_DEVICE_ID_H 0x005
62#define AD469x_REG_SCRATCH_PAD 0x00A
63#define AD469x_REG_VENDOR_L 0x00C
64#define AD469x_REG_VENDOR_H 0x00D
65#define AD469x_REG_LOOP_MODE 0x00E
66#define AD469x_REG_IF_CONFIG_C 0x010
67#define AD469x_REG_IF_STATUS 0x011
68#define AD469x_REG_STATUS 0x014
69#define AD469x_REG_ALERT_STATUS1 0x015
70#define AD469x_REG_ALERT_STATUS2 0x016
71#define AD469x_REG_ALERT_STATUS3 0x017
72#define AD469x_REG_ALERT_STATUS4 0x018
73#define AD469x_REG_CLAMP_STATUS1 0x01A
74#define AD469x_REG_CLAMP_STATUS2 0x01B
75#define AD469x_REG_SETUP 0x020
76#define AD469x_REG_REF_CTRL 0x021
77#define AD469x_REG_SEQ_CTRL 0x022
78#define AD469x_REG_AC_CTRL 0x023
79#define AD469x_REG_STD_SEQ_CONFIG 0x024
80#define AD469x_REG_GPIO_CTRL 0x026
81#define AD469x_REG_GP_MODE 0x027
82#define AD469x_REG_GPIO_STATE 0x028
83#define AD469x_REG_TEMP_CTRL 0x029
84#define AD469x_REG_CONFIG_IN(x) ((x & 0x0F) | 0x30)
85#define AD469x_REG_THRESHOLD_UB(x) ((x << 1) | 0x40)
86#define AD469x_REG_THRESHOLD_LB(x) ((x << 1) | 0x60)
87#define AD469x_REG_HYST_IN(x) ((x << 1) | 0x80)
88#define AD469x_REG_OFFSET_IN(x) ((x << 1) | 0xA0)
89#define AD469x_REG_GAIN_IN(x) ((x << 1) | 0x0C0)
90#define AD469x_REG_AS_SLOT(x) ((x & 0x7F) | 0x100)
93#define AD469x_CMD_REG_CONFIG_MODE (0x0A << 3)
94#define AD469x_CMD_SEL_TEMP_SNSOR_CH (0x0F << 3)
95#define AD469x_CMD_CONFIG_CH_SEL(x) ((0x10 | (0x0F & x)) << 3)
98#define AD469x_REG_STATUS_RESET_MASK (0x01 << 5)
101#define AD469x_SETUP_IF_MODE_MASK (0x01 << 2)
102#define AD469x_SETUP_IF_MODE_CONV (0x01 << 2)
103#define AD469x_SETUP_CYC_CTRL_MASK (0x01 << 1)
104#define AD469x_SETUP_CYC_CTRL_SINGLE(x) ((x & 0x01) << 1)
107#define AD469x_REG_REF_VREF_SET_MASK (0x07 << 2)
108#define AD469x_REG_REF_VREF_SET(x) ((x & 0x07) << 2)
109#define AD469x_REG_REF_VREF_REFHIZ_MASK (0x07 << 1)
110#define AD469x_REG_REF_VREF_REFHIZ(x) ((x & 0x01) << 1)
111#define AD469x_REG_REF_VREF_REFBUF_MASK 0x01
112#define AD469x_REG_REF_VREF_REFBUF(x) (x & 0x01)
115#define AD469x_GP_MODE_BUSY_GP_EN_MASK (0x01 << 1)
116#define AD469x_GP_MODE_BUSY_GP_EN(x) ((x & 0x01) << 1)
117#define AD469x_GP_MODE_BUSY_GP_SEL_MASK (0x01 << 4)
118#define AD469x_GP_MODE_BUSY_GP_SEL(x) ((x & 0x01) << 4)
121#define AD469x_SEQ_CTRL_STD_SEQ_EN_MASK (0x01 << 7)
122#define AD469x_SEQ_CTRL_STD_SEQ_EN(x) ((x & 0x01) << 7)
123#define AD469x_SEQ_CTRL_NUM_SLOTS_AS_MASK (0x7f << 0)
124#define AD469x_SEQ_CTRL_NUM_SLOTS_AS(x) ((x & 0x7f) << 0)
127#define AD469x_REG_TEMP_CTRL_TEMP_EN_MASK (0x01 << 0)
128#define AD469x_REG_TEMP_CTRL_TEMP_EN(x) ((x & 0x01) << 0)
131#define AD469x_REG_AS_SLOT_INX(x) ((x & 0x0f) << 0)
134#define AD469x_REG_IF_CONFIG_C_MB_STRICT_MASK (0x01 << 5)
135#define AD469x_REG_IF_CONFIG_C_MB_STRICT(x) ((x & 0x01) << 5)
138#define AD469x_REG_CONFIG_IN_OSR_MASK (0x03 << 0)
139#define AD469x_REG_CONFIG_IN_OSR(x) ((x & 0x03) << 0)
140#define AD469x_REG_CONFIG_IN_HIZ_EN_MASK (0x01 << 3)
141#define AD469x_REG_CONFIG_IN_HIZ_EN(x) ((x & 0x01) << 3)
142#define AD469x_REG_CONFIG_IN_PAIR_MASK (0x03 << 4)
143#define AD469x_REG_CONFIG_IN_PAIR(x) ((x & 0x03) << 4)
144#define AD469x_REG_CONFIG_IN_MODE_MASK (0x01 << 6)
145#define AD469x_REG_CONFIG_IN_MODE(x) ((x & 0x01) << 6)
146#define AD469x_REG_CONFIG_IN_TD_EN_MASK (0x01 << 7)
147#define AD469x_REG_CONFIG_IN_TD_EN(x) ((x & 0x01) << 7)
149#define AD469x_CHANNEL(x) (NO_OS_BIT(x) & 0xFFFF)
150#define AD469x_CHANNEL_NO 16
151#define AD469x_SLOTS_NO 0x80
248#if !defined(USE_STANDARD_SPI)
299#if !defined(USE_STANDARD_SPI)
num_channels
Definition ad3552r.h:234
ad469x_reg_access
Register access modes.
Definition ad469x.h:183
@ AD469x_WORD_ACCESS
Definition ad469x.h:185
@ AD469x_BYTE_ACCESS
Definition ad469x.h:184
int32_t ad469x_set_reference(struct ad469x_dev *device, enum ad469x_ref_set ref_set)
Set the value of reference.
Definition ad469x.c:893
int32_t ad469x_get_reference(struct ad469x_dev *device, enum ad469x_ref_set *ref_set)
Get the value of reference.
Definition ad469x.c:869
int32_t ad469x_spi_write_mask(struct ad469x_dev *dev, uint16_t reg_addr, uint8_t mask, uint8_t data)
Definition ad469x.c:184
int32_t ad469x_spi_read_mask(struct ad469x_dev *dev, uint16_t reg_addr, uint8_t mask, uint8_t *data)
Definition ad469x.c:159
ad469x_ref_set
Reference input range control.
Definition ad469x.h:224
@ AD469x_3P25_3P75
Definition ad469x.h:227
@ AD469x_4P5_5P1
Definition ad469x.h:229
@ AD469x_2P4_2P75
Definition ad469x.h:225
@ AD469x_3P75_4P5
Definition ad469x.h:228
@ AD469x_2P75_3P25
Definition ad469x.h:226
int32_t ad469x_adv_sequence_set_slot(struct ad469x_dev *dev, uint8_t slot, uint8_t channel)
Advanced sequencer, assign channel to a slot.
Definition ad469x.c:525
int32_t ad469x_spi_reg_read(struct ad469x_dev *dev, uint16_t reg_addr, uint8_t *reg_data)
Definition ad469x.c:77
ad469x_pin_pairing
Channel pin pairing options.
Definition ad469x.h:214
@ AD469x_INx_COM
Definition ad469x.h:216
@ AD469x_INx_EVEN_ODD
Definition ad469x.h:217
@ AD469x_INx_REF_GND
Definition ad469x.h:215
int32_t ad469x_remove(struct ad469x_dev *dev)
Free the memory allocated by ad469x_init().
Definition ad469x.c:1184
bool ad469x_is_temp_channel(struct ad469x_dev *dev, uint8_t channel)
Definition ad469x.c:269
int32_t ad469x_std_sequence_ch(struct ad469x_dev *dev, uint16_t ch_mask)
Configure standard sequencer channels.
Definition ad469x.c:547
int32_t ad469x_spi_reg_write(struct ad469x_dev *dev, uint16_t reg_addr, uint8_t reg_data)
Definition ad469x.c:118
int32_t ad469x_std_seq_osr(struct ad469x_dev *dev, enum ad469x_osr_ratios ratio)
Configure over sampling ratio in standard sequencer mode.
Definition ad469x.c:347
int32_t ad469x_adv_seq_osr(struct ad469x_dev *dev, uint16_t ch, enum ad469x_osr_ratios ratio)
Configure over sampling ratio in advanced sequencer mode.
Definition ad469x.c:290
ad469x_ain_high_z
Analog input high impedance mode.
Definition ad469x.h:236
@ AD469x_AIN_HIGH_Z_DISABLE
Definition ad469x.h:237
@ AD469x_AIN_HIGH_Z_ENABLE
Definition ad469x.h:238
int32_t ad469x_get_ain_high_z_status(struct ad469x_dev *dev, uint8_t ch, enum ad469x_ain_high_z *status)
Get the status of analog input high Z mode.
Definition ad469x.c:1030
#define AD469x_CHANNEL_NO
Definition ad469x.h:150
int32_t ad469x_sequence_enable_temp(struct ad469x_dev *dev)
Enable temperature read at the end of the sequence, for standard and advanced sequencer.
Definition ad469x.c:574
int32_t ad469x_sequence_disable_temp(struct ad469x_dev *dev)
Disable temperature read at the end of the sequence, for standard and advanced sequencer.
Definition ad469x.c:596
int32_t ad469x_reset_dev(struct ad469x_dev *dev)
Resets the ad469x device.
Definition ad469x.c:836
int32_t ad469x_config(struct ad469x_dev *dev, struct ad469x_init_param *config_desc)
Definition ad469x.c:909
int32_t ad469x_read_data(struct ad469x_dev *dev, uint8_t channel, uint32_t *buf, uint16_t samples)
Read from device. Enter register mode to read/write registers.
Definition ad469x.c:783
int32_t ad469x_seq_read_data(struct ad469x_dev *dev, uint32_t *buf, uint32_t samples)
Read from device when converter has the channel sequencer activated. Enter register mode to read/writ...
Definition ad469x.c:749
int32_t ad469x_set_channel_sequence(struct ad469x_dev *dev, enum ad469x_channel_sequencing seq)
Set channel sequence.
Definition ad469x.c:392
int32_t ad469x_enter_conversion_mode(struct ad469x_dev *dev)
Enter conversion mode. To exit conversion mode send a 5 bit conversion mode command AD469x_CMD_REG_CO...
Definition ad469x.c:649
ad469x_busy_gp_sel
Busy state, possible general purpose pin selections.
Definition ad469x.h:172
@ AD469x_busy_gp3
Definition ad469x.h:176
@ AD469x_busy_gp0
Definition ad469x.h:174
ad469x_osr_ratios
Supported oversampling ratios.
Definition ad469x.h:203
@ AD469x_OSR_16
Definition ad469x.h:206
@ AD469x_OSR_4
Definition ad469x.h:205
@ AD469x_OSR_1
Definition ad469x.h:204
@ AD469x_OSR_64
Definition ad469x.h:207
#define AD469x_SLOTS_NO
Definition ad469x.h:151
ad469x_supported_dev_ids
Supported devices.
Definition ad469x.h:192
@ ID_AD4697
Definition ad469x.h:195
@ ID_AD4695
Definition ad469x.h:193
@ ID_AD4698
Definition ad469x.h:196
@ ID_AD4696
Definition ad469x.h:194
int32_t ad469x_exit_conversion_mode(struct ad469x_dev *dev)
Exit conversion mode. Enter register mode to read/write registers.
Definition ad469x.c:663
int32_t ad469x_set_busy(struct ad469x_dev *dev, enum ad469x_busy_gp_sel gp_sel)
Configure converter busy indicator to the output of the specified port.
Definition ad469x.c:618
ad469x_channel_sequencing
Channel sequencing modes.
Definition ad469x.h:157
@ AD469x_two_cycle
Definition ad469x.h:161
@ AD469x_single_cycle
Definition ad469x.h:159
@ AD469x_standard_seq
Definition ad469x.h:163
@ AD469x_advanced_seq
Definition ad469x.h:165
int32_t ad469x_get_num_channels(struct ad469x_dev *dev, uint8_t *num_channels)
Definition ad469x.c:256
int32_t ad469x_adv_sequence_set_num_slots(struct ad469x_dev *dev, uint8_t num_slots)
Configure advanced sequencer number of slots, temp channel not included.
Definition ad469x.c:497
int32_t ad469x_configure_ain_high_z(struct ad469x_dev *dev, uint8_t ch, enum ad469x_ain_high_z status)
Configure analog input high Z mode.
Definition ad469x.c:1014
int32_t ad469x_init(struct ad469x_dev **device, struct ad469x_init_param *init_param)
Definition ad469x.c:1055
int32_t ad469x_std_pin_pairing(struct ad469x_dev *dev, enum ad469x_pin_pairing pin_pair)
Configure the pin pairing option in standard sequencer mode.
Definition ad469x.c:375
struct ad7616_init_param init_param
Definition ad7616_sdz.c:107
Driver for the Analog Devices AXI CLKGEN.
Header file of GPIO Interface.
Header file of PWM Interface.
Header file of SPI Interface.
Structure representing an ad469x device.
Definition ad469x.h:296
struct axi_clkgen * clkgen
Definition ad469x.h:301
enum ad469x_supported_dev_ids dev_id
Definition ad469x.h:314
uint8_t capture_data_width
Definition ad469x.h:312
enum ad469x_osr_ratios adv_seq_osr_resol[AD469x_CHANNEL_NO]
Definition ad469x.h:332
uint8_t ch_slots[AD469x_SLOTS_NO]
Definition ad469x.h:334
struct no_os_gpio_desc * gpio_busy
Definition ad469x.h:320
struct spi_engine_offload_init_param * offload_init_param
Definition ad469x.h:305
void(* dcache_invalidate_range)(uint32_t address, uint32_t bytes_count)
Definition ad469x.h:322
uint32_t reg_access_speed
Definition ad469x.h:308
struct no_os_gpio_desc * gpio_convst
Definition ad469x.h:318
enum ad469x_channel_sequencing ch_sequence
Definition ad469x.h:324
struct no_os_spi_desc * spi_desc
Definition ad469x.h:298
struct no_os_gpio_desc * gpio_resetn
Definition ad469x.h:316
enum ad469x_pin_pairing std_seq_pin_pairing
Definition ad469x.h:326
struct no_os_pwm_desc * trigger_pwm_desc
Definition ad469x.h:303
enum ad469x_osr_ratios std_seq_osr
Definition ad469x.h:329
uint8_t num_data_ch
Definition ad469x.h:340
uint8_t num_slots
Definition ad469x.h:338
uint8_t reg_data_width
Definition ad469x.h:310
bool temp_enabled
Definition ad469x.h:336
Structure containing the init parameters needed by the ad469x device.
Definition ad469x.h:245
enum ad469x_osr_ratios adv_seq_osr_resol[AD469x_CHANNEL_NO]
Definition ad469x.h:281
enum ad469x_channel_sequencing ch_sequence
Definition ad469x.h:275
enum ad469x_pin_pairing std_seq_pin_pairing
Definition ad469x.h:273
struct no_os_gpio_init_param * gpio_busy
Definition ad469x.h:263
struct spi_engine_offload_init_param * offload_init_param
Definition ad469x.h:250
uint8_t num_data_ch
Definition ad469x.h:285
enum ad469x_osr_ratios std_seq_osr
Definition ad469x.h:278
uint32_t reg_access_speed
Definition ad469x.h:265
struct no_os_spi_init_param * spi_init
Definition ad469x.h:247
uint8_t capture_data_width
Definition ad469x.h:269
struct no_os_gpio_init_param * gpio_resetn
Definition ad469x.h:259
bool temp_enabled
Definition ad469x.h:287
uint32_t axi_clkgen_rate
Definition ad469x.h:256
uint8_t reg_data_width
Definition ad469x.h:267
bool enable_extended_init
Definition ad469x.h:289
struct no_os_pwm_init_param * trigger_pwm_init
Definition ad469x.h:252
void(* dcache_invalidate_range)(uint32_t address, uint32_t bytes_count)
Definition ad469x.h:283
struct axi_clkgen_init * clkgen_init
Definition ad469x.h:254
enum ad469x_supported_dev_ids dev_id
Definition ad469x.h:271
struct no_os_gpio_init_param * gpio_convst
Definition ad469x.h:261
Definition clk_axi_clkgen.h:44
Definition clk_axi_clkgen.h:38
Definition ad9361_util.h:63
Structure holding the GPIO descriptor.
Definition no_os_gpio.h:84
Structure holding the parameters for GPIO initialization.
Definition no_os_gpio.h:67
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:131