Lines Matching refs:adc

125 	struct adc_hdl *adc = get_adc(argv[-2]);  in cmd_adc_ch_id()  local
128 if (!device_is_ready(adc->dev)) { in cmd_adc_ch_id()
138 adc->channel_config.channel_id = (uint8_t)strtol(argv[1], NULL, 10); in cmd_adc_ch_id()
139 retval = adc_channel_setup(adc->dev, &adc->channel_config); in cmd_adc_ch_id()
148 struct adc_hdl *adc = get_adc(argv[-2]); in cmd_adc_ch_diff() local
153 if (!device_is_ready(adc->dev)) { in cmd_adc_ch_diff()
165 adc->channel_config.differential = (uint8_t)diff; in cmd_adc_ch_diff()
166 retval = adc_channel_setup(adc->dev, &adc->channel_config); in cmd_adc_ch_diff()
176 struct adc_hdl *adc = get_adc(argv[-2]); in cmd_adc_ch_neg() local
179 if (!device_is_ready(adc->dev)) { in cmd_adc_ch_neg()
189 adc->channel_config.input_negative = (uint8_t)strtol(argv[1], NULL, 10); in cmd_adc_ch_neg()
190 retval = adc_channel_setup(adc->dev, &adc->channel_config); in cmd_adc_ch_neg()
203 struct adc_hdl *adc = get_adc(argv[-2]); in cmd_adc_ch_pos() local
206 if (!device_is_ready(adc->dev)) { in cmd_adc_ch_pos()
216 adc->channel_config.input_positive = (uint8_t)strtol(argv[1], NULL, 10); in cmd_adc_ch_pos()
217 retval = adc_channel_setup(adc->dev, &adc->channel_config); in cmd_adc_ch_pos()
230 struct adc_hdl *adc = get_adc(argv[-2]); in cmd_adc_gain() local
234 if (!device_is_ready(adc->dev)) { in cmd_adc_gain()
239 adc->channel_config.gain = gain; in cmd_adc_gain()
244 retval = adc_channel_setup(adc->dev, &adc->channel_config); in cmd_adc_gain()
253 struct adc_hdl *adc = get_adc(argv[-1]); in cmd_adc_acq() local
257 if (!device_is_ready(adc->dev)) { in cmd_adc_acq()
269 adc->channel_config.acquisition_time = in cmd_adc_acq()
272 adc->channel_config.acquisition_time = in cmd_adc_acq()
275 adc->channel_config.acquisition_time = in cmd_adc_acq()
278 adc->channel_config.acquisition_time = in cmd_adc_acq()
281 retval = adc_channel_setup(adc->dev, &adc->channel_config); in cmd_adc_acq()
289 struct adc_hdl *adc = get_adc(argv[-1]); in cmd_adc_reso() local
292 if (!device_is_ready(adc->dev)) { in cmd_adc_reso()
302 adc->resolution = (uint8_t)strtol(argv[1], NULL, 10); in cmd_adc_reso()
303 retval = adc_channel_setup(adc->dev, &adc->channel_config); in cmd_adc_reso()
312 struct adc_hdl *adc = get_adc(argv[-2]); in cmd_adc_ref() local
316 if (!device_is_ready(adc->dev)) { in cmd_adc_ref()
326 adc->channel_config.reference = reference; in cmd_adc_ref()
327 retval = adc_channel_setup(adc->dev, &adc->channel_config); in cmd_adc_ref()
338 struct adc_hdl *adc = get_adc(argv[-1]); in cmd_adc_read() local
342 if (!device_is_ready(adc->dev)) { in cmd_adc_read()
347 adc->channel_config.channel_id = adc_channel_id; in cmd_adc_read()
349 .channels = BIT(adc->channel_config.channel_id), in cmd_adc_read()
352 .resolution = adc->resolution, in cmd_adc_read()
355 retval = adc_read(adc->dev, &sequence); in cmd_adc_read()
366 struct adc_hdl *adc = get_adc(argv[-1]); in cmd_adc_print() local
375 adc->dev->name, in cmd_adc_print()
378 adc->channel_config.acquisition_time, in cmd_adc_print()
379 adc->channel_config.channel_id, in cmd_adc_print()
380 adc->channel_config.differential, in cmd_adc_print()
381 adc->resolution); in cmd_adc_print()
384 adc->channel_config.input_positive); in cmd_adc_print()
385 if (adc->channel_config.differential != 0) { in cmd_adc_print()
387 adc->channel_config.input_negative); in cmd_adc_print()
455 SHELL_CMD_REGISTER(adc, &sub_adc_dev, "ADC commands", NULL);