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