[stm32] unify GPIO code for f3 & f4 discovery