Lines Matching +full:output +full:- +full:gain
4 * SPDX-License-Identifier: Apache-2.0
32 uint8_t gain; member
39 const struct ad569x_config *config = dev->config; in ad569x_write()
46 return i2c_write_dt(&config->bus, tx_data, sizeof(tx_data)); in ad569x_write()
51 const struct ad569x_config *config = dev->config; in ad569x_read()
56 ret = i2c_read_dt(&config->bus, rx_data, sizeof(rx_data)); in ad569x_read()
68 const struct ad569x_config *config = dev->config; in ad569x_channel_setup()
70 if (channel_cfg->channel_id > 0) { in ad569x_channel_setup()
71 LOG_ERR("invalid channel %d", channel_cfg->channel_id); in ad569x_channel_setup()
72 return -EINVAL; in ad569x_channel_setup()
75 if (channel_cfg->resolution != config->resolution) { in ad569x_channel_setup()
76 LOG_ERR("invalid resolution %d", channel_cfg->resolution); in ad569x_channel_setup()
77 return -EINVAL; in ad569x_channel_setup()
80 if (channel_cfg->internal) { in ad569x_channel_setup()
82 return -ENOTSUP; in ad569x_channel_setup()
93 LOG_DBG("reset %s", dev->name); in ad569x_sw_reset()
98 /* Check that DAC output is reset */ in ad569x_sw_reset()
106 LOG_ERR("failed to reset DAC output"); in ad569x_sw_reset()
107 return -EIO; in ad569x_sw_reset()
115 const struct ad569x_config *config = dev->config; in ad569x_write_value()
119 return -EINVAL; in ad569x_write_value()
122 if (value > (BIT(config->resolution) - 1)) { in ad569x_write_value()
124 return -EINVAL; in ad569x_write_value()
127 value <<= 16 - config->resolution; in ad569x_write_value()
134 const struct ad569x_config *config = dev->config; in ad569x_init()
137 if (!i2c_is_ready_dt(&config->bus)) { in ad569x_init()
138 return -ENODEV; in ad569x_init()
147 LOG_DBG("configure %s: gain %d, voltage reference %d, power down mode %d", dev->name, in ad569x_init()
148 config->gain, config->voltage_reference, config->power_down_mode); in ad569x_init()
150 uint16_t ctrl_reg = AD569X_CTRL_GAIN(config->gain) | in ad569x_init()
151 AD569X_CTRL_REF(config->voltage_reference) | in ad569x_init()
152 AD569X_CTRL_PD(config->power_down_mode); in ad569x_init()
172 .gain = DT_INST_ENUM_IDX(index, gain), \