CubeMX MX_GPIO_Init() Set GPIO output level at runtime before initialization
Hello,
I want to know if there is a way to set the GPIO output level for an output at runtime before it will be initialized by the CubeMX generated MX_GPIO_Init() function?
In other words: The MX_GPIO_Init() function writes the in CubeMX configured value to a GPIO output before intializing it:
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(***_GPIO_Port, ***_Pin, GPIO_PIN_SET);Can I somehow get CubeMX to insert a variable name/value instead of the define 'GPIO_PIN_SET' which would allow me to change the value before calling the MX_GPIO_Init() function?
My intention is to decide at runtime if this pin should be initialized to high or low. I could copy&paste the generated MX_GPIO_Init() and adapt it to my needs, but then I am not in sync with the CubeMX project anymore. Also changing the pin value after the initialization is not an option for me because I don't want a wrong value at the pin.
Thanks,
Jens
Edit: Tried to clarify the 'runtime' aspect of the question.
