/* ADC Enable an External Trigger for Injected Channels. 
This enables an external trigger for set of defined injected channels, and sets the polarity of the trigger event: rising or falling edge or both. */
void adc_enable_external_trigger_injected(uint32_t adc, uint32_t trigger, uint32_t polarity)
/* ADC Enable an External Trigger for Injected Channels. 
This enables an external trigger for set of defined injected channels, and sets the polarity of the trigger event: rising or falling edge or both. */
void adc_enable_external_trigger_injected(uint32_t adc, uint32_t trigger, uint32_t polarity)
{
	uint32_t reg32 = ADC_JSQR(adc);
	reg32 &= ~(ADC_JSQR_JEXTSEL_MASK | ADC_JSQR_JEXTEN_MASK);
	reg32 |= (trigger | polarity);
	ADC_JSQR(adc) = reg32;
}