Is it possible to toggle a pin between "ground" and "not connected"?
According to the data sheet for the xmc4300 the io pin is tri-stated when set to input.  So you could output a zero to this pin and toggle between input (tri-state) and output (low).

However.  You may wreck the micro if you do so.  When you tri-state the pin (toggle to input) the voltage on the pin will rise up to whatever the pump control pin pulls it up to.  This could be 12V for example.  Your micro's input pin would see 12V and surely fry.

You should use an npn transistor to pull low/tri-state the pump's control pin.  And ensure that the transistor has a higher voltage rating than whatever the pump pulls the pin up to.







simulate this circuit &ndash; Schematic created using CircuitLab