Disable the clocks to unused peripheral modules

The XMEGA devices have a very rich set of peripherals available, and each peripheral will add a small contribution to the total current consumption. The clock domain of most peripherals can be disabled independently, and by removing the clock signal to an unused peripheral, the dynamic power consumption contribution of that peripheral will be removed.

There are seven PR registers available on the ATxmega128A1U (no PORT F), see section "Register Description – Power Reduction" in the XMEGA AU Manual.

Note: To disable the clock of a peripheral module, the corresponding bit in the PR register need to be written to "1".
Note: Each port might have its own instance of a peripheral. For instance USART0 is found in PORT C, PORT D, PORT E, and PORT F. Each port has its own PR register to disable the peripherals of that port.

As an example, disabling the AES and EBI module is done by setting the corresponding bits in the PR.PRGEN register like this:

PR.PRGEN = PR_AES_bm | PR_EBI_bm. 

The following modules can be disabled: