The code example for hibernate mode on psoc 62S2 43012 board is coming soon.
Currenly, please refer to PSOC 6 HAL documentation for the usage details for the API cyhal_syspm_hibernate() - https://cypresssemiconductorco.github.io/psoc6hal/html/group__group__hal__syspm.html
Why i must implementation the callback to activate the hibernate mode ? To explain me better, i have used the PSoC Creator for many years and on the creator is necessary add only function di hibernate to activate this mode. While in PSoC 6 using SDK of modusToolbox is necessary implementation of the callback to activate the hibernate mode, to what reason ?
The callbacks were put there in order to allow each block to register that it wants to be told of an impending low power state.... and to have the block be able to say... yes do this... or no dont do this... it was also put there so the blocks could perform their own work before and after the low power mode.
This was code that you probably had in one function... but given the increase complexity of systems available in PSoC 6 we put in more flexibility... which yes increases the complexity somewhat.
There is a nice appnote that Greg wrote on this topic.