1
0
mirror of https://github.com/arduino-libraries/ArduinoLowPower.git synced 2025-10-16 02:46:40 +03:00

Initial ARC32 implementation

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?)
This commit is contained in:
Martino Facchin
2016-11-11 16:20:30 +01:00
parent 63b24bed79
commit e99fcefe8b
5 changed files with 1447 additions and 0 deletions

View File

@@ -7,6 +7,13 @@
#error The library is not compatible with AVR boards
#endif
#ifdef ARDUINO_ARCH_ARC32
#include "include/arc32/power_states.h"
#include "include/arc32/ss_power_states.h"
#include "include/arc32/qm_sensor_regs.h"
#include "include/arc32/qm_soc_regs.h"
#endif
#ifdef ARDUINO_ARCH_SAMD
#include "RTCZero.h"
#endif
@@ -32,6 +39,23 @@ class ArduinoLowPowerClass {
RTCZero rtc;
#define RTC_ALARM_WAKEUP 0xFF
#endif
#ifdef ARDUINO_ARCH_ARC32
void ss_power_soc_lpss_enable();
void ss_power_soc_lpss_disable();
void ss_power_cpu_ss1(const ss_power_cpu_ss1_mode_t mode);
void ss_power_cpu_ss2();
void ss_power_soc_sleep_restore();
void ss_power_soc_deep_sleep_restore();
void ss_power_sleep_wait();
void power_soc_set_ss_restore_flag();
void power_soc_sleep();
void power_soc_deep_sleep();
void setAlarmIn(uint32_t millis);
#define RTC_ALARM_WAKEUP 0xFF
#define RESET_BUTTON_WAKEUP 0xFE
#endif
};
extern ArduinoLowPowerClass LowPower;