I can suggest to write directly in GPIO control registers. You need to set the GPIOx->CR1 CR2 DDR ...
The best way is to analyze the function and check the setted bits and write directly in the GPIO control registers.
The driver functions are generic and test the different cases.
In you case you know your pin configuration --> do it, without the different cases.
I test it with a code someting like that quickly the results seems interesting:
GPIOE->ODR = 0;
GPIOE->DDR =0x80; // pin 7 output
GPIOE->DDR = 0; // PIN7 INPUT
Retrieving data ...