arduino-libraries / ArduinoLowPower

Powersave features for SAMD boards
GNU Lesser General Public License v2.1
80 stars 57 forks source link

Add support for ADC wakeup interrupt on SAMD21 #25

Closed sijk closed 4 years ago

sijk commented 4 years ago

This can be used to configure the ADC window interrupt on the SAMD21. It uses OSCULP32K via GCLK6 to clock the ADC while in sleep mode (the same as used for the EIC).

Note that attachAdcInterrupt()/detachAdcInterrupt() should be called immediately before/after LowPower.sleep() otherwise analogRead() will not work as expected.

There is also an example (AdcWakeup.ino) which is much like the ExternalWakeup example but uses the ADC interrupt instead.

facchinm commented 4 years ago

Love this PR! Very cool, thanks you so much!

mcxiv commented 3 years ago

Hi everyone,

Why is the function attachAdcInterrupt() not documented anywhere? (Or at least I can't find anything) It looks so interesting!