no-OS
ad5592r.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef AD5592R_H_
40 #define AD5592R_H_
41 
42 #include "stdint.h"
43 #include "ad5592r-base.h"
44 
45 #define AD5592R_GPIO_READBACK_EN NO_OS_BIT(10)
46 #define AD5592R_LDAC_READBACK_EN NO_OS_BIT(6)
47 
48 #define swab16(x) \
49  ((((x) & 0x00ff) << 8) | \
50  (((x) & 0xff00) >> 8))
51 
52 int32_t ad5592r_write_dac(struct ad5592r_dev *dev, uint8_t chan,
53  uint16_t value);
54 int32_t ad5592r_read_adc(struct ad5592r_dev *dev, uint8_t chan,
55  uint16_t *value);
56 int32_t ad5592r_multi_read_adc(struct ad5592r_dev *dev,
57  uint16_t chans, uint16_t *value);
58 int32_t ad5592r_reg_write(struct ad5592r_dev *dev, uint8_t reg,
59  uint16_t value);
60 int32_t ad5592r_reg_read(struct ad5592r_dev *dev, uint8_t reg,
61  uint16_t *value);
62 int32_t ad5592r_gpio_read(struct ad5592r_dev *dev, uint8_t *value);
63 int32_t ad5592r_init(struct ad5592r_dev *dev,
65 
66 #endif /* AD5592R_H_ */
ad5592r_read_adc
int32_t ad5592r_read_adc(struct ad5592r_dev *dev, uint8_t chan, uint16_t *value)
Definition: ad5592r.c:102
ad5592r_write_dac
int32_t ad5592r_write_dac(struct ad5592r_dev *dev, uint8_t chan, uint16_t value)
Definition: ad5592r.c:82
AD5592R_GPIO_READBACK_EN
#define AD5592R_GPIO_READBACK_EN
Definition: ad5592r.h:45
AD5592R_REG_GPIO_IN_EN
@ AD5592R_REG_GPIO_IN_EN
Definition: ad5592r-base.h:72
ad5592r_write_dac
int32_t ad5592r_write_dac(struct ad5592r_dev *dev, uint8_t chan, uint16_t value)
Definition: ad5592r.c:82
swab16
#define swab16(x)
Definition: ad5592r.h:48
ad5592r_dev::gpio_in
uint8_t gpio_in
Definition: ad5592r-base.h:132
ad5592r_reg_write
int32_t ad5592r_reg_write(struct ad5592r_dev *dev, uint8_t reg, uint16_t value)
Definition: ad5592r.c:188
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
ad5592r_dev::ldac_mode
uint8_t ldac_mode
Definition: ad5592r-base.h:134
ad5592r_rw_ops
const struct ad5592r_rw_ops ad5592r_rw_ops
Definition: ad5592r.c:43
AD5592R_REG_ADC_SEQ
@ AD5592R_REG_ADC_SEQ
Definition: ad5592r-base.h:64
ad5592r_software_reset
int32_t ad5592r_software_reset(struct ad5592r_dev *dev)
Definition: ad5592r-base.c:188
ad5592r_init
int32_t ad5592r_init(struct ad5592r_dev *dev, struct ad5592r_init_param *init_param)
Definition: ad5592r.c:266
ad5592r_reg_read
int32_t ad5592r_reg_read(struct ad5592r_dev *dev, uint8_t reg, uint16_t *value)
Definition: ad5592r.c:207
ad5592r_reg_write
int32_t ad5592r_reg_write(struct ad5592r_dev *dev, uint8_t reg, uint16_t value)
Definition: ad5592r.c:188
ad5592r_gpio_read
int32_t ad5592r_gpio_read(struct ad5592r_dev *dev, uint8_t *value)
Definition: ad5592r.c:238
ad5592r_rw_ops::write_dac
int32_t(* write_dac)(struct ad5592r_dev *dev, uint8_t chan, uint16_t value)
Definition: ad5592r-base.h:104
no_os_error.h
Error codes definition.
AD5592R_REG_LDAC
@ AD5592R_REG_LDAC
Definition: ad5592r-base.h:69
no_os_hweight16
unsigned int no_os_hweight16(uint16_t word)
ad5592r-base.h
Header file of AD5592R Base Driver.
ad5592r_dev::spi
no_os_spi_desc * spi
Definition: ad5592r-base.h:124
ad5592r_multi_read_adc
int32_t ad5592r_multi_read_adc(struct ad5592r_dev *dev, uint16_t chans, uint16_t *value)
Definition: ad5592r.c:143
ad5592r_gpio_read
int32_t ad5592r_gpio_read(struct ad5592r_dev *dev, uint8_t *value)
Definition: ad5592r.c:238
ad5592r_init
int32_t ad5592r_init(struct ad5592r_dev *dev, struct ad5592r_init_param *init_param)
Definition: ad5592r.c:266
ad5592r_init_param
Definition: ad5592r-base.h:117
AD5592R_REG_PD
@ AD5592R_REG_PD
Definition: ad5592r-base.h:73
NO_OS_BIT
#define NO_OS_BIT(x)
Definition: no_os_util.h:51
ad5592r_rw_ops
Definition: ad5592r-base.h:103
ad5592r_reg_read
int32_t ad5592r_reg_read(struct ad5592r_dev *dev, uint8_t reg, uint16_t *value)
Definition: ad5592r.c:207
ad5592r_multi_read_adc
int32_t ad5592r_multi_read_adc(struct ad5592r_dev *dev, uint16_t chans, uint16_t *values)
Definition: ad5592r.c:143
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:96
ad5592r_read_adc
int32_t ad5592r_read_adc(struct ad5592r_dev *dev, uint8_t chan, uint16_t *value)
Definition: ad5592r.c:102
ad5592r_dev::spi_msg
uint16_t spi_msg
Definition: ad5592r-base.h:125
AD5592R_REG_PD_EN_REF
#define AD5592R_REG_PD_EN_REF
Definition: ad5592r-base.h:80
ad5592r_set_channel_modes
int32_t ad5592r_set_channel_modes(struct ad5592r_dev *dev)
Definition: ad5592r-base.c:209
AD5592R_LDAC_READBACK_EN
#define AD5592R_LDAC_READBACK_EN
Definition: ad5592r.h:46
ad5592r_dev
Definition: ad5592r-base.h:121
ad5592r.h
Header file of AD5592R driver.
ad5592r_dev::ops
const struct ad5592r_rw_ops * ops
Definition: ad5592r-base.h:122