2021-11-16 01:49 PM
Good evening, I would need, for a project with a custom board that mounts a micro STM32H7A3... to be able to set the value of a pin to 0 or 1 during the code and not via MX cube for the initial settings which function could I use? I would like to point out that the pin in question is set as I2C_SDA and not GPIO_output generic.
2021-11-16 02:25 PM
Switch it to GPIO output in GPIOx_MODER, and then back again when you need so.
> which function
You need only the bitwise AND (&) and OR (|) operators for that.
JW
2021-11-16 02:25 PM
The behavior of SDA is governed by the state machine of the peripheral.
If you want to set it to an arbitrary value, initialize the pin as a GPIO output, then set it back to I2C AF mode when finished.
2021-11-17 12:20 AM
thanks for the answers but I did not understand how to do. I have no way to use the functions Hal_GPOI on the SDA pin because I have no way to get to the reference GPOIx since I have no references to code of how this particular pin is defined.