Go to the documentation of this file.
54 #define AD5686_CTRL_NOP 0
55 #define AD5686_CTRL_WRITE 1
56 #define AD5686_CTRL_UPDATE 2
57 #define AD5686_CTRL_WRITEUPDATE 3
58 #define AD5686_CTRL_PWR 4
59 #define AD5686_CTRL_LDAC_MASK 5
60 #define AD5686_CTRL_SWRESET 6
61 #define AD5686_CTRL_IREF_REG 7
62 #define AD5686_CTRL_DCEN 8
63 #define AD5686_CTRL_RB_REG 9
65 #define AD5683_CMD_WR_CTRL_REG 4
66 #define AD5683_CTRL_RB_REG 5
69 #define AD5686_PWRM_NORMAL 0
70 #define AD5686_PWRM_1K 1
71 #define AD5686_PWRM_100K 2
72 #define AD5686_PWRM_THREESTATE 3
74 #define AD5686_PWRM_MASK 3
77 #define AD5686_INTREF_EN 1
78 #define AD5686_INTREF_DIS 0
79 #define AD5686_DC_EN 1
80 #define AD5686_DC_DIS 0
81 #define AD5686_RB_EN 1
82 #define AD5686_RB_DIS 0
84 #define MAX_RESOLUTION 16 // Maximum resolution of the supported devices
86 #define PKT_LENGTH 3 // SPI packet length in byte
88 #define ADDR_MASK 0xFF // Mask for Address bits
89 #define CMD_OFFSET 4 // Offset for Command
91 #define AD5686_CMD_MASK 0xFF
92 #define AD5686_MSB_MASK 0xFF00 // Most significant byte of the data word
93 #define AD5686_MSB_OFFSET 8
94 #define AD5686_LSB_MASK 0x00FF // Least significant byte of the data word
95 #define AD5686_LSB_OFFSET 0
97 #define AD5683_MIDB_OFFSET 4 // Offset for middle bits
98 #define AD5683_MIDB_MASK 0xFF
99 #define AD5683_MSB_OFFSET 12
100 #define AD5683_MSB_MASK 0xF
101 #define AD5683_CMD_MASK 0xF
102 #define AD5683_LSB_MASK 0xF
103 #define AD5683_LSB_OFFSET 4
105 #define AD5683_REG_MAP 0
106 #define AD5686_REG_MAP 1
110 #define AD5683_CTRL_DCEN(x) (((((x) & 0x1) << 0) << 10) & 0xFC00)
111 #define AD5683_CTRL_GM(x) (((((x) & 0x1) << 1) << 10) & 0xFC00)
112 #define AD5683_CTRL_INT_REF(x) (((((x) & 0x1) << 2) << 10) & 0xFC00)
113 #define AD5683_CTRL_PWRM(x) (((((x) & 0x3) << 3) << 10) & 0xFC00)
114 #define AD5683_SW_RESET ((((0x1) << 5) << 10) & 0xFC00)
@ ID_AD5684R
Definition: ad5686.h:134
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:85
struct no_os_gpio_desc * gpio_ldac
Definition: ad5686.h:195
#define AD5686_CTRL_RB_REG
Definition: ad5686.h:63
@ I2C
Definition: ad5686.h:159
int32_t no_os_i2c_write(struct no_os_i2c_desc *desc, uint8_t *data, uint8_t bytes_number, uint8_t stop_bit)
I2C Write data to slave device.
Definition: no_os_i2c.c:97
int32_t no_os_i2c_init(struct no_os_i2c_desc **desc, const struct no_os_i2c_init_param *param)
Initialize the I2C communication peripheral.
Definition: no_os_i2c.c:51
@ AD5686_CH_7
Definition: ad5686.h:170
uint8_t register_map
Definition: ad5686.h:183
@ AD5686_CH_2
Definition: ad5686.h:165
@ ID_AD5676
Definition: ad5686.h:128
void ad5686_read_back_en(struct ad5686_dev *dev, uint8_t value)
Set up readback register (readback enable)
Definition: ad5686.c:741
#define AD5686_CTRL_NOP
Definition: ad5686.h:54
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:95
@ ID_AD5689R
Definition: ad5686.h:140
@ ID_AD5675R
Definition: ad5686.h:127
#define AD5686_CTRL_DCEN
Definition: ad5686.h:62
int32_t ad5686_gain_mode(struct ad5686_dev *dev, uint8_t value)
Set Gain mode.
Definition: ad5686.c:759
Header file of SPI Interface.
uint32_t ldac_mask
Definition: ad5686.h:200
@ AD5686_CH_13
Definition: ad5686.h:176
@ AD5686_CH_9
Definition: ad5686.h:172
#define AD5683_MIDB_MASK
Definition: ad5686.h:98
void ad5686_write_update_register(struct ad5686_dev *dev, enum ad5686_dac_channels channel, uint16_t data)
Write to and update DAC channel n.
Definition: ad5686.c:519
int32_t no_os_i2c_remove(struct no_os_i2c_desc *desc)
Free the resources allocated by no_os_i2c_init().
Definition: no_os_i2c.c:76
#define AD5686_CTRL_WRITE
Definition: ad5686.h:55
@ AD5686_CH_6
Definition: ad5686.h:169
@ ID_AD5692R
Definition: ad5686.h:152
struct no_os_gpio_desc * gpio_reset
Definition: ad5686.h:194
@ SPI
Definition: ad5686.h:158
#define CMD_OFFSET
Definition: ad5446.c:59
#define AD5683_SW_RESET
Definition: ad5686.h:114
@ AD5686_CH_8
Definition: ad5686.h:171
#define AD5683_MIDB_OFFSET
Definition: ad5686.h:97
#define AD5683_CTRL_DCEN(x)
Definition: ad5686.h:110
@ ID_AD5681R
Definition: ad5686.h:147
#define PKT_LENGTH
Definition: ad5446.c:60
uint16_t ad5686_set_shift_reg(struct ad5686_dev *dev, uint8_t command, uint8_t address, uint16_t data)
Write to input shift register.
Definition: ad5686.c:392
Definition: ad9361_util.h:75
#define AD5683_CTRL_GM(x)
Definition: ad5686.h:111
@ AD5686_CH_4
Definition: ad5686.h:167
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:123
Header file of AD5686 Driver. This driver supporting the following devices: AD5684R,...
void ad5686_ldac_mask(struct ad5686_dev *dev, enum ad5686_dac_channels channel, uint8_t enable)
Set hardware LDAC mask register.
Definition: ad5686.c:665
#define AD5683_CTRL_RB_REG
Definition: ad5686.h:66
@ AD5686_CH_0
Definition: ad5686.h:163
@ AD5686_CH_12
Definition: ad5686.h:175
@ AD5686_CH_3
Definition: ad5686.h:166
void ad5686_daisy_chain_en(struct ad5686_dev *dev, uint8_t value)
Set up DCEN register (daisy-chain enable)
Definition: ad5686.c:722
#define AD5683_CMD_WR_CTRL_REG
Definition: ad5686.h:65
void ad5686_ldac_mask(struct ad5686_dev *dev, enum ad5686_dac_channels channel, uint8_t enable)
Set hardware LDAC mask register.
Definition: ad5686.c:665
@ ID_AD5674R
Definition: ad5686.h:126
void ad5686_software_reset(struct ad5686_dev *dev)
Software reset (power-on reset)
Definition: ad5686.c:683
@ ID_AD5693
Definition: ad5686.h:154
uint16_t ad5686_read_back_register(struct ad5686_dev *dev, enum ad5686_dac_channels channel)
Read back Input Register n.
Definition: ad5686.c:557
enum ad5686_type act_device
Definition: ad5686.h:198
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:121
uint32_t power_down_mask
Definition: ad5686.h:199
@ ID_AD5673R
Definition: ad5686.h:124
#define AD5686_CTRL_UPDATE
Definition: ad5686.h:56
int32_t ad5686_gain_mode(struct ad5686_dev *dev, uint8_t value)
Set Gain mode.
Definition: ad5686.c:759
struct no_os_i2c_init_param i2c_init
Definition: ad5686.h:205
@ ID_AD5685R
Definition: ad5686.h:135
@ ID_AD5686
Definition: ad5686.h:133
void ad5686_write_register(struct ad5686_dev *dev, enum ad5686_dac_channels channel, uint16_t data)
Write to Input Register n (dependent on LDAC)
Definition: ad5686.c:451
#define AD5686_CTRL_IREF_REG
Definition: ad5686.h:61
@ I2C
Definition: adxl372.h:323
ad5686_type
Definition: ad5686.h:121
@ ID_AD5691R
Definition: ad5686.h:151
struct no_os_spi_desc * spi_desc
Definition: ad5686.h:192
enum ad5686_type act_device
Definition: ad5686.h:213
#define AD5686_MSB_OFFSET
Definition: ad5686.h:93
@ ID_AD5687R
Definition: ad5686.h:138
#define AD5683_MSB_OFFSET
Definition: ad5686.h:99
@ ID_AD5697R
Definition: ad5686.h:141
#define AD5683_LSB_OFFSET
Definition: ad5686.h:103
#define AD5686_MSB_MASK
Definition: ad5686.h:92
@ ID_AD5672R
Definition: ad5686.h:123
void ad5686_internal_reference(struct ad5686_dev *dev, uint8_t value)
Write to Internal reference setup register.
Definition: ad5686.c:702
uint8_t resolution
Definition: ad5686.h:182
uint16_t ad5686_read_back_register(struct ad5686_dev *dev, enum ad5686_dac_channels channel)
Read back Input Register n.
Definition: ad5686.c:557
@ AD5686_CH_11
Definition: ad5686.h:174
uint16_t ad5686_set_shift_reg(struct ad5686_dev *dev, uint8_t command, uint8_t address, uint16_t data)
Write to input shift register.
Definition: ad5686.c:392
void ad5686_update_register(struct ad5686_dev *dev, enum ad5686_dac_channels channel)
Update DAC Register n with contents of Input Register n.
Definition: ad5686.c:486
@ AD5686_CH_14
Definition: ad5686.h:177
void ad5686_read_back_en(struct ad5686_dev *dev, uint8_t value)
Set up readback register (readback enable)
Definition: ad5686.c:741
#define AD5686_CTRL_PWR
Definition: ad5686.h:58
void ad5686_write_register(struct ad5686_dev *dev, enum ad5686_dac_channels channel, uint16_t data)
Write to Input Register n (dependent on LDAC)
Definition: ad5686.c:451
struct no_os_i2c_desc * i2c_desc
Definition: ad5686.h:190
@ ID_AD5694R
Definition: ad5686.h:143
const uint32_t * channel_addr
Definition: ad5686.h:185
#define AD5686_CTRL_SWRESET
Definition: ad5686.h:60
struct no_os_gpio_init_param gpio_ldac
Definition: ad5686.h:210
void ad5686_power_mode(struct ad5686_dev *dev, enum ad5686_dac_channels channel, uint8_t mode)
Set Power-down mode for DAC channel n.
Definition: ad5686.c:619
@ ID_AD5682R
Definition: ad5686.h:148
@ ID_AD5696
Definition: ad5686.h:145
#define AD5683_CTRL_INT_REF(x)
Definition: ad5686.h:112
void ad5686_software_reset(struct ad5686_dev *dev)
Software reset (power-on reset)
Definition: ad5686.c:683
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:110
@ AD5686_CH_5
Definition: ad5686.h:168
Structure holding SPI descriptor.
Definition: no_os_spi.h:143
@ ID_AD5677R
Definition: ad5686.h:130
@ ID_AD5676R
Definition: ad5686.h:129
void ad5686_power_mode(struct ad5686_dev *dev, enum ad5686_dac_channels channel, uint8_t mode)
Set Power-down mode for DAC channel n.
Definition: ad5686.c:619
@ ID_AD5683R
Definition: ad5686.h:149
@ ID_AD5679
Definition: ad5686.h:131
int32_t ad5686_init(struct ad5686_dev **device, struct ad5686_init_param init_param)
Initializes the communication peripheral and the initial Values for AD5686 Board.
Definition: ad5686.c:314
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:102
void ad5686_update_register(struct ad5686_dev *dev, enum ad5686_dac_channels channel)
Update DAC Register n with contents of Input Register n.
Definition: ad5686.c:486
@ ID_AD5674
Definition: ad5686.h:125
@ ID_AD5687
Definition: ad5686.h:137
#define AD5686_CTRL_LDAC_MASK
Definition: ad5686.h:59
@ ID_AD5696R
Definition: ad5686.h:146
Structure holding I2C descriptor.
Definition: no_os_i2c.h:81
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:55
int32_t no_os_i2c_read(struct no_os_i2c_desc *desc, uint8_t *data, uint8_t bytes_number, uint8_t stop_bit)
I2C Read data from slave device.
Definition: no_os_i2c.c:122
void * no_os_malloc(size_t size)
@ AD5686_CH_1
Definition: ad5686.h:164
Header file of I2C Interface.
@ ID_AD5689
Definition: ad5686.h:139
#define AD5683_LSB_MASK
Definition: ad5686.h:102
void ad5686_daisy_chain_en(struct ad5686_dev *dev, uint8_t value)
Set up DCEN register (daisy-chain enable)
Definition: ad5686.c:722
void no_os_free(void *ptr)
@ AD5686_CH_15
Definition: ad5686.h:178
int32_t ad5686_init(struct ad5686_dev **device, struct ad5686_init_param init_param)
Initializes the communication peripheral and the initial Values for AD5686 Board.
Definition: ad5686.c:314
@ ID_AD5679R
Definition: ad5686.h:132
@ ID_AD5686R
Definition: ad5686.h:136
@ ID_AD5695R
Definition: ad5686.h:144
ad5686_dac_channels
Definition: ad5686.h:162
Structure holding the parameters for I2C initialization.
Definition: no_os_i2c.h:64
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:96
#define AD5686_CMD_MASK
Definition: ad5686.h:91
#define AD5683_MSB_MASK
Definition: ad5686.h:100
#define MAX_RESOLUTION
Definition: ad5446.c:51
enum comm_type communication
Definition: ad5686.h:184
#define AD5683_REG_MAP
Definition: ad5686.h:105
@ AD5686_CH_10
Definition: ad5686.h:173
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:77
Header file of GPIO Interface.
void ad5686_internal_reference(struct ad5686_dev *dev, uint8_t value)
Write to Internal reference setup register.
Definition: ad5686.c:702
#define AD5683_CTRL_PWRM(x)
Definition: ad5686.h:113
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:51
@ ID_AD5683
Definition: ad5686.h:150
#define AD5686_REG_MAP
Definition: ad5686.h:106
struct no_os_spi_init_param spi_init
Definition: ad5686.h:207
comm_type
Definition: ad5686.h:157
@ SPI
Definition: adxl372.h:322
#define AD5683_CMD_MASK
Definition: ad5686.h:101
#define AD5686_CTRL_WRITEUPDATE
Definition: ad5686.h:57
void ad5686_write_update_register(struct ad5686_dev *dev, enum ad5686_dac_channels channel, uint16_t data)
Write to and update DAC channel n.
Definition: ad5686.c:519
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:153
#define ADDR_MASK
Definition: ad5686.h:88
struct no_os_gpio_init_param gpio_gain
Definition: ad5686.h:211
@ ID_AD5693R
Definition: ad5686.h:153
int32_t ad5686_remove(struct ad5686_dev *dev)
Free the resources allocated by ad5686_init().
Definition: ad5686.c:359
struct no_os_gpio_desc * gpio_gain
Definition: ad5686.h:196
struct no_os_gpio_init_param gpio_reset
Definition: ad5686.h:209
#define AD5686_LSB_MASK
Definition: ad5686.h:94
@ ID_AD5694
Definition: ad5686.h:142
@ ID_AD5671R
Definition: ad5686.h:122
int32_t ad5686_remove(struct ad5686_dev *dev)
Free the resources allocated by ad5686_init().
Definition: ad5686.c:359
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:121