2017-08-01 09:10 PM
Hi.
I wonder if I can dynamically change the GPIO configuration of stm32f072.(that is, input to output or output to input)
Regards.
Solved! Go to Solution.
2017-08-01 10:17 PM
Hello!
Yes you can change on the fly the mode of GPIO pin.
by change GPIOx_MODER register.
You can use SPL function, GPIO_Init(GPIO_TypeDef* GPIOx, GPIO_InitTypeDef* GPIO_InitStruct)
HAL function, HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init)
Directly, GPIOx->MODER &= ~ y ; GPIOx->MODER |=z; (zeroize first and write after) Read Ref MAnual about MODER Reg
2017-08-01 10:17 PM
Hello!
Yes you can change on the fly the mode of GPIO pin.
by change GPIOx_MODER register.
You can use SPL function, GPIO_Init(GPIO_TypeDef* GPIOx, GPIO_InitTypeDef* GPIO_InitStruct)
HAL function, HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init)
Directly, GPIOx->MODER &= ~ y ; GPIOx->MODER |=z; (zeroize first and write after) Read Ref MAnual about MODER Reg
2017-08-02 12:23 AM
Thank you very much.