Go to the documentation of this file.
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)
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)
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)
153 #define AD3552R_REG_ADDR_MAX 0x4B
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
169 #define AD3552R_MAX_NUM_CH 2
247 #define AD3552R_CH_OUTPUT_RANGE_CUSTOM 100
279 #ifdef AD3552R_QSPI_IMPLEMENTED
281 AD3552R_SPI_MULTI_IO_MODE,
283 AD3552R_SPI_DATA_RATE,
285 AD3552R_SPI_SYNCHRONOUS_ENABLE,
345 #ifdef AD3552R_QSPI_IMPLEMENTED
347 uint8_t multi_io_mode : 2;
357 uint8_t synchronous : 1;
510 int32_t *integer, int32_t *dec);
513 int32_t *integer, int32_t *dec);
523 uint32_t samples, uint32_t ch_mask,
530 uint16_t samples,
bool cyclic,
int cyclic_secs);
@ AD3552R_WRITE_DAC_REGS
Definition: ad3552r.h:325
#define AD3552R_REG_ADDR_POWERDOWN_CONFIG
Definition: ad3552r.h:116
#define AD3552R_MASK_SPI_CONFIG_DDR
Definition: ad3552r.h:96
int32_t ad3552r_transfer(struct ad3552r_desc *desc, struct ad3552_transfer_data *data)
Definition: ad3552r.c:544
struct no_os_spi_desc * spi
Definition: ad3552r.h:392
@ AD3552R_MEDIUM_LOW_SDIO_DRIVE_STRENGTH
Definition: ad3552r.h:235
void no_os_put_unaligned_be16(uint16_t val, uint8_t *buf)
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
Definition: ad3552r.h:316
@ AD3552R_MEDIUM_HIGH_SDIO_DRIVE_STRENGTH
Definition: ad3552r.h:236
@ AD3552R_CH_RANGE_OVERRIDE
Definition: ad3552r.h:300
uint32_t timeout
Definition: ad413x.c:49
int32_t ad3552r_init(struct ad3552r_desc **desc, struct ad3552r_init_param *param)
Definition: ad3552r.c:1318
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
#define AD3552R_MASK_DUAL_SPI_SYNCHROUNOUS_EN
Definition: ad3552r.h:95
#define AD3552R_SCRATCH_PAD_TEST_VAL1
Definition: ad3552r.c:88
#define AD3552R_MASK_INTERFACE_NOT_READY
Definition: ad3552r.h:85
@ AD3552R_CH_GAIN_SCALING_N
Definition: ad3552r.h:308
#define AD3552R_REG_ADDR_MAX
Definition: ad3552r.h:153
@ AD3552R_REGISTER_ADDRESS_INVALID
Definition: ad3552r.h:201
#define AD3552R_MASK_SDO_DRIVE_STRENGTH
Definition: ad3552r.h:94
struct no_os_gpio_desc * reset
Definition: ad3552r.h:394
uint8_t crc_table[NO_OS_CRC8_TABLE_SIZE]
Definition: ad3552r.h:400
#define AD3552R_READ_BIT
Definition: ad3552r.c:77
int32_t ad3552r_axi_init(struct ad3552r_desc *desc, struct ad3552r_init_param *init_param)
Definition: ad3552r.c:1266
@ AD3552R_INTERFACE_NOT_READY
Definition: ad3552r.h:194
@ AD3552R_CRC_ENABLE
Definition: ad3552r.h:278
#define AD3552R_REG_ADDR_CH_INPUT_16B(ch)
Definition: ad3552r.h:142
int32_t ad3552r_set_dev_value(struct ad3552r_desc *desc, enum ad3552r_dev_attributes attr, uint16_t val)
Definition: ad3552r.c:724
int32_t ad3552r_init(struct ad3552r_desc **desc, struct ad3552r_init_param *init_param)
Definition: ad3552r.c:1318
#define AD3552R_REG_ADDR_CH_SELECT_24B
Definition: ad3552r.h:148
ad3552r_offset_polarity
Definition: ad3552r.h:260
#define AD3552R_REG_ADDR_CH_DAC_16B(ch)
Definition: ad3552r.h:137
Definition: axi_dmac.h:127
ad3552r_ch_output_range
Definition: ad3552r.h:207
@ AD3552R_MEM_CRC_ERR_STATUS
Definition: ad3552r.h:204
@ AD3552R_DUAL_SPI_STREAM_EXCEEDS_DAC_ERR_STATUS
Definition: ad3552r.h:203
#define AD3552R_MAX_CH_NUM(id)
Definition: ad3552r.c:91
#define AD3552R_LDAC_PULSE_US
Definition: ad3552r.h:164
@ AD3552R_CH_DAC_POWERDOWN
Definition: ad3552r.h:291
Header file of SPI Interface.
int32_t ad3552r_read_reg(struct ad3552r_desc *desc, uint8_t addr, uint16_t *val)
Definition: ad3552r.c:613
#define AD3552R_MASK_CH_GAIN_SCALING_P
Definition: ad3552r.h:126
uint8_t ad3552r_reg_len(uint8_t addr)
Definition: ad3552r.c:218
uint8_t fast_en
Definition: ad3552r.h:387
@ AD3552R_CH_GAIN_SCALING_0_125
Definition: ad3552r.h:257
uint8_t range_override
Definition: ad3552r.h:386
uint8_t single_instr
Definition: ad3552r.h:339
Driver for the Analog Devices AXI CLKGEN.
#define AD3552R_CRC_ENABLE_VALUE
Definition: ad3552r.c:79
#define AD3552R_MASK_SOFTWARE_RESET
Definition: ad3552r.h:55
int32_t axi_dmac_transfer_wait_completion(struct axi_dmac *dmac, uint32_t timeout_ms)
Definition: axi_dmac.c:525
int32_t ad3552r_read_reg(struct ad3552r_desc *desc, uint8_t addr, uint16_t *val)
Definition: ad3552r.c:613
#define pr_err(fmt, args...)
Definition: no_os_print_log.h:88
uint8_t addr
Definition: ad3552r.h:363
int32_t ad3552r_set_asynchronous(struct ad3552r_desc *desc, uint8_t enable)
Definition: ad3552r.c:1518
struct no_os_gpio_init_param * ldac_gpio_param_optional
Definition: ad3552r.h:439
#define AD3552R_CRC_SEED
Definition: ad3552r.c:83
uint8_t ad3552r_reg_len(uint8_t addr)
Definition: ad3552r.c:218
Definition: no_os_spi.h:100
#define NO_OS_IS_ERR_VALUE(x)
Definition: no_os_error.h:50
struct ad3552_transfer_config * spi_cfg
Definition: ad3552r.h:371
uint8_t ad3552r_get_code_reg_addr(uint8_t ch, uint8_t is_dac, uint8_t is_fast)
Definition: ad3552r.c:748
#define AD3552R_MASK_CRC_ENABLE
Definition: ad3552r.h:82
Header file of Delay functions.
#define AD3552R_REG_ADDR_CH_DAC_24B(ch)
Definition: ad3552r.h:146
Definition: clk_axi_clkgen.h:50
@ AD3552R_CLOCK_COUNTING_ERROR
Definition: ad3552r.h:197
int32_t axi_clkgen_set_rate(struct axi_clkgen *clkgen, uint32_t rate)
axi_clkgen_set_rate
Definition: clk_axi_clkgen.c:414
struct axi_dmac * dmac_ip
Definition: ad3552r.h:397
#define AD3552R_MASK_ADDR_ASCENSION
Definition: ad3552r.h:56
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
#define AD3552R_MASK_CH(ch)
Definition: ad3552r.h:156
@ AD3552R_CH_HW_LDAC_MASK
Definition: ad3552r.h:312
int32_t ad3552r_remove(struct ad3552r_desc *desc)
Definition: ad3552r.c:1425
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
Definition: ad3552r.h:243
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
Definition: ad3552r.h:276
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
Definition: no_os_gpio.h:117
@ AD3552R_SDO_DRIVE_STRENGTH
Definition: ad3552r.h:270
#define AD3552R_REG_ADDR_INTERFACE_CONFIG_A
Definition: ad3552r.h:54
@ AD3552R_SINGLE_INST
Definition: ad3552r.c:62
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
Definition: ad3552r.h:230
Definition: clk_axi_clkgen.h:44
Timer control module header.
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
#define AD3552R_REG_ADDR_HW_LDAC_16B
Definition: ad3552r.h:136
Driver for the Analog Devices AXI-DAC-CORE module.
ad3552r_ch_gain_scaling
Definition: ad3552r.h:249
uint8_t is_simultaneous
Definition: ad3552r.h:403
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
#define NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:49
ad3552r_status
Definition: ad3552r.h:191
@ AD3552R_PARTIAL_REGISTER_ACCESS
Definition: ad3552r.h:200
@ AD3542R_CH_OUTPUT_RANGE_0__5V
Definition: ad3552r.h:224
@ AD3552R_EXTERNAL_VREF_PIN_INPUT
Definition: ad3552r.h:188
#define AD3552R_REG_ADDR_CH_INPUT_24B(ch)
Definition: ad3552r.h:151
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
Definition: ad3552r.h:222
enum ad3552r_id chip_id
Definition: ad3552r.h:434
int32_t offset_int
Definition: ad3552r.h:377
@ AD3552R_CH_GAIN_SCALING_0_25
Definition: ad3552r.h:255
@ AD3552R_INVALID_OR_NO_CRC
Definition: ad3552r.h:198
uint8_t stream_length_keep_value
Definition: ad3552r.h:344
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:115
uint8_t * tx_buff
Definition: no_os_spi.h:102
struct ad3552_transfer_config spi_cfg
Definition: ad3552r.h:391
#define AD3552R_MAX_REG_SIZE
Definition: ad3552r.c:76
@ AD3552R_CH_OUTPUT_RANGE_NEG_5__5V
Definition: ad3552r.h:215
@ AD3552R_CH_GAIN_OFFSET
Definition: ad3552r.h:302
bool crc_en
Definition: ad3552r.h:448
@ AD3552R_WRITE_TO_READ_ONLY_REGISTER
Definition: ad3552r.h:199
ad3542r_ch_output_range
Definition: ad3552r.h:220
@ AD3552R_INTERNAL_VREF_PIN_FLOATING
Definition: ad3552r.h:184
ad3552r_sdio_drive_strength
Definition: ad3552r.h:233
#define AD3552R_REG_ADDR_INTERFACE_CONFIG_C
Definition: ad3552r.h:81
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
struct axi_dac * ad3552r_core_ip
Definition: ad3552r.h:396
Definition: axi_dmac.h:102
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
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
#define AD3552R_REG_ADDR_CH0_CH1_OUTPUT_RANGE
Definition: ad3552r.h:119
#define AD3552R_MASK_SINGLE_INST
Definition: ad3552r.h:59
#define AD3552R_MASK_CH_OFFSET_BIT_8
Definition: ad3552r.h:128
Definition: ad3552r.h:374
#define pr_debug(fmt, args...)
Definition: no_os_print_log.h:129
ad3552r_id
Definition: ad3552r.h:175
@ AD3552R_OFFSET_POLARITY_POSITIVE
Definition: ad3552r.h:262
bool is_simultaneous
Definition: ad3552r.h:449
#define AD3552R_MASK_CH_GAIN_SCALING_N
Definition: ad3552r.h:125
int32_t ad3552r_get_dev_value(struct ad3552r_desc *desc, enum ad3552r_dev_attributes attr, uint16_t *val)
Definition: ad3552r.c:698
#define AD3552R_REG_ADDR_HW_LDAC_24B
Definition: ad3552r.h:145
int32_t offset_dec
Definition: ad3552r.h:378
#define AD3552R_REG_ADDR_INTERFACE_CONFIG_B
Definition: ad3552r.h:58
int32_t ad3552r_get_status(struct ad3552r_desc *desc, uint32_t *status, uint8_t clr_err)
@ AD3552R_WRITE_INPUT_REGS
Definition: ad3552r.h:327
#define AD3552R_SECONDARY_REGION_ADDR
Definition: ad3552r.c:84
#define AD3552R_MASK_CH_OUTPUT_RANGE_SEL(ch)
Definition: ad3552r.h:120
void no_os_crc8_populate_msb(uint8_t *table, const uint8_t polynomial)
#define AD3552R_REG_ADDR_ERR_STATUS
Definition: ad3552r.h:111
uint8_t * rx_buff
Definition: no_os_spi.h:104
@ AD3541R_ID
Definition: ad3552r.h:176
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
Definition: ad3552r.c:59
bool fast_en
Definition: ad3552r.h:423
int32_t ad3552r_get_dev_value(struct ad3552r_desc *desc, enum ad3552r_dev_attributes attr, uint16_t *val)
Definition: ad3552r.c:698
int32_t ad3552r_remove(struct ad3552r_desc *desc)
Definition: ad3552r.c:1425
@ AD3552R_CH_OUTPUT_RANGE_0__10V
Definition: ad3552r.h:213
struct no_os_gpio_desc * ldac
Definition: ad3552r.h:393
@ AD3552R_INTERNAL_VREF_PIN_2P5V
Definition: ad3552r.h:186
#define AD3552R_MASK_REFERENCE_VOLTAGE_SEL
Definition: ad3552r.h:102
#define AD3552R_MASK_CH_OFFSET_POLARITY
Definition: ad3552r.h:127
@ AD3552R_CH_OUTPUT_RANGE_0__5V
Definition: ad3552r.h:211
#define AD3552R_CH_ATTR_REG(attr)
Definition: ad3552r.c:73
uint8_t gain_scaling_p_inv_log2
Definition: ad3552r.h:412
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
Definition: ad3552r.h:304
#define AD3552R_REG_ADDR_DAC_PAGE_MASK_24B
Definition: ad3552r.h:147
uint8_t cs_change
Definition: no_os_spi.h:108
uint32_t len
Definition: ad3552r.h:367
uint8_t addr_asc
Definition: ad3552r.h:337
@ AD3552R_CH_OUTPUT_RANGE_NEG_10__10V
Definition: ad3552r.h:217
Driver for the Analog Devices AXI-DMAC core.
@ AD3552R_STREAM_MODE
Definition: ad3552r.c:64
@ AD3552R_REF_RANGE_ERR_STATUS
Definition: ad3552r.h:202
uint8_t axi_xfer_size
Definition: ad3552r.h:399
Definition: ad3552r.h:361
#define AD3552R_ATTR_MASK(attr)
Definition: ad3552r.c:72
struct ad3552r_ch_data ch_data[AD3552R_MAX_NUM_CH]
Definition: ad3552r.h:398
bool en
Definition: ad3552r.h:421
Definition: axi_dac_core.h:68
@ AD3552R_CH_AMPLIFIER_POWERDOWN
Definition: ad3552r.h:293
uint8_t axi
Definition: ad3552r.h:405
struct ad3552r_channel_init channels[AD3552R_MAX_NUM_CH]
Definition: ad3552r.h:446
struct ad3552r_custom_output_range_cfg custom_range
Definition: ad3552r.h:430
#define AD3552R_REG_ADDR_CH_OFFSET(ch)
Definition: ad3552r.h:121
#define AD3552R_REG_ADDR_CH_GAIN(ch)
Definition: ad3552r.h:123
int32_t ad3552r_get_offset(struct ad3552r_desc *desc, uint8_t ch, int32_t *integer, int32_t *dec)
Definition: ad3552r.c:1129
uint32_t dest_addr
Definition: axi_dmac.h:107
uint8_t gain_scaling_n_inv_log2
Definition: ad3552r.h:415
#define AD3552R_MAX_NUM_CH
Definition: ad3552r.h:169
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
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
ad3552r_ch_attributes
Definition: ad3552r.h:289
#define AD3552R_MASK_STREAM_LENGTH_KEEP_VALUE
Definition: ad3552r.h:80
#define AD3552R_SCRATCH_PAD_TEST_VAL2
Definition: ad3552r.c:89
num_channels
Definition: ad3552r.h:240
#define AD3552R_CH_ATTR_MASK(ch, attr)
Definition: ad3552r.c:74
@ AD3552R_RESET_STATUS
Definition: ad3552r.h:193
AXI DAC Device Descriptor.
Definition: axi_dac_core.h:53
int32_t ad3552r_reset(struct ad3552r_desc *desc)
Definition: ad3552r.c:1439
#define AD3552R_ADDR_MASK
Definition: ad3552r.c:78
@ AD3552R_CH_GAIN_SCALING_0_5
Definition: ad3552r.h:253
struct no_os_spi_init_param spi_param
Definition: ad3552r.h:435
uint8_t n
Definition: ad3552r.h:383
uint8_t range
Definition: ad3552r.h:385
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
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
enum cyclic_transfer cyclic
Definition: axi_dmac.h:105
int32_t ad3552r_get_scale(struct ad3552r_desc *desc, uint8_t ch, int32_t *integer, int32_t *dec)
Definition: ad3552r.c:1117
bool single_transfer
Definition: ad3552r.h:450
ad3552r_dev_attributes
Definition: ad3552r.h:267
@ AD3552R_WRITE_INPUT_REGS_AND_TRIGGER_LDAC
Definition: ad3552r.h:329
#define AD3552R_MASK_ALL_CH
Definition: ad3552r.h:157
Definition: ad3552r.h:433
@ AD3552R_CH_GAIN_SCALING_1
Definition: ad3552r.h:251
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
struct axi_dmac_init * dmac_ip
Definition: ad3552r.h:460
uint32_t bytes_number
Definition: no_os_spi.h:106
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
Definition: ad3552r.h:244
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
int32_t ad3552r_ldac_trigger(struct ad3552r_desc *desc, uint16_t mask, uint8_t is_fast)
Definition: ad3552r.c:1493
#define AD3552R_REG_ADDR_STREAM_MODE
Definition: ad3552r.h:76
#define AD3552R_REG_ADDR_TRANSFER_REGISTER
Definition: ad3552r.h:78
#define NO_OS_CRC8_TABLE_SIZE
Definition: no_os_crc8.h:39
#define AD3552R_GAIN_SCALE
Definition: ad3552r.c:97
uint32_t axi_clkgen_rate
Definition: ad7616.h:211
ad3552r_ch_vref_select
Definition: ad3552r.h:182
ad3552r_spi_attributes
Definition: ad3552r.c:54
int16_t gain_offset
Definition: ad3552r.h:409
@ AD3541R_NUM_CHANNELS
Definition: ad3552r.h:241
#define AD3552R_CRC_DISABLE_VALUE
Definition: ad3552r.c:80
Definition: ad3552r.h:333
int32_t ad3552r_set_dev_value(struct ad3552r_desc *desc, enum ad3552r_dev_attributes attr, uint16_t val)
Definition: ad3552r.c:724
uint32_t no_os_field_get(uint32_t mask, uint32_t word)
int32_t ad3552r_simulatneous_update_enable(struct ad3552r_desc *desc)
Definition: ad3552r.c:775
int32_t ad3552r_single_transfer(struct ad3552r_desc *desc, struct ad3552_transfer_data *data)
Definition: ad3552r.c:498
Definition: ad3552r.h:408
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
uint16_t rfb_ohms
Definition: ad3552r.h:417
uint8_t no_os_crc8(const uint8_t *table, const uint8_t *pdata, size_t nbytes, uint8_t crc)
@ NO
Definition: axi_dmac.h:98
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
int32_t scale_int
Definition: ad3552r.h:375
bool axi_qspi_controller
Definition: ad3552r.h:452
#define AD3552R_REG_ADDR_PRODUCT_ID_L
Definition: ad3552r.h:67
@ AD3542R_CH_OUTPUT_RANGE_0__10V
Definition: ad3552r.h:226
@ AD3552R_CH_RFB
Definition: ad3552r.h:314
int32_t axi_dmac_init(struct axi_dmac **dmac_core, const struct axi_dmac_init *init)
Definition: axi_dmac.c:334
@ CYCLIC
Definition: axi_dmac.h:99
@ AD3552R_STREAM_LENGTH_KEEP_VALUE
Definition: ad3552r.c:66
#define AD3552R_ATTR_REG(attr)
Definition: ad3552r.c:71
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:114
@ AD3551R_ID
Definition: ad3552r.h:178
@ AD3542R_CH_OUTPUT_RANGE_NEG_5__5V
Definition: ad3552r.h:228
struct axi_clkgen * clkgen
Definition: ad3552r.h:395
@ AD3552R_HIGH_SDIO_DRIVE_STRENGTH
Definition: ad3552r.h:237
@ AD3552R_CH_GAIN_SCALING_P
Definition: ad3552r.h:306
int32_t ad3552r_write_reg(struct ad3552r_desc *desc, uint8_t addr, uint16_t val)
Definition: ad3552r.c:574
#define AD3552R_REG_ADDR_SCRATCH_PAD
Definition: ad3552r.h:72
uint16_t rfb
Definition: ad3552r.h:382
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
int axi_clkgen_rate
Definition: ad3552r.h:454
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
int32_t ad3552r_ldac_trigger(struct ad3552r_desc *desc, uint16_t mask, uint8_t is_fast)
Definition: ad3552r.c:1493
#define AD3552R_MASK_LENGTH
Definition: ad3552r.h:77
@ AD3552R_CH_OUTPUT_RANGE_SEL
Definition: ad3552r.h:295
@ AD3552R_ID
Definition: ad3552r.h:179
#define AD3552R_DEFAULT_CONFIG_B_VALUE
Definition: ad3552r.c:85
uint8_t p
Definition: ad3552r.h:384
int32_t ad3552r_reset(struct ad3552r_desc *desc)
Definition: ad3552r.c:1439
int16_t gain_offset
Definition: ad3552r.h:379
#define AD3552R_MASK_CH_RANGE_OVERRIDE
Definition: ad3552r.h:124
uint8_t range
Definition: ad3552r.h:429
int32_t ad3552r_simulatneous_update_enable(struct ad3552r_desc *desc)
Definition: ad3552r.c:775
Definition: ad3552r.h:420
#define AD3552R_REG_ADDR_INTERFACE_CONFIG_D
Definition: ad3552r.h:91
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
int32_t ad3552r_get_scale(struct ad3552r_desc *desc, uint8_t ch, int32_t *integer, int32_t *dec)
Definition: ad3552r.c:1117
Header file of GPIO Interface.
uint8_t crc_en
Definition: ad3552r.h:402
#define AD3552R_BOTH_CH_DESELECT
Definition: ad3552r.h:166
#define AD3552R_MASK_CH_DAC_POWERDOWN(ch)
Definition: ad3552r.h:117
uint8_t sdo_drive_strength
Definition: ad3552r.h:445
Header file of ad3552r Driver.
#define AD3552R_BOTH_CH_SELECT
Definition: ad3552r.h:165
#define AD3552R_REG_ADDR_INTERFACE_STATUS_A
Definition: ad3552r.h:84
bool use_external_vref
Definition: ad3552r.h:441
#define AD3552R_REG_ADDR_SW_LDAC_16B
Definition: ad3552r.h:141
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
uint16_t no_os_get_unaligned_be16(uint8_t *buf)
struct axi_clkgen_init * clkgen_ip
Definition: ad3552r.h:456
int32_t axi_dmac_transfer_start(struct axi_dmac *dmac, struct axi_dma_transfer *dma_transfer)
Definition: axi_dmac.c:385
#define AD3552R_MASK_CH_OFFSET_BITS_0_7
Definition: ad3552r.h:122
int32_t ad3552r_transfer(struct ad3552r_desc *desc, struct ad3552_transfer_data *data)
Definition: ad3552r.c:544
@ AD3552R_LOW_SDIO_DRIVE_STRENGTH
Definition: ad3552r.h:234
@ AXI_DAC_DATA_SEL_DMA
Definition: axi_dac_core.h:86
#define AD3552R_REG_ADDR_SH_REFERENCE_CONFIG
Definition: ad3552r.h:97
uint8_t * data
Definition: ad3552r.h:365
struct axi_dac_init * ad3552r_core_ip
Definition: ad3552r.h:458
Header file of utility functions.
uint32_t no_os_find_first_set_bit(uint32_t word)
uint16_t offset
Definition: ad3552r.h:380
#define AD3552R_MASK_CH_AMPLIFIER_POWERDOWN(ch)
Definition: ad3552r.h:118
#define AD3552R_REG_ADDR_CH_SELECT_16B
Definition: ad3552r.h:139
#define AD3552R_BYTES_PER_SAMPLE
Definition: ad3552r.c:51
@ AD3542R_ID
Definition: ad3552r.h:177
#define AD3552R_CRC_POLY
Definition: ad3552r.c:82
ad3552r_write_mode
Definition: ad3552r.h:323
@ AD3552R_CH_SELECT
Definition: ad3552r.h:318
bool vref_out_enable
Definition: ad3552r.h:443
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
uint8_t is_read
Definition: ad3552r.h:369
@ AD3552R_CH_TRIGGER_SOFTWARE_LDAC
Definition: ad3552r.h:310
@ AD3552R_CH_CODE
Definition: ad3552r.h:320
uint8_t single_transfer
Definition: ad3552r.h:404
#define AD3552R_REG_ADDR_PRODUCT_ID_H
Definition: ad3552r.h:68
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
uint32_t size
Definition: axi_dmac.h:103
int32_t ad3552r_set_asynchronous(struct ad3552r_desc *desc, uint8_t enable)
Definition: ad3552r.c:1518
#define AD3552R_REG_ADDR_DAC_PAGE_MASK_16B
Definition: ad3552r.h:138
@ AD3552R_CH_OUTPUT_RANGE_0__2P5V
Definition: ad3552r.h:209
uint8_t stream_mode_length
Definition: ad3552r.h:335
Header file of CRC-8 computation.
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
Definition: ad3552r.h:264
uint8_t chip_id
Definition: ad3552r.h:401
#define AD3552R_MASK_MULTI_IO_MODE
Definition: ad3552r.h:79
#define AD3552R_REG_ADDR_SW_LDAC_24B
Definition: ad3552r.h:150
Definition: axi_dmac.h:110
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
Definition: ad3552r.h:242
#define NO_OS_DIV_ROUND_CLOSEST(x, y)
Definition: no_os_util.h:54
int32_t ad3552r_write_reg(struct ad3552r_desc *desc, uint8_t addr, uint16_t val)
Definition: ad3552r.c:574
int32_t scale_dec
Definition: ad3552r.h:376
Definition: ad3552r.h:390
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
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
#define AD3552R_CH_OUTPUT_RANGE_CUSTOM
Definition: ad3552r.h:247
uint8_t offset_polarity
Definition: ad3552r.h:381
struct no_os_gpio_init_param * reset_gpio_param_optional
Definition: ad3552r.h:437
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