no-OS
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ad3552r.h
Go to the documentation of this file.
1/**************************************************************************/
34
35#ifndef _AD3552R_H_
36#define _AD3552R_H_
37
38#include <stdint.h>
39#include <stdbool.h>
40#include "no_os_spi.h"
41#include "no_os_gpio.h"
42#include "no_os_crc8.h"
43
44/* Register addresses */
45/* Primary address space */
46#define AD3552R_REG_ADDR_INTERFACE_CONFIG_A 0x00
47#define AD3552R_MASK_SOFTWARE_RESET (NO_OS_BIT(7) | NO_OS_BIT(0))
48#define AD3552R_MASK_ADDR_ASCENSION NO_OS_BIT(5)
49#define AD3552R_MASK_SDO_ACTIVE NO_OS_BIT(4)
50#define AD3552R_REG_ADDR_INTERFACE_CONFIG_B 0x01
51#define AD3552R_MASK_SINGLE_INST NO_OS_BIT(7)
52#define AD3552R_MASK_SHORT_INSTRUCTION NO_OS_BIT(3)
53#define AD3552R_REG_ADDR_DEVICE_CONFIG 0x02
54#define AD3552R_MASK_DEVICE_STATUS(n) NO_OS_BIT(4 + (n))
55#define AD3552R_MASK_CUSTOM_MODES (NO_OS_BIT(3) | NO_OS_BIT(2))
56#define AD3552R_MASK_OPERATING_MODES NO_OS_GENMASK(1, 0)
57#define AD3552R_REG_ADDR_CHIP_TYPE 0x03
58#define AD3552R_MASK_CLASS NO_OS_GENMASK(7, 0)
59#define AD3552R_REG_ADDR_PRODUCT_ID_L 0x04
60#define AD3552R_REG_ADDR_PRODUCT_ID_H 0x05
61#define AD3552R_REG_ADDR_CHIP_GRADE 0x06
62#define AD3552R_MASK_GRADE NO_OS_GENMASK(7, 4)
63#define AD3552R_MASK_DEVICE_REVISION NO_OS_GENMASK(3, 0)
64#define AD3552R_REG_ADDR_SCRATCH_PAD 0x0A
65#define AD3552R_REG_ADDR_SPI_REVISION 0x0B
66#define AD3552R_REG_ADDR_VENDOR_L 0x0C
67#define AD3552R_REG_ADDR_VENDOR_H 0x0D
68#define AD3552R_REG_ADDR_STREAM_MODE 0x0E
69#define AD3552R_MASK_LENGTH 0xFF
70#define AD3552R_REG_ADDR_TRANSFER_REGISTER 0x0F
71#define AD3552R_MASK_MULTI_IO_MODE (NO_OS_BIT(7) | NO_OS_BIT(6))
72#define AD3552R_MASK_STREAM_LENGTH_KEEP_VALUE NO_OS_BIT(2)
73#define AD3552R_REG_ADDR_INTERFACE_CONFIG_C 0x10
74#define AD3552R_MASK_CRC_ENABLE (NO_OS_BIT(7) | NO_OS_BIT(6) | NO_OS_BIT(1) | NO_OS_BIT(0))
75#define AD3552R_MASK_STRICT_REGISTER_ACCESS NO_OS_BIT(5)
76#define AD3552R_REG_ADDR_INTERFACE_STATUS_A 0x11
77#define AD3552R_MASK_INTERFACE_NOT_READY NO_OS_BIT(7)
78#define AD3552R_MASK_CLOCK_COUNTING_ERROR NO_OS_BIT(5)
79#define AD3552R_MASK_INVALID_OR_NO_CRC NO_OS_BIT(3)
80#define AD3552R_MASK_WRITE_TO_READ_ONLY_REGISTER NO_OS_BIT(2)
81#define AD3552R_MASK_PARTIAL_REGISTER_ACCESS NO_OS_BIT(1)
82#define AD3552R_MASK_REGISTER_ADDRESS_INVALID NO_OS_BIT(0)
83#define AD3552R_REG_ADDR_INTERFACE_CONFIG_D 0x14
84#define AD3552R_MASK_ALERT_ENABLE_PULLUP NO_OS_BIT(6)
85#define AD3552R_MASK_MEM_CRC_EN NO_OS_BIT(4)
86#define AD3552R_MASK_SDO_DRIVE_STRENGTH (NO_OS_BIT(3) | NO_OS_BIT(2))
87#define AD3552R_MASK_DUAL_SPI_SYNCHROUNOUS_EN NO_OS_BIT(1)
88#define AD3552R_MASK_SPI_CONFIG_DDR NO_OS_BIT(0)
89#define AD3552R_REG_ADDR_SH_REFERENCE_CONFIG 0x15
90#define AD3552R_MASK_IDUMP_FAST_MODE NO_OS_BIT(6)
91#define AD3552R_MASK_SAMPLE_HOLD_DIFFERENTIAL_USER_EN NO_OS_BIT(5)
92#define AD3552R_MASK_SAMPLE_HOLD_USER_TRIM (NO_OS_BIT(4) | NO_OS_BIT(3))
93#define AD3552R_MASK_SAMPLE_HOLD_USER_ENABLE NO_OS_BIT(2)
94#define AD3552R_MASK_REFERENCE_VOLTAGE_SEL (NO_OS_BIT(1) | NO_OS_BIT(0))
95#define AD3552R_REG_ADDR_ERR_ALARM_MASK 0x16
96#define AD3552R_MASK_REF_RANGE_ALARM NO_OS_BIT(6)
97#define AD3552R_MASK_CLOCK_COUNT_ERR_ALARM NO_OS_BIT(5)
98#define AD3552R_MASK_MEM_CRC_ERR_ALARM NO_OS_BIT(4)
99#define AD3552R_MASK_SPI_CRC_ERR_ALARM NO_OS_BIT(3)
100#define AD3552R_MASK_WRITE_TO_READ_ONLY_ALARM NO_OS_BIT(2)
101#define AD3552R_MASK_PARTIAL_REGISTER_ACCESS_ALARM NO_OS_BIT(1)
102#define AD3552R_MASK_REGISTER_ADDRESS_INVALID_ALARM NO_OS_BIT(0)
103#define AD3552R_REG_ADDR_ERR_STATUS 0x17
104#define AD3552R_MASK_REF_RANGE_ERR_STATUS NO_OS_BIT(6)
105#define AD3552R_MASK_DUAL_SPI_STREAM_EXCEEDS_DAC_ERR_STATUS NO_OS_BIT(5)
106#define AD3552R_MASK_MEM_CRC_ERR_STATUS NO_OS_BIT(4)
107#define AD3552R_MASK_RESET_STATUS NO_OS_BIT(0)
108#define AD3552R_REG_ADDR_POWERDOWN_CONFIG 0x18
109#define AD3552R_MASK_CH_DAC_POWERDOWN(ch) NO_OS_BIT(4 + (ch))
110#define AD3552R_MASK_CH_AMPLIFIER_POWERDOWN(ch) NO_OS_BIT(ch)
111#define AD3552R_REG_ADDR_CH0_CH1_OUTPUT_RANGE 0x19
112#define AD3552R_MASK_CH_OUTPUT_RANGE_SEL(ch) ((ch) ? 0xF0 : 0xF)
113#define AD3552R_REG_ADDR_CH_OFFSET(ch) (0x1B + (ch) * 2)
114#define AD3552R_MASK_CH_OFFSET_BITS_0_7 0xFF
115#define AD3552R_REG_ADDR_CH_GAIN(ch) (0x1C + (ch) * 2)
116#define AD3552R_MASK_CH_RANGE_OVERRIDE NO_OS_BIT(7)
117#define AD3552R_MASK_CH_GAIN_SCALING_N (NO_OS_BIT(6) | NO_OS_BIT(5))
118#define AD3552R_MASK_CH_GAIN_SCALING_P (NO_OS_BIT(4) | NO_OS_BIT(3))
119#define AD3552R_MASK_CH_OFFSET_POLARITY NO_OS_BIT(2)
120#define AD3552R_MASK_CH_OFFSET_BIT_8 NO_OS_BIT(0)
121
122/*
123 * Secondary region
124 * For multibyte registers specify the highest address because the access is
125 * done in descending order
126 */
127#define AD3552R_SECONDARY_REGION_START 0x28
128#define AD3552R_REG_ADDR_HW_LDAC_16B 0x28
129#define AD3552R_REG_ADDR_CH_DAC_16B(ch) (0x2C - (1 - ch) * 2)
130#define AD3552R_REG_ADDR_DAC_PAGE_MASK_16B 0x2E
131#define AD3552R_REG_ADDR_CH_SELECT_16B 0x2F
132#define AD3552R_REG_ADDR_INPUT_PAGE_MASK_16B 0x31
133#define AD3552R_REG_ADDR_SW_LDAC_16B 0x32
134#define AD3552R_REG_ADDR_CH_INPUT_16B(ch) (0x36 - (1 - ch) * 2)
135/* 3 bytes registers */
136#define AD3552R_REG_START_24B 0x37
137#define AD3552R_REG_ADDR_HW_LDAC_24B 0x37
138#define AD3552R_REG_ADDR_CH_DAC_24B(ch) (0x3D - (1 - ch) * 3)
139#define AD3552R_REG_ADDR_DAC_PAGE_MASK_24B 0x40
140#define AD3552R_REG_ADDR_CH_SELECT_24B 0x41
141#define AD3552R_REG_ADDR_INPUT_PAGE_MASK_24B 0x44
142#define AD3552R_REG_ADDR_SW_LDAC_24B 0x45
143#define AD3552R_REG_ADDR_CH_INPUT_24B(ch) (0x4B - (1 - ch) * 3)
144
145#define AD3552R_REG_ADDR_MAX 0x4B
146
147/* Useful defines */
148#define AD3552R_MASK_CH(ch) NO_OS_BIT(ch)
149#define AD3552R_MASK_ALL_CH (NO_OS_BIT(0) | NO_OS_BIT(1))
150#define AD3552R_MASK_DAC_12B 0xFFF0
151#define AD3552R_REAL_BITS_PREC_MODE 16
152#define AD3552R_STORAGE_BITS_PREC_MODE 24
153#define AD3552R_REAL_BITS_FAST_MODE 12
154#define AD3552R_STORAGE_BITS_FAST_MODE 16
155#define AD3552R_MAX_OFFSET 511
156#define AD3552R_LDAC_PULSE_US 1
157#define AD3552R_BOTH_CH_SELECT (NO_OS_BIT(0) | NO_OS_BIT(1))
158#define AD3552R_BOTH_CH_DESELECT 0x0
159
160/* Maximum number of channels in this family of devices */
161#define AD3552R_MAX_NUM_CH 2
162
169
175
177 /* Internal source with Vref I/O floating */
179 /* Internal source with Vref I/O at 2.5V */
181 /* External source with Vref I/O as input */
183};
184
200
202 /* Range from 0 V to 2.5 V. Requires Rfb1x connection */
204 /* Range from 0 V to 5 V. Requires Rfb1x connection */
206 /* Range from 0 V to 10 V. Requires Rfb2x connection */
208 /* Range from -5 V to 5 V. Requires Rfb2x connection */
210 /* Range from -10 V to 10 V. Requires Rfb4x connection */
212};
213
215 /* Range from 0 V to 2.5 V. Requires Rfb1x connection */
217 /* Range from 0 V to 5 V. Requires Rfb1x connection */
219 /* Range from 0 V to 10 V. Requires Rfb2x connection */
221 /* Range from -5 V to 5 V. Requires Rfb2x connection */
223 /* Range from -2.5 V to 7.5 V. Requires Rfb2x connection */
225};
226
233
240
241#define AD3552R_CH_OUTPUT_RANGE_CUSTOM 100
242
244 /* Gain scaling of 1 */
246 /* Gain scaling of 0.5 */
248 /* Gain scaling of 0.25 */
250 /* Gain scaling of 0.125 */
252};
253
255 /* Positive offset */
257 /* Negative offset */
259};
260
262 /* Direct register values */
263 /* From 0-3 */
265 /*
266 * 0 -> Internal Vref, vref_io pin floating (default)
267 * 1 -> Internal Vref, vref_io driven by internal vref
268 * 2 or 3 -> External Vref
269 */
271 /* Enable / Disable CRC */
273#ifdef AD3552R_QSPI_IMPLEMENTED
274 /* Spi mode: Strandard, Dual or Quad */
275 AD3552R_SPI_MULTI_IO_MODE,
276 /* Spi data rate: Single or dual */
277 AD3552R_SPI_DATA_RATE,
278 /* Dual spi synchronous mode */
279 AD3552R_SPI_SYNCHRONOUS_ENABLE,
280#endif
281};
282
284 /* DAC powerdown */
286 /* DAC amplifier powerdown */
288 /* Select from enum ad3552r_ch_output_range or ad3542r_ch_output_range */
290 /*
291 * Over-rider the range selector in order to manually set the output
292 * voltage range
293 */
295 /* Manually set the offset voltage */
297 /* Sets the polarity of the offset. */
299 /* PDAC gain scaling */
301 /* NDAC gain scaling */
303 /* Trigger a software LDAC */
305 /* Hardware LDAC Mask */
307 /* Rfb value */
309 /* Write to fast regs (only 16 bits of data) */
311 /* Channel select. When set allow Input -> DAC and Mask -> DAC */
313 /* Raw value to be set to dac */
315};
316
318 /* Write to DAC registers. No need to trigger LDAC */
320 /* Write to input registers. User needs to trigger LDAC */
322 /* Write to input registers. LDAC is triggered by the driver */
324};
325
326/* By default all values are set to 0 */
328 /* Defines the length of the loop when streaming data */
330 /* Determines Sequential Addressing Behavior */
331 uint8_t addr_asc : 1;
332 /* Select Streaming or Single Instruction Mode */
333 uint8_t single_instr: 1;
334 /*
335 * Set this bit to prevent the STREAM_MODE LENGTH value from
336 * automatically resetting to zero
337 */
339#ifdef AD3552R_QSPI_IMPLEMENTED
340 /* Controls the SPI. Single (0), Dual (1), Quad (2)*/
341 uint8_t multi_io_mode : 2;
342 /*
343 * When this bIt is set, the DAC word is expected in
344 * Double Data Rate(DDR) configuration
345 */
346 uint8_t ddr : 1;
347 /*
348 * When this bit is set the SPI interface is expected as a dual
349 * synchronous configuration
350 */
351 uint8_t synchronous : 1;
352#endif
353};
354
356 /* Starting address for transfer */
357 uint8_t addr;
358 /* Data to transfer */
359 uint8_t *data;
360 /* Size of data to transfer */
361 uint32_t len;
362 /* Read transaction if true, write transfer otherwise */
363 uint8_t is_read : 1;
364 /* If NULL will be default or last configured will be used */
366};
367
369 int32_t scale_int;
370 int32_t scale_dec;
371 int32_t offset_int;
372 int32_t offset_dec;
373 int16_t gain_offset;
374 uint16_t offset;
376 uint16_t rfb;
377 uint8_t n;
378 uint8_t p;
379 uint8_t range;
381 uint8_t fast_en;
382};
383
389#ifdef XILINX_PLATFORM
390 struct axi_clkgen *clkgen;
391 struct axi_dac *ad3552r_core_ip;
392 struct axi_dmac *dmac_ip;
393#endif
397 uint8_t chip_id;
399 uint8_t crc_en : 1;
400 uint8_t is_simultaneous : 1;
401 uint8_t single_transfer : 1;
402 uint8_t axi: 1;
403};
404
406 int16_t gain_offset;
407 /* GainP = 1 / ( 2 ^ gain_scaling_p_inv_log2)
408 From 0 to 3 */
410 /* GainP = 1 / ( 2 ^ gain_scaling_n_inv_log2)
411 From 0 to 3 */
413 /* RFB value */
414 uint16_t rfb_ohms;
415};
416
418 bool en;
419 /* Use only 12 bits precision instead of 16 for data. */
421 /*
422 * Use enum ad3552r_ch_ouput_range or ad3542r_ch_output_range
423 * (Depending on id), or AD3552R_CH_OUTPUT_RANGE_CUSTOM to configure
424 * using custom_output_range.
425 */
426 uint8_t range;
428};
429
433 /* If set, reset is done with RESET pin, otherwise it will be soft */
435 /* If set, input register are used and LDAC pulse is sent */
437 /* If set, use external Vref */
439 /* If set, output internal Vref on Vref pin */
441 /* From 0 to 3 */
444 /* Set to enable CRC */
445 bool crc_en;
448 /* Set for AXI qspi controller in use */
450 /* Set AXI clock rate */
452#ifdef XILINX_PLATFORM
453 /* Points to struct axi_clkgen_init for clkgen ip init params */
455 /* Points to struct axi_dac_init for AXI ip init params */
457 /* Points to struct axi_dmac_init for AXI DMAC init params */
458 struct axi_dmac_init *dmac_ip;
459#endif
460};
461
462uint8_t ad3552r_reg_len(uint8_t addr);
463
464uint8_t ad3552r_get_code_reg_addr(uint8_t ch, uint8_t is_dac, uint8_t is_fast);
465
466int32_t ad3552r_init(struct ad3552r_desc **desc,
468
469int32_t ad3552r_remove(struct ad3552r_desc *desc);
470
471int32_t ad3552r_reset(struct ad3552r_desc *desc);
472
473/* Get status and error bits. If clear_errors is set, errors will be cleared */
474int32_t ad3552r_get_status(struct ad3552r_desc *desc, uint32_t *status,
475 uint8_t clr_err);
476
477int32_t ad3552r_transfer(struct ad3552r_desc *desc,
478 struct ad3552_transfer_data *data);
479
480int32_t ad3552r_write_reg(struct ad3552r_desc *desc, uint8_t addr,
481 uint16_t val);
482
483int32_t ad3552r_read_reg(struct ad3552r_desc *desc, uint8_t addr,
484 uint16_t *val);
485
486int32_t ad3552r_get_dev_value(struct ad3552r_desc *desc,
487 enum ad3552r_dev_attributes attr,
488 uint16_t *val);
489
490int32_t ad3552r_set_dev_value(struct ad3552r_desc *desc,
491 enum ad3552r_dev_attributes attr,
492 uint16_t val);
493
494int32_t ad3552r_get_ch_value(struct ad3552r_desc *desc,
495 enum ad3552r_ch_attributes attr,
496 uint8_t ch,
497 uint16_t *val);
498
499int32_t ad3552r_set_ch_value(struct ad3552r_desc *desc,
500 enum ad3552r_ch_attributes attr,
501 uint8_t ch,
502 uint16_t val);
503
504int32_t ad3552r_get_scale(struct ad3552r_desc *desc, uint8_t ch,
505 int32_t *integer, int32_t *dec);
506
507int32_t ad3552r_get_offset(struct ad3552r_desc *desc, uint8_t ch,
508 int32_t *integer, int32_t *dec);
509
510int32_t ad3552r_ldac_trigger(struct ad3552r_desc *desc, uint16_t mask,
511 uint8_t is_fast);
512
513int32_t ad3552r_set_asynchronous(struct ad3552r_desc *desc, uint8_t enable);
514
515/* Send one sample at a time, one after an other or at a LDAC_period interval.
516 * If LDAC pin set, send LDAC signal. Otherwise software LDAC is used. */
517int32_t ad3552r_write_samples(struct ad3552r_desc *desc, uint16_t *data,
518 uint32_t samples, uint32_t ch_mask,
519 enum ad3552r_write_mode mode);
520
522
523/* DMA buffering, fast mode, AXI QSPI */
524int32_t ad3552r_axi_write_data(struct ad3552r_desc *desc, uint32_t *buf,
525 uint16_t samples, bool cyclic, int cyclic_secs);
526
527#endif /* _AD3552R_H_ */
ad3552r_id
Definition ad3552r.h:163
@ AD3542R_ID
Definition ad3552r.h:165
@ AD3541R_ID
Definition ad3552r.h:164
@ AD3551R_ID
Definition ad3552r.h:166
@ AD3552R_ID
Definition ad3552r.h:167
int32_t ad3552r_init(struct ad3552r_desc **desc, struct ad3552r_init_param *init_param)
Definition ad3552r.c:1342
int32_t ad3552r_transfer(struct ad3552r_desc *desc, struct ad3552_transfer_data *data)
Definition ad3552r.c:546
int32_t ad3552r_write_reg(struct ad3552r_desc *desc, uint8_t addr, uint16_t val)
Definition ad3552r.c:576
int32_t ad3552r_write_samples(struct ad3552r_desc *desc, uint16_t *data, uint32_t samples, uint32_t ch_mask, enum ad3552r_write_mode mode)
Definition ad3552r.c:1912
int32_t ad3552r_get_scale(struct ad3552r_desc *desc, uint8_t ch, int32_t *integer, int32_t *dec)
Definition ad3552r.c:1139
ad3552r_write_mode
Definition ad3552r.h:317
@ AD3552R_WRITE_DAC_REGS
Definition ad3552r.h:319
@ AD3552R_WRITE_INPUT_REGS
Definition ad3552r.h:321
@ AD3552R_WRITE_INPUT_REGS_AND_TRIGGER_LDAC
Definition ad3552r.h:323
ad3542r_ch_output_range
Definition ad3552r.h:214
@ AD3542R_CH_OUTPUT_RANGE_0__10V
Definition ad3552r.h:220
@ AD3542R_CH_OUTPUT_RANGE_NEG_2P5__7P5V
Definition ad3552r.h:224
@ AD3542R_CH_OUTPUT_RANGE_0__5V
Definition ad3552r.h:218
@ AD3542R_CH_OUTPUT_RANGE_NEG_5__5V
Definition ad3552r.h:222
@ AD3542R_CH_OUTPUT_RANGE_0__2P5V
Definition ad3552r.h:216
int32_t ad3552r_set_dev_value(struct ad3552r_desc *desc, enum ad3552r_dev_attributes attr, uint16_t val)
Definition ad3552r.c:730
ad3552r_io_mode
Definition ad3552r.h:170
@ AD3552R_QUAD_SPI
Definition ad3552r.h:173
@ AD3552R_DUAL_SPI
Definition ad3552r.h:172
@ AD3552R_SPI
Definition ad3552r.h:171
int32_t ad3552r_get_status(struct ad3552r_desc *desc, uint32_t *status, uint8_t clr_err)
int32_t ad3552r_remove(struct ad3552r_desc *desc)
Definition ad3552r.c:1490
int32_t ad3552r_ldac_trigger(struct ad3552r_desc *desc, uint16_t mask, uint8_t is_fast)
Definition ad3552r.c:1558
int32_t ad3552r_axi_write_data(struct ad3552r_desc *desc, uint32_t *buf, uint16_t samples, bool cyclic, int cyclic_secs)
Write data samples to dac.
Definition ad3552r.c:1783
int32_t ad3552r_set_asynchronous(struct ad3552r_desc *desc, uint8_t enable)
Definition ad3552r.c:1583
int32_t ad3552r_get_ch_value(struct ad3552r_desc *desc, enum ad3552r_ch_attributes attr, uint8_t ch, uint16_t *val)
Definition ad3552r.c:997
ad3552r_ch_gain_scaling
Definition ad3552r.h:243
@ AD3552R_CH_GAIN_SCALING_1
Definition ad3552r.h:245
@ AD3552R_CH_GAIN_SCALING_0_125
Definition ad3552r.h:251
@ AD3552R_CH_GAIN_SCALING_0_5
Definition ad3552r.h:247
@ AD3552R_CH_GAIN_SCALING_0_25
Definition ad3552r.h:249
num_channels
Definition ad3552r.h:234
@ AD3552R_NUM_CHANNELS
Definition ad3552r.h:238
@ AD3542R_NUM_CHANNELS
Definition ad3552r.h:236
@ AD3541R_NUM_CHANNELS
Definition ad3552r.h:235
@ AD3551R_NUM_CHANNELS
Definition ad3552r.h:237
int32_t ad3552r_simulatneous_update_enable(struct ad3552r_desc *desc)
Definition ad3552r.c:781
uint8_t ad3552r_reg_len(uint8_t addr)
Definition ad3552r.c:220
int32_t ad3552r_reset(struct ad3552r_desc *desc)
Definition ad3552r.c:1504
ad3552r_ch_attributes
Definition ad3552r.h:283
@ AD3552R_CH_GAIN_SCALING_N
Definition ad3552r.h:302
@ AD3552R_CH_DAC_POWERDOWN
Definition ad3552r.h:285
@ AD3552R_CH_FAST_EN
Definition ad3552r.h:310
@ AD3552R_CH_GAIN_OFFSET
Definition ad3552r.h:296
@ AD3552R_CH_CODE
Definition ad3552r.h:314
@ AD3552R_CH_OUTPUT_RANGE_SEL
Definition ad3552r.h:289
@ AD3552R_CH_RANGE_OVERRIDE
Definition ad3552r.h:294
@ AD3552R_CH_GAIN_SCALING_P
Definition ad3552r.h:300
@ AD3552R_CH_SELECT
Definition ad3552r.h:312
@ AD3552R_CH_AMPLIFIER_POWERDOWN
Definition ad3552r.h:287
@ AD3552R_CH_GAIN_OFFSET_POLARITY
Definition ad3552r.h:298
@ AD3552R_CH_HW_LDAC_MASK
Definition ad3552r.h:306
@ AD3552R_CH_RFB
Definition ad3552r.h:308
@ AD3552R_CH_TRIGGER_SOFTWARE_LDAC
Definition ad3552r.h:304
int32_t ad3552r_set_ch_value(struct ad3552r_desc *desc, enum ad3552r_ch_attributes attr, uint8_t ch, uint16_t val)
Definition ad3552r.c:1051
uint8_t ad3552r_get_code_reg_addr(uint8_t ch, uint8_t is_dac, uint8_t is_fast)
Definition ad3552r.c:754
ad3552r_dev_attributes
Definition ad3552r.h:261
@ AD3552R_VREF_SELECT
Definition ad3552r.h:270
@ AD3552R_SDO_DRIVE_STRENGTH
Definition ad3552r.h:264
@ AD3552R_CRC_ENABLE
Definition ad3552r.h:272
int32_t ad3552r_read_reg(struct ad3552r_desc *desc, uint8_t addr, uint16_t *val)
Definition ad3552r.c:617
ad3552r_offset_polarity
Definition ad3552r.h:254
@ AD3552R_OFFSET_POLARITY_POSITIVE
Definition ad3552r.h:256
@ AD3552R_OFFSET_POLARITY_NEGATIVE
Definition ad3552r.h:258
#define AD3552R_MAX_NUM_CH
Definition ad3552r.h:161
ad3552r_ch_output_range
Definition ad3552r.h:201
@ AD3552R_CH_OUTPUT_RANGE_0__5V
Definition ad3552r.h:205
@ AD3552R_CH_OUTPUT_RANGE_NEG_10__10V
Definition ad3552r.h:211
@ AD3552R_CH_OUTPUT_RANGE_NEG_5__5V
Definition ad3552r.h:209
@ AD3552R_CH_OUTPUT_RANGE_0__2P5V
Definition ad3552r.h:203
@ AD3552R_CH_OUTPUT_RANGE_0__10V
Definition ad3552r.h:207
ad3552r_ch_vref_select
Definition ad3552r.h:176
@ AD3552R_INTERNAL_VREF_PIN_FLOATING
Definition ad3552r.h:178
@ AD3552R_INTERNAL_VREF_PIN_2P5V
Definition ad3552r.h:180
@ AD3552R_EXTERNAL_VREF_PIN_INPUT
Definition ad3552r.h:182
ad3552r_sdio_drive_strength
Definition ad3552r.h:227
@ AD3552R_HIGH_SDIO_DRIVE_STRENGTH
Definition ad3552r.h:231
@ AD3552R_LOW_SDIO_DRIVE_STRENGTH
Definition ad3552r.h:228
@ AD3552R_MEDIUM_LOW_SDIO_DRIVE_STRENGTH
Definition ad3552r.h:229
@ AD3552R_MEDIUM_HIGH_SDIO_DRIVE_STRENGTH
Definition ad3552r.h:230
ad3552r_status
Definition ad3552r.h:185
@ AD3552R_REGISTER_ADDRESS_INVALID
Definition ad3552r.h:195
@ AD3552R_MEM_CRC_ERR_STATUS
Definition ad3552r.h:198
@ AD3552R_INVALID_OR_NO_CRC
Definition ad3552r.h:192
@ AD3552R_DUAL_SPI_STREAM_EXCEEDS_DAC_ERR_STATUS
Definition ad3552r.h:197
@ AD3552R_REF_RANGE_ERR_STATUS
Definition ad3552r.h:196
@ AD3552R_WRITE_TO_READ_ONLY_REGISTER
Definition ad3552r.h:193
@ AD3552R_PARTIAL_REGISTER_ACCESS
Definition ad3552r.h:194
@ AD3552R_CLOCK_COUNTING_ERROR
Definition ad3552r.h:191
@ AD3552R_INTERFACE_NOT_READY
Definition ad3552r.h:188
@ AD3552R_RESET_STATUS
Definition ad3552r.h:187
int32_t ad3552r_get_offset(struct ad3552r_desc *desc, uint8_t ch, int32_t *integer, int32_t *dec)
Definition ad3552r.c:1151
int32_t ad3552r_get_dev_value(struct ad3552r_desc *desc, enum ad3552r_dev_attributes attr, uint16_t *val)
Definition ad3552r.c:704
struct axi_clkgen_init clkgen_ip
Definition common_data.c:58
struct axi_dmac_init dmac_ip
Definition common_data.c:64
struct axi_dac_init ad3552r_core_ip
Definition common_data.c:51
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 ad3552r.h:327
uint8_t stream_length_keep_value
Definition ad3552r.h:338
uint8_t stream_mode_length
Definition ad3552r.h:329
uint8_t addr_asc
Definition ad3552r.h:331
uint8_t single_instr
Definition ad3552r.h:333
Definition ad3552r.h:355
uint32_t len
Definition ad3552r.h:361
uint8_t addr
Definition ad3552r.h:357
uint8_t is_read
Definition ad3552r.h:363
uint8_t * data
Definition ad3552r.h:359
struct ad3552_transfer_config * spi_cfg
Definition ad3552r.h:365
Definition ad3552r.h:368
int32_t scale_dec
Definition ad3552r.h:370
uint8_t p
Definition ad3552r.h:378
uint8_t offset_polarity
Definition ad3552r.h:375
uint16_t offset
Definition ad3552r.h:374
uint8_t fast_en
Definition ad3552r.h:381
uint8_t range
Definition ad3552r.h:379
uint16_t rfb
Definition ad3552r.h:376
int32_t offset_int
Definition ad3552r.h:371
int32_t scale_int
Definition ad3552r.h:369
uint8_t range_override
Definition ad3552r.h:380
int16_t gain_offset
Definition ad3552r.h:373
int32_t offset_dec
Definition ad3552r.h:372
uint8_t n
Definition ad3552r.h:377
Definition ad3552r.h:417
struct ad3552r_custom_output_range_cfg custom_range
Definition ad3552r.h:427
uint8_t range
Definition ad3552r.h:426
bool fast_en
Definition ad3552r.h:420
bool en
Definition ad3552r.h:418
Definition ad3552r.h:405
uint8_t gain_scaling_p_inv_log2
Definition ad3552r.h:409
int16_t gain_offset
Definition ad3552r.h:406
uint8_t gain_scaling_n_inv_log2
Definition ad3552r.h:412
uint16_t rfb_ohms
Definition ad3552r.h:414
Definition ad3552r.h:384
uint8_t crc_en
Definition ad3552r.h:399
uint8_t single_transfer
Definition ad3552r.h:401
uint8_t num_spi_data_lanes
Definition ad3552r.h:398
uint8_t axi
Definition ad3552r.h:402
struct no_os_gpio_desc * reset
Definition ad3552r.h:388
struct ad3552r_ch_data ch_data[AD3552R_MAX_NUM_CH]
Definition ad3552r.h:394
struct no_os_spi_desc * spi
Definition ad3552r.h:386
uint8_t is_simultaneous
Definition ad3552r.h:400
uint8_t axi_xfer_size
Definition ad3552r.h:395
uint8_t crc_table[NO_OS_CRC8_TABLE_SIZE]
Definition ad3552r.h:396
struct no_os_gpio_desc * ldac
Definition ad3552r.h:387
struct ad3552_transfer_config spi_cfg
Definition ad3552r.h:385
uint8_t chip_id
Definition ad3552r.h:397
Definition ad3552r.h:430
enum ad3552r_id chip_id
Definition ad3552r.h:431
struct no_os_spi_init_param spi_param
Definition ad3552r.h:432
int axi_clkgen_rate
Definition ad3552r.h:451
bool crc_en
Definition ad3552r.h:445
bool is_simultaneous
Definition ad3552r.h:446
uint8_t sdo_drive_strength
Definition ad3552r.h:442
struct no_os_gpio_init_param * reset_gpio_param_optional
Definition ad3552r.h:434
struct no_os_gpio_init_param * ldac_gpio_param_optional
Definition ad3552r.h:436
bool vref_out_enable
Definition ad3552r.h:440
struct ad3552r_channel_init channels[AD3552R_MAX_NUM_CH]
Definition ad3552r.h:443
bool use_external_vref
Definition ad3552r.h:438
bool single_transfer
Definition ad3552r.h:447
bool axi_qspi_controller
Definition ad3552r.h:449
Definition clk_axi_clkgen.h:44
Definition clk_axi_clkgen.h:38
Definition axi_dac_core.h:68
AXI DAC Device Descriptor.
Definition axi_dac_core.h:53
Definition axi_dmac.h:118
Definition axi_dmac.h:101
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