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