Lines Matching +full:multi +full:- +full:channel

4  * SPDX-License-Identifier: Apache-2.0
18 #define MCP4728_DAC_MAX_VAL ((1U << MCP4728_RESOLUTION) - 1U)
40 if (channel_cfg->channel_id >= MCP4728_MAX_CHANNEL) { in mcp4728_channel_setup()
41 return -ENOTSUP; in mcp4728_channel_setup()
44 if (channel_cfg->resolution != MCP4728_RESOLUTION) { in mcp4728_channel_setup()
45 return -ENOTSUP; in mcp4728_channel_setup()
48 if (channel_cfg->internal) { in mcp4728_channel_setup()
49 return -ENOTSUP; in mcp4728_channel_setup()
55 static int mcp4728_write_value(const struct device *dev, uint8_t channel, uint32_t value) in mcp4728_write_value() argument
57 const struct mcp4728_config *config = (struct mcp4728_config *)dev->config; in mcp4728_write_value()
61 if (channel >= MCP4728_MAX_CHANNEL) { in mcp4728_write_value()
62 return -ENOTSUP; in mcp4728_write_value()
66 return -ENOTSUP; in mcp4728_write_value()
69 /* Multi-Write Command: Write Multiple DAC Input Registers. */ in mcp4728_write_value()
71 (channel << MCP4728_MULTI_WRITE_CHANNEL_POS); in mcp4728_write_value()
72 tx_data[1] = (config->voltage_reference[channel] << MCP4728_MULTI_WRITE_REFERENCE_POS) | in mcp4728_write_value()
73 ((config->power_down[channel] & MCP4728_MULTI_WRITE_POWER_DOWN_MASK) in mcp4728_write_value()
75 ((config->gain[channel] << MCP4728_MULTI_WRITE_GAIN_POS)) | in mcp4728_write_value()
79 ret = i2c_write_dt(&config->bus, tx_data, sizeof(tx_data)); in mcp4728_write_value()
86 const struct mcp4728_config *config = dev->config; in dac_mcp4728_init()
88 if (!device_is_ready(config->bus.bus)) { in dac_mcp4728_init()
89 LOG_ERR("%s device not found", config->bus.bus->name); in dac_mcp4728_init()
90 return -ENODEV; in dac_mcp4728_init()