Function sam4l::pm::deep_sleep_ready [] [src]

pub fn deep_sleep_ready() -> bool

Determines if the chip can safely go into deep sleep without preventing currently active peripherals from operating.

We look at the PM's clock mask registers and compare them against a set of known masks that include no peripherals that can't operate in deep sleep (or that have no function during sleep). Specifically:

This means it is the responsibility of each peripheral to disable it's clock mask whenever it is idle.

We also special case GPIO (which is in PBCMASK), and just see if any interrupts are pending through the INTERRUPT_COUNT variable.