How should I do to set a GPIO output pin as open drain?
There seems to be no option for that?
Or should I set the GPIO as input when I want to set the pin high and set the GPIO as low output when I want to set the pin low?
First, KL series has not open drain control register.
Then I think your solution is OK. One reminder is attention to pull-up resistor value selection.
Retrieving data ...