no-OS
ad5592r.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef AD5592R_H_
34 #define AD5592R_H_
35 
36 #include "stdint.h"
37 #include "ad5592r-base.h"
38 
39 #define AD5592R_GPIO_READBACK_EN NO_OS_BIT(10)
40 #define AD5592R_LDAC_READBACK_EN NO_OS_BIT(6)
41 
42 #define swab16(x) \
43  ((((x) & 0x00ff) << 8) | \
44  (((x) & 0xff00) >> 8))
45 
46 int32_t ad5592r_write_dac(struct ad5592r_dev *dev, uint8_t chan,
47  uint16_t value);
48 int32_t ad5592r_read_adc(struct ad5592r_dev *dev, uint8_t chan,
49  uint16_t *value);
50 int32_t ad5592r_multi_read_adc(struct ad5592r_dev *dev,
51  uint16_t chans, uint16_t *value);
52 int32_t ad5592r_reg_write(struct ad5592r_dev *dev, uint8_t reg,
53  uint16_t value);
54 int32_t ad5592r_reg_read(struct ad5592r_dev *dev, uint8_t reg,
55  uint16_t *value);
56 int32_t ad5592r_gpio_read(struct ad5592r_dev *dev, uint8_t *value);
57 int32_t ad5592r_init(struct ad5592r_dev *dev,
59 
60 #endif /* AD5592R_H_ */
ad5592r_read_adc
int32_t ad5592r_read_adc(struct ad5592r_dev *dev, uint8_t chan, uint16_t *value)
Definition: ad5592r.c:96
ad5592r_write_dac
int32_t ad5592r_write_dac(struct ad5592r_dev *dev, uint8_t chan, uint16_t value)
Definition: ad5592r.c:76
AD5592R_GPIO_READBACK_EN
#define AD5592R_GPIO_READBACK_EN
Definition: ad5592r.h:39
AD5592R_REG_GPIO_IN_EN
@ AD5592R_REG_GPIO_IN_EN
Definition: ad5592r-base.h:66
ad5592r_write_dac
int32_t ad5592r_write_dac(struct ad5592r_dev *dev, uint8_t chan, uint16_t value)
Definition: ad5592r.c:76
swab16
#define swab16(x)
Definition: ad5592r.h:42
ad5592r_dev::gpio_in
uint8_t gpio_in
Definition: ad5592r-base.h:126
ad5592r_reg_write
int32_t ad5592r_reg_write(struct ad5592r_dev *dev, uint8_t reg, uint16_t value)
Definition: ad5592r.c:182
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
ad5592r_dev::ldac_mode
uint8_t ldac_mode
Definition: ad5592r-base.h:128
ad5592r_rw_ops
const struct ad5592r_rw_ops ad5592r_rw_ops
Definition: ad5592r.c:37
AD5592R_REG_ADC_SEQ
@ AD5592R_REG_ADC_SEQ
Definition: ad5592r-base.h:58
ad5592r_software_reset
int32_t ad5592r_software_reset(struct ad5592r_dev *dev)
Definition: ad5592r-base.c:182
ad5592r_init
int32_t ad5592r_init(struct ad5592r_dev *dev, struct ad5592r_init_param *init_param)
Definition: ad5592r.c:260
ad5592r_reg_read
int32_t ad5592r_reg_read(struct ad5592r_dev *dev, uint8_t reg, uint16_t *value)
Definition: ad5592r.c:201
ad5592r_reg_write
int32_t ad5592r_reg_write(struct ad5592r_dev *dev, uint8_t reg, uint16_t value)
Definition: ad5592r.c:182
ad5592r_dev::spi
struct no_os_spi_desc * spi
Definition: ad5592r-base.h:118
ad5592r_gpio_read
int32_t ad5592r_gpio_read(struct ad5592r_dev *dev, uint8_t *value)
Definition: ad5592r.c:232
ad5592r_rw_ops::write_dac
int32_t(* write_dac)(struct ad5592r_dev *dev, uint8_t chan, uint16_t value)
Definition: ad5592r-base.h:98
no_os_error.h
Error codes definition.
AD5592R_REG_LDAC
@ AD5592R_REG_LDAC
Definition: ad5592r-base.h:63
no_os_hweight16
unsigned int no_os_hweight16(uint16_t word)
ad5592r-base.h
Header file of AD5592R Base Driver.
ad5592r_multi_read_adc
int32_t ad5592r_multi_read_adc(struct ad5592r_dev *dev, uint16_t chans, uint16_t *value)
Definition: ad5592r.c:137
ad5592r_gpio_read
int32_t ad5592r_gpio_read(struct ad5592r_dev *dev, uint8_t *value)
Definition: ad5592r.c:232
ad5592r_init
int32_t ad5592r_init(struct ad5592r_dev *dev, struct ad5592r_init_param *init_param)
Definition: ad5592r.c:260
ad5592r_init_param
Definition: ad5592r-base.h:111
AD5592R_REG_PD
@ AD5592R_REG_PD
Definition: ad5592r-base.h:67
NO_OS_BIT
#define NO_OS_BIT(x)
Definition: no_os_util.h:45
ad5592r_rw_ops
Definition: ad5592r-base.h:97
ad5592r_reg_read
int32_t ad5592r_reg_read(struct ad5592r_dev *dev, uint8_t reg, uint16_t *value)
Definition: ad5592r.c:201
ad5592r_multi_read_adc
int32_t ad5592r_multi_read_adc(struct ad5592r_dev *dev, uint16_t chans, uint16_t *values)
Definition: ad5592r.c:137
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
ad5592r_read_adc
int32_t ad5592r_read_adc(struct ad5592r_dev *dev, uint8_t chan, uint16_t *value)
Definition: ad5592r.c:96
ad5592r_dev::spi_msg
uint16_t spi_msg
Definition: ad5592r-base.h:119
AD5592R_REG_PD_EN_REF
#define AD5592R_REG_PD_EN_REF
Definition: ad5592r-base.h:74
ad5592r_set_channel_modes
int32_t ad5592r_set_channel_modes(struct ad5592r_dev *dev)
Definition: ad5592r-base.c:203
AD5592R_LDAC_READBACK_EN
#define AD5592R_LDAC_READBACK_EN
Definition: ad5592r.h:40
ad5592r_dev
Definition: ad5592r-base.h:115
ad5592r.h
Header file of AD5592R driver.
ad5592r_dev::ops
const struct ad5592r_rw_ops * ops
Definition: ad5592r-base.h:116