The order of the Conversion Frame results (Continuous Mode).
Posted: Thu Dec 12, 2024 3:39 am
the documentation does not provide information about the order in case of a configuration with several ADC channels (Continuous Mode).
https://docs.espressif.com/projects/esp ... r-concepts
i use ADC with 2 number of the channels -- the conversion results of the different channels have some order in the frame?
I use filtering for different channels due to the algorithm.
does this need to be done?
https://docs.espressif.com/projects/esp ... r-concepts
i use ADC with 2 number of the channels -- the conversion results of the different channels have some order in the frame?
I use filtering for different channels due to the algorithm.
Code: Select all
std::vector< adc_digi_pattern_config_t > mDigiPatterns {
adc_digi_pattern_config_t { static_cast< std::uint8_t >( adc_atten_t::ADC_ATTEN_DB_12 ),
static_cast< std::uint8_t >( channel1 ),
static_cast< std::uint8_t >( unit ),
static_cast< std::uint8_t >( adc_bitwidth_t::ADC_BITWIDTH_12 ) },
adc_digi_pattern_config_t { static_cast< std::uint8_t >( adc_atten_t::ADC_ATTEN_DB_12 ),
static_cast< std::uint8_t >( channel2 ),
static_cast< std::uint8_t >( unit ),
static_cast< std::uint8_t >( adc_bitwidth_t::ADC_BITWIDTH_12 ) }
};
mAdc.configure( mDigiPatterns, SamplingRateHZ, ADC_CONV_SINGLE_UNIT_1, ADC_DIGI_OUTPUT_FORMAT_TYPE1 );
mAdc.read( std::as_writable_bytes( dataSpan ), std::chrono::milliseconds( ADC_MAX_DELAY ) );
auto channel_1_digies = dataSpan | std::views::as_const | std::views::filter( [ channel1 ]( auto & el ) {
return el.type1.channel == channel1;
} );
auto channel_2_digies = dataSpan | std::views::as_const | std::views::filter( [ channel2 ]( auto & el ) {
return el.type1.channel == channel2;
} );