Lines Matching refs:sequence
156 static int adc_ra_check_buffer_size(const struct device *dev, const struct adc_sequence *sequence) in adc_ra_check_buffer_size() argument
164 if (mask & sequence->channels) { in adc_ra_check_buffer_size()
170 if (sequence->options) { in adc_ra_check_buffer_size()
171 needed *= (1 + sequence->options->extra_samplings); in adc_ra_check_buffer_size()
174 if (sequence->buffer_size < needed) { in adc_ra_check_buffer_size()
194 static int adc_ra_start_read(const struct device *dev, const struct adc_sequence *sequence) in adc_ra_start_read() argument
200 if (sequence->resolution > ADC_RA_MAX_RESOLUTION || sequence->resolution == 0) { in adc_ra_start_read()
201 LOG_ERR("unsupported resolution %d", sequence->resolution); in adc_ra_start_read()
205 if (find_msb_set(sequence->channels) > config->num_channels) { in adc_ra_start_read()
206 LOG_ERR("unsupported channels in mask: 0x%08x", sequence->channels); in adc_ra_start_read()
210 err = adc_ra_check_buffer_size(dev, sequence); in adc_ra_start_read()
217 data->buf = sequence->buffer; in adc_ra_start_read()
218 adc_context_start_read(&data->ctx, sequence); in adc_ra_start_read()
239 static int adc_ra_read_async(const struct device *dev, const struct adc_sequence *sequence, in adc_ra_read_async() argument
246 err = adc_ra_start_read(dev, sequence); in adc_ra_read_async()
265 static int adc_ra_read(const struct device *dev, const struct adc_sequence *sequence) in adc_ra_read() argument
267 return adc_ra_read_async(dev, sequence, NULL); in adc_ra_read()
274 data->channels = ctx->sequence.channels; in adc_context_start_sampling()