The board is retired and the corresponding core (https://github.com/arduino/ArduinoCore-primo) has been archived. Considering that no one is going to maintain the low power code for nRF52/Primo its better to get rid of it alltogether (and no longer advertise compatibility to 'nrf52' which - imho rightfully - seems to confuse a lot of people.
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.
* Replace SerialUSB by SERIAL_PORT_USBVIRTUAL
Support boards where USB serial is named differently. E.g. the
Adafruit Feather M0 uses Serial1 as name for serial USB port.
Waking from deepSleep() is comparable to an hard reset; the sketch won't restart from the sleep invocation but the wakeuup source can be retrieved with wakeupReason()
The includes and relevant (non wrapper) functions are borrowed from Zephyr 1.5.0
The implementation is still broken:
- an RTC driver is still missing, so no timed wakeup possible
- only the AON pins configured as LEVEL can wakeup the processor
on Arduino101, the only AON broken out is RESET button
Changing the main loop in CODK-A allows operating the button without triggering a reboot. However, the board doesn't wakeup from deep sleep (am I missing something maybe?)