Lines Matching refs:chan
108 int adc_emul_const_value_set(const struct device *dev, unsigned int chan, in adc_emul_const_value_set() argument
115 if (chan >= config->num_channels) { in adc_emul_const_value_set()
116 LOG_ERR("unsupported channel %d", chan); in adc_emul_const_value_set()
120 chan_cfg = &data->chan_cfg[chan]; in adc_emul_const_value_set()
132 int adc_emul_const_raw_value_set(const struct device *dev, unsigned int chan, uint32_t raw_value) in adc_emul_const_raw_value_set() argument
138 if (chan >= config->num_channels) { in adc_emul_const_raw_value_set()
139 LOG_ERR("unsupported channel %d", chan); in adc_emul_const_raw_value_set()
143 chan_cfg = &data->chan_cfg[chan]; in adc_emul_const_raw_value_set()
155 int adc_emul_value_func_set(const struct device *dev, unsigned int chan, adc_emul_value_func func, in adc_emul_value_func_set() argument
162 if (chan >= config->num_channels) { in adc_emul_value_func_set()
163 LOG_ERR("unsupported channel %d", chan); in adc_emul_value_func_set()
167 chan_cfg = &data->chan_cfg[chan]; in adc_emul_value_func_set()
180 int adc_emul_raw_value_func_set(const struct device *dev, unsigned int chan, in adc_emul_raw_value_func_set() argument
187 if (chan >= config->num_channels) { in adc_emul_raw_value_func_set()
188 LOG_ERR("unsupported channel %d", chan); in adc_emul_raw_value_func_set()
192 chan_cfg = &data->chan_cfg[chan]; in adc_emul_raw_value_func_set()
452 unsigned int chan, in adc_emul_get_chan_value() argument
455 struct adc_emul_chan_cfg *chan_cfg = &data->chan_cfg[chan]; in adc_emul_get_chan_value()
470 err = chan_cfg->func(data->dev, chan, chan_cfg->func_data, in adc_emul_get_chan_value()
474 chan, err); in adc_emul_get_chan_value()
484 err = chan_cfg->func(data->dev, chan, chan_cfg->func_data, &input_mV); in adc_emul_get_chan_value()
486 LOG_ERR("failed to read channel %d (err %d)", chan, err); in adc_emul_get_chan_value()
502 LOG_ERR("failed to get ref voltage (channel %d)", chan); in adc_emul_get_chan_value()
550 unsigned int chan = find_lsb_set(data->channels) - 1; in adc_emul_acquisition_thread() local
552 LOG_DBG("reading channel %d", chan); in adc_emul_acquisition_thread()
554 err = adc_emul_get_chan_value(data, chan, &result); in adc_emul_acquisition_thread()
560 LOG_DBG("read channel %d, result = %d", chan, result); in adc_emul_acquisition_thread()
563 WRITE_BIT(data->channels, chan, 0); in adc_emul_acquisition_thread()
584 int chan; in adc_emul_init() local
591 for (chan = 0; chan < config->num_channels; chan++) { in adc_emul_init()
592 struct adc_emul_chan_cfg *chan_cfg = &data->chan_cfg[chan]; in adc_emul_init()