/* This provides the code for the "next gen" EXTI block provided in F2/F4/L1 devices. (differences only in the source selection)  */
void exti_set_trigger(uint32_t extis, enum exti_trigger_type trig)
/* This provides the code for the "next gen" EXTI block provided in F2/F4/L1 devices. (differences only in the source selection)  */
void exti_set_trigger(uint32_t extis, enum exti_trigger_type trig)
{
	switch (trig) {
	case EXTI_TRIGGER_RISING:
		EXTI_RTSR |= extis;
		EXTI_FTSR &= ~extis;
		break;
	case EXTI_TRIGGER_FALLING:
		EXTI_RTSR &= ~extis;
		EXTI_FTSR |= extis;
		break;
	case EXTI_TRIGGER_BOTH:
		EXTI_RTSR |= extis;
		EXTI_FTSR |= extis;
		break;
	}
}