Subsection 16.1.1 Part 1: Where Does the Power Go?
The microcontroller’s circuits are made of transistors acting as switches (Figure 5.1.1). Even when a transistor is off, a tiny current leaks through it from the supply to ground; that is static power consumption. To switch a transistor on or off, a tiny capacitance must be charged or discharged; that is dynamic power consumption, and it is proportional to the clock frequency, because every clock edge switches transistors. For the Cortex-M0+ core, the dynamic power ranges from about 5 to 50 µW per MHz.
To reduce power consumption, enable only the internal peripherals you are actually using, and disable them when you are done, because a peripheral whose clock is stopped consumes almost nothing; you have been enabling peripheral clocks through
RCC->IOPENR and its siblings all term, and the same registers turn them off. Run the processor at the lowest clock speed that does the job. Let the processor sleep when it has nothing to do, using the low-power modes below. And read the datasheets of all the components you are using, and run tests at different clock frequencies, because in a whole system the microcontroller is rarely the only consumer. For low power consumption, disable anything you don’t need. The deeper the sleep, the longer it can take to restore the system to its operating state after waking (Figure 16.1.7).

