There are functions for most components to be used before and after hibernation.
These are usually named Component_sleep() and Component_Wakeup(). Look into the appropiate datasheets.
Thanks for highlighting that. We found that the original project didn't have the *_PM.c files generated while for some reason my test project did and it worked fine. Is there a way to enable those power management files to be generated? I'm not aware of anything that would stop that feature from being enabled.