The HAL for my stm32f10x provides an adc interface with the following mode selector by enabling ScanConvMode
, which determines whether multiple channels or a single one are processed by the ADC, or just a single one
For multi-channel adc reading (scan mode), there is an interface to provide a sequence to order how the multiple channels are read. With this interface you can initialize each channel with a sequence number for which they will be converted in ascending order.
My question is, if you assign a channel to 0, will it be ignored? And if you have discontinuities in your adc ranks, (say 1-5, 8, 9, 16) will these be read in the correct order? The docs are very unclear on this
I have up to 16 channels which I want to read by multi-channel scan, for which I don't care about the order, but I want to be able to toggle them off and on as I need them so that any given time I am not making more conversions than I need to.
Relevant information
uint32_t ScanConvMode If enabled: Conversions are performed in sequence mode (multiple ranks defined by 'NbrOfConversion'). Scan direction is upward: from rank1 to rank 'n'. This parameter can be a value of ADC_Scan_mode
uint32_t Rank Specifies the rank in the regular group sequencer This parameter can be a value of ADC_regular_rank Note: In case of need to disable a channel or change order of conversion sequencer, rank containing a previous channel setting can be overwritten by the new channel setting (or parameter number of conversions can be adjusted)