no-OS
ad5755.h
Go to the documentation of this file.
1 /***************************************************************************/
34 #ifndef __AD5755_H__
35 #define __AD5755_H__
36 
37 /******************************************************************************/
38 /***************************** Include Files **********************************/
39 /******************************************************************************/
40 #include <stdint.h>
41 #include "no_os_delay.h"
42 #include "no_os_gpio.h"
43 #include "no_os_spi.h"
44 
45 /******************************************************************************/
46 /******************* Macros and Constants Definitions *************************/
47 /******************************************************************************/
48 
49 /******************************************************************************/
50 /******************************** AD5755 **************************************/
51 /******************************************************************************/
52 
53 /* LDAC */
54 #define AD5755_LDAC_OUT no_os_gpio_direction_output(dev->gpio_ldac, \
55  NO_OS_GPIO_HIGH);
56 #define AD5755_LDAC_LOW no_os_gpio_set_value(dev->gpio_ldac, \
57  NO_OS_GPIO_LOW)
58 #define AD5755_LDAC_HIGH no_os_gpio_set_value(dev->gpio_ldac, \
59  NO_OS_GPIO_HIGH)
60 
61 /* RESET */
62 #define AD5755_RESET_OUT no_os_gpio_direction_output(dev->gpio_rst, \
63  NO_OS_GPIO_HIGH);
64 #define AD5755_RESET_LOW no_os_gpio_set_value(dev->gpio_rst, \
65  NO_OS_GPIO_LOW)
66 #define AD5755_RESET_HIGH no_os_gpio_set_value(dev->gpio_rst, \
67  NO_OS_GPIO_HIGH)
68 
69 /* CLEAR */
70 #define AD5755_CLEAR_OUT no_os_gpio_direction_output(dev->gpio_clr, \
71  NO_OS_GPIO_HIGH);
72 #define AD5755_CLEAR_LOW no_os_gpio_set_value(dev->gpio_clr, \
73  NO_OS_GPIO_LOW)
74 #define AD5755_CLEAR_HIGH no_os_gpio_set_value(dev->gpio_clr, \
75  NO_OS_GPIO_HIGH)
76 
77 /* POC */
78 #define AD5755_POC_OUT no_os_gpio_direction_output(dev->gpio_poc, \
79  NO_OS_GPIO_HIGH);
80 #define AD5755_POC_LOW no_os_gpio_set_value(dev->gpio_poc, \
81  NO_OS_GPIO_LOW)
82 #define AD5755_POC_HIGH no_os_gpio_set_value(dev->gpio_poc, \
83  NO_OS_GPIO_HIGH)
84 
85 /* Input Shift Register Contents for a Write Operation. */
86 #define AD5755_ISR_WRITE (0ul << 23) /* R/nW */
87 #define AD5755_ISR_DUT_AD1(x) (((x) & 0x1) << 22) /* Device AddrBit1*/
88 #define AD5755_ISR_DUT_AD0(x) (((x) & 0x1) << 21) /* Device AddrBit0*/
89 #define AD5755_ISR_DREG(x) (((x) & 0x7) << 18) /* Register AddrBits*/
90 #define AD5755_ISR_DAC_AD(x) (((x) & 0x3) << 16) /* Channel AddrBits */
91 #define AD5755_ISR_DATA(x) ((x) & 0xFFFF) /* Data Bits*/
92 
93 /* Nop operation code. */
94 #define AD5755_ISR_NOP 0x1CE000
95 
96 /* AD5755_ISR_DREG(x) options. (Register addresses) */
97 #define AD5755_DREG_WR_DAC 0
98 #define AD5755_DREG_WR_GAIN 2
99 #define AD5755_DREG_WR_GAIN_ALL 3
100 #define AD5755_DREG_WR_OFFSET 4
101 #define AD5755_DREG_WR_OFFSET_ALL 5
102 #define AD5755_DREG_WR_CLR_CODE 6
103 #define AD5755_DREG_WR_CTRL_REG 7
104 
105 /* AD5755_ISR_DAC_AD(x) options. (Channel addresses) */
106 #define AD5755_DAC_A 0
107 #define AD5755_DAC_B 1
108 #define AD5755_DAC_C 2
109 #define AD5755_DAC_D 3
110 
111 /* Gain register definition. */
112 #define AD5755_GAIN_ADJUSTMENT(x) ((x) & 0xFFFF)
113 
114 /* Offset register definition. */
115 #define AD5755_OFFSET_ADJUSTMENT(x) ((x) & 0xFFFF)
116 
117 /* Clear Code Register definition. */
118 #define AD5755_CLEAR_CODE(x) ((x) & 0xFFFF)
119 
120 /* Control Register definition. */
121 #define AD5755_CTRL_CREG(x) (((x) & 0x7) << 13)
122 #define AD5755_CTRL_DATA(x) ((x) & 0x1FFF)
123 
124 /* AD5755_CTRL_CREG(x) options. */
125 #define AD5755_CREG_SLEW 0 // Slew rate control register(one per channel)
126 #define AD5755_CREG_MAIN 1 // Main control register
127 #define AD5755_CREG_DAC 2 // DAC control register(one per channel)
128 #define AD5755_CREG_DC_DC 3 // DC-to-dc control register
129 #define AD5755_CREG_SOFT 4 // Software register
130 
131 /* Slew Rate Control Register definition. */
132 #define AD5755_SLEW_SREN (1 << 12)
133 #define AD5755_SLEW_SR_CLOCK(x) (((x) & 0xF) << 3)
134 #define AD5755_SLEW_SR_STEP(x) (((x) & 0x7) << 0)
135 
136 /* AD5755_SLEW_SR_CLOCK(x) options. */
137 #define AD5755_SR_CLK_64K 0
138 #define AD5755_SR_CLK_32k 1
139 #define AD5755_SR_CLK_16k 2
140 #define AD5755_SR_CLK_8K 3
141 #define AD5755_SR_CLK_4K 4
142 #define AD5755_SR_CLK_2K 5
143 #define AD5755_SR_CLK_1K 6
144 #define AD5755_SR_CLK_500 7
145 #define AD5755_SR_CLK_250 8
146 #define AD5755_SR_CLK_125 9
147 #define AD5755_SR_CLK_64 10
148 #define AD5755_SR_CLK_32 11
149 #define AD5755_SR_CLK_16 12
150 #define AD5755_SR_CLK_8 13
151 #define AD5755_SR_CLK_4 14
152 #define AD5755_SR_CLK_0_5 15
153 
154 /* AD5755_SLEW_SR_STEP(x) options. */
155 #define AD5755_STEP_1 0
156 #define AD5755_STEP_2 1
157 #define AD5755_STEP_4 2
158 #define AD5755_STEP_16 3
159 #define AD5755_STEP_32 4
160 #define AD5755_STEP_64 5
161 #define AD5755_STEP_128 6
162 #define AD5755_STEP_256 7
163 
164 /* Main Control Register definition. */
165 #define AD5755_MAIN_POC (1 << 12)
166 #define AD5755_MAIN_STATREAD (1 << 11)
167 #define AD5755_MAIN_EWD (1 <<10)
168 #define AD5755_MAIN_WD(x) (((x) & 0x3) << 8)
169 #define AD5755_MAIN_SHTCCTLIM(x) (((x) & 0x1) << 6)
170 #define AD5755_MAIN_OUTEN_ALL (1 << 5)
171 #define AD5755_MAIN_DCDC_ALL (1 << 4)
172 
173 /* AD5755_MAIN_WD(x) options. */
174 #define AD5755_WD_5MS 0 // 5 ms timeout period
175 #define AD5755_WD_10MS 1 // 10 ms timeout period
176 #define AD5755_WD_100MS 2 // 100 ms timeout period
177 #define AD5755_WD_200MS 3 // 200 ms timeout period
178 
179 /* AD5755_MAIN_SHTCCTLIM(x) options. */
180 #define AD5755_LIMIT_16_MA 0 // 16 mA (default)
181 #define AD5755_LIMIT_8_MA 1 // 8 mA
182 
183 /* DAC Control Register definition. */
184 #define AD5755_DAC_INT_ENABLE (1 << 8)
185 #define AD5755_DAC_CLR_EN (1 << 7)
186 #define AD5755_DAC_OUTEN (1 << 6)
187 #define AD5755_DAC_RSET (1 << 5)
188 #define AD5755_DAC_DC_DC (1 << 4)
189 #define AD5755_DAC_OVRNG (1 << 3)
190 #define AD5755_DAC_R(x) ((x) & 0x7)
191 
192 /* AD5755_DAC_R(x) options. */
193 #define AD5755_R_0_5_V 0 // 0 V to 5 V voltage range (default)
194 #define AD5755_R_0_10_V 1 // 0 V to 10 V voltage range
195 #define AD5755_R_M5_P5_V 2 // -5 V to +5 V voltage range
196 #define AD5755_R_M10_P10_V 3 // -10 V to 10 V voltage range
197 #define AD5755_R_4_20_MA 4 // 4 mA to 20 mA current range
198 #define AD5755_R_0_20_MA 5 // 0 mA to 20 mA current range
199 #define AD5755_R_0_24_MA 6 // 0 mA to 24 mA current range
200 
201 /* DC-to-DC Control Register definition. */
202 #define AD5755_DC_DC_COMP (1 << 6)
203 #define AD5755_DC_DC_PHASE(x) (((x) & 0x3) << 4)
204 #define AD5755_DC_DC_FREQ(x) (((x) & 0x3) << 2)
205 #define AD5755_DC_DC_MAX_V(x) (((x) & 0x3) << 0)
206 
207 /* AD5755_DC_DC_PHASE(x) options. */
208 #define AD5755_PHASE_ALL_DC_DC 0 // all dc-dc converters clock on same edge
209 #define AD5755_PHASE_AB_CD 1 // Ch A,B clk same edge, C,D opposite edge
210 #define AD5755_PHASE_AC_BD 2 // Ch A,C clk same edge, B,D opposite edge
211 #define AD5755_PHASE_A_B_C_D_90 3 // A,B,C,D clock 90 degree out of phase
212 
213 /* AD5755_DC_DC_FREQ(x) options. */
214 #define AD5755_FREQ_250_HZ 0 // 250 +/- 10% kHz
215 #define AD5755_FREQ_410_HZ 1 // 410 +/- 10% kHz
216 #define AD5755_FREQ_650_HZ 2 // 650 +/- 10% kHz
217 
218 /* AD5755_DC_DC_MAX_V(x) options. */
219 #define AD5755_MAX_23V 0 // 23 V + 1 V/-1.5 V (default)
220 #define AD5755_MAX_24_5V 1 // 24.5 V +/- 1 V
221 #define AD5755_MAX_27V 2 // 27 V +/- 1 V
222 #define AD5755_MAX_29_5V 3 // 29.5 V +/- 1V
223 
224 /* Software Register definition. */
225 #define AD5755_SOFT_USER_BIT (1 << 12)
226 #define AD5755_SOFT_RESET_CODE(x) ((x) & 0xFFF)
227 
228 /* AD5755_SOFT_RESET_CODE(x) options. */
229 #define AD5755_RESET_CODE 0x555 // Performs a reset of the AD5755.
230 #define AD5755_SPI_CODE 0x195 // If watchdog is enabled, 0x195 must be
231 // written to the software register within
232 // the programmed timeout period.
233 
234 /* Input Shift Register Contents for a Read Operation. */
235 #define AD5755_ISR_READ (1 << 23)
236 /* Same as Input Shift Register Contents for a Write Operation. */
237 /*
238 #define AD5755_ISR_DUT_AD1(x) (((x) & 0x1) << 22)
239 #define AD5755_ISR_DUT_AD0(x) (((x) & 0x1) << 21)
240 */
241 #define AD5755_ISR_RD(x) (((x) & 0x1F) << 16)
242 
243 /* AD5755_ISR_RD(x) options. (Read address decoding) */
244 #define AD5755_RD_DATA_REG(x) (((x) & 0x3) + 0)
245 #define AD5755_RD_CTRL_REG(x) (((x) & 0x3) + 4)
246 #define AD5755_RD_GAIN_REG(x) (((x) & 0x3) + 8)
247 #define AD5755_RD_OFFSET_REG(x) (((x) & 0x3) + 12)
248 #define AD5755_RD_CODE_REG(x) (((x) & 0x3) + 16)
249 #define AD5755_RD_SR_CTRL_REG(x) (((x) & 0x3) + 20)
250 #define AD5755_RD_STATUS_REG 24
251 #define AD5755_RD_MAIN_CTRL_REG 25
252 #define AD5755_RD_Dc_DC_CTRL_REG 26
253 
254 /* Status Register definition. */
255 /* channelA = 0 ... channelD = 3 */
256 #define AD5755_STATUS_DC_DC(x) (1 << (12 + (x)))
257 #define AD5755_STATUS_USER_BIT (1 << 11)
258 #define AD5755_STATUS_PEC_ERROR (1 << 10)
259 #define AD5755_STATUS_RAMP_ACTIVE (1 << 9)
260 #define AD5755_STATUS_OVER_TEMP (1 << 8)
261 /* channelA = 0 ... channelD = 3 */
262 #define AD5755_STATUS_VOUT_FAULT(x) (1 << (4 + (x)))
263 #define AD5755_STATUS_IOUT_FAULT(x) (1 << (0 + (x)))
264 
265 #define AD5755_CRC_POLYNOMIAL 0x07 // P(x)=x^8+x^2+x^1+1 = 100000111
266 #define AD5755_CRC_CHECK_CODE 0x00
267 
268 /*****************************************************************************/
269 /************************** Types Declarations *******************************/
270 /*****************************************************************************/
276 struct ad5755_setup {
278  uint8_t pin_ad0state;
280  uint8_t pin_ad1state;
285 
293  uint8_t poc_bit;
295  uint8_t stat_readbit;
300  uint8_t sht_cc_lim_bit;
301 
306  uint8_t rset_bits[4];
308  uint8_t ovrng_bits[4];
309 
313  uint8_t dc_dc_comp_bit;
319  uint8_t dc_dc_freq_bit;
323  uint8_t dc_dc_max_vbit;
324 };
325 
326 /* Supported devices */
331 };
332 
333 struct ad5755_dev {
334  /* SPI */
336  /* GPIO */
341  /* Device Settings */
344 };
345 
347  /* SPI */
349  /* GPIO */
354  /* Device Settings */
356 };
357 
358 /******************************************************************************/
359 /************************ Functions Declarations ******************************/
360 /******************************************************************************/
361 
363 int8_t ad5755_init(struct ad5755_dev **device,
365 
367 int32_t ad5755_remove(struct ad5755_dev *dev);
368 
370 int32_t ad5755_get_register_value(struct ad5755_dev *dev,
371  uint8_t register_address);
372 
374 uint16_t ad5755_set_register_value(struct ad5755_dev *dev,
375  uint8_t register_address,
376  uint8_t channel,
377  uint16_t register_value);
378 
380 void ad5755_software_reset(struct ad5755_dev *dev);
381 
383 void ad5755_watch_dog_setup(struct ad5755_dev *dev,
384  uint8_t wtd_enable,
385  uint8_t timeout);
386 
388 void ad5755_feed_watch_dog_timer(struct ad5755_dev *dev);
389 
392  uint8_t ctrl_reg_address,
393  uint8_t channel,
394  uint16_t reg_value);
395 
397 uint8_t ad5755_check_crc(uint8_t* data,
398  uint8_t bytes_number);
399 
402 void ad5755_set_channel_power(struct ad5755_dev *dev,
403  uint8_t channel,
404  uint8_t pwr_status);
405 
407 void ad5755_set_channel_range(struct ad5755_dev *dev,
408  uint8_t channel,
409  uint8_t range);
410 
412 void ad5755_channel_clear_enable(struct ad5755_dev *dev,
413  uint8_t channel,
414  uint8_t clear_en);
415 
417 void ad5755_slew_rate_ctrl(struct ad5755_dev *dev,
418  int8_t channel,
419  int8_t sr_en,
420  int8_t updt_freq,
421  int8_t step_size);
422 
424 float ad5755_set_voltage(struct ad5755_dev *dev,
425  uint8_t channel,
426  float voltage);
427 
429 float ad5755_set_current(struct ad5755_dev *dev,
430  uint8_t channel,
431  float m_acurrent);
432 
433 #endif // __AD5755_H__
ad5755_setup::rset_bits
uint8_t rset_bits[4]
Definition: ad5755.h:306
ad5755_set_current
float ad5755_set_current(struct ad5755_dev *dev, uint8_t channel, float m_acurrent)
Sets the output current of a channel.
Definition: ad5755.c:711
ad5755_set_voltage
float ad5755_set_voltage(struct ad5755_dev *dev, uint8_t channel, float voltage)
Sets the output voltage of a channel.
Definition: ad5755.c:619
timeout
uint32_t timeout
Definition: ad413x.c:49
no_os_alloc.h
no_os_gpio_init_param
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
ad5755_setup::dc_dc_max_vbit
uint8_t dc_dc_max_vbit
Definition: ad5755.h:323
ad5755_setup::dc_dc_freq_bit
uint8_t dc_dc_freq_bit
Definition: ad5755.h:319
ad5755_set_voltage
float ad5755_set_voltage(struct ad5755_dev *dev, uint8_t channel, float voltage)
Sets the output voltage of a channel.
Definition: ad5755.c:619
AD5755_RD_MAIN_CTRL_REG
#define AD5755_RD_MAIN_CTRL_REG
Definition: ad5755.h:251
ad5755_dev::gpio_ldac
struct no_os_gpio_desc * gpio_ldac
Definition: ad5755.h:337
no_os_spi_write_and_read
int32_t no_os_spi_write_and_read(struct no_os_spi_desc *desc, uint8_t *data, uint16_t bytes_number)
Write and read data to/from SPI.
Definition: no_os_spi.c:159
ad5755_dev::spi_desc
struct no_os_spi_desc * spi_desc
Definition: ad5755.h:335
no_os_spi.h
Header file of SPI Interface.
AD5755_DAC_INT_ENABLE
#define AD5755_DAC_INT_ENABLE
Definition: ad5755.h:184
AD5755_CRC_CHECK_CODE
#define AD5755_CRC_CHECK_CODE
Definition: ad5755.h:266
ad5755_set_current
float ad5755_set_current(struct ad5755_dev *dev, uint8_t channel, float m_acurrent)
Sets the output current of a channel.
Definition: ad5755.c:711
ad5755_dev::gpio_rst
struct no_os_gpio_desc * gpio_rst
Definition: ad5755.h:338
AD5755_DAC_CLR_EN
#define AD5755_DAC_CLR_EN
Definition: ad5755.h:185
ad5755_dev::p_ad5755_st
struct ad5755_setup * p_ad5755_st
Definition: ad5755.h:342
ad5755_type_t
ad5755_type_t
Definition: ad5755.h:327
ad5755_cfg.h
Header file of AD5755 Driver Configuration.
AD5755_SLEW_SREN
#define AD5755_SLEW_SREN
Definition: ad5755.h:132
no_os_delay.h
Header file of Delay functions.
ad5755_software_reset
void ad5755_software_reset(struct ad5755_dev *dev)
Performs a software reset to the device.
Definition: ad5755.c:304
AD5755_RD_GAIN_REG
#define AD5755_RD_GAIN_REG(x)
Definition: ad5755.h:246
AD5755_MAIN_WD
#define AD5755_MAIN_WD(x)
Definition: ad5755.h:168
ad5755_dev::this_device
enum ad5755_type_t this_device
Definition: ad5755.h:343
AD5755_DC_DC_FREQ
#define AD5755_DC_DC_FREQ(x)
Definition: ad5755.h:204
AD5755_DAC_A
#define AD5755_DAC_A
Definition: ad5755.h:106
AD5755_ISR_RD
#define AD5755_ISR_RD(x)
Definition: ad5755.h:241
ad5755_init_param::gpio_clr
struct no_os_gpio_init_param gpio_clr
Definition: ad5755.h:352
device
Definition: ad9361_util.h:69
AD5755_MAIN_POC
#define AD5755_MAIN_POC
Definition: ad5755.h:165
AD5755_LDAC_OUT
#define AD5755_LDAC_OUT
Definition: ad5755.h:54
AD5755_ISR_DATA
#define AD5755_ISR_DATA(x)
Definition: ad5755.h:91
AD5755_CREG_DC_DC
#define AD5755_CREG_DC_DC
Definition: ad5755.h:128
ad5755_setup::dc_dc_comp_bit
uint8_t dc_dc_comp_bit
Definition: ad5755.h:313
ad5755_channel_clear_enable
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:545
ad5755_get_register_value
int32_t ad5755_get_register_value(struct ad5755_dev *dev, uint8_t register_address)
Reads the value of a register.
Definition: ad5755.c:193
ad5755_feed_watch_dog_timer
void ad5755_feed_watch_dog_timer(struct ad5755_dev *dev)
Write a "service pulse" to the AD5755 watchdog timer when enabled.
Definition: ad5755.c:353
AD5755_ISR_DUT_AD0
#define AD5755_ISR_DUT_AD0(x)
Definition: ad5755.h:88
AD5755_DREG_WR_DAC
#define AD5755_DREG_WR_DAC
Definition: ad5755.h:97
ad5755_setup::sht_cc_lim_bit
uint8_t sht_cc_lim_bit
Definition: ad5755.h:300
ad5755_dev::gpio_clr
struct no_os_gpio_desc * gpio_clr
Definition: ad5755.h:339
AD5755_CREG_MAIN
#define AD5755_CREG_MAIN
Definition: ad5755.h:126
AD5755_ISR_DREG
#define AD5755_ISR_DREG(x)
Definition: ad5755.h:89
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
AD5755_POC_LOW
#define AD5755_POC_LOW
Definition: ad5755.h:80
AD5755_DC_DC_MAX_V
#define AD5755_DC_DC_MAX_V(x)
Definition: ad5755.h:205
ad5755_watch_dog_setup
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:327
AD5755_R_0_10_V
#define AD5755_R_0_10_V
Definition: ad5755.h:194
ID_AD5757
@ ID_AD5757
Definition: ad5755.h:330
ad5755_channel_clear_enable
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:545
AD5755_DREG_WR_CTRL_REG
#define AD5755_DREG_WR_CTRL_REG
Definition: ad5755.h:103
ad5755_setup::poc_bit
uint8_t poc_bit
Definition: ad5755.h:293
ID_AD5755
@ ID_AD5755
Definition: ad5755.h:328
ad5755_slew_rate_ctrl
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:592
ad5755.h
Header file of AD5755 Driver. This driver supporting the following devices: AD5755,...
ad5755_dev
Definition: ad5755.h:333
AD5755_ISR_DAC_AD
#define AD5755_ISR_DAC_AD(x)
Definition: ad5755.h:90
ad5755_init_param::gpio_poc
struct no_os_gpio_init_param gpio_poc
Definition: ad5755.h:353
AD5755_MAIN_STATREAD
#define AD5755_MAIN_STATREAD
Definition: ad5755.h:166
AD5755_MAIN_EWD
#define AD5755_MAIN_EWD
Definition: ad5755.h:167
ad5755_init_param::this_device
enum ad5755_type_t this_device
Definition: ad5755.h:355
ad5755_set_channel_range
void ad5755_set_channel_range(struct ad5755_dev *dev, uint8_t channel, uint8_t range)
Sets the range of a channel.
Definition: ad5755.c:482
ad5755_setup::dc_dc_phase_bit
uint8_t dc_dc_phase_bit
Definition: ad5755.h:317
AD5755_st
struct ad5755_setup AD5755_st
Definition: ad5755_cfg.h:37
AD5755_ISR_DUT_AD1
#define AD5755_ISR_DUT_AD1(x)
Definition: ad5755.h:87
AD5755_ISR_READ
#define AD5755_ISR_READ
Definition: ad5755.h:235
AD5755_DC_DC_PHASE
#define AD5755_DC_DC_PHASE(x)
Definition: ad5755.h:203
AD5755_RD_CTRL_REG
#define AD5755_RD_CTRL_REG(x)
Definition: ad5755.h:245
AD5755_LDAC_LOW
#define AD5755_LDAC_LOW
Definition: ad5755.h:56
ad5755_feed_watch_dog_timer
void ad5755_feed_watch_dog_timer(struct ad5755_dev *dev)
Write a "service pulse" to the AD5755 watchdog timer when enabled.
Definition: ad5755.c:353
AD5755_CLEAR_OUT
#define AD5755_CLEAR_OUT
Definition: ad5755.h:70
AD5755_ISR_NOP
#define AD5755_ISR_NOP
Definition: ad5755.h:94
ad5755_init_param::spi_init
struct no_os_spi_init_param spi_init
Definition: ad5755.h:348
ad5755_set_register_value
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:261
AD5755_SLEW_SR_STEP
#define AD5755_SLEW_SR_STEP(x)
Definition: ad5755.h:134
AD5755_SPI_CODE
#define AD5755_SPI_CODE
Definition: ad5755.h:230
ad5755_slew_rate_ctrl
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:592
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
AD5755_DAC_OUTEN
#define AD5755_DAC_OUTEN
Definition: ad5755.h:186
ad5755_dev::gpio_poc
struct no_os_gpio_desc * gpio_poc
Definition: ad5755.h:340
ad5755_remove
int32_t ad5755_remove(struct ad5755_dev *dev)
Free the resources allocated by ad5755_init().
Definition: ad5755.c:158
no_os_gpio_desc
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
AD5755_ISR_WRITE
#define AD5755_ISR_WRITE
Definition: ad5755.h:86
ad5755_setup
Stores the settings that will be written to the device when the "AD5755_Init" functions is called.
Definition: ad5755.h:276
ad5755_setup::pin_ad1state
uint8_t pin_ad1state
Definition: ad5755.h:280
ad5755_check_crc
uint8_t ad5755_check_crc(uint8_t *data, uint8_t bytes_number)
Computes the CRC for a data buffer.
Definition: ad5755.c:401
AD5755_RD_OFFSET_REG
#define AD5755_RD_OFFSET_REG(x)
Definition: ad5755.h:247
no_os_gpio_get
int32_t no_os_gpio_get(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Obtain the GPIO decriptor.
Definition: no_os_gpio.c:49
ad5755_set_control_registers
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:382
no_os_malloc
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:43
ad5755_setup::stat_readbit
uint8_t stat_readbit
Definition: ad5755.h:295
ad5755_init
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:58
ad5755_set_channel_range
void ad5755_set_channel_range(struct ad5755_dev *dev, uint8_t channel, uint8_t range)
Sets the range of a channel.
Definition: ad5755.c:482
AD5755_DAC_D
#define AD5755_DAC_D
Definition: ad5755.h:109
ad5755_get_register_value
int32_t ad5755_get_register_value(struct ad5755_dev *dev, uint8_t register_address)
Reads the value of a register.
Definition: ad5755.c:193
AD5755_RESET_CODE
#define AD5755_RESET_CODE
Definition: ad5755.h:229
AD5755_POC_OUT
#define AD5755_POC_OUT
Definition: ad5755.h:78
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
AD5755_DC_DC_COMP
#define AD5755_DC_DC_COMP
Definition: ad5755.h:202
AD5755_R_M10_P10_V
#define AD5755_R_M10_P10_V
Definition: ad5755.h:196
AD5755_R_0_5_V
#define AD5755_R_0_5_V
Definition: ad5755.h:193
ad5755_remove
int32_t ad5755_remove(struct ad5755_dev *dev)
Free the resources allocated by ad5755_init().
Definition: ad5755.c:158
AD5755_R_0_20_MA
#define AD5755_R_0_20_MA
Definition: ad5755.h:198
AD5755_CREG_SLEW
#define AD5755_CREG_SLEW
Definition: ad5755.h:125
ad5755_setup::pin_ad0state
uint8_t pin_ad0state
Definition: ad5755.h:278
AD5755_DAC_DC_DC
#define AD5755_DAC_DC_DC
Definition: ad5755.h:188
AD5755_R_4_20_MA
#define AD5755_R_4_20_MA
Definition: ad5755.h:197
ad5755_check_crc
uint8_t ad5755_check_crc(uint8_t *data, uint8_t bytes_number)
Computes the CRC for a data buffer.
Definition: ad5755.c:401
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
ad5755_watch_dog_setup
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:327
ad5755_set_control_registers
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:382
ad5755_software_reset
void ad5755_software_reset(struct ad5755_dev *dev)
Performs a software reset to the device.
Definition: ad5755.c:304
AD5755_MAIN_SHTCCTLIM
#define AD5755_MAIN_SHTCCTLIM(x)
Definition: ad5755.h:169
ad5755_init
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:58
ad5755_setup::enable_packet_error_check
uint8_t enable_packet_error_check
Definition: ad5755.h:284
AD5755_R_0_24_MA
#define AD5755_R_0_24_MA
Definition: ad5755.h:199
AD5755_SLEW_SR_CLOCK
#define AD5755_SLEW_SR_CLOCK(x)
Definition: ad5755.h:133
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
no_os_gpio.h
Header file of GPIO Interface.
AD5755_RESET_OUT
#define AD5755_RESET_OUT
Definition: ad5755.h:62
AD5755_DAC_R
#define AD5755_DAC_R(x)
Definition: ad5755.h:190
ID_AD5755_1
@ ID_AD5755_1
Definition: ad5755.h:329
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
ad5755_init_param::gpio_rst
struct no_os_gpio_init_param gpio_rst
Definition: ad5755.h:351
AD5755_CTRL_CREG
#define AD5755_CTRL_CREG(x)
Definition: ad5755.h:121
AD5755_RESET_HIGH
#define AD5755_RESET_HIGH
Definition: ad5755.h:66
ad5755_init_param
Definition: ad5755.h:346
ad5755_setup::ovrng_bits
uint8_t ovrng_bits[4]
Definition: ad5755.h:308
AD5755_R_M5_P5_V
#define AD5755_R_M5_P5_V
Definition: ad5755.h:195
ad5755_set_channel_power
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:439
ad5755_set_register_value
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:261
ad5755_init_param::gpio_ldac
struct no_os_gpio_init_param gpio_ldac
Definition: ad5755.h:350
AD5755_CREG_SOFT
#define AD5755_CREG_SOFT
Definition: ad5755.h:129
AD5755_CRC_POLYNOMIAL
#define AD5755_CRC_POLYNOMIAL
Definition: ad5755.h:265
ad5755_set_channel_power
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:439
AD5755_CREG_DAC
#define AD5755_CREG_DAC
Definition: ad5755.h:127
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
AD5755_CLEAR_LOW
#define AD5755_CLEAR_LOW
Definition: ad5755.h:72