Go to the documentation of this file.
33 #ifndef AD5592R_BASE_H_
34 #define AD5592R_BASE_H_
43 #define CH_MODE_UNUSED 0
46 #define CH_MODE_DAC_AND_ADC 3
50 #define CH_OFFSTATE_PULLDOWN 0
51 #define CH_OFFSTATE_OUT_LOW 1
52 #define CH_OFFSTATE_OUT_HIGH 2
53 #define CH_OFFSTATE_OUT_TRISTATE 3
73 #define AD5592R_REG_PD_PD_ALL NO_OS_BIT(10)
74 #define AD5592R_REG_PD_EN_REF NO_OS_BIT(9)
76 #define AD5592R_REG_CTRL_ADC_PC_BUFF NO_OS_BIT(9)
77 #define AD5592R_REG_CTRL_ADC_BUFF_EN NO_OS_BIT(8)
78 #define AD5592R_REG_CTRL_CONFIG_LOCK NO_OS_BIT(7)
79 #define AD5592R_REG_CTRL_W_ALL_DACS NO_OS_BIT(6)
80 #define AD5592R_REG_CTRL_ADC_RANGE NO_OS_BIT(5)
81 #define AD5592R_REG_CTRL_DAC_RANGE NO_OS_BIT(4)
83 #define AD5592R_REG_ADC_SEQ_REP NO_OS_BIT(9)
84 #define AD5592R_REG_ADC_SEQ_TEMP_READBACK NO_OS_BIT(8)
85 #define AD5592R_REG_ADC_SEQ_CODE_MSK(x) ((x) & 0x0FFF)
87 #define AD5592R_REG_GPIO_OUT_EN_ADC_NOT_BUSY NO_OS_BIT(8)
89 #define AD5592R_REG_LDAC_IMMEDIATE_OUT 0x00
90 #define AD5592R_REG_LDAC_INPUT_REG_ONLY 0x01
91 #define AD5592R_REG_LDAC_INPUT_REG_OUT 0x02
93 #define INTERNAL_VREF_VOLTAGE 2.5
103 uint16_t chans, uint16_t *value);
140 uint8_t offset, int32_t value);
int32_t ad5592r_reset_channel_modes(struct ad5592r_dev *dev)
Definition: ad5592r-base.c:311
@ AD5592R_REG_GPIO_IN_EN
Definition: ad5592r-base.h:66
uint16_t cached_dac[8]
Definition: ad5592r-base.h:121
uint8_t num_channels
Definition: ad5592r-base.h:120
int32_t(* reg_read)(struct ad5592r_dev *dev, uint8_t reg, uint16_t *value)
Definition: ad5592r-base.h:106
int32_t ad5592r_gpio_get(struct ad5592r_dev *dev, uint8_t offset)
Definition: ad5592r-base.c:71
uint8_t gpio_in
Definition: ad5592r-base.h:126
@ AD5592R_REG_NOOP
Definition: ad5592r-base.h:56
int32_t(* read_adc)(struct ad5592r_dev *dev, uint8_t chan, uint16_t *value)
Definition: ad5592r-base.h:100
int32_t ad5592r_gpio_set(struct ad5592r_dev *dev, uint8_t offset, int32_t value)
Definition: ad5592r-base.c:97
uint8_t ldac_mode
Definition: ad5592r-base.h:128
Header file of SPI Interface.
@ AD5592R_REG_DAC_READBACK
Definition: ad5592r-base.h:57
int32_t ad5592r_software_reset(struct ad5592r_dev *dev)
Definition: ad5592r-base.c:182
@ AD5592R_REG_GPIO_OUT_EN
Definition: ad5592r-base.h:64
#define CH_OFFSTATE_OUT_HIGH
Definition: ad5592r-base.h:52
@ AD5592R_REG_GPIO_SET
Definition: ad5592r-base.h:65
@ AD5592R_REG_ADC_SEQ
Definition: ad5592r-base.h:58
int32_t ad5592r_software_reset(struct ad5592r_dev *dev)
Definition: ad5592r-base.c:182
Header file of Delay functions.
#define CH_OFFSTATE_PULLDOWN
Definition: ad5592r-base.h:50
uint16_t cached_gp_ctrl
Definition: ad5592r-base.h:122
@ AD5592R_REG_CTRL
Definition: ad5592r-base.h:59
@ AD5592R_REG_PULLDOWN
Definition: ad5592r-base.h:62
struct no_os_i2c_desc * i2c
Definition: ad5592r-base.h:117
uint8_t channel_offstate[8]
Definition: ad5592r-base.h:124
int32_t ad5592r_gpio_set(struct ad5592r_dev *dev, uint8_t offset, int32_t value)
Definition: ad5592r-base.c:97
@ AD5592R_REG_DAC_EN
Definition: ad5592r-base.h:61
struct no_os_spi_desc * spi
Definition: ad5592r-base.h:118
#define CH_MODE_ADC
Definition: ad5592r-base.h:44
uint8_t gpio_val
Definition: ad5592r-base.h:127
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
int32_t(* write_dac)(struct ad5592r_dev *dev, uint8_t chan, uint16_t value)
Definition: ad5592r-base.h:98
uint8_t channel_modes[8]
Definition: ad5592r-base.h:123
int32_t ad5592r_gpio_direction_output(struct ad5592r_dev *dev, uint8_t offset, int32_t value)
Definition: ad5592r-base.c:145
int32_t ad5592r_base_reg_write(struct ad5592r_dev *dev, uint8_t reg, uint16_t value)
Definition: ad5592r-base.c:44
@ AD5592R_REG_TRISTATE
Definition: ad5592r-base.h:69
int32_t ad5592r_base_reg_write(struct ad5592r_dev *dev, uint8_t reg, uint16_t value)
Definition: ad5592r-base.c:44
#define CH_MODE_UNUSED
Definition: ad5592r-base.h:43
@ AD5592R_REG_LDAC
Definition: ad5592r-base.h:63
#define CH_OFFSTATE_OUT_LOW
Definition: ad5592r-base.h:51
int32_t(* multi_read_adc)(struct ad5592r_dev *dev, uint16_t chans, uint16_t *value)
Definition: ad5592r-base.h:102
#define CH_OFFSTATE_OUT_TRISTATE
Definition: ad5592r-base.h:53
int32_t ad5592r_base_reg_read(struct ad5592r_dev *dev, uint8_t reg, uint16_t *value)
Definition: ad5592r-base.c:58
Header file of AD5592R Base Driver.
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
int32_t(* reg_write)(struct ad5592r_dev *dev, uint8_t reg, uint16_t value)
Definition: ad5592r-base.h:104
ad5592r_registers
Definition: ad5592r-base.h:55
Definition: ad5592r-base.h:111
bool int_ref
Definition: ad5592r-base.h:112
int32_t ad5592r_gpio_direction_output(struct ad5592r_dev *dev, uint8_t offset, int32_t value)
Definition: ad5592r-base.c:145
Structure holding I2C address descriptor.
Definition: no_os_i2c.h:101
int32_t ad5592r_gpio_get(struct ad5592r_dev *dev, uint8_t offset)
Definition: ad5592r-base.c:71
Header file of I2C Interface.
int32_t ad5592r_set_channel_modes(struct ad5592r_dev *dev)
Definition: ad5592r-base.c:203
int32_t(* gpio_read)(struct ad5592r_dev *dev, uint8_t *value)
Definition: ad5592r-base.h:108
@ AD5592R_REG_PD
Definition: ad5592r-base.h:67
#define NO_OS_BIT(x)
Definition: no_os_util.h:45
Definition: ad5592r-base.h:97
int32_t ad5592r_gpio_direction_input(struct ad5592r_dev *dev, uint8_t offset)
Definition: ad5592r-base.c:118
uint16_t spi_msg
Definition: ad5592r-base.h:119
uint8_t gpio_out
Definition: ad5592r-base.h:125
#define CH_MODE_GPO
Definition: ad5592r-base.h:48
int32_t ad5592r_set_channel_modes(struct ad5592r_dev *dev)
Definition: ad5592r-base.c:203
@ AD5592R_REG_RESET
Definition: ad5592r-base.h:70
@ AD5592R_REG_ADC_EN
Definition: ad5592r-base.h:60
@ AD5592R_REG_OPEN_DRAIN
Definition: ad5592r-base.h:68
#define CH_MODE_DAC
Definition: ad5592r-base.h:45
int32_t ad5592r_reset_channel_modes(struct ad5592r_dev *dev)
Definition: ad5592r-base.c:311
int32_t ad5592r_gpio_direction_input(struct ad5592r_dev *dev, uint8_t offset)
Definition: ad5592r-base.c:118
Header file of utility functions.
Definition: ad5592r-base.h:115
#define CH_MODE_GPI
Definition: ad5592r-base.h:47
int32_t ad5592r_base_reg_read(struct ad5592r_dev *dev, uint8_t reg, uint16_t *value)
Definition: ad5592r-base.c:58
const struct ad5592r_rw_ops * ops
Definition: ad5592r-base.h:116
#define CH_MODE_DAC_AND_ADC
Definition: ad5592r-base.h:46