Lines Matching refs:channel_cfg

378 				 const struct adc_channel_cfg *channel_cfg)  in ads1x1x_channel_setup()  argument
385 if (channel_cfg->channel_id != 0) { in ads1x1x_channel_setup()
386 LOG_ERR("unsupported channel id '%d'", channel_cfg->channel_id); in ads1x1x_channel_setup()
390 if (channel_cfg->reference != ADC_REF_INTERNAL) { in ads1x1x_channel_setup()
391 LOG_ERR("unsupported channel reference type '%d'", channel_cfg->reference); in ads1x1x_channel_setup()
397 if (channel_cfg->differential) { in ads1x1x_channel_setup()
398 if (channel_cfg->input_positive == 0 && channel_cfg->input_negative == 1) { in ads1x1x_channel_setup()
400 } else if (channel_cfg->input_positive == 0 && in ads1x1x_channel_setup()
401 channel_cfg->input_negative == 3) { in ads1x1x_channel_setup()
403 } else if (channel_cfg->input_positive == 1 && in ads1x1x_channel_setup()
404 channel_cfg->input_negative == 3) { in ads1x1x_channel_setup()
406 } else if (channel_cfg->input_positive == 2 && in ads1x1x_channel_setup()
407 channel_cfg->input_negative == 3) { in ads1x1x_channel_setup()
411 channel_cfg->input_positive, channel_cfg->input_negative); in ads1x1x_channel_setup()
415 if (channel_cfg->input_positive == 0) { in ads1x1x_channel_setup()
417 } else if (channel_cfg->input_positive == 1) { in ads1x1x_channel_setup()
419 } else if (channel_cfg->input_positive == 2) { in ads1x1x_channel_setup()
421 } else if (channel_cfg->input_positive == 3) { in ads1x1x_channel_setup()
425 channel_cfg->input_positive); in ads1x1x_channel_setup()
431 if (!((channel_cfg->differential) && in ads1x1x_channel_setup()
432 (channel_cfg->input_positive == 0 && channel_cfg->input_negative == 1))) { in ads1x1x_channel_setup()
434 channel_cfg->input_positive, channel_cfg->input_negative); in ads1x1x_channel_setup()
439 data->differential = channel_cfg->differential; in ads1x1x_channel_setup()
441 dr = ads1x1x_acq_time_to_dr(dev, channel_cfg->acquisition_time); in ads1x1x_channel_setup()
444 channel_cfg->acquisition_time); in ads1x1x_channel_setup()
452 switch (channel_cfg->gain) { in ads1x1x_channel_setup()
472 LOG_ERR("unsupported channel gain '%d'", channel_cfg->gain); in ads1x1x_channel_setup()
477 if (channel_cfg->gain != ADC_GAIN_1) { in ads1x1x_channel_setup()
478 LOG_ERR("unsupported channel gain '%d'", channel_cfg->gain); in ads1x1x_channel_setup()