Skip to content

Commit e99fcef

Browse files
committed
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?)
1 parent 63b24be commit e99fcef

File tree

5 files changed

+1447
-0
lines changed

5 files changed

+1447
-0
lines changed

src/ArduinoLowPower.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77
#error The library is not compatible with AVR boards
88
#endif
99

10+
#ifdef ARDUINO_ARCH_ARC32
11+
#include "include/arc32/power_states.h"
12+
#include "include/arc32/ss_power_states.h"
13+
#include "include/arc32/qm_sensor_regs.h"
14+
#include "include/arc32/qm_soc_regs.h"
15+
#endif
16+
1017
#ifdef ARDUINO_ARCH_SAMD
1118
#include "RTCZero.h"
1219
#endif
@@ -32,6 +39,23 @@ class ArduinoLowPowerClass {
3239
RTCZero rtc;
3340
#define RTC_ALARM_WAKEUP 0xFF
3441
#endif
42+
43+
#ifdef ARDUINO_ARCH_ARC32
44+
void ss_power_soc_lpss_enable();
45+
void ss_power_soc_lpss_disable();
46+
void ss_power_cpu_ss1(const ss_power_cpu_ss1_mode_t mode);
47+
void ss_power_cpu_ss2();
48+
void ss_power_soc_sleep_restore();
49+
void ss_power_soc_deep_sleep_restore();
50+
void ss_power_sleep_wait();
51+
void power_soc_set_ss_restore_flag();
52+
void power_soc_sleep();
53+
void power_soc_deep_sleep();
54+
void setAlarmIn(uint32_t millis);
55+
#define RTC_ALARM_WAKEUP 0xFF
56+
#define RESET_BUTTON_WAKEUP 0xFE
57+
#endif
58+
3559
};
3660

3761
extern ArduinoLowPowerClass LowPower;

0 commit comments

Comments
 (0)