/* ADC Set an Injected Channel Conversion Sequence. 
Defines a sequence of channels to be converted as an injected group with a length from 1 to 4 channels. If this is called during conversion, the current conversion is reset and conversion begins again with the newly defined group. */
void adc_set_injected_sequence(uint32_t adc, uint8_t length, uint8_t channel[])
/* ADC Set an Injected Channel Conversion Sequence. 
Defines a sequence of channels to be converted as an injected group with a length from 1 to 4 channels. If this is called during conversion, the current conversion is reset and conversion begins again with the newly defined group. */
void adc_set_injected_sequence(uint32_t adc, uint8_t length, uint8_t channel[])
{
	uint32_t reg32 = 0;
	uint8_t i = 0;
	if ((length - 1) > 3) {
		return;
	}
	for (i = 0; i < length; i++) {
		reg32 |= ADC_JSQR_JSQ_VAL(4 - i, channel[length - i - 1]);
	}
	reg32 |= ADC_JSQR_JL_VAL(length);
	ADC_JSQR(adc) = reg32;
}