How to read GPIO direction using HAL?
Hello world,
I'm developing a FW for STM32F107VCT6 which can change GPIO direction programmatically: there is a terminal command which can switch individually 7 pins* mapped on different ports between GPIO_MODE_OUTPUT_PP \ GPIO_MODE_INPUT.
I'm wondering if is there a way to read GPIO direction using STM32 HAL the same way I use HAL_GPIO_ReadPin for the status.
Since the code is completely written pointing the resources with an header file which defines are used to feed HAL drivers calls, I don't want to write just for this code which dive down to GPIOx_CRL/H MODEx pins....is there a more straightforward way?
Thanks
*: Pin listed below
#define EXP6_Pin GPIO_PIN_8
#define EXP6_GPIO_Port GPIOB
#define EXP5_Pin GPIO_PIN_9
#define EXP5_GPIO_Port GPIOB
#define EXP4_Pin GPIO_PIN_10
#define EXP4_GPIO_Port GPIOC
#define EXP3_Pin GPIO_PIN_11
#define EXP3_GPIO_Port GPIOC
#define EXP2_Pin GPIO_PIN_5
#define EXP2_GPIO_Port GPIOA
#define EXP1_Pin GPIO_PIN_6
#define EXP1_GPIO_Port GPIOA
#define EXP0_Pin GPIO_PIN_7
#define EXP0_GPIO_Port GPIOA