Skip to content

Commit aeb7149

Browse files
committed
Added docs
1 parent 85b2a8b commit aeb7149

File tree

2 files changed

+146
-0
lines changed

2 files changed

+146
-0
lines changed

docs/api.md

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# Ardunio Low Power
2+
3+
## Methods
4+
5+
### `LowPower.idle()`
6+
7+
#### Description
8+
9+
Puts the MCU in IDLE mode. This mode allows power optimization with the fastest wake-up time. The CPU is stopped. To further reduce power consumption, the user can manually disable the clocking of modules and clock sources.
10+
11+
12+
#### Syntax
13+
14+
```
15+
LowPower.idle();
16+
LowPower.idle(milliseconds);
17+
```
18+
19+
#### Parameters
20+
21+
milliseconds: the number of milliseconds to put the board in idle mode. If void the idle mode is used till a wakeup event.
22+
23+
### `LowPower.sleep()`
24+
25+
#### Description
26+
27+
Puts the MCU in sleep mode. The sleep mode allows power optimization with a slower wakeup time. Only the chosen peripherals are on.
28+
29+
30+
#### Syntax
31+
32+
```
33+
LowPower.sleep();
34+
LowPower.sleep(milliseconds);
35+
```
36+
37+
#### Parameters
38+
39+
milliseconds: the number of milliseconds to put the board in sleep mode. If void the sleep mode is used till a wakeup event.
40+
41+
### `LowPower.deepSleep()`
42+
43+
#### Description
44+
45+
Puts the MCU in deep sleep mode. The deep sleep mode allows power optimization with the slowest wake-up time. All but the RTC peripherals are stopped. The CPU can be wakeup only using RTC or wakeup on interrupt capable pins.
46+
47+
48+
#### Syntax
49+
50+
```
51+
LowPower.deepSleep();
52+
LowPower.deepSleep(milliseconds);
53+
```
54+
55+
#### Parameters
56+
57+
milliseconds: the number of milliseconds to put the board in deep sleep mode. If void the deep sleep mode is used till a wakeup event.
58+
59+
### `LowPower.attachInterruptWakeup()`
60+
61+
#### Description
62+
63+
Indicates the function to call and the conditions for a wakeup event.
64+
65+
66+
#### Syntax
67+
68+
```
69+
LowPower.attachInterruptWakeup(pin, callback, mode);
70+
```
71+
72+
#### Parameters
73+
74+
pin: the pin used as external wakeup
75+
76+
callback: the function to call on wakeup
77+
78+
mode: the transitions to sense on the indicated pin. Can be one between:
79+
80+
- FALLING
81+
- RISING
82+
- CHANGE
83+
84+
### `LowPower.CompanionLowPowerCallback()`
85+
86+
#### Description
87+
88+
Indicates the function that the on-boad co-processor (Tian only) has to call just before going to sleep.
89+
90+
91+
#### Syntax
92+
93+
LowPower.CompanionLowPowerCallback(callback);
94+
95+
#### Parameters
96+
97+
callback: the function to call before going to sleep
98+
99+
### `LowPower.companionSleep()`
100+
101+
#### Description
102+
103+
Puts the on-board co-processor (Tian only) in sleep mode
104+
105+
106+
#### Syntax
107+
108+
LowPower.companionSleep();
109+
110+
#### Parameters
111+
112+
None
113+
114+
### `LowPower.companionWakeup()`
115+
116+
#### Description
117+
118+
Forces the on board co-processor (Tian only) wakeup from sleep mode.
119+
120+
121+
#### Syntax
122+
123+
```
124+
LowPower.companionWakeup();
125+
```
126+
127+
#### Parameters
128+
129+
None
130+
131+
## Examples
132+
133+
- [ExternalWakeup](https://github.com/arduino-libraries/ArduinoLowPower/blob/master/examples/ExternalWakeup/ExternalWakeup.ino) : Demonstrates how to wake your board from an external source like a button.
134+
- [TianStandby](https://github.com/arduino-libraries/ArduinoLowPower/blob/master/examples/TianStandby/TianStandby.ino) : Demonstrates how to put a Tian in standby
135+
- [TimedWakeup](https://github.com/arduino-libraries/ArduinoLowPower/blob/master/examples/TimedWakeup/TimedWakeup.ino) : Demonstrates how to put in sleep your board for a certain amount of time

docs/readme.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Arduino Low Power Library
2+
3+
This library allows you to use the low power features of the SAMD21 MCU, which is used for all [MKR family boards](https://store.arduino.cc/collections/mkr-family) and the [Nano 33 IoT board](https://store.arduino.cc/products/arduino-nano-33-iot).
4+
5+
In these pages, the term companion chip is used. This term refers to a board co-processor like the MIPS processor on the [Arduino Tian](https://docs.arduino.cc/retired/boards/arduino-tian).
6+
7+
To use this library:
8+
9+
```
10+
#include "<ArduinoLowPower.h>"
11+
```

0 commit comments

Comments
 (0)