44#define AD5755_LDAC_OUT no_os_gpio_direction_output(dev->gpio_ldac, \
44#define AD5755_LDAC_OUT no_os_gpio_direction_output(dev->gpio_ldac, \ …
46#define AD5755_LDAC_LOW no_os_gpio_set_value(dev->gpio_ldac, \
46#define AD5755_LDAC_LOW no_os_gpio_set_value(dev->gpio_ldac, \ …
48#define AD5755_LDAC_HIGH no_os_gpio_set_value(dev->gpio_ldac, \
48#define AD5755_LDAC_HIGH no_os_gpio_set_value(dev->gpio_ldac, \ …
52#define AD5755_RESET_OUT no_os_gpio_direction_output(dev->gpio_rst, \
52#define AD5755_RESET_OUT no_os_gpio_direction_output(dev->gpio_rst, \ …
54#define AD5755_RESET_LOW no_os_gpio_set_value(dev->gpio_rst, \
54#define AD5755_RESET_LOW no_os_gpio_set_value(dev->gpio_rst, \ …
56#define AD5755_RESET_HIGH no_os_gpio_set_value(dev->gpio_rst, \
56#define AD5755_RESET_HIGH no_os_gpio_set_value(dev->gpio_rst, \ …
60#define AD5755_CLEAR_OUT no_os_gpio_direction_output(dev->gpio_clr, \
60#define AD5755_CLEAR_OUT no_os_gpio_direction_output(dev->gpio_clr, \ …
62#define AD5755_CLEAR_LOW no_os_gpio_set_value(dev->gpio_clr, \
62#define AD5755_CLEAR_LOW no_os_gpio_set_value(dev->gpio_clr, \ …
64#define AD5755_CLEAR_HIGH no_os_gpio_set_value(dev->gpio_clr, \
64#define AD5755_CLEAR_HIGH no_os_gpio_set_value(dev->gpio_clr, \ …
68#define AD5755_POC_OUT no_os_gpio_direction_output(dev->gpio_poc, \
68#define AD5755_POC_OUT no_os_gpio_direction_output(dev->gpio_poc, \ …
70#define AD5755_POC_LOW no_os_gpio_set_value(dev->gpio_poc, \
70#define AD5755_POC_LOW no_os_gpio_set_value(dev->gpio_poc, \ …
72#define AD5755_POC_HIGH no_os_gpio_set_value(dev->gpio_poc, \
72#define AD5755_POC_HIGH no_os_gpio_set_value(dev->gpio_poc, \ …
76#define AD5755_ISR_WRITE (0ul << 23)
77#define AD5755_ISR_DUT_AD1(x) (((x) & 0x1) << 22)
78#define AD5755_ISR_DUT_AD0(x) (((x) & 0x1) << 21)
79#define AD5755_ISR_DREG(x) (((x) & 0x7) << 18)
80#define AD5755_ISR_DAC_AD(x) (((x) & 0x3) << 16)
81#define AD5755_ISR_DATA(x) ((x) & 0xFFFF)
84#define AD5755_ISR_NOP 0x1CE000
87#define AD5755_DREG_WR_DAC 0
88#define AD5755_DREG_WR_GAIN 2
89#define AD5755_DREG_WR_GAIN_ALL 3
90#define AD5755_DREG_WR_OFFSET 4
91#define AD5755_DREG_WR_OFFSET_ALL 5
92#define AD5755_DREG_WR_CLR_CODE 6
93#define AD5755_DREG_WR_CTRL_REG 7
102#define AD5755_GAIN_ADJUSTMENT(x) ((x) & 0xFFFF)
105#define AD5755_OFFSET_ADJUSTMENT(x) ((x) & 0xFFFF)
108#define AD5755_CLEAR_CODE(x) ((x) & 0xFFFF)
111#define AD5755_CTRL_CREG(x) (((x) & 0x7) << 13)
112#define AD5755_CTRL_DATA(x) ((x) & 0x1FFF)
115#define AD5755_CREG_SLEW 0
116#define AD5755_CREG_MAIN 1
117#define AD5755_CREG_DAC 2
118#define AD5755_CREG_DC_DC 3
119#define AD5755_CREG_SOFT 4
122#define AD5755_SLEW_SREN (1 << 12)
123#define AD5755_SLEW_SR_CLOCK(x) (((x) & 0xF) << 3)
124#define AD5755_SLEW_SR_STEP(x) (((x) & 0x7) << 0)
127#define AD5755_SR_CLK_64K 0
128#define AD5755_SR_CLK_32k 1
129#define AD5755_SR_CLK_16k 2
130#define AD5755_SR_CLK_8K 3
131#define AD5755_SR_CLK_4K 4
132#define AD5755_SR_CLK_2K 5
133#define AD5755_SR_CLK_1K 6
134#define AD5755_SR_CLK_500 7
135#define AD5755_SR_CLK_250 8
136#define AD5755_SR_CLK_125 9
137#define AD5755_SR_CLK_64 10
138#define AD5755_SR_CLK_32 11
139#define AD5755_SR_CLK_16 12
140#define AD5755_SR_CLK_8 13
141#define AD5755_SR_CLK_4 14
142#define AD5755_SR_CLK_0_5 15
145#define AD5755_STEP_1 0
146#define AD5755_STEP_2 1
147#define AD5755_STEP_4 2
148#define AD5755_STEP_16 3
149#define AD5755_STEP_32 4
150#define AD5755_STEP_64 5
151#define AD5755_STEP_128 6
152#define AD5755_STEP_256 7
155#define AD5755_MAIN_POC (1 << 12)
156#define AD5755_MAIN_STATREAD (1 << 11)
157#define AD5755_MAIN_EWD (1 <<10)
158#define AD5755_MAIN_WD(x) (((x) & 0x3) << 8)
159#define AD5755_MAIN_SHTCCTLIM(x) (((x) & 0x1) << 6)
160#define AD5755_MAIN_OUTEN_ALL (1 << 5)
161#define AD5755_MAIN_DCDC_ALL (1 << 4)
164#define AD5755_WD_5MS 0
165#define AD5755_WD_10MS 1
166#define AD5755_WD_100MS 2
167#define AD5755_WD_200MS 3
170#define AD5755_LIMIT_16_MA 0
171#define AD5755_LIMIT_8_MA 1
174#define AD5755_DAC_INT_ENABLE (1 << 8)
175#define AD5755_DAC_CLR_EN (1 << 7)
176#define AD5755_DAC_OUTEN (1 << 6)
177#define AD5755_DAC_RSET (1 << 5)
178#define AD5755_DAC_DC_DC (1 << 4)
179#define AD5755_DAC_OVRNG (1 << 3)
180#define AD5755_DAC_R(x) ((x) & 0x7)
183#define AD5755_R_0_5_V 0
184#define AD5755_R_0_10_V 1
185#define AD5755_R_M5_P5_V 2
186#define AD5755_R_M10_P10_V 3
187#define AD5755_R_4_20_MA 4
188#define AD5755_R_0_20_MA 5
189#define AD5755_R_0_24_MA 6
192#define AD5755_DC_DC_COMP (1 << 6)
193#define AD5755_DC_DC_PHASE(x) (((x) & 0x3) << 4)
194#define AD5755_DC_DC_FREQ(x) (((x) & 0x3) << 2)
195#define AD5755_DC_DC_MAX_V(x) (((x) & 0x3) << 0)
198#define AD5755_PHASE_ALL_DC_DC 0
199#define AD5755_PHASE_AB_CD 1
200#define AD5755_PHASE_AC_BD 2
201#define AD5755_PHASE_A_B_C_D_90 3
204#define AD5755_FREQ_250_HZ 0
205#define AD5755_FREQ_410_HZ 1
206#define AD5755_FREQ_650_HZ 2
209#define AD5755_MAX_23V 0
210#define AD5755_MAX_24_5V 1
211#define AD5755_MAX_27V 2
212#define AD5755_MAX_29_5V 3
215#define AD5755_SOFT_USER_BIT (1 << 12)
216#define AD5755_SOFT_RESET_CODE(x) ((x) & 0xFFF)
219#define AD5755_RESET_CODE 0x555
220#define AD5755_SPI_CODE 0x195
225#define AD5755_ISR_READ (1 << 23)
231#define AD5755_ISR_RD(x) (((x) & 0x1F) << 16)
234#define AD5755_RD_DATA_REG(x) (((x) & 0x3) + 0)
235#define AD5755_RD_CTRL_REG(x) (((x) & 0x3) + 4)
236#define AD5755_RD_GAIN_REG(x) (((x) & 0x3) + 8)
237#define AD5755_RD_OFFSET_REG(x) (((x) & 0x3) + 12)
238#define AD5755_RD_CODE_REG(x) (((x) & 0x3) + 16)
239#define AD5755_RD_SR_CTRL_REG(x) (((x) & 0x3) + 20)
240#define AD5755_RD_STATUS_REG 24
241#define AD5755_RD_MAIN_CTRL_REG 25
242#define AD5755_RD_Dc_DC_CTRL_REG 26
246#define AD5755_STATUS_DC_DC(x) (1 << (12 + (x)))
247#define AD5755_STATUS_USER_BIT (1 << 11)
248#define AD5755_STATUS_PEC_ERROR (1 << 10)
249#define AD5755_STATUS_RAMP_ACTIVE (1 << 9)
250#define AD5755_STATUS_OVER_TEMP (1 << 8)
252#define AD5755_STATUS_VOUT_FAULT(x) (1 << (4 + (x)))
253#define AD5755_STATUS_IOUT_FAULT(x) (1 << (0 + (x)))
255#define AD5755_CRC_POLYNOMIAL 0x07
256#define AD5755_CRC_CHECK_CODE 0x00
354 uint8_t register_address);
358 uint8_t register_address,
360 uint16_t register_value);
375 uint8_t ctrl_reg_address,
381 uint8_t bytes_number);
uint32_t timeout
Definition ad413x.c:46
void ad5755_feed_watch_dog_timer(struct ad5755_dev *dev)
Write a "service pulse" to the AD5755 watchdog timer when enabled.
Definition ad5755.c:338
uint16_t ad5755_set_register_value(struct ad5755_dev *dev, uint8_t register_address, uint8_t channel, uint16_t register_value)
Writes data into a register.
Definition ad5755.c:252
void ad5755_set_control_registers(struct ad5755_dev *dev, uint8_t ctrl_reg_address, uint8_t channel, uint16_t reg_value)
Configures one of the control registers.
Definition ad5755.c:365
void ad5755_slew_rate_ctrl(struct ad5755_dev *dev, int8_t channel, int8_t sr_en, int8_t updt_freq, int8_t step_size)
Configures the Digital Slew Rate Control.
Definition ad5755.c:567
void ad5755_set_channel_range(struct ad5755_dev *dev, uint8_t channel, uint8_t range)
Sets the range of a channel.
Definition ad5755.c:461
int8_t ad5755_init(struct ad5755_dev **device, struct ad5755_init_param init_param)
Initializes the device and powers-up all channels. The device is initialized with the values held by ...
Definition ad5755.c:51
ad5755_type_t
Definition ad5755.h:314
@ ID_AD5755_1
Definition ad5755.h:316
@ ID_AD5757
Definition ad5755.h:317
@ ID_AD5755
Definition ad5755.h:315
void ad5755_watch_dog_setup(struct ad5755_dev *dev, uint8_t wtd_enable, uint8_t timeout)
Enables/Disables watchdog timer and sets the timeout period.
Definition ad5755.c:314
float ad5755_set_current(struct ad5755_dev *dev, uint8_t channel, float m_acurrent)
Sets the output current of a channel.
Definition ad5755.c:686
void ad5755_software_reset(struct ad5755_dev *dev)
Performs a software reset to the device.
Definition ad5755.c:293
uint8_t ad5755_check_crc(uint8_t *data, uint8_t bytes_number)
Computes the CRC for a data buffer.
Definition ad5755.c:384
float ad5755_set_voltage(struct ad5755_dev *dev, uint8_t channel, float voltage)
Sets the output voltage of a channel.
Definition ad5755.c:594
int32_t ad5755_remove(struct ad5755_dev *dev)
Free the resources allocated by ad5755_init().
Definition ad5755.c:151
int32_t ad5755_get_register_value(struct ad5755_dev *dev, uint8_t register_address)
Reads the value of a register.
Definition ad5755.c:186
void ad5755_channel_clear_enable(struct ad5755_dev *dev, uint8_t channel, uint8_t clear_en)
Selects if the channel clears when CLEAR pin is activated.
Definition ad5755.c:522
void ad5755_set_channel_power(struct ad5755_dev *dev, uint8_t channel, uint8_t pwr_status)
Allows power-up/down of the dc-to-dc converter, DAC and internal amplifiers for the selected channel.
Definition ad5755.c:420
struct ad7616_init_param init_param
Definition ad7616_sdz.c:107
Header file of Delay functions.
Header file of GPIO Interface.
Header file of SPI Interface.
struct no_os_gpio_desc * gpio_poc
Definition ad5755.h:327
struct ad5755_setup * p_ad5755_st
Definition ad5755.h:329
enum ad5755_type_t this_device
Definition ad5755.h:330
struct no_os_gpio_desc * gpio_clr
Definition ad5755.h:326
struct no_os_gpio_desc * gpio_ldac
Definition ad5755.h:324
struct no_os_spi_desc * spi_desc
Definition ad5755.h:322
struct no_os_gpio_desc * gpio_rst
Definition ad5755.h:325
struct no_os_gpio_init_param gpio_ldac
Definition ad5755.h:337
struct no_os_gpio_init_param gpio_poc
Definition ad5755.h:340
struct no_os_spi_init_param spi_init
Definition ad5755.h:335
struct no_os_gpio_init_param gpio_clr
Definition ad5755.h:339
enum ad5755_type_t this_device
Definition ad5755.h:342
struct no_os_gpio_init_param gpio_rst
Definition ad5755.h:338
Stores the settings that will be written to the device when the "AD5755_Init" functions is called.
Definition ad5755.h:263
uint8_t pin_ad1state
Definition ad5755.h:267
uint8_t dc_dc_comp_bit
Definition ad5755.h:300
uint8_t enable_packet_error_check
Definition ad5755.h:271
uint8_t poc_bit
Definition ad5755.h:280
uint8_t pin_ad0state
Definition ad5755.h:265
uint8_t dc_dc_max_vbit
Definition ad5755.h:310
uint8_t sht_cc_lim_bit
Definition ad5755.h:287
uint8_t rset_bits[4]
Definition ad5755.h:293
uint8_t stat_readbit
Definition ad5755.h:282
uint8_t dc_dc_freq_bit
Definition ad5755.h:306
uint8_t dc_dc_phase_bit
Definition ad5755.h:304
uint8_t ovrng_bits[4]
Definition ad5755.h:295
Definition ad9361_util.h:63
Structure holding the GPIO descriptor.
Definition no_os_gpio.h:84
Structure holding the parameters for GPIO initialization.
Definition no_os_gpio.h:67
Structure holding SPI descriptor.
Definition no_os_spi.h:180
Structure holding the parameters for SPI initialization.
Definition no_os_spi.h:128