Default (initial) output value on GPIO2

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 18, 2016 by lpcware
Content originally posted in LPCWare by satyendra_sss on Thu Mar 03 00:28:58 MST 2016
I was wondering if there is a way to set the initial value of a GPIO pin to be configured as output pin to high(or low).
I am using GPIO2.0 of lpc1769 for switching a relay using a PNP switch.
Whenever I configure the pin as output, the switch gets turned on immediately. I am assuming this happens since the GPIO pin goes low the moment I configure it as an output pin.

Thanks and Regards,