GPIO pin status after setting the direction to output

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by Florian Kohl on Thu Oct 16 06:50:32 MST 2014
I have a question concerning the LPC1549 run on the board LPCXpresso1549 OM13056.

If the direction of a GPIO pin is set to output, e.g. for PIO0_3

LPC_GPIO->DIR[0] |= 1UL << 3

the LED turns on, as the coressponding pin (LPC_GPIO->B[0][3]) is initialized with 0.
Why the pin is initialized with 0, when the direction is set to output?

In some examples the direction is set to output and after that the pin is set to 1 again.
But this produces a short 0, which I would like to avoid.
Is it possible to initialize the pin with 1, when the direction is set to output?

Best regards, Florian