Lines Matching +full:bus +full:- +full:range
6 * SPDX-License-Identifier: Apache-2.0
21 struct spi_dt_spec bus; member
29 const struct ltc166x_config *config = dev->config; in ltc166x_reg_write()
34 if (config->resolution == 10) { in ltc166x_reg_write()
50 return spi_write_dt(&config->bus, &tx); in ltc166x_reg_write()
57 const struct ltc166x_config *config = dev->config; in ltc166x_channel_setup()
59 if (channel_cfg->channel_id > config->nchannels - 1) { in ltc166x_channel_setup()
60 LOG_ERR("Unsupported channel %d", channel_cfg->channel_id); in ltc166x_channel_setup()
61 return -ENOTSUP; in ltc166x_channel_setup()
64 if (channel_cfg->resolution != config->resolution) { in ltc166x_channel_setup()
65 LOG_ERR("Unsupported resolution %d", channel_cfg->resolution); in ltc166x_channel_setup()
66 return -ENOTSUP; in ltc166x_channel_setup()
75 const struct ltc166x_config *config = dev->config; in ltc166x_write_value()
77 if (channel > config->nchannels - 1) { in ltc166x_write_value()
79 return -ENOTSUP; in ltc166x_write_value()
82 if (value >= (1 << config->resolution)) { in ltc166x_write_value()
83 LOG_ERR("Value %d out of range", value); in ltc166x_write_value()
84 return -EINVAL; in ltc166x_write_value()
92 const struct ltc166x_config *config = dev->config; in ltc166x_init()
94 if (!spi_is_ready_dt(&config->bus)) { in ltc166x_init()
95 LOG_ERR("SPI bus %s not ready", config->bus.bus->name); in ltc166x_init()
96 return -ENODEV; in ltc166x_init()
111 .bus = SPI_DT_SPEC_GET(INST_DT_LTC166X(n, t), \
125 * LTC1660: 10-bit
130 * LTC1665: 8-bit