Go to the documentation of this file.
46 #define NO_OS_GENMASK(h, l) \
47 (((~0UL) - (1UL << (l)) + 1) & (~0UL >> (31 - (h))))
48 #define NO_OS_BIT(x) (1UL << (x))
51 #define AD5758_REG_NOP 0x00
52 #define AD5758_REG_DAC_INPUT 0x01
53 #define AD5758_REG_DAC_OUTPUT 0x02
54 #define AD5758_REG_CLEAR_CODE 0x03
55 #define AD5758_REG_USER_GAIN 0x04
56 #define AD5758_REG_USER_OFFSET 0x05
57 #define AD5758_REG_DAC_CONFIG 0x06
58 #define AD5758_REG_SW_LDAC 0x07
59 #define AD5758_REG_KEY 0x08
60 #define AD5758_REG_GP_CONFIG1 0x09
61 #define AD5758_REG_GP_CONFIG2 0x0A
62 #define AD5758_REG_DCDC_CONFIG1 0x0B
63 #define AD5758_REG_DCDC_CONFIG2 0x0C
64 #define AD5758_REG_WDT_CONFIG 0x0F
65 #define AD5758_REG_DIGITAL_DIAG_CONFIG 0x10
66 #define AD5758_REG_ADC_CONFIG 0x11
67 #define AD5758_REG_FAULT_PIN_CONFIG 0x12
68 #define AD5758_REG_TWO_STAGE_READBACK_SELECT 0x13
69 #define AD5758_REG_DIGITAL_DIAG_RESULTS 0x14
70 #define AD5758_REG_ANALOG_DIAG_RESULTS 0x15
71 #define AD5758_REG_STATUS 0x16
72 #define AD5758_REG_CHIP_ID 0x17
73 #define AD5758_REG_FREQ_MONITOR 0x18
74 #define AD5758_REG_DEVICE_ID_0 0x19
75 #define AD5758_REG_DEVICE_ID_1 0x1A
76 #define AD5758_REG_DEVICE_ID_2 0x1B
77 #define AD5758_REG_DEVICE_ID_3 0x1C
80 #define AD5758_DAC_CONFIG_RANGE_MSK NO_OS_GENMASK(3, 0)
81 #define AD5758_DAC_CONFIG_RANGE_MODE(x) (((x) & 0xF) << 0)
82 #define AD5758_DAC_CONFIG_OVRNG_EN_MSK NO_OS_BIT(4)
83 #define AD5758_DAC_CONFIG_OVRNG_EN_MODE(x) (((x) & 0x1) << 4)
84 #define AD5758_DAC_CONFIG_INT_EN_MSK NO_OS_BIT(5)
85 #define AD5758_DAC_CONFIG_INT_EN_MODE(x) (((x) & 0x1) << 5)
86 #define AD5758_DAC_CONFIG_OUT_EN_MSK NO_OS_BIT(6)
87 #define AD5758_DAC_CONFIG_OUT_EN_MODE(x) (((x) & 0x1) << 6)
88 #define AD5758_DAC_CONFIG_RSET_EXT_EN_MSK NO_OS_BIT(7)
89 #define AD5758_DAC_CONFIG_RSET_EXT_EN_MODE(x) (((x) & 0x1) << 7)
90 #define AD5758_DAC_CONFIG_SR_EN_MSK NO_OS_BIT(8)
91 #define AD5758_DAC_CONFIG_SR_EN_MODE(x) (((x) & 0x1) << 8)
92 #define AD5758_DAC_CONFIG_SR_CLOCK_MSK NO_OS_GENMASK(12, 9)
93 #define AD5758_DAC_CONFIG_SR_CLOCK_MODE(x) (((x) & 0xF) << 9)
94 #define AD5758_DAC_CONFIG_SR_STEP_MSK NO_OS_GENMASK(15, 13)
95 #define AD5758_DAC_CONFIG_SR_STEP_MODE(x) (((x) & 0x7) << 13)
98 #define AD5758_SW_LDAC_COMMAND 0x1DAC
101 #define AD5758_KEY_CODE_RESET_1 0x15FA
102 #define AD5758_KEY_CODE_RESET_2 0xAF51
103 #define AD5758_KEY_CODE_SINGLE_ADC_CONV 0x1ADC
104 #define AD5758_KEY_CODE_RESET_WDT 0x0D06
105 #define AD5758_KEY_CODE_CALIB_MEM_REFRESH 0xFCBA
108 #define AD5758_GP_CONFIG1_OSC_STOP_DETECT_EN_MSK NO_OS_BIT(2)
109 #define AD5758_GP_CONFIG1_OSC_STOP_DETECT_EN_MODE(x) (((x) & 0x1) << 2)
110 #define AD5758_GP_CONFIG1_SPI_DIAG_QUIET_EN_MSK NO_OS_BIT(3)
111 #define AD5758_GP_CONFIG1_SPI_DIAG_QUIET_EN_MODE(x) (((x) & 0x1) << 3)
112 #define AD5758_GP_CONFIG1_CLEAR_NOW_EN_MSK NO_OS_BIT(4)
113 #define AD5758_GP_CONFIG1_CLEAR_NOW_EN_MODE(x) (((x) & 0x1) << 4)
114 #define AD5758_GP_CONFIG1_NEG_OFFSET_EN_MSK NO_OS_BIT(5)
115 #define AD5758_GP_CONFIG1_NEG_OFFSET_EN_MODE(x) (((x) & 0x1) << 5)
116 #define AD5758_GP_CONFIG1_HART_EN_MSK NO_OS_BIT(6)
117 #define AD5758_GP_CONFIG1_HART_EN_MODE(x) (((x) & 0x1) << 6)
118 #define AD5758_GP_CONFIG1_CLKOUT_FREQ_MSK NO_OS_GENMASK(9, 7)
119 #define AD5758_GP_CONFIG1_CLKOUT_FREQ_MODE(x) (((x) & 0x7) << 7)
120 #define AD5758_GP_CONFIG1_CLKOUT_CONFIG_MSK NO_OS_GENMASK(11, 10)
121 #define AD5758_GP_CONFIG1_CLKOUT_CONFIG_MODE(x) (((x) & 0x3) << 10)
122 #define AD5758_GP_CONFIG1_SET_TEMP_THRESHOLD_MSK NO_OS_GENMASK(13, 12)
123 #define AD5758_GP_CONFIG1_SET_TEMP_THRESHOLD_MODE(x) (((x) & 0x3) << 12)
126 #define AD5758_GP_CONFIG2_FAULT_TIMEOUT_MSK NO_OS_BIT(9)
127 #define AD5758_GP_CONFIG2_FAULT_TIMEOUT_MODE(x) (((x) & 0x1) << 9)
128 #define AD5758_GP_CONFIG2_GLOBAL_SW_LDAC_MSK NO_OS_BIT(10)
129 #define AD5758_GP_CONFIG2_GLOBAL_SW_LDAC_MODE(x) (((x) & 0x1) << 10)
130 #define AD5758_GP_CONFIG2_INT_I_MONITOR_EN_MSK NO_OS_BIT(11)
131 #define AD5758_GP_CONFIG2_INT_I_MONITOR_EN_MODE(x) (((x) & 0x1) << 11)
132 #define AD5758_GP_CONFIG2_COMPARATOR_CONFIG_MSK NO_OS_GENMASK(14, 13)
133 #define AD5758_GP_CONFIG2_COMPARATOR_CONFIG_MODE(x) (((x) & 0x3) << 13)
136 #define AD5758_DCDC_CONFIG1_DCDC_VPROG_MSK NO_OS_GENMASK(4, 0)
137 #define AD5758_DCDC_CONFIG1_DCDC_VPROG_MODE(x) (((x) & 0x1F) << 0)
138 #define AD5758_DCDC_CONFIG1_DCDC_MODE_MSK NO_OS_GENMASK(6, 5)
139 #define AD5758_DCDC_CONFIG1_DCDC_MODE_MODE(x) (((x) & 0x3) << 5)
142 #define AD5758_DCDC_CONFIG2_ILIMIT_MSK NO_OS_GENMASK(3, 1)
143 #define AD5758_DCDC_CONFIG2_ILIMIT_MODE(x) (((x) & 0x7) << 1)
144 #define AD5758_DCDC_CONFIG2_ADC_CONTROL_DIAG_MSK NO_OS_GENMASK(5, 4)
145 #define AD5758_DCDC_CONFIG2_ADC_CONTROL_DIAG_MODE(x) (((x) & 0x3) << 4)
146 #define AD5758_DCDC_CONFIG2_VIOUT_PULLDOWN_EN_MSK NO_OS_BIT(6)
147 #define AD5758_DCDC_CONFIG2_VIOUT_PULLDOWN_EN_MODE(x) (((x) & 0x1) << 6)
148 #define AD5758_DCDC_CONFIG2_SHORT_DEGLITCH_MSK NO_OS_BIT(7)
149 #define AD5758_DCDC_CONFIG2_SHORT_DEGLITCH_MODE(x) (((x) & 0x1) << 7)
150 #define AD5758_DCDC_CONFIG2_READ_COMP_DIS_MSK NO_OS_BIT(10)
151 #define AD5758_DCDC_CONFIG2_READ_COMP_DIS_MODE(x) (((x) & 0x1) << 10)
152 #define AD5758_DCDC_CONFIG2_INTR_SAT_3WI_MSK NO_OS_BIT(11)
153 #define AD5758_DCDC_CONFIG2_BUSY_3WI_MSK NO_OS_BIT(12)
156 #define AD5758_WDT_CONFIG_WDT_TIMEOUT_MSK NO_OS_GENMASK(3, 0)
157 #define AD5758_WDT_CONFIG_WDT_TIMEOUT_MODE(x) (((x) & 0xF) << 0)
158 #define AD5758_WDT_CONFIG_WDT_EN_MSK NO_OS_BIT(6)
159 #define AD5758_WDT_CONFIG_WDT_EN_MODE(x) (((x) & 0x1) << 6)
160 #define AD5758_WDT_CONFIG_KICK_ON_VALID_WRITE_MSK NO_OS_BIT(8)
161 #define AD5758_WDT_CONFIG_KICK_ON_VALID_WRITE_MODE(x) (((x) & 0x1) << 8)
162 #define AD5758_WDT_CONFIG_RESET_ON_WDT_FAIL_MSK NO_OS_BIT(9)
163 #define AD5758_WDT_CONFIG_RESET_ON_WDT_FAIL_MODE(x) (((x) & 0x1) << 9)
164 #define AD5758_WDT_CONFIG_CLEAR_ON_WDT_FAIL_MSK NO_OS_BIT(10)
165 #define AD5758_WDT_CONFIG_CLEAR_ON_WDT_FAIL_MODE(x) (((x) & 0x1) << 10)
168 #define AD5758_DIG_DIAG_CONFIG_SPI_CRC_EN_MSK NO_OS_BIT(0)
169 #define AD5758_DIG_DIAG_CONFIG_SPI_CRC_EN_MODE(x) (((x) & 0x1) << 0)
170 #define AD5758_DIG_DIAG_CONFIG_FREQ_MON_EN_MSK NO_OS_BIT(2)
171 #define AD5758_DIG_DIAG_CONFIG_FREQ_MON_EN_MODE(x) (((x) & 0x1) << 2)
172 #define AD5758_DIG_DIAG_CONFIG_CAL_MEM_CRC_EN_MSK NO_OS_BIT(3)
173 #define AD5758_DIG_DIAG_CONFIG_CAL_MEM_CRC_EN_MODE(x) (((x) & 0x1) << 3)
174 #define AD5758_DIG_DIAG_CONFIG_INV_DAC_CHECK_EN_MSK NO_OS_BIT(4)
175 #define AD5758_DIG_DIAG_CONFIG_INV_DAC_CHECK_EN_MODE(x) (((x) & 0x1) << 4)
176 #define AD5758_DIG_DIAG_CONFIG_DAC_LATCH_MON_EN_MSK NO_OS_BIT(6)
177 #define AD5758_DIG_DIAG_CONFIG_DAC_LATCH_MON_EN_MODE(x) (((x) & 0x1) << 6)
180 #define AD5758_ADC_CONFIG_ADC_IP_SELECT_MSK NO_OS_GENMASK(4, 0)
181 #define AD5758_ADC_CONFIG_ADC_IP_SELECT_MODE(x) (((x) & 0x1F) << 0)
182 #define AD5758_ADC_CONFIG_SEQUENCE_DATA_MSK NO_OS_GENMASK(7, 5)
183 #define AD5758_ADC_CONFIG_SEQUENCE_DATA_MODE(x) (((x) & 0x7) << 5)
184 #define AD5758_ADC_CONFIG_SEQUENCE_COMMAND_MSK NO_OS_GENMASK(10, 8)
185 #define AD5758_ADC_CONFIG_SEQUENCE_COMMAND_MODE(x) (((x) & 0x7) << 8)
186 #define AD5758_ADC_CONFIG_PPC_BUF_MSK NO_OS_BIT(11)
187 #define AD5758_ADC_CONFIG_PPC_BUF_EN(x) (((x) & 0x1) << 11)
190 #define AD5758_FAULT_PIN_CONFIG_MAIN_DIE_TEMP_ERR_MSK NO_OS_BIT(0)
191 #define AD5758_FAULT_PIN_CONFIG_MAIN_DIE_TEMP_ERR_MODE(x) (((x) & 0x1) << 0)
192 #define AD5758_FAULT_PIN_CONFIG_DCDC_DIE_TEMP_ERR_MSK NO_OS_BIT(1)
193 #define AD5758_FAULT_PIN_CONFIG_DCDC_DIE_TEMP_ERR_MODE(x) (((x) & 0x1) << 1)
194 #define AD5758_FAULT_PIN_CONFIG_VOUT_SC_ERR_MSK NO_OS_BIT(2)
195 #define AD5758_FAULT_PIN_CONFIG_VOUT_SC_ERR_MODE(x) (((x) & 0x1) << 2)
196 #define AD5758_FAULT_PIN_CONFIG_IOUT_OC_ERR_MSK NO_OS_BIT(3)
197 #define AD5758_FAULT_PIN_CONFIG_IOUT_OC_ERR_MODE(x) (((x) & 0x1) << 3)
198 #define AD5758_FAULT_PIN_CONFIG_DCDC_P_SC_ERR_MSK NO_OS_BIT(4)
199 #define AD5758_FAULT_PIN_CONFIG_DCDC_P_SC_ERR_MODE(x) (((x) & 0x1) << 4)
200 #define AD5758_FAULT_PIN_CONFIG_SPI_CRC_ERR_MSK NO_OS_BIT(6)
201 #define AD5758_FAULT_PIN_CONFIG_SPI_CRC_ERR_MODE(x) (((x) & 0x1) << 6)
202 #define AD5758_FAULT_PIN_CONFIG_SLIPBIT_ERR_MSK NO_OS_BIT(7)
203 #define AD5758_FAULT_PIN_CONFIG_SLIPBIT_ERR_MODE(x) (((x) & 0x1) << 7)
204 #define AD5758_FAULT_PIN_CONFIG_WDT_ERR_MSK NO_OS_BIT(8)
205 #define AD5758_FAULT_PIN_CONFIG_WDT_ERR_MODE(x) (((x) & 0x1) << 8)
206 #define AD5758_FAULT_PIN_CONFIG_DAC_LATCH_MON_ERR_MSK NO_OS_BIT(9)
207 #define AD5758_FAULT_PIN_CONFIG_DAC_LATCH_MON_ERR_MODE(x) (((x) & 0x1) << 9)
208 #define AD5758_FAULT_PIN_CONFIG_OSC_STOP_DETECT_MSK NO_OS_BIT(10)
209 #define AD5758_FAULT_PIN_CONFIG_OSC_STOP_DETECT_MODE(x) (((x) & 0x1) << 10)
210 #define AD5758_FAULT_PIN_CONFIG_INV_DAC_CHECK_ERR_MSK NO_OS_BIT(12)
211 #define AD5758_FAULT_PIN_CONFIG_INV_DAC_CHECK_ERR_MODE(x) (((x) & 0x1) << 12)
212 #define AD5758_FAULT_PIN_CONFIG_PROT_SW_ERR_MSK NO_OS_BIT(14)
213 #define AD5758_FAULT_PIN_CONFIG_PROT_SW_ERR_MODE(x) (((x) & 0x1) << 14)
214 #define AD5758_FAULT_PIN_CONFIG_SPI_ACC_ERR_MSK NO_OS_BIT(15)
215 #define AD5758_FAULT_PIN_CONFIG_SPI_ACC_ERR_MODE(x) (((x) & 0x1) << 15)
218 #define AD5758_TWO_STAGE_READBACK_SELECT_MSK NO_OS_GENMASK(4, 0)
219 #define AD5758_TWO_STAGE_READBACK_SELECT_MODE(x) (((x) & 0x1F) << 0)
220 #define AD5758_TWO_STAGE_READBACK_SELECT_MODE_MSK NO_OS_GENMASK(6, 5)
221 #define AD5758_TWO_STAGE_READBACK_SELECT_MODE_MODE(x) (((x) & 0x3) << 5)
224 #define AD5758_DIG_DIAG_RESULTS_SPI_CRC_ERR NO_OS_BIT(0)
225 #define AD5758_DIG_DIAG_RESULTS_SLIPBIT_ERR_MSK NO_OS_BIT(1)
226 #define AD5758_DIG_DIAG_RESULTS_SCLK_COUNT_ERR_MSK NO_OS_BIT(2)
227 #define AD5758_DIG_DIAG_RESULTS_INVALID_SPI_ACC_ERR_MSK NO_OS_BIT(4)
228 #define AD5758_DIG_DIAG_RESULTS_CAL_MEM_CRC_ERR_MSK NO_OS_BIT(5)
229 #define AD5758_DIG_DIAG_RESULTS_INV_DAC_CHECK_ERR_MSK NO_OS_BIT(6)
230 #define AD5758_DIG_DIAG_RESULTS_DAC_LATCH_MON_ERR_MSK NO_OS_BIT(8)
231 #define AD5758_DIG_DIAG_RESULTS_3WI_RC_ERR_MSK NO_OS_BIT(9)
232 #define AD5758_DIG_DIAG_RESULTS_WDT_ERR_MSK NO_OS_BIT(11)
233 #define AD5758_DIG_DIAG_RESULTS_ERR_3WI_MSK NO_OS_BIT(12)
234 #define AD5758_DIG_DIAG_RESULTS_RES_OCCURRED_MSK NO_OS_BIT(13)
235 #define AD5758_DIG_DIAG_RESULTS_SLEW_BUSY_MSK NO_OS_BIT(14)
236 #define AD5758_DIG_DIAG_RESULTS_CAL_MEM_UNREFRESHED_MSK NO_OS_BIT(15)
239 #define AD5758_ANA_DIAG_RESULTS_REGOUT_ERR_MSK NO_OS_BIT(0)
240 #define AD5758_ANA_DIAG_RESULTS_INT_AVCC_ERR_MSK NO_OS_BIT(1)
241 #define AD5758_ANA_DIAG_RESULTS_REFIN_ERR_MSK NO_OS_BIT(2)
242 #define AD5758_ANA_DIAG_RESULTS_REFOUT_ERR_MSK NO_OS_BIT(3)
243 #define AD5758_ANA_DIAG_RESULTS_MAIN_DIE_TEMP_ERR_MSK NO_OS_BIT(4)
244 #define AD5758_ANA_DIAG_RESULTS_DCDC_DIE_TEMP_ERR_MSK NO_OS_BIT(5)
245 #define AD5758_ANA_DIAG_RESULTS_VOUT_SC_ERR_MSK NO_OS_BIT(6)
246 #define AD5758_ANA_DIAG_RESULTS_IOUT_OC_ERR_MSK NO_OS_BIT(7)
247 #define AD5758_ANA_DIAG_RESULTS_DCDC_P_PWR_ERR_MSK NO_OS_BIT(9)
248 #define AD5758_ANA_DIAG_RESULTS_DCDC_P_SC_ERR_MSK NO_OS_BIT(11)
249 #define AD5758_ANA_DIAG_RESULTS_FAULT_PROT_SW_ERR_MSK NO_OS_BIT(13)
252 #define AD5758_STATUS_ADC_DATA_MSK NO_OS_GENMASK(11, 0)
253 #define AD5758_STATUS_ADC_CH_MSK NO_OS_GENMASK(16, 12)
254 #define AD5758_STATUS_ADC_BUSY_MSK NO_OS_BIT(17)
255 #define AD5758_STATUS_WDT_STATUS_MSK NO_OS_BIT(18)
256 #define AD5758_STATUS_ANA_DIAG_STATUS_MSK NO_OS_BIT(19)
257 #define AD5758_STATUS_DIG_DIAG_STATUS_MSK NO_OS_BIT(20)
259 #define AD5758_REG_WRITE(x) ((0x80) | (x & 0x1F))
260 #define AD5758_CRC8_POLY 0x07 // x^8 + x^2 + x^1 + x^0
431 uint8_t num_of_channels);
int32_t ad5758_set_adc_channel_input(struct ad5758_dev *dev, uint8_t channel, enum ad5758_adc_ip adc_ip_sel)
Definition: ad5758.c:705
@ RANGE_0mA_20mA
Definition: ad5758.h:335
#define AD5758_DAC_CONFIG_OUT_EN_MODE(x)
Definition: ad5758.h:87
#define AD5758_ADC_CONFIG_SEQUENCE_COMMAND_MODE(x)
Definition: ad5758.h:185
int32_t ad5758_set_adc_mode(struct ad5758_dev *dev, enum ad5758_adc_mode adc_mode, uint8_t enable)
Definition: ad5758.c:739
ad5758_dc_dc_ilimt
Definition: ad5758.h:321
@ DIAG_SCLK_COUNT_ERR
Definition: ad5758.h:275
@ ADC_IP_MAIN_DIE_TEMP
Definition: ad5758.h:344
int32_t ad5758_calib_mem_refresh(struct ad5758_dev *dev)
Definition: ad5758.c:259
@ CLKOUT_FREQ_555_KHZ
Definition: ad5758.h:298
#define AD5758_REG_NOP
Definition: ad5758.h:51
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
ad5758_clkout_config
Definition: ad5758.h:286
enum ad5758_output_range output_range
Definition: ad5758.h:383
#define AD5758_REG_ADC_CONFIG
Definition: ad5758.h:66
enum ad5758_output_range output_range
Definition: ad5758.h:399
int32_t ad5758_select_adc_depth(struct ad5758_dev *dev, uint8_t num_of_channels)
Definition: ad5758.c:656
#define AD5758_ADC_CONFIG_ADC_IP_SELECT_MODE(x)
Definition: ad5758.h:181
@ ADC_IP_DCDC_DIE_NODE
Definition: ad5758.h:360
@ DIAG_INVALID_SPI_ACCESS_ERR
Definition: ad5758.h:276
#define AD5758_ADC_CONFIG_ADC_IP_SELECT_MSK
Definition: ad5758.h:180
@ ADC_IP_REFOUT
Definition: ad5758.h:361
#define AD5758_REG_DIGITAL_DIAG_CONFIG
Definition: ad5758.h:65
ad5758_output_range
Definition: ad5758.h:330
@ RANGE_M24mA_24mA
Definition: ad5758.h:339
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
enum ad5758_slew_rate_clk slew_rate_clk
Definition: ad5758.h:400
int32_t ad5758_select_adc_depth(struct ad5758_dev *dev, uint8_t num_of_channels)
Definition: ad5758.c:656
@ ADC_IP_VSENSE
Definition: ad5758.h:348
Header file of SPI Interface.
@ ADC_IP_DCDC_DIE_TEMP
Definition: ad5758.h:345
ad5758_dc_dc_mode
Definition: ad5758.h:265
@ SR_CLOCK_128_KHZ
Definition: ad5758.h:306
int32_t ad5758_dac_input_write(struct ad5758_dev *dev, uint16_t code)
Definition: ad5758.c:487
#define AD5758_DAC_CONFIG_INT_EN_MODE(x)
Definition: ad5758.h:85
@ ADC_IP_AGND
Definition: ad5758.h:355
struct no_os_gpio_desc * ldac_n
Definition: ad5758.h:376
int32_t ad5758_init(struct ad5758_dev **device, struct ad5758_init_param *init_param)
Definition: ad5758.c:767
#define pr_err(fmt, args...)
Definition: no_os_print_log.h:88
#define AD5758_DCDC_CONFIG2_ILIMIT_MSK
Definition: ad5758.h:142
Header file of Delay functions.
@ RANGE_0V_5V
Definition: ad5758.h:331
#define AD5758_DAC_CONFIG_OUT_EN_MSK
Definition: ad5758.h:86
#define pr_info(fmt, args...)
Definition: no_os_print_log.h:115
@ ADC_IP_INT_AVCC
Definition: ad5758.h:350
#define AD5758_REG_DCDC_CONFIG2
Definition: ad5758.h:63
@ ADC_IP_REFGND
Definition: ad5758.h:354
#define AD5758_DCDC_CONFIG2_BUSY_3WI_MSK
Definition: ad5758.h:153
@ CLKOUT_FREQ_435_KHZ
Definition: ad5758.h:293
@ CLKOUT_ENABLE
Definition: ad5758.h:288
int32_t ad5758_set_crc(struct ad5758_dev *dev, uint8_t crc_en)
Definition: ad5758.c:189
@ ILIMIT_400_mA
Definition: ad5758.h:327
Definition: ad9361_util.h:69
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:117
@ CLKOUT_FREQ_588_KHZ
Definition: ad5758.h:299
@ SR_CLOCK_8_KHZ
Definition: ad5758.h:310
#define AD5758_REG_DAC_INPUT
Definition: ad5758.h:52
@ RANGE_0V_10V
Definition: ad5758.h:332
#define AD5758_REG_TWO_STAGE_READBACK_SELECT
Definition: ad5758.h:68
int32_t ad5758_dac_input_write(struct ad5758_dev *dev, uint16_t code)
Definition: ad5758.c:487
#define AD5758_ADC_CONFIG_PPC_BUF_EN(x)
Definition: ad5758.h:187
@ ADC_MODE_SINGLE_KEY_CONV
Definition: ad5758.h:368
int32_t ad5758_set_dc_dc_ilimit(struct ad5758_dev *dev, enum ad5758_dc_dc_ilimt ilimit)
Definition: ad5758.c:336
#define AD5758_GP_CONFIG1_CLKOUT_CONFIG_MODE(x)
Definition: ad5758.h:121
int32_t ad5758_set_clkout_config(struct ad5758_dev *dev, enum ad5758_clkout_config config, enum ad5758_clkout_freq freq)
Definition: ad5758.c:580
enum ad5758_dc_dc_mode dc_dc_mode
Definition: ad5758.h:379
@ SR_CLOCK_512_HZ
Definition: ad5758.h:314
#define AD5758_REG_DCDC_CONFIG1
Definition: ad5758.h:62
@ DPC_CURRENT_MODE
Definition: ad5758.h:267
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:115
@ ADC_IP_AVDD2
Definition: ad5758.h:358
#define AD5758_REG_DAC_CONFIG
Definition: ad5758.h:57
Header file for ad5758 Driver.
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
int32_t ad5758_set_clkout_config(struct ad5758_dev *dev, enum ad5758_clkout_config config, enum ad5758_clkout_freq freq)
Definition: ad5758.c:580
int32_t ad5758_set_crc(struct ad5758_dev *dev, uint8_t crc_en)
Definition: ad5758.c:189
@ DIAG_RESET_OCCURRED
Definition: ad5758.h:283
enum ad5758_clkout_config clkout_config
Definition: ad5758.h:380
@ RANGE_M20mA_20mA
Definition: ad5758.h:338
@ DPC_VOLTAGE_MODE
Definition: ad5758.h:268
int32_t ad5758_dac_output_en(struct ad5758_dev *dev, uint8_t enable)
Definition: ad5758.c:509
enum ad5758_dc_dc_mode dc_dc_mode
Definition: ad5758.h:395
@ SR_CLOCK_2_KHZ
Definition: ad5758.h:312
int32_t ad5758_calib_mem_refresh(struct ad5758_dev *dev)
Definition: ad5758.c:259
@ SR_CLOCK_256_HZ
Definition: ad5758.h:315
ad5758_slew_rate_clk
Definition: ad5758.h:302
@ DIAG_THREE_WI_RC_ERR
Definition: ad5758.h:280
int32_t ad5758_set_dc_dc_conv_mode(struct ad5758_dev *dev, enum ad5758_dc_dc_mode mode)
Definition: ad5758.c:284
int32_t ad5758_spi_reg_write(struct ad5758_dev *dev, uint8_t reg_addr, uint16_t reg_data)
Definition: ad5758.c:141
@ ILIMIT_300_mA
Definition: ad5758.h:325
enum ad5758_dc_dc_ilimt dc_dc_ilimit
Definition: ad5758.h:398
@ RANGE_4mA_24mA
Definition: ad5758.h:337
int32_t ad5758_spi_reg_read(struct ad5758_dev *dev, uint8_t reg_addr, uint16_t *reg_data)
Definition: ad5758.c:85
#define AD5758_DCDC_CONFIG1_DCDC_MODE_MSK
Definition: ad5758.h:138
#define AD5758_DCDC_CONFIG1_DCDC_MODE_MODE(x)
Definition: ad5758.h:139
@ ILIMIT_350_mA
Definition: ad5758.h:326
int32_t ad5758_soft_reset(struct ad5758_dev *dev)
Definition: ad5758.c:231
ad5758_dig_diag_flags
Definition: ad5758.h:272
uint8_t crc_en
Definition: ad5758.h:378
@ ADC_IP_MVSENSE
Definition: ad5758.h:349
@ ILIMIT_250_mA
Definition: ad5758.h:324
#define AD5758_REG_KEY
Definition: ad5758.h:59
int32_t ad5758_set_out_range(struct ad5758_dev *dev, enum ad5758_output_range range)
Definition: ad5758.c:403
@ CLKOUT_DISABLE
Definition: ad5758.h:287
@ ADC_IP_REF2
Definition: ad5758.h:347
#define AD5758_DAC_CONFIG_SR_EN_MODE(x)
Definition: ad5758.h:91
#define AD5758_DAC_CONFIG_INT_EN_MSK
Definition: ad5758.h:84
int32_t ad5758_dac_output_en(struct ad5758_dev *dev, uint8_t enable)
Definition: ad5758.c:509
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
@ ADC_IP_INT_CURR_MON_VOUT
Definition: ad5758.h:353
#define AD5758_GP_CONFIG1_CLKOUT_FREQ_MODE(x)
Definition: ad5758.h:119
@ SR_CLOCK_200_KHZ
Definition: ad5758.h:304
#define AD5758_DAC_CONFIG_SR_CLOCK_MODE(x)
Definition: ad5758.h:93
#define AD5758_DAC_CONFIG_SR_CLOCK_MSK
Definition: ad5758.h:92
@ SR_CLOCK_128_HZ
Definition: ad5758.h:316
enum ad5758_slew_rate_clk slew_rate_clk
Definition: ad5758.h:384
int32_t ad5758_init(struct ad5758_dev **device, struct ad5758_init_param *init_param)
Definition: ad5758.c:767
@ RANGE_0mA_24mA
Definition: ad5758.h:336
int32_t ad5758_slew_rate_config(struct ad5758_dev *dev, enum ad5758_slew_rate_clk clk, uint8_t enable)
Definition: ad5758.c:451
@ RANGE_M10V_10V
Definition: ad5758.h:334
#define AD5758_CRC8_POLY
Definition: ad5758.h:260
int32_t ad5758_set_adc_channel_input(struct ad5758_dev *dev, uint8_t channel, enum ad5758_adc_ip adc_ip_sel)
Definition: ad5758.c:705
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
int32_t ad5758_set_adc_mode(struct ad5758_dev *dev, enum ad5758_adc_mode adc_mode, uint8_t enable)
Definition: ad5758.c:739
@ SR_CLOCK_64_HZ
Definition: ad5758.h:317
@ PPC_CURRENT_MODE
Definition: ad5758.h:269
@ RANGE_M5V_5V
Definition: ad5758.h:333
@ CLKOUT_FREQ_526_KHZ
Definition: ad5758.h:297
@ SR_CLOCK_1_KHZ
Definition: ad5758.h:313
int32_t ad5758_internal_buffers_en(struct ad5758_dev *dev, uint8_t enable)
Definition: ad5758.c:371
struct no_os_gpio_init_param reset_n
Definition: ad5758.h:391
ad5758_adc_mode
Definition: ad5758.h:364
@ CLKOUT_FREQ_500_KHZ
Definition: ad5758.h:296
@ DIAG_ERR_3WI
Definition: ad5758.h:282
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
@ SR_CLOCK_16_KHZ
Definition: ad5758.h:309
#define AD5758_REG_DIGITAL_DIAG_RESULTS
Definition: ad5758.h:69
enum ad5758_clkout_freq clkout_freq
Definition: ad5758.h:381
struct no_os_spi_init_param spi_init
Definition: ad5758.h:389
@ DIAG_WDT_ERR
Definition: ad5758.h:281
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:43
@ SR_CLOCK_4_KHZ
Definition: ad5758.h:311
#define AD5758_ADC_CONFIG_SEQUENCE_DATA_MODE(x)
Definition: ad5758.h:183
@ ADC_IP_REFIN
Definition: ad5758.h:346
#define AD5758_DIG_DIAG_RESULTS_CAL_MEM_UNREFRESHED_MSK
Definition: ad5758.h:236
enum ad5758_dc_dc_ilimt dc_dc_ilimit
Definition: ad5758.h:382
int32_t ad5758_set_dc_dc_conv_mode(struct ad5758_dev *dev, enum ad5758_dc_dc_mode mode)
Definition: ad5758.c:284
@ SR_CLOCK_64_KHZ
Definition: ad5758.h:307
#define AD5758_DIG_DIAG_CONFIG_SPI_CRC_EN_MODE(x)
Definition: ad5758.h:169
@ CLKOUT_FREQ_454_KHZ
Definition: ad5758.h:294
int32_t ad5758_clear_dig_diag_flag(struct ad5758_dev *dev, enum ad5758_dig_diag_flags flag)
Definition: ad5758.c:543
#define NO_OS_BIT(x)
Definition: no_os_util.h:45
@ ILIMIT_150_mA
Definition: ad5758.h:322
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
ad5758_adc_ip
Definition: ad5758.h:343
struct no_os_spi_desc * spi_desc
Definition: ad5758.h:373
#define AD5758_KEY_CODE_RESET_2
Definition: ad5758.h:102
#define AD5758_REG_WRITE(x)
Definition: ad5758.h:259
@ ILIMIT_200_mA
Definition: ad5758.h:323
int32_t ad5758_wait_for_refresh_cycle(struct ad5758_dev *dev)
Definition: ad5758.c:211
enum ad5758_clkout_config clkout_config
Definition: ad5758.h:396
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:114
int32_t ad5758_set_out_range(struct ad5758_dev *dev, enum ad5758_output_range range)
Definition: ad5758.c:403
int32_t ad5758_internal_buffers_en(struct ad5758_dev *dev, uint8_t enable)
Definition: ad5758.c:371
@ RANGE_M1mA_22mA
Definition: ad5758.h:340
#define AD5758_ADC_CONFIG_PPC_BUF_MSK
Definition: ad5758.h:186
enum ad5758_clkout_freq clkout_freq
Definition: ad5758.h:397
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
int32_t ad5758_wait_for_refresh_cycle(struct ad5758_dev *dev)
Definition: ad5758.c:211
int32_t ad5758_select_adc_ip(struct ad5758_dev *dev, enum ad5758_adc_ip adc_ip_sel)
Definition: ad5758.c:632
@ DC_DC_POWER_OFF
Definition: ad5758.h:266
#define AD5758_DAC_CONFIG_RANGE_MODE(x)
Definition: ad5758.h:81
@ ADC_MODE_AUTO_SEQ
Definition: ad5758.h:366
#define AD5758_GP_CONFIG1_CLKOUT_CONFIG_MSK
Definition: ad5758.h:120
@ SR_CLOCK_150_KHZ
Definition: ad5758.h:305
@ ADC_IP_VLOGIC
Definition: ad5758.h:352
@ DIAG_SPI_CRC_ERR
Definition: ad5758.h:273
@ DIAG_SLIPBIT_ERR
Definition: ad5758.h:274
int32_t ad5758_fault_prot_switch_en(struct ad5758_dev *dev, uint8_t enable)
#define AD5758_GP_CONFIG1_CLKOUT_FREQ_MSK
Definition: ad5758.h:118
#define AD5758_DCDC_CONFIG2_ILIMIT_MODE(x)
Definition: ad5758.h:143
#define AD5758_DIG_DIAG_CONFIG_SPI_CRC_EN_MSK
Definition: ad5758.h:168
@ DIAG_DAC_LATCH_MON_ERR
Definition: ad5758.h:279
Header file of GPIO Interface.
@ SR_CLOCK_240_KHZ
Definition: ad5758.h:303
@ ADC_MODE_KEY_SEQ
Definition: ad5758.h:365
@ ADC_IP_AVSS
Definition: ad5758.h:359
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
@ CLKOUT_FREQ_416_KHZ
Definition: ad5758.h:292
@ SR_CLOCK_32_KHZ
Definition: ad5758.h:308
#define AD5758_REG_GP_CONFIG1
Definition: ad5758.h:60
int32_t ad5758_set_dc_dc_ilimit(struct ad5758_dev *dev, enum ad5758_dc_dc_ilimt ilimit)
Definition: ad5758.c:336
int32_t ad5758_soft_reset(struct ad5758_dev *dev)
Definition: ad5758.c:231
struct no_os_gpio_desc * reset_n
Definition: ad5758.h:375
@ DIAG_INVERSE_DAC_CHECK_ERR
Definition: ad5758.h:278
@ SR_CLOCK_16_HZ
Definition: ad5758.h:318
struct no_os_gpio_init_param ldac_n
Definition: ad5758.h:392
int32_t ad5758_clear_dig_diag_flag(struct ad5758_dev *dev, enum ad5758_dig_diag_flags flag)
Definition: ad5758.c:543
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
@ ADC_IP_DGND
Definition: ad5758.h:356
#define AD5758_DAC_CONFIG_SR_EN_MSK
Definition: ad5758.h:90
@ ADC_MODE_SINGLE_CONV
Definition: ad5758.h:367
uint8_t crc_en
Definition: ad5758.h:394
#define AD5758_DAC_CONFIG_RANGE_MSK
Definition: ad5758.h:80
@ ADC_IP_VDPC
Definition: ad5758.h:357
@ DIAG_CAL_MEM_CRC_ERR
Definition: ad5758.h:277
#define AD5758_KEY_CODE_CALIB_MEM_REFRESH
Definition: ad5758.h:105
ad5758_clkout_freq
Definition: ad5758.h:291
#define AD5758_KEY_CODE_RESET_1
Definition: ad5758.h:101
@ ADC_IP_REGOUT
Definition: ad5758.h:351
@ CLKOUT_FREQ_476_KHZ
Definition: ad5758.h:295
int32_t ad5758_slew_rate_config(struct ad5758_dev *dev, enum ad5758_slew_rate_clk clk, uint8_t enable)
Definition: ad5758.c:451
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
int32_t ad5758_select_adc_ip(struct ad5758_dev *dev, enum ad5758_adc_ip adc_ip_sel)
Definition: ad5758.c:632