add support for GPIO remapping (copied from stm32f_gpio.c)