no-OS
Loading...
Searching...
No Matches
ad5706r.h
Go to the documentation of this file.
1/***************************************************************************/
32#ifndef AD5706R_H_
33#define AD5706R_H_
34
35/******************************************************************************/
36/***************************** Include Files **********************************/
37/******************************************************************************/
38#include <stdint.h>
39#include <stdbool.h>
40#include "no_os_gpio.h"
41#include "no_os_spi.h"
42#include "no_os_crc8.h"
43
44/******************************************************************************/
45/********************** Macros and Constants Definitions **********************/
46/******************************************************************************/
47
48#define AD5706R_R1B (1ul << 16) /* 1-byte register address */
49#define AD5706R_R2B (2ul << 16) /* 2-byte register address */
50#define AD5706R_LEN(x) (x >> 16) /* Get register byte length */
51#define AD5706R_ADDR(x) (x & 0xFFFF)
52#define AD5706R_ADDR_MD(x) (x & 0x0FFF) /* Reg Addr exclude MD Addr */
53#define AD5706R_MD_ADDR_MASK NO_OS_GENMASK(1, 0)
54#define AD5706R_MD_ADDR(x) ((x & AD5706R_MD_ADDR_MASK) << 4)
55
56#define AD5706R_READ_BIT NO_OS_BIT(7)
57#define AD5706R_ADDR_MASK (~AD5706R_READ_BIT)
58#define AD5706R_WRITE_BIT_LONG_INSTR 0x00
59#define AD5706R_CRC_POLY 0x07
60#define AD5706R_CRC_SEED 0xA5
61#define AD5706R_SCRATCH_PAD_TEST_VAL 0x6A
62
63#define AD5706R_MULTIBYTE_REG_START 0x14
64#define AD5706R_MULTIBYTE_REG_END 0x71
65
66/*
67 * AD5706R Registers Addresses
68 */
69#define AD5706R_REG_INTERFACE_CONFIG_A (AD5706R_R1B | 0x00)
70#define AD5706R_REG_INTERFACE_CONFIG_B (AD5706R_R1B | 0x01)
71#define AD5706R_REG_DEVICE_CONFIG (AD5706R_R1B | 0x02)
72#define AD5706R_REG_CHIP_TYPE (AD5706R_R1B | 0x03)
73#define AD5706R_REG_PRODUCT_ID_L (AD5706R_R1B | 0x04)
74#define AD5706R_REG_PRODUCT_ID_H (AD5706R_R1B | 0x05)
75#define AD5706R_REG_CHIP_GRADE (AD5706R_R1B | 0x06)
76#define AD5706R_REG_DEVICE_INDEX (AD5706R_R1B | 0x09)
77#define AD5706R_REG_SCRATCH_PAD (AD5706R_R1B | 0x0A)
78#define AD5706R_REG_SPI_REVISION (AD5706R_R1B | 0x0B)
79#define AD5706R_REG_VENDOR_L (AD5706R_R1B | 0x0C)
80#define AD5706R_REG_VENDOR_H (AD5706R_R1B | 0x0D)
81#define AD5706R_REG_STREAM_MODE (AD5706R_R1B | 0x0E)
82#define AD5706R_REG_TRANSFER_CONFIG (AD5706R_R1B | 0x0F)
83#define AD5706R_REG_INTERFACE_CONFIG_C (AD5706R_R1B | 0x10)
84#define AD5706R_REG_INTERFACE_STATUS_A (AD5706R_R1B | 0x11)
85
86/*
87 * AD5706R DAC Configuration Registers
88 */
89#define AD5706R_REG_MULTI_DAC_CH_SEL (AD5706R_R2B | 0x14)
90#define AD5706R_REG_LDAC_SYNC_ASYNC (AD5706R_R2B | 0x16)
91#define AD5706R_REG_LDAC_HW_SW (AD5706R_R2B | 0x18)
92#define AD5706R_REG_LDAC_EDGE_SEL_CH(x) (AD5706R_R2B | (0x1A + (x * 2)))
93#define AD5706R_REG_OUT_OPERATING_MODE (AD5706R_R2B | 0x22)
94#define AD5706R_REG_OUT_SWITCH_EN (AD5706R_R2B | 0x24)
95#define AD5706R_REG_HW_SHUTDOWN_EN (AD5706R_R2B | 0x26)
96#define AD5706R_REG_OUT_RANGE_CH(x) (AD5706R_R2B | (0x28 + (x * 2)))
97#define AD5706R_REG_FUNC_EN (AD5706R_R2B | 0x30)
98#define AD5706R_REG_FUNC_MODE_SEL_CH(x) (AD5706R_R2B | (0x32 + (x * 2)))
99#define AD5706R_REG_FUNC_DAC_INPUT_B_CH(x) (AD5706R_R2B | (0x3A + (x * 2)))
100#define AD5706R_REG_FUNC_DITHER_PERIOD_CH(x) (AD5706R_R2B | (0x42 + (x * 2)))
101#define AD5706R_REG_FUNC_DITHER_PHASE_CH(x) (AD5706R_R2B | (0x4A + (x * 2)))
102#define AD5706R_REG_MUX_OUT_SEL (AD5706R_R2B | 0x54)
103#define AD5706R_REG_MUX_OUT_CONTROL (AD5706R_R2B | 0x56)
104#define AD5706R_REG_TEMP_WARN_INT_EN (AD5706R_R2B | 0x58)
105#define AD5706R_REG_MULTI_DAC_SW_LDAC (AD5706R_R2B | 0x5A)
106#define AD5706R_REG_MULTI_DAC_INPUT_A (AD5706R_R2B | 0x5C)
107#define AD5706R_REG_DAC_SW_LDAC (AD5706R_R2B | 0x5E)
108#define AD5706R_REG_DAC_INPUT_A_CH(x) (AD5706R_R2B | (0x60 + (x * 2)))
109#define AD5706R_REG_DAC_DATA_READBACK_CH(x) (AD5706R_R2B | (0x68 + (x * 2)))
110#define AD5706R_REG_TEMP_WARN_STAT (AD5706R_R2B | 0x70)
111
112#define AD5706R_REG_DIGITAL_STATUS (AD5706R_R1B | 0x72)
113#define AD5706R_REG_BANDGAP_CONTROL (AD5706R_R1B | 0x73)
114#define AD5706R_REG_USER_SPARE_0 (AD5706R_R1B | 0x74)
115#define AD5706R_REG_USER_SPARE_1 (AD5706R_R1B | 0x75)
116#define AD5706R_REG_USER_SPARE_2 (AD5706R_R1B | 0x76)
117#define AD5706R_REG_USER_SPARE_3 (AD5706R_R1B | 0x77)
118
119/*
120 * AD5706R_REG_INTERFACE_CONFIG_A
121 */
122#define AD5706R_INT_CONFIG_A_SW_RESET_MASK (NO_OS_BIT(7) | NO_OS_BIT(0))
123#define AD5706R_INT_CONFIG_A_ADDR_ASC_MASK NO_OS_BIT(5)
124#define AD5706R_INT_CONFIG_A_SDO_EN_MASK NO_OS_BIT(4)
125
126/*
127 * AD5706R_REG_INTERFACE_CONFIG_B
128 */
129#define AD5706R_INT_CONFIG_B_SINGLE_INSTR_MASK NO_OS_BIT(7)
130#define AD5706R_INT_CONFIG_B_SHORT_INSTR_MASK NO_OS_BIT(3)
131
132/*
133 * AD5706R_REG_DEVICE_CONFIG
134 */
135#define AD5706R_DEVICE_CONFIG_OPERATING_MODE NO_OS_GENMASK(1, 0)
136
137/*
138 * AD5706R_REG_CHIP_TYPE
139 */
140#define AD5706R_CHIP_TYPE_MASK NO_OS_GENMASK(3, 0)
141#define AD5706R_CHIP_TYPE 0x4
142
143/*
144 * AD5706R_REG_PRODUCT_ID
145 */
146#define AD5706R_PRODUCT_ID_L 0x30
147#define AD5706R_PRODUCT_ID_H 0x41
148
149/*
150 * AD5706R_REG_CHIP_GRADE
151 */
152#define AD5706R_CHIP_GRADE_MASK NO_OS_GENMASK(7, 4)
153#define AD5706R_CHIP_GRADE 0x0
154#define AD5706R_DEVICE_REV_MASK NO_OS_GENMASK(3, 0)
155#define AD5706R_DEVICE_REV 0x0
156
157/*
158 * AD5706R_REG_SPI_REVISION
159 */
160#define AD5706R_SPI_TYPE_MASK NO_OS_GENMASK(7, 6)
161#define AD5706R_SPI_TYPE 0x2
162#define AD5706R_SPI_VER_MASK NO_OS_GENMASK(5, 0)
163#define AD5706R_SPI_VER 0x4
164
165/*
166 * AD5706R_REG_VENDOR_ID
167 */
168#define AD5706R_VENDOR_ID_L 0x56
169#define AD5706R_VENDOR_ID_H 0x04
170
171/*
172 * AD5706R_REG_TRANSFER_CONFIG
173 */
174#define AD5706R_TRANSFER_CONFIG_MASK NO_OS_BIT(2)
175
176/*
177 * AD5706R_REG_INTERFACE_CONFIG_C
178 */
179#define AD5706R_CRC_ENABLE_MASK (NO_OS_GENMASK(7, 6) | NO_OS_GENMASK(1, 0))
180#define AD5706R_INT_CONFIG_C_STRICT_INSTR_MASK NO_OS_BIT(3)
181
182/*
183 * AD5706R_REG_INTERFACE_STATUS_A
184 */
185#define AD5706R_NOT_READY_ERR_MASK NO_OS_BIT(7)
186#define AD5706R_CLK_COUNT_ERR_MASK NO_OS_BIT(4)
187#define AD5706R_CRC_ERR_MASK NO_OS_BIT(3)
188#define AD5706R_WRITE_TO_READ_ONLY_REG_ERR_MASK NO_OS_BIT(2)
189#define AD5706R_REG_PARTIAL_ACC_ERR_MASK NO_OS_BIT(1)
190#define AD5706R_ADDR_INV_ERR_MASK NO_OS_BIT(0)
191
192/*
193 * AD5706R_REG_MULTI_DAC_CH_SEL
194 */
195#define AD5706R_MULTI_DAC_CH_SEL_MASK NO_OS_GENMASK(3, 0)
196#define AD5706R_MULTI_DAC_CH_SEL_MODE(x, ch) (((x) & 0x1) << (ch))
197
198/*
199 * AD5706R_REG_LDAC_SYNC_ASYNC
200 */
201#define AD5706R_REG_LDAC_SYNC_ASYNC_MASK NO_OS_GENMASK(3, 0)
202
203/*
204 * AD5706R_REG_LDAC_HW_SW
205 */
206#define AD5706R_LDAC_HW_SW_MASK NO_OS_GENMASK(3, 0)
207
208/*
209 * AD5706R_REG_LDAC_EDGE_SEL_CHn
210 */
211#define AD5706R_LDAC_EDGE_SEL_CH_MASK NO_OS_GENMASK(1, 0)
212
213/*
214 * AD5706R_REG_OUT_OPERATING_MODE
215 */
216#define AD5706R_OUT_OPERATING_MASK NO_OS_GENMASK(3, 0)
217#define AD5706R_OUT_OPERATING_MODE(x, ch) (((x) & 0x1) << (ch))
218
219/*
220 * AD5706R_REG_OUT_SWITCH_EN
221 */
222#define AD5706R_OUT_SWITCH_EN_MASK NO_OS_GENMASK(3, 0)
223#define AD5706R_OUT_SWITCH_EN_MODE(x, ch) (((x) & 0x1) << (ch))
224
225/*
226 * AD5706R_REG_HW_SHUTDOWN_EN
227 */
228#define AD5706R_HW_SHUTDOWN_EN_MASK NO_OS_GENMASK(3, 0)
229#define AD5706R_HW_SHUTDOWN_EN_MODE(x, ch) (((x) & 0x1) << (ch))
230
231/*
232 * AD5706R_REG_OUT_RANGE_CHn
233 */
234#define AD5706R_OUT_RANGE_CHn_MASK NO_OS_GENMASK(1, 0)
235
236/*
237 * AD5706R_REG_FUNC_EN
238 */
239#define AD5706R_FUNC_EN_MASK NO_OS_GENMASK(3, 0)
240
241/*
242 * AD5706R_REG_FUNC_MODE_SEL_CHn
243 */
244#define AD5706R_FUNC_MODE_SEL_CHn NO_OS_BIT(0)
245
246/*
247 * AD5706R_REG_FUNC_DITHER_PERIOD_CHn
248 */
249#define AD5706R_FUNC_DITHER_PERIOD_CHn_MASK NO_OS_GENMASK(2, 0)
250
251/*
252 * AD5706R_REG_FUNC_DITHER_PHASE_CHn
253 */
254#define AD5706R_FUNC_DITHER_PHASE_CHn_MASK NO_OS_GENMASK(1, 0)
255
256/*
257 * AD5706R_REG_MUX_OUT_SEL
258 */
259#define AD5706R_MUX_OUT_EN NO_OS_BIT(7)
260#define AD5706R_MUX_PARAM_SEL_MASK NO_OS_GENMASK(4, 0)
261
262/*
263 * AD5706R_REG_MUX_OUT_CONTROL
264 */
265#define AD5706R_MUX_OUT_BUFFER_EN NO_OS_BIT(0)
266
267/*
268 * AD5706R_REG_TEMP_WARN_INT_EN
269 */
270#define AD5706R_TEMP_WARN_INT_CHn_EN_MASK NO_OS_GENMASK(3, 0)
271#define AD5706R_TEMP_WARN_INT_CHn_EN(x, ch) (((x) & 0x1) << (ch))
272
273/*
274 * AD5706R_REG_MULTI_DAC_SW_LDAC
275 */
276#define AD5706R_MULTI_DAC_SW_LDAC_TRIG NO_OS_BIT(0)
277
278/*
279 * AD5706R_REG_DAC_SW_LDAC
280 */
281#define AD5706R_DAC_SW_LDAC_MASK NO_OS_GENMASK(3, 0)
282
283/*
284 * AD5706R_REG_DIGITAL_STATUS
285 */
286#define AD5706R_INTERFACE_ERR NO_OS_BIT(2)
287#define AD5706R_POWERUP_COMPLETED NO_OS_BIT(1)
288#define AD5706R_RESET_OCCURRED NO_OS_BIT(0)
289
290/*
291 * AD5706R_REG_BANDGAP_CONTROL
292 */
293#define AD5706R_BANDGAP_CONTROL_EN NO_OS_BIT(0)
294
295/* Useful defines */
296#define AD5706R_CRC_ENABLE_VALUE (NO_OS_BIT(6) | NO_OS_BIT(1))
297#define AD5706R_CRC_DISABLE_VALUE NO_OS_GENMASK(1, 0)
298#define AD5706R_NUM_CH 4
299#define AD5706R_MAX_MD_ADDR 0x03
300#define AD5706R_REG_ADDR_MAX 0x77
301#define AD5706R_LDAC_PULSE_US 1
302#define AD5706R_CHANNEL_SEL(ch) NO_OS_BIT(ch)
303#define AD5706R_INTF_CFG_A_DEFAULT 0x10
304#define AD5706R_PRODUCT_ID ((AD5706R_PRODUCT_ID_H << 8) | (AD5706R_PRODUCT_ID_L))
305
306/******************************************************************************/
307/*************************** Types Declarations *******************************/
308
325
335
341 /* External source with Vref I/O as input */
343 /* Internal source with Vref I/O at 2.5V */
345};
346
359
372
403
417
432
443
454
471
486
499
502 bool short_instr; /* for 7-bit addressing */
503 bool single_instr; /* for multibyte read/write */
504 bool stream_length_keep_value; /* to keep stream length */
506};
507
509 /* Enable function generator mask. */
510 uint16_t func_en_mask;
511 /* Function generator mode select. */
513 /* LDAC sync/async mask. */
515 /* LDAC HW/SW mask. */
517 /* LDAC/TGP/DCLK edge trig */
519 /* Dither period setting. */
521 /* Dither phase setting. */
523 /* Multi-DAC channel mask. */
525};
526
528 /* Starting address for transfer */
529 uint8_t addr;
530 /* Data to transfer */
531 uint8_t *data;
532 /* Size of data to transfer */
533 uint32_t len;
534 /* Read transaction if true, write transfer otherwise */
536 /* If NULL will be default or last configured will be used */
538};
539
541 /* SPI */
543 /* GPIO */
554 bool crc_en;
556 /* Device SPI Settings */
558 /* LDAC Settings */
560 /* Device Address Settings */
561 uint8_t dev_addr;
562 /* Monitor MUX Mode Setting */
564 /* Monitor MUX parameter select */
566};
567
569 /* SPI */
571 /* GPIO */
582 bool crc_en;
583 /* Device SPI Settings */
585 /* DAC Mode Initialization per channel */
587 /* LDAC Settings */
589 /* Device Address Settings */
590 uint8_t dev_addr;
591 /* Monitor MUX Mode Setting */
593 /* Monitor MUX parameter select */
595};
596
598int ad5706r_spi_reg_read(struct ad5706r_dev *dev, uint32_t reg_addr,
599 uint16_t *reg_data);
600
603 uint32_t start_addr,
604 uint8_t count,
605 uint8_t *buff);
606
608int ad5706r_spi_reg_write(struct ad5706r_dev *dev, uint32_t reg_addr,
609 uint16_t reg_data);
610
613 uint32_t start_addr,
614 uint8_t count,
615 uint8_t *buff);
616
618int ad5706r_spi_write_mask(struct ad5706r_dev *dev,
619 uint32_t reg_addr,
620 uint32_t mask,
621 uint16_t data);
622
624int ad5706r_set_reference(struct ad5706r_dev *dev,
625 enum ad5706r_vref_select reference_selector);
626
629 enum ad5706r_channels chan_sel,
630 enum ad5706r_output_op_mode op_mode);
631
634 enum ad5706r_channels chan_sel,
635 enum ad5706r_output_range range_sel);
636
638int ad5706r_func_en(struct ad5706r_dev *dev, uint16_t en_mask);
639
642 enum ad5706r_channels chan_sel,
643 enum ad5706r_function_mode func_mode_sel);
644
647 enum ad5706r_channels ch,
648 enum ad5706r_dither_period period);
649
652 enum ad5706r_channels ch,
653 enum ad5706r_dither_phase phase);
654
656int ad5706r_set_hw_sw_ldac(struct ad5706r_dev *dev, uint16_t mask_hw_sw_ldac);
657
660 uint16_t mask_ldac_sync_async);
661
664 enum ad5706r_channels chn,
665 enum ad5706r_dac_mode dac_mode,
666 struct ad5706r_ldac_settings *ldac_settings);
667
670
673 uint16_t ch_mask,
674 enum ad5706r_dac_mode dac_mode,
675 struct ad5706r_ldac_settings *ldac_settings);
676
679 enum ad5706r_channels chn,
680 uint16_t dac_value);
681
684 enum ad5706r_channels chn,
685 uint16_t dac_value);
686
689 uint16_t dac_value);
690
693 enum ad5706r_mux_out_state mux_output_mode_sel);
694
697 enum ad5706r_mux_out_select mux_output_sel);
698
700int ad5706r_hw_ldac_trigger(struct ad5706r_dev *dev);
701
704 enum ad5706r_channels chn,
705 enum ad5706r_ldac_edge_trig trig_edge);
706
708int ad5706r_sw_ldac_trigger(struct ad5706r_dev *dev);
709
711int ad5706r_sw_reset(struct ad5706r_dev *dev);
712
714int ad5706r_hw_reset(struct ad5706r_dev *dev);
715
717int ad5706r_device_config(struct ad5706r_dev *dev,
719
721int ad5706r_set_device_spi(struct ad5706r_dev *dev,
722 struct ad5706r_device_spi_settings *spi_settings);
723
725int ad5706r_crc_enable(struct ad5706r_dev *dev, bool crc_enable);
726
728int ad5706r_shdn_trigger(struct ad5706r_dev *dev, bool shdn_state);
729
731int ad5706r_init(struct ad5706r_dev **device,
733
735int ad5706r_remove(struct ad5706r_dev *dev);
736
737#endif /* AD5706R_H_ */
int ad5706r_init(struct ad5706r_dev **device, struct ad5706r_init_param *init_param)
Initialize the device.
Definition ad5706r.c:1691
ad5706r_vref_select
Voltage reference options.
Definition ad5706r.h:340
@ AD5706R_EXTERNAL_VREF_PIN_INPUT
Definition ad5706r.h:342
@ AD5706R_INTERNAL_VREF_PIN_2P5V
Definition ad5706r.h:344
#define AD5706R_NUM_CH
Definition ad5706r.h:298
ad5706r_output_range
AD5706R list of output range.
Definition ad5706r.h:422
@ AD5706R_200mA
Definition ad5706r.h:428
@ AD5706R_150mA
Definition ad5706r.h:426
@ AD5706R_50mA
Definition ad5706r.h:424
@ AD5706R_300mA
Definition ad5706r.h:430
ad5706r_ldac_edge_trig
AD5706R hardware LDAC edge select options.
Definition ad5706r.h:351
@ AD5706R_FALLING_EDGE_TRIG
Definition ad5706r.h:355
@ AD5706R_ANY_EDGE_TRIG
Definition ad5706r.h:357
@ AD5706R_RISING_EDGE_TRIG
Definition ad5706r.h:353
int ad5706r_set_dither_phase(struct ad5706r_dev *dev, enum ad5706r_channels ch, enum ad5706r_dither_phase phase)
Set phase for dither function generator.
Definition ad5706r.c:789
int ad5706r_sw_reset(struct ad5706r_dev *dev)
Perform soft reset.
Definition ad5706r.c:1422
ad5706r_dither_period
AD5706R list of dither function period settings.
Definition ad5706r.h:459
@ AD5706R_SAMPLES_4
Definition ad5706r.h:461
@ AD5706R_SAMPLES_8
Definition ad5706r.h:463
@ AD5706R_SAMPLES_64
Definition ad5706r.h:469
@ AD5706R_SAMPLES_16
Definition ad5706r.h:465
@ AD5706R_SAMPLES_32
Definition ad5706r.h:467
ad5706r_dac_resolution
AD5706R list of supported data resolution.
Definition ad5706r.h:330
@ AD5706R_12_BIT_RESOLUTION
Definition ad5706r.h:332
@ AD5706R_16_BIT_RESOLUTION
Definition ad5706r.h:331
@ AD5706R_10_BIT_RESOLUTION
Definition ad5706r.h:333
int ad5706r_sw_ldac_trigger(struct ad5706r_dev *dev)
Trigger the LDAC using software.
Definition ad5706r.c:1378
int ad5706r_set_dac_b_value(struct ad5706r_dev *dev, enum ad5706r_channels chn, uint16_t dac_value)
Set dac value on DAC input register B.
Definition ad5706r.c:1203
int ad5706r_shdn_trigger(struct ad5706r_dev *dev, bool shdn_state)
Set SHDN pin state.
Definition ad5706r.c:1646
int ad5706r_set_operating_mode(struct ad5706r_dev *dev, enum ad5706r_channels chan_sel, enum ad5706r_output_op_mode op_mode)
Set output operating mode of a channel.
Definition ad5706r.c:574
int ad5706r_set_multi_ldac_config(struct ad5706r_dev *dev, uint16_t ch_mask, enum ad5706r_dac_mode dac_mode, struct ad5706r_ldac_settings *ldac_settings)
Set ldac config for multiple channels.
Definition ad5706r.c:1027
ad5706r_function_mode
AD5706R list of function modes.
Definition ad5706r.h:448
@ AD5706R_DITHER
Definition ad5706r.h:452
@ AD5706R_TOGGLE
Definition ad5706r.h:450
int ad5706r_spi_reg_write(struct ad5706r_dev *dev, uint32_t reg_addr, uint16_t reg_data)
Write to device.
Definition ad5706r.c:394
int ad5706r_spi_write_mask(struct ad5706r_dev *dev, uint32_t reg_addr, uint32_t mask, uint16_t data)
SPI write to device using a mask.
Definition ad5706r.c:507
ad5706r_channels
AD5706R list of channels.
Definition ad5706r.h:313
@ AD5706R_CH1
Definition ad5706r.h:317
@ AD5706R_CH2
Definition ad5706r.h:319
@ AD5706R_CH_MAX
Definition ad5706r.h:323
@ AD5706R_CH0
Definition ad5706r.h:315
@ AD5706R_CH3
Definition ad5706r.h:321
int ad5706r_device_config(struct ad5706r_dev *dev, struct ad5706r_init_param *init_param)
Configures the device.
Definition ad5706r.c:1498
int ad5706r_set_edge_trigger(struct ad5706r_dev *dev, enum ad5706r_channels chn, enum ad5706r_ldac_edge_trig trig_edge)
Set LDAC/TGP/DCLK edge trigger.
Definition ad5706r.c:1352
int ad5706r_multi_dac_sw_ldac_trigger(struct ad5706r_dev *dev)
Trigger Multi DAC SW LDAC.
Definition ad5706r.c:1001
ad5706r_output_op_mode
AD5706R hardware-software LDAC select options.
Definition ad5706r.h:364
@ AD5706R_SHUTDOWN_HW
Definition ad5706r.h:368
@ AD5706R_SHUTDOWN_SW_W_GND
Definition ad5706r.h:366
@ AD5706R_SHUTDOWN_SW
Definition ad5706r.h:365
@ AD5706R_NORMAL_HW
Definition ad5706r.h:370
@ AD5706R_NORMAL_SW
Definition ad5706r.h:367
@ AD5706R_SHUTDOWN_HW_W_GND
Definition ad5706r.h:369
int ad5706r_set_sync_async_ldac(struct ad5706r_dev *dev, uint16_t mask_ldac_sync_async)
Set sync/async ldac configuration.
Definition ad5706r.c:840
int ad5706r_hw_reset(struct ad5706r_dev *dev)
Perform hard reset.
Definition ad5706r.c:1445
int ad5706r_set_dac_a_value(struct ad5706r_dev *dev, enum ad5706r_channels chn, uint16_t dac_value)
Set dac value on DAC input register A.
Definition ad5706r.c:1184
int ad5706r_hw_ldac_trigger(struct ad5706r_dev *dev)
Trigger the LDAC using hardware.
Definition ad5706r.c:1326
int ad5706r_set_multi_dac_a_value(struct ad5706r_dev *dev, uint16_t dac_value)
Set dac value on Multi DAC input register A.
Definition ad5706r.c:1222
int ad5706r_set_hw_sw_ldac(struct ad5706r_dev *dev, uint16_t mask_hw_sw_ldac)
Set the hardware and software ldac configuration.
Definition ad5706r.c:815
int ad5706r_spi_reg_write_multiple(struct ad5706r_dev *dev, uint32_t start_addr, uint8_t count, uint8_t *buff)
Write multiple register's values.
Definition ad5706r.c:460
int ad5706r_remove(struct ad5706r_dev *dev)
Free the device descriptor.
Definition ad5706r.c:1841
ad5706r_hw_sw_trig
AD5706R HW or SW trigger mode.
Definition ad5706r.h:437
@ AD5706R_SW_TRIG
Definition ad5706r.h:441
@ AD5706R_HW_TRIG
Definition ad5706r.h:439
int ad5706r_set_mux_out_mode(struct ad5706r_dev *dev, enum ad5706r_mux_out_state mux_output_mode_sel)
Set the multiplexer output mode.
Definition ad5706r.c:1242
int ad5706r_func_en(struct ad5706r_dev *dev, uint16_t en_mask)
Set the function generator enable configuration.
Definition ad5706r.c:697
int ad5706r_func_mode_select(struct ad5706r_dev *dev, enum ad5706r_channels chan_sel, enum ad5706r_function_mode func_mode_sel)
Set function generator mode for a channel.
Definition ad5706r.c:725
ad5706r_mux_out_select
Signals to monitor on MUX_OUT pin.
Definition ad5706r.h:377
@ AD5706R_MUXIN1
Definition ad5706r.h:399
@ AD5706R_TDIODE2
Definition ad5706r.h:396
@ AD5706R_VOUT0
Definition ad5706r.h:382
@ AD5706R_TDIODE3
Definition ad5706r.h:397
@ AD5706R_PVDD3
Definition ad5706r.h:393
@ AD5706R_TDIODE0
Definition ad5706r.h:394
@ AD5706R_AGND
Definition ad5706r.h:378
@ AD5706R_VOUT1
Definition ad5706r.h:383
@ AD5706R_MUXIN2
Definition ad5706r.h:400
@ AD5706R_VOUT2
Definition ad5706r.h:384
@ AD5706R_AGND_SPARE
Definition ad5706r.h:381
@ AD5706R_AVDD
Definition ad5706r.h:379
@ AD5706R_PVDD0
Definition ad5706r.h:390
@ AD5706R_VERVREF
Definition ad5706r.h:380
@ AD5706R_IOUT0
Definition ad5706r.h:386
@ AD5706R_PVDD1
Definition ad5706r.h:391
@ AD5706R_VOUT3
Definition ad5706r.h:385
@ AD5706R_IOUT1
Definition ad5706r.h:387
@ AD5706R_IOUT2
Definition ad5706r.h:388
@ AD5706R_TDIODE1
Definition ad5706r.h:395
@ AD5706R_MUXIN0
Definition ad5706r.h:398
@ AD5706R_IOUT3
Definition ad5706r.h:389
@ AD5706R_PVDD2
Definition ad5706r.h:392
@ AD5706R_MUXIN3
Definition ad5706r.h:401
int ad5706r_spi_reg_read(struct ad5706r_dev *dev, uint32_t reg_addr, uint16_t *reg_data)
Read from device.
Definition ad5706r.c:264
int ad5706r_set_device_spi(struct ad5706r_dev *dev, struct ad5706r_device_spi_settings *spi_settings)
Set device spi settings.
Definition ad5706r.c:1551
int ad5706r_set_reference(struct ad5706r_dev *dev, enum ad5706r_vref_select reference_selector)
Set reference configuration.
Definition ad5706r.c:541
int ad5706r_set_mux_out_select(struct ad5706r_dev *dev, enum ad5706r_mux_out_select mux_output_sel)
Set the multiplexer output select register.
Definition ad5706r.c:1302
ad5706r_mux_out_state
AD5706R list of MUX Out states.
Definition ad5706r.h:491
@ AD5706R_HIGH_Z
Definition ad5706r.h:493
@ AD5706R_BUFFER
Definition ad5706r.h:497
@ AD5706R_BYPASS
Definition ad5706r.h:495
int ad5706r_crc_enable(struct ad5706r_dev *dev, bool crc_enable)
Configures the CRC selection bit .
Definition ad5706r.c:1618
ad5706r_dac_mode
DAC modes.
Definition ad5706r.h:408
@ AD5706R_HW_LDAC
Definition ad5706r.h:411
@ AD5706R_SW_DITHER
Definition ad5706r.h:414
@ AD5706R_DIRECT_WRITE_REG
Definition ad5706r.h:409
@ AD5706R_HW_TOGGLE
Definition ad5706r.h:413
@ AD5706R_HW_DITHER
Definition ad5706r.h:415
@ AD5706R_SW_TOGGLE
Definition ad5706r.h:412
@ AD5706R_SW_LDAC
Definition ad5706r.h:410
int ad5706r_spi_reg_read_multiple(struct ad5706r_dev *dev, uint32_t start_addr, uint8_t count, uint8_t *buff)
Read multiple register's values.
Definition ad5706r.c:347
int ad5706r_set_ch_output_range(struct ad5706r_dev *dev, enum ad5706r_channels chan_sel, enum ad5706r_output_range range_sel)
Set output range for a channel.
Definition ad5706r.c:670
ad5706r_dither_phase
AD5706R list of dither function phase settings.
Definition ad5706r.h:476
@ AD5706R_DEGREES_180
Definition ad5706r.h:482
@ AD5706R_DEGREES_0
Definition ad5706r.h:478
@ AD5706R_DEGREES_270
Definition ad5706r.h:484
@ AD5706R_DEGREES_90
Definition ad5706r.h:480
int ad5706r_set_ldac_config(struct ad5706r_dev *dev, enum ad5706r_channels chn, enum ad5706r_dac_mode dac_mode, struct ad5706r_ldac_settings *ldac_settings)
Set ldac config for single channel.
Definition ad5706r.c:875
int ad5706r_set_dither_period(struct ad5706r_dev *dev, enum ad5706r_channels ch, enum ad5706r_dither_period period)
Set period for dither function generator.
Definition ad5706r.c:758
struct ad7616_init_param init_param
Definition ad7616_sdz.c:107
Header file of CRC-8 computation.
#define NO_OS_CRC8_TABLE_SIZE
Definition no_os_crc8.h:39
Header file of GPIO Interface.
Header file of SPI Interface.
Definition ad5706r.h:540
struct no_os_gpio_desc * gpio_shdn
Definition ad5706r.h:546
struct ad5706r_ldac_settings ldac_cfg
Definition ad5706r.h:559
struct ad5706r_device_spi_settings spi_cfg
Definition ad5706r.h:557
enum ad5706r_mux_out_select mux_out_sel
Definition ad5706r.h:565
enum ad5706r_output_range range[AD5706R_NUM_CH]
Definition ad5706r.h:552
uint8_t dev_addr
Definition ad5706r.h:561
enum ad5706r_mux_out_state mux_out_mode
Definition ad5706r.h:563
bool crc_en
Definition ad5706r.h:554
enum ad5706r_vref_select vref_enable
Definition ad5706r.h:548
uint8_t crc_table[NO_OS_CRC8_TABLE_SIZE]
Definition ad5706r.h:555
enum ad5706r_output_op_mode op_mode[AD5706R_NUM_CH]
Definition ad5706r.h:550
struct no_os_spi_desc * spi_desc
Definition ad5706r.h:542
struct no_os_gpio_desc * gpio_reset
Definition ad5706r.h:545
struct no_os_gpio_desc * gpio_ldac_tgp
Definition ad5706r.h:544
Definition ad5706r.h:500
bool short_instr
Definition ad5706r.h:502
bool addr_asc
Definition ad5706r.h:501
uint8_t stream_mode_length
Definition ad5706r.h:505
bool single_instr
Definition ad5706r.h:503
bool stream_length_keep_value
Definition ad5706r.h:504
Definition ad5706r.h:568
enum ad5706r_mux_out_select mux_out_sel
Definition ad5706r.h:594
struct no_os_spi_init_param * spi_init_prm
Definition ad5706r.h:570
struct no_os_gpio_init_param * gpio_reset
Definition ad5706r.h:573
struct no_os_gpio_init_param * gpio_ldac_tgp
Definition ad5706r.h:572
bool crc_en
Definition ad5706r.h:582
enum ad5706r_output_op_mode op_mode[AD5706R_NUM_CH]
Definition ad5706r.h:578
enum ad5706r_output_range range[AD5706R_NUM_CH]
Definition ad5706r.h:580
enum ad5706r_mux_out_state mux_out_mode
Definition ad5706r.h:592
struct no_os_gpio_init_param * gpio_shdn
Definition ad5706r.h:574
enum ad5706r_vref_select vref_enable
Definition ad5706r.h:576
struct ad5706r_ldac_settings ldac_cfg
Definition ad5706r.h:588
uint8_t dev_addr
Definition ad5706r.h:590
enum ad5706r_dac_mode dac_mode[AD5706R_NUM_CH]
Definition ad5706r.h:586
struct ad5706r_device_spi_settings spi_cfg
Definition ad5706r.h:584
Definition ad5706r.h:508
enum ad5706r_ldac_edge_trig edge_trig[AD5706R_NUM_CH]
Definition ad5706r.h:518
uint16_t func_en_mask
Definition ad5706r.h:510
enum ad5706r_function_mode func_mode[AD5706R_NUM_CH]
Definition ad5706r.h:512
uint16_t ldac_hw_sw_mask
Definition ad5706r.h:516
uint16_t ldac_sync_async_mask
Definition ad5706r.h:514
enum ad5706r_dither_phase dither_phase[AD5706R_NUM_CH]
Definition ad5706r.h:522
enum ad5706r_dither_period dither_period[AD5706R_NUM_CH]
Definition ad5706r.h:520
uint16_t multi_dac_ch_mask
Definition ad5706r.h:524
Definition ad5706r.h:527
bool is_read
Definition ad5706r.h:535
uint8_t * data
Definition ad5706r.h:531
uint8_t addr
Definition ad5706r.h:529
struct ad5706r_device_spi_settings * spi_cfg
Definition ad5706r.h:537
uint32_t len
Definition ad5706r.h:533
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 holding SPI descriptor.
Definition no_os_spi.h:180
Structure holding the parameters for SPI initialization.
Definition no_os_spi.h:128