no-OS
ad5761r.h
Go to the documentation of this file.
1 /***************************************************************************/
40 /******************************************************************************/
41 /***************************** Include Files **********************************/
42 /******************************************************************************/
43 #include <stdint.h>
44 #include "no_os_gpio.h"
45 #include "no_os_spi.h"
46 
47 /******************************************************************************/
48 /********************** Macros and Constants Definitions **********************/
49 /******************************************************************************/
50 
51 #ifndef AD5761R_H_
52 #define AD5761R_H_
53 
54 /* Input Shift Register Format */
55 #define AD5761R_INPUT_ZERO_BIT (1 << 20)
56 #define AD5761R_INPUT_ADDR_CMD(x) (((x) & 0xF) << 16)
57 #define AD5761R_INPUT_DATA(x) (((x) & 0xFFFF) << 0)
58 
59 #define AD5761R_DATA(x) (((x) & 0xFFFF) << 0)
60 #define AD5721R_DATA(x) (((x) & 0xFFF) << 4)
61 
62 /* Input Shift Register Commands */
63 #define CMD_NOP 0x0
64 #define CMD_WR_TO_INPUT_REG 0x1
65 #define CMD_UPDATE_DAC_REG 0x2
66 #define CMD_WR_UPDATE_DAC_REG 0x3
67 #define CMD_WR_CTRL_REG 0x4
68 #define CMD_NOP_ALT_1 0x5
69 #define CMD_NOP_ALT_2 0x6
70 #define CMD_SW_DATA_RESET 0x7
71 #define CMD_RESERVED 0x8
72 #define CMD_DIS_DAISY_CHAIN 0x9
73 #define CMD_RD_INPUT_REG 0xA
74 #define CMD_RD_DAC_REG 0xB
75 #define CMD_RD_CTRL_REG 0xC
76 #define CMD_NOP_ALT_3 0xD
77 #define CMD_NOP_ALT_4 0xE
78 #define CMD_SW_FULL_RESET 0xF
79 
80 /* Control Register Format */
81 #define AD5761R_CTRL_SC (1 << 12) // RO
82 #define AD5761R_CTRL_BO (1 << 11) // RO
83 #define AD5761R_CTRL_CV(x) (((x) & 0x3) << 9) // RW
84 #define AD5761R_CTRL_OVR (1 << 8) // RW
85 #define AD5761R_CTRL_B2C (1 << 7) // RW
86 #define AD5761R_CTRL_ETS (1 << 6) // RW
87 #define AD5761R_CTRL_IRO (1 << 5) // RW
88 #define AD5761R_CTRL_PV(x) (((x) & 0x3) << 3) // RW
89 #define AD5761R_CTRL_RA(x) (((x) & 0x7) << 0) // RW
90 
91 /* Disable Daisy-Chain Register Format */
92 #define AD5761R_DIS_DAISY_CHAIN_DDC(x) (((x) & 0x1) << 0)
93 
94 /******************************************************************************/
95 /*************************** Types Declarations *******************************/
96 /******************************************************************************/
97 
101 };
102 
107 };
108 
113 };
114 
124 };
125 
126 struct ad5761r_dev {
127  /* SPI */
129  /* GPIO */
133  uint8_t gpio_clr_value;
136  /* Device Settings */
144  bool ovr_en;
146 };
147 
149  /* SPI */
151  /* GPIO */
155  uint8_t gpio_clr_value;
158  /* Device Settings */
166  bool ovr_en;
168 };
169 
170 /******************************************************************************/
171 /************************ Functions Declarations ******************************/
172 /******************************************************************************/
173 /* Initialize the device. */
174 int32_t ad5761r_init(struct ad5761r_dev **device,
176 /* Free the resources allocated by ad5761r_init(). */
177 int32_t ad5761r_remove(struct ad5761r_dev *dev);
178 /* SPI write to device. */
179 int32_t ad5761r_write(struct ad5761r_dev *dev,
180  uint8_t reg_addr_cmd,
181  uint16_t reg_data);
182 /* SPI read from device. */
183 int32_t ad5761r_read(struct ad5761r_dev *dev,
184  uint8_t reg_addr_cmd,
185  uint16_t *reg_data);
186 /* Readback the register data. */
187 int32_t ad5761r_register_readback(struct ad5761r_dev *dev,
188  enum ad5761r_reg reg,
189  uint16_t *reg_data);
190 /* Configure the part based on the settings stored in the device structure. */
191 int32_t ad5761r_config(struct ad5761r_dev *dev);
192 /* Enable/disable daisy-chain mode. */
193 int32_t ad5761r_set_daisy_chain_en_dis(struct ad5761r_dev *dev,
194  bool en_dis);
195 /* Get the status of the daisy-chain mode. */
196 int32_t ad5761r_get_daisy_chain_en_dis(struct ad5761r_dev *dev,
197  bool *en_dis);
198 /* Set the output_range. */
199 int32_t ad5761r_set_output_range(struct ad5761r_dev *dev,
200  enum ad5761r_range out_range);
201 /* Get the output_range. */
202 int32_t ad5761r_get_output_range(struct ad5761r_dev *dev,
203  enum ad5761r_range *out_range);
204 /* Set the power up voltage. */
205 int32_t ad5761r_set_power_up_voltage(struct ad5761r_dev *dev,
206  enum ad5761r_scale pv);
207 /* Get the power up voltage. */
208 int32_t ad5761r_get_power_up_voltage(struct ad5761r_dev *dev,
209  enum ad5761r_scale *pv);
210 /* Set the clear voltage. */
211 int32_t ad5761r_set_clear_voltage(struct ad5761r_dev *dev,
212  enum ad5761r_scale cv);
213 /* Get the clear voltage. */
214 int32_t ad5761r_get_clear_voltage(struct ad5761r_dev *dev,
215  enum ad5761r_scale *cv);
216 /* Enable/disable internal reference. */
218  bool en_dis);
219 /* Get the status of the internal reference. */
221  bool *en_dis);
222 /* Enable/disable ETS (exceed temperature shutdown) function. */
224  bool en_dis);
225 /* Get the status of the ETS (exceed temperature shutdown) function. */
227  bool *en_dis);
228 /* Enable/disable the twos complement bipolar output range. */
230  bool en_dis);
231 /* Get the status of the twos complement bipolar output range. */
233  bool *en_dis);
234 /* Enable/disable the 5% overrange. */
235 int32_t ad5761r_set_overrange_en_dis(struct ad5761r_dev *dev,
236  bool en_dis);
237 /* Get the status of the 5% overrange. */
238 int32_t ad5761r_get_overrange_en_dis(struct ad5761r_dev *dev,
239  bool *en_dis);
240 /* Get the short-circuit condition. */
242  bool *sc);
243 /* Get the brownout condition. */
244 int32_t ad5761r_get_brownout_condition(struct ad5761r_dev *dev,
245  bool *bo);
246 /* Set the reset pin value. */
247 int32_t ad5761r_set_reset_pin(struct ad5761r_dev *dev,
248  uint8_t value);
249 /* Get the reset pin value. */
250 int32_t ad5761r_get_reset_pin(struct ad5761r_dev *dev,
251  uint8_t *value);
252 /* Set the clr pin value. */
253 int32_t ad5761r_set_clr_pin(struct ad5761r_dev *dev,
254  uint8_t value);
255 /* Get the clr pin value. */
256 int32_t ad5761r_get_clr_pin(struct ad5761r_dev *dev,
257  uint8_t *value);
258 /* Set the ldac pin value. */
259 int32_t ad5761r_set_ldac_pin(struct ad5761r_dev *dev,
260  uint8_t value);
261 /* Get the ldac pin value. */
262 int32_t ad5761r_get_ldac_pin(struct ad5761r_dev *dev,
263  uint8_t *value);
264 /* Write to input register. */
265 int32_t ad5761r_write_input_register(struct ad5761r_dev *dev,
266  uint16_t reg_data);
267 /* Update DAC register. */
268 int32_t ad5761r_update_dac_register(struct ad5761r_dev *dev);
269 /* Write to input register and update DAC register. */
271  uint16_t reg_data);
272 /*Software data reset. */
273 int32_t ad5761r_software_data_reset(struct ad5761r_dev *dev);
274 /* Software full reset. */
275 int32_t ad5761r_software_full_reset(struct ad5761r_dev *dev);
276 
277 #endif // AD5761R_H_
CMD_WR_CTRL_REG
#define CMD_WR_CTRL_REG
Definition: ad5761r.h:67
ad5761r_write_update_dac_register
int32_t ad5761r_write_update_dac_register(struct ad5761r_dev *dev, uint16_t reg_data)
Definition: ad5761r.c:619
AD5761R_RANGE_M_3V_TO_P_3V
@ AD5761R_RANGE_M_3V_TO_P_3V
Definition: ad5761r.h:121
CMD_RD_CTRL_REG
#define CMD_RD_CTRL_REG
Definition: ad5761r.h:75
ad5761r_set_clear_voltage
int32_t ad5761r_set_clear_voltage(struct ad5761r_dev *dev, enum ad5761r_scale cv)
Definition: ad5761r.c:295
AD5761R_SCALE_HALF
@ AD5761R_SCALE_HALF
Definition: ad5761r.h:111
no_os_gpio_init_param
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:85
ad5761r_update_dac_register
int32_t ad5761r_update_dac_register(struct ad5761r_dev *dev)
Definition: ad5761r.c:608
ad5761r_init_param::clr_voltage
enum ad5761r_scale clr_voltage
Definition: ad5761r.h:162
ad5761r_dev
Definition: ad5761r.h:126
ad5761r_set_exceed_temp_shutdown_en_dis
int32_t ad5761r_set_exceed_temp_shutdown_en_dis(struct ad5761r_dev *dev, bool en_dis)
Definition: ad5761r.c:355
ad5761r_set_clr_pin
int32_t ad5761r_set_clr_pin(struct ad5761r_dev *dev, uint8_t value)
Definition: ad5761r.c:522
AD5761R_RANGE_0_V_TO_P_10V
@ AD5761R_RANGE_0_V_TO_P_10V
Definition: ad5761r.h:117
ad5761r_get_ldac_pin
int32_t ad5761r_get_ldac_pin(struct ad5761r_dev *dev, uint8_t *value)
Definition: ad5761r.c:574
ad5761r_set_power_up_voltage
int32_t ad5761r_set_power_up_voltage(struct ad5761r_dev *dev, enum ad5761r_scale pv)
Definition: ad5761r.c:264
AD5761R_RANGE_M_2V5_TO_P_7V5
@ AD5761R_RANGE_M_2V5_TO_P_7V5
Definition: ad5761r.h:120
ad5761r_set_2c_bipolar_range_en_dis
int32_t ad5761r_set_2c_bipolar_range_en_dis(struct ad5761r_dev *dev, bool en_dis)
Definition: ad5761r.c:386
CMD_DIS_DAISY_CHAIN
#define CMD_DIS_DAISY_CHAIN
Definition: ad5761r.h:72
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:82
ad5761r_set_reset_pin
int32_t ad5761r_set_reset_pin(struct ad5761r_dev *dev, uint8_t value)
Definition: ad5761r.c:487
ad5761r_dev::pv
enum ad5761r_scale pv
Definition: ad5761r.h:139
ad5761r_get_2c_bipolar_range_en_dis
int32_t ad5761r_get_2c_bipolar_range_en_dis(struct ad5761r_dev *dev, bool *en_dis)
Definition: ad5761r.c:401
ad5761r_register_readback
int32_t ad5761r_register_readback(struct ad5761r_dev *dev, enum ad5761r_reg reg, uint16_t *reg_data)
Definition: ad5761r.c:132
ad5761r_get_clr_pin
int32_t ad5761r_get_clr_pin(struct ad5761r_dev *dev, uint8_t *value)
Definition: ad5761r.c:539
ad5761r_reg
ad5761r_reg
Definition: ad5761r.h:103
no_os_spi.h
Header file of SPI Interface.
AD5761R_SCALE_ZERO
@ AD5761R_SCALE_ZERO
Definition: ad5761r.h:110
ad5761r_set_overrange_en_dis
int32_t ad5761r_set_overrange_en_dis(struct ad5761r_dev *dev, bool en_dis)
Definition: ad5761r.c:417
ad5761r_dev::exc_temp_sd_en
bool exc_temp_sd_en
Definition: ad5761r.h:142
ad5761r_dev::gpio_clr_value
uint8_t gpio_clr_value
Definition: ad5761r.h:133
AD5761R_CTRL_PV
#define AD5761R_CTRL_PV(x)
Definition: ad5761r.h:88
CMD_WR_UPDATE_DAC_REG
#define CMD_WR_UPDATE_DAC_REG
Definition: ad5761r.h:66
ad5761r_get_short_circuit_condition
int32_t ad5761r_get_short_circuit_condition(struct ad5761r_dev *dev, bool *sc)
Definition: ad5761r.c:447
ad5761r_get_ldac_pin
int32_t ad5761r_get_ldac_pin(struct ad5761r_dev *dev, uint8_t *value)
Definition: ad5761r.c:574
CMD_SW_FULL_RESET
#define CMD_SW_FULL_RESET
Definition: ad5761r.h:78
ad5761r_config
int32_t ad5761r_config(struct ad5761r_dev *dev)
Definition: ad5761r.c:173
AD5761R_DATA
#define AD5761R_DATA(x)
Definition: ad5761r.h:59
ad5761r_set_power_up_voltage
int32_t ad5761r_set_power_up_voltage(struct ad5761r_dev *dev, enum ad5761r_scale pv)
Definition: ad5761r.c:264
ad5761r_init_param::daisy_chain_en
bool daisy_chain_en
Definition: ad5761r.h:167
CMD_RD_INPUT_REG
#define CMD_RD_INPUT_REG
Definition: ad5761r.h:73
device
Definition: ad9361_util.h:75
ad5761r_get_exceed_temp_shutdown_en_dis
int32_t ad5761r_get_exceed_temp_shutdown_en_dis(struct ad5761r_dev *dev, bool *en_dis)
Definition: ad5761r.c:369
ad5761r_get_clr_pin
int32_t ad5761r_get_clr_pin(struct ad5761r_dev *dev, uint8_t *value)
Definition: ad5761r.c:539
AD5721R_DATA
#define AD5721R_DATA(x)
Definition: ad5761r.h:60
ad5761r_get_power_up_voltage
int32_t ad5761r_get_power_up_voltage(struct ad5761r_dev *dev, enum ad5761r_scale *pv)
Definition: ad5761r.c:278
ad5761r_read
int32_t ad5761r_read(struct ad5761r_dev *dev, uint8_t reg_addr_cmd, uint16_t *reg_data)
Definition: ad5761r.c:104
ad5761r_init_param
Definition: ad5761r.h:148
ad5761r_range
ad5761r_range
Definition: ad5761r.h:115
AD5761R_SCALE_FULL
@ AD5761R_SCALE_FULL
Definition: ad5761r.h:112
AD5761R_CTRL_BO
#define AD5761R_CTRL_BO
Definition: ad5761r.h:82
ad5761r_init_param::gpio_ldac
struct no_os_gpio_init_param gpio_ldac
Definition: ad5761r.h:156
ad5761r_dev::daisy_chain_en
bool daisy_chain_en
Definition: ad5761r.h:145
ad5761r_init_param::ovr_en
bool ovr_en
Definition: ad5761r.h:166
AD5761R_CTRL_RA
#define AD5761R_CTRL_RA(x)
Definition: ad5761r.h:89
ad5761r_get_clear_voltage
int32_t ad5761r_get_clear_voltage(struct ad5761r_dev *dev, enum ad5761r_scale *cv)
Definition: ad5761r.c:309
ad5761r_dev::spi_desc
no_os_spi_desc * spi_desc
Definition: ad5761r.h:128
AD5761R_REG_DAC
@ AD5761R_REG_DAC
Definition: ad5761r.h:105
AD5761R_CTRL_IRO
#define AD5761R_CTRL_IRO
Definition: ad5761r.h:87
ad5761r_dev::ovr_en
bool ovr_en
Definition: ad5761r.h:144
ad5761r_config
int32_t ad5761r_config(struct ad5761r_dev *dev)
Definition: ad5761r.c:173
AD5761R_CTRL_SC
#define AD5761R_CTRL_SC
Definition: ad5761r.h:81
ad5761r_init_param::gpio_ldac_value
uint8_t gpio_ldac_value
Definition: ad5761r.h:157
ad5761r_init
int32_t ad5761r_init(struct ad5761r_dev **device, struct ad5761r_init_param init_param)
Definition: ad5761r.c:659
ad5761r.h
Header file of AD5761R Driver.
ad5761r_remove
int32_t ad5761r_remove(struct ad5761r_dev *dev)
Free the resources allocated by ad5761r_init().
Definition: ad5761r.c:716
ad5761r_dev::cv
enum ad5761r_scale cv
Definition: ad5761r.h:140
CMD_RD_DAC_REG
#define CMD_RD_DAC_REG
Definition: ad5761r.h:74
ad5761r_write_input_register
int32_t ad5761r_write_input_register(struct ad5761r_dev *dev, uint16_t reg_data)
Definition: ad5761r.c:590
ad5761r_software_full_reset
int32_t ad5761r_software_full_reset(struct ad5761r_dev *dev)
Definition: ad5761r.c:647
ad5761r_init_param::gpio_clr
struct no_os_gpio_init_param gpio_clr
Definition: ad5761r.h:154
ad5761r_dev::type
enum ad5761r_type type
Definition: ad5761r.h:137
ad5761r_write_input_register
int32_t ad5761r_write_input_register(struct ad5761r_dev *dev, uint16_t dac_data)
Definition: ad5761r.c:590
ad5761r_dev::ra
enum ad5761r_range ra
Definition: ad5761r.h:138
ad5761r_get_brownout_condition
int32_t ad5761r_get_brownout_condition(struct ad5761r_dev *dev, bool *bo)
Definition: ad5761r.c:467
ad5761r_register_readback
int32_t ad5761r_register_readback(struct ad5761r_dev *dev, enum ad5761r_reg reg, uint16_t *reg_data)
Definition: ad5761r.c:132
ad5761r_get_daisy_chain_en_dis
int32_t ad5761r_get_daisy_chain_en_dis(struct ad5761r_dev *dev, bool *en_dis)
Definition: ad5761r.c:211
ad5761r_set_overrange_en_dis
int32_t ad5761r_set_overrange_en_dis(struct ad5761r_dev *dev, bool en_dis)
Definition: ad5761r.c:417
ad5761r_get_internal_reference_en_dis
int32_t ad5761r_get_internal_reference_en_dis(struct ad5761r_dev *dev, bool *en_dis)
Definition: ad5761r.c:339
AD5761R
@ AD5761R
Definition: ad5761r.h:99
ad5761r_type
ad5761r_type
Definition: ad5761r.h:98
ad5761r_get_output_range
int32_t ad5761r_get_output_range(struct ad5761r_dev *dev, enum ad5761r_range *out_range)
Definition: ad5761r.c:247
CMD_UPDATE_DAC_REG
#define CMD_UPDATE_DAC_REG
Definition: ad5761r.h:65
ad5761r_set_output_range
int32_t ad5761r_set_output_range(struct ad5761r_dev *dev, enum ad5761r_range out_range)
Definition: ad5761r.c:233
ad5761r_dev::gpio_ldac_value
uint8_t gpio_ldac_value
Definition: ad5761r.h:135
ad5761r_get_short_circuit_condition
int32_t ad5761r_get_short_circuit_condition(struct ad5761r_dev *dev, bool *sc)
Definition: ad5761r.c:447
ad5761r_get_internal_reference_en_dis
int32_t ad5761r_get_internal_reference_en_dis(struct ad5761r_dev *dev, bool *en_dis)
Definition: ad5761r.c:339
ad5761r_write_update_dac_register
int32_t ad5761r_write_update_dac_register(struct ad5761r_dev *dev, uint16_t dac_data)
Definition: ad5761r.c:619
ad5761r_set_internal_reference_en_dis
int32_t ad5761r_set_internal_reference_en_dis(struct ad5761r_dev *dev, bool en_dis)
Definition: ad5761r.c:325
ad5761r_set_clear_voltage
int32_t ad5761r_set_clear_voltage(struct ad5761r_dev *dev, enum ad5761r_scale cv)
Definition: ad5761r.c:295
ad5761r_software_full_reset
int32_t ad5761r_software_full_reset(struct ad5761r_dev *dev)
Definition: ad5761r.c:647
ad5761r_init_param::b2c_range_en
bool b2c_range_en
Definition: ad5761r.h:165
AD5761R_CTRL_OVR
#define AD5761R_CTRL_OVR
Definition: ad5761r.h:84
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:95
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:132
ad5761r_set_exceed_temp_shutdown_en_dis
int32_t ad5761r_set_exceed_temp_shutdown_en_dis(struct ad5761r_dev *dev, bool en_dis)
Definition: ad5761r.c:355
ad5761r_scale
ad5761r_scale
Definition: ad5761r.h:109
ad5761r_get_brownout_condition
int32_t ad5761r_get_brownout_condition(struct ad5761r_dev *dev, bool *bo)
Definition: ad5761r.c:467
ad5761r_set_internal_reference_en_dis
int32_t ad5761r_set_internal_reference_en_dis(struct ad5761r_dev *dev, bool en_dis)
Definition: ad5761r.c:325
ad5761r_software_data_reset
int32_t ad5761r_software_data_reset(struct ad5761r_dev *dev)
Definition: ad5761r.c:637
ad5761r_get_power_up_voltage
int32_t ad5761r_get_power_up_voltage(struct ad5761r_dev *dev, enum ad5761r_scale *pv)
Definition: ad5761r.c:278
ad5761r_init_param::pwr_voltage
enum ad5761r_scale pwr_voltage
Definition: ad5761r.h:161
AD5761R_RANGE_0V_TO_P_20V
@ AD5761R_RANGE_0V_TO_P_20V
Definition: ad5761r.h:123
no_os_gpio_desc
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:102
ad5761r_get_overrange_en_dis
int32_t ad5761r_get_overrange_en_dis(struct ad5761r_dev *dev, bool *en_dis)
Definition: ad5761r.c:431
ad5761r_get_2c_bipolar_range_en_dis
int32_t ad5761r_get_2c_bipolar_range_en_dis(struct ad5761r_dev *dev, bool *en_dis)
Definition: ad5761r.c:401
AD5761R_DIS_DAISY_CHAIN_DDC
#define AD5761R_DIS_DAISY_CHAIN_DDC(x)
Definition: ad5761r.h:92
AD5761R_RANGE_M_10V_TO_P_10V
@ AD5761R_RANGE_M_10V_TO_P_10V
Definition: ad5761r.h:116
ad5761r_set_daisy_chain_en_dis
int32_t ad5761r_set_daisy_chain_en_dis(struct ad5761r_dev *dev, bool en_dis)
Definition: ad5761r.c:196
ad5761r_set_output_range
int32_t ad5761r_set_output_range(struct ad5761r_dev *dev, enum ad5761r_range out_range)
Definition: ad5761r.c:233
AD5761R_REG_INPUT
@ AD5761R_REG_INPUT
Definition: ad5761r.h:104
ad5761r_write
int32_t ad5761r_write(struct ad5761r_dev *dev, uint8_t reg_addr_cmd, uint16_t reg_data)
Definition: ad5761r.c:70
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:55
AD5761R_RANGE_0V_TO_P_5V
@ AD5761R_RANGE_0V_TO_P_5V
Definition: ad5761r.h:119
ad5761r_init_param::out_range
enum ad5761r_range out_range
Definition: ad5761r.h:160
ad5761r_dev::gpio_ldac
struct no_os_gpio_desc * gpio_ldac
Definition: ad5761r.h:134
ad5761r_get_reset_pin
int32_t ad5761r_get_reset_pin(struct ad5761r_dev *dev, uint8_t *value)
Definition: ad5761r.c:504
CMD_WR_TO_INPUT_REG
#define CMD_WR_TO_INPUT_REG
Definition: ad5761r.h:64
AD5761R_CTRL_ETS
#define AD5761R_CTRL_ETS
Definition: ad5761r.h:86
ad5761r_get_reset_pin
int32_t ad5761r_get_reset_pin(struct ad5761r_dev *dev, uint8_t *value)
Definition: ad5761r.c:504
ad5761r_get_overrange_en_dis
int32_t ad5761r_get_overrange_en_dis(struct ad5761r_dev *dev, bool *en_dis)
Definition: ad5761r.c:431
ad5761r_set_ldac_pin
int32_t ad5761r_set_ldac_pin(struct ad5761r_dev *dev, uint8_t value)
Definition: ad5761r.c:557
AD5761R_REG_CTRL
@ AD5761R_REG_CTRL
Definition: ad5761r.h:106
ad5761r_get_exceed_temp_shutdown_en_dis
int32_t ad5761r_get_exceed_temp_shutdown_en_dis(struct ad5761r_dev *dev, bool *en_dis)
Definition: ad5761r.c:369
AD5721R
@ AD5721R
Definition: ad5761r.h:100
ad5761r_read
int32_t ad5761r_read(struct ad5761r_dev *dev, uint8_t reg_addr_cmd, uint16_t *reg_data)
Definition: ad5761r.c:104
AD5761R_RANGE_M_5V_TO_P_5V
@ AD5761R_RANGE_M_5V_TO_P_5V
Definition: ad5761r.h:118
ad5761r_dev::int_ref_en
bool int_ref_en
Definition: ad5761r.h:141
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:160
CMD_SW_DATA_RESET
#define CMD_SW_DATA_RESET
Definition: ad5761r.h:70
ad5761r_set_2c_bipolar_range_en_dis
int32_t ad5761r_set_2c_bipolar_range_en_dis(struct ad5761r_dev *dev, bool en_dis)
Definition: ad5761r.c:386
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:96
ad5761r_set_daisy_chain_en_dis
int32_t ad5761r_set_daisy_chain_en_dis(struct ad5761r_dev *dev, bool en_dis)
Definition: ad5761r.c:196
ad5761r_init_param::gpio_clr_value
uint8_t gpio_clr_value
Definition: ad5761r.h:155
AD5761R_CTRL_CV
#define AD5761R_CTRL_CV(x)
Definition: ad5761r.h:83
ad5761r_init_param::gpio_reset
struct no_os_gpio_init_param gpio_reset
Definition: ad5761r.h:152
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:70
no_os_gpio.h
Header file of GPIO Interface.
AD5761R_CTRL_B2C
#define AD5761R_CTRL_B2C
Definition: ad5761r.h:85
ad5761r_init_param::int_ref_en
bool int_ref_en
Definition: ad5761r.h:163
ad5761r_init_param::exc_temp_sd_en
bool exc_temp_sd_en
Definition: ad5761r.h:164
ad5761r_dev::b2c_range_en
bool b2c_range_en
Definition: ad5761r.h:143
ad5761r_init_param::type
enum ad5761r_type type
Definition: ad5761r.h:159
ad5761r_dev::gpio_clr
struct no_os_gpio_desc * gpio_clr
Definition: ad5761r.h:132
ad5761r_dev::gpio_reset
struct no_os_gpio_desc * gpio_reset
Definition: ad5761r.h:130
ad5761r_init
int32_t ad5761r_init(struct ad5761r_dev **device, struct ad5761r_init_param init_param)
Definition: ad5761r.c:659
ad5761r_set_ldac_pin
int32_t ad5761r_set_ldac_pin(struct ad5761r_dev *dev, uint8_t value)
Definition: ad5761r.c:557
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:51
ad5761r_remove
int32_t ad5761r_remove(struct ad5761r_dev *dev)
Free the resources allocated by ad5761r_init().
Definition: ad5761r.c:716
AD5761R_RANGE_0V_TO_P_16V
@ AD5761R_RANGE_0V_TO_P_16V
Definition: ad5761r.h:122
ad5761r_software_data_reset
int32_t ad5761r_software_data_reset(struct ad5761r_dev *dev)
Definition: ad5761r.c:637
ad5761r_set_clr_pin
int32_t ad5761r_set_clr_pin(struct ad5761r_dev *dev, uint8_t value)
Definition: ad5761r.c:522
ad5761r_init_param::spi_init
no_os_spi_init_param spi_init
Definition: ad5761r.h:150
ad5761r_get_daisy_chain_en_dis
int32_t ad5761r_get_daisy_chain_en_dis(struct ad5761r_dev *dev, bool *en_dis)
Definition: ad5761r.c:211
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:124
ad5761r_write
int32_t ad5761r_write(struct ad5761r_dev *dev, uint8_t reg_addr_cmd, uint16_t reg_data)
Definition: ad5761r.c:70
ad5761r_set_reset_pin
int32_t ad5761r_set_reset_pin(struct ad5761r_dev *dev, uint8_t value)
Definition: ad5761r.c:487
ad5761r_dev::gpio_reset_value
uint8_t gpio_reset_value
Definition: ad5761r.h:131
ad5761r_get_clear_voltage
int32_t ad5761r_get_clear_voltage(struct ad5761r_dev *dev, enum ad5761r_scale *cv)
Definition: ad5761r.c:309
ad5761r_get_output_range
int32_t ad5761r_get_output_range(struct ad5761r_dev *dev, enum ad5761r_range *out_range)
Definition: ad5761r.c:247
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:112
ad5761r_update_dac_register
int32_t ad5761r_update_dac_register(struct ad5761r_dev *dev)
Definition: ad5761r.c:608
ad5761r_init_param::gpio_reset_value
uint8_t gpio_reset_value
Definition: ad5761r.h:153