8
8
#endif
9
9
10
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"
11
+ #include " include/arc32/defines.h"
15
12
#endif
16
13
17
14
#ifdef ARDUINO_ARCH_SAMD
@@ -24,15 +21,28 @@ class ArduinoLowPowerClass {
24
21
public:
25
22
void idle (void );
26
23
void idle (uint32_t millis);
24
+ void idle (int millis) {
25
+ idle ((uint32_t )millis);
26
+ }
27
27
28
28
void sleep (void );
29
29
void sleep (uint32_t millis);
30
+ void sleep (int millis) {
31
+ sleep ((uint32_t )millis);
32
+ }
30
33
31
34
void deepSleep (void );
32
35
void deepSleep (uint32_t millis);
36
+ void deepSleep (int millis) {
37
+ deepSleep ((uint32_t )millis);
38
+ }
33
39
34
40
void attachInterruptWakeup (uint32_t pin, voidFuncPtr callback, uint32_t mode);
35
41
42
+ #ifdef ARDUINO_ARCH_ARC32
43
+ void wakeFromSleepCallback (void );
44
+ #endif
45
+
36
46
private:
37
47
#ifdef ARDUINO_ARCH_SAMD
38
48
void setAlarmIn (uint32_t millis);
@@ -41,18 +51,20 @@ class ArduinoLowPowerClass {
41
51
#endif
42
52
43
53
#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
54
+ void wakeFromDoze ();
55
+ void switchToHybridOscillator ();
56
+ void switchToCrystalOscillator ();
57
+ void attachWakeInterruptRTC (void (*userCallBack)());
58
+ void turnOffUSB ();
59
+ void turnOnUSB ();
60
+ void setRTCCMR (int milliseconds);
61
+ uint32_t readRTC_CCVR ();
62
+ bool isSleeping = false ;
63
+ uint32_t millisToRTCTicks (int milliseconds);
64
+ void enableRTCInterrupt ();
65
+ void x86_C2Request ();
66
+ void (*pmCB)();
67
+ #define RTC_ALARM_WAKEUP 0xFF
56
68
#define RESET_BUTTON_WAKEUP 0xFE
57
69
#endif
58
70
0 commit comments