Thank you very much, XiangJun Rong.
That was not exactly the question, but you answered it indirectly. In AN10915 it is recommended to configure the pins that are not going to be used as low-level outputs: "All General Purpose I / O pins (GPIO) default to input with pull-up resistor enabled. Using the PINMODEx registers, first, disable the internal pull-ups on all general port pins. Second, configure the IOs as GPIO outputs and drive them low " (p. 13).
It is also recommended to remove power to peripherals that are not to be used: "Peripherals Power Control Register contains control bits that enable and disable individual peripheral functions, allowing elimination of power consumption by peripherals that are not needed. This feature allows individual peripherals to be turned off if they are not needed in the application, resulting in additional power savings" (p. 12).
I am trying to create a generic function to apply all the recommendations of AN10915. The idea would be to execute this function at the beginning of my projects, then configure the hardware according to the needs of said project (by feeding the necessary peripherals) and, finally, in the infinite loop, put the processor in sleep mode (since It is the only one that supports debug mode).
Therefore, within this function for energy saving, my intention was, once the pull-ups have been deactivated and the pins configured as outputs at a low level, turn off all peripherals:
LPC_SYSCTL-> PCONP = 0x0;
And then, in the main function, feed the peripherals to be used in each project.
From your answer I deduce that if I remove the power supply from the GPIO, the state of the pins is not maintained. So I should first turn off the peripherals, then power the GPIO, configure the pins that I will not use, and leave the GPIO powered. It is right?
Sorry for the level of English (I'm using a translator). Thank you very much for your help.