Hi @zz642040273
Not using mbed, but you can easily do this with the Freescale/NXP Kinetis Design Studio and Processor Expert in the Cpu and Clock settings:
You can easily configure all different low power modes and switch between them:
If using mbed, you can look at the code which is used for this.
I hope this helps,
Erich