You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-23
Original file line number
Diff line number
Diff line change
@@ -5,20 +5,20 @@
5
5
The Portenta C33 Low Power Library is a library designed to optimize power consumption for projects using the Portenta C33 boards, which are powered by the Renesas RA6M5 microcontroller. The library achieves this by providing access to various low power modes. These modes are essential for applications where power efficiency is crucial, such as in remote sensing, IoT devices, or battery-powered applications.
6
6
7
7
## Examples
8
-
*[WakeFromGPIO](https://github.com/arduino-libraries/Arduino_LowPowerPortentaC33/blob/main/examples/WakeFromGPIO/WakeFromGPIO.ino) - This example demonstrates how you can use [the GPIO pins](https://github.com/arduino-libraries/Arduino_LowPowerPortentaC33/blob/main/docs/README.md#wakeup-pins) to wake your board from sleep.
9
-
*[WakeFromRTC](https://github.com/arduino-libraries/Arduino_LowPowerPortentaC33/blob/main/examples/WakeFromRTC/WakeFromRTC.ino) - This example demonstrates how you can use the RTC to wake the board from sleep.
8
+
*[WakeFromPin](./examples/WakeFromPin/WakeFromPin.ino) - This example demonstrates how you can use [the GPIO pins](#wake-up-pins) to wake your board from sleep.
9
+
*[WakeFromRTC](./examples/WakeFromRTC/WakeFromRTC.ino) - This example demonstrates how you can use the RTC to wake the board from sleep.
10
10
11
-
## 😴 Sleep Modes
11
+
## 💤 Sleep Modes
12
12
13
-
### Sleep
13
+
### 🥱 Sleep
14
14
***Function**: Reduces the microcontroller's power usage to about half of its normal consumption.
15
15
***Effect**: Upon waking up from this mode, the execution of your program resumes exactly where it stopped. This is particularly useful for applications that require a quick resume with minimal power savings.
16
16
***Wake-Up Triggers**: The board can be configured to wake up either from an RTC alarm or an external interrupt pin.
17
17
18
-
### Deep Sleep
19
-
***Function**: Significantly reduces power usage to approximately 100uA (when all peripherals are off), making it ideal for long-term, battery-dependent operations.
20
-
***Effect**: Unlike Sleep Mode, waking up from Deep Sleep Mode restarts the board, triggering the void setup() function. This behavior is suitable for scenarios where a full reset is acceptable or desired upon waking up.
21
-
***Wake-Up Triggers**: The board can be configured to wake up either from an RTC alarm or an external interrupt pin.
18
+
### 😴 Deep Sleep
19
+
-**Function**: Significantly reduces power usage to approximately 100uA (when all peripherals are off), making it ideal for long-term, battery-dependent operations.
20
+
-**Effect**: Unlike Sleep Mode, waking up from Deep Sleep Mode restarts the board, triggering the `setup()` function. This behavior is suitable for scenarios where a full reset is acceptable or desired upon waking up. The application state may need to be persisted before going to sleep.
21
+
-**Wake-Up Triggers**: The board can be configured to wake up either from an RTC alarm or an external interrupt pin.
22
22
23
23
24
24
## 📐 Measurements
@@ -32,16 +32,16 @@ Here's an overview of the reduction in power usage that you can expect from this
32
32
| Deep Sleep | On | 11.57mA |
33
33
| Deep Sleep | Off |**58.99uA**|
34
34
35
-
For more information about these measurements check out [this document](https://github.com/arduino-libraries/Arduino_LowPowerPortentaC33/blob/main/docs/README.md)
35
+
For more information about these measurements check out [this page](./docs/)
36
36
37
-
## Usage
38
-
### Selecting a wakeup source
39
-
The wakeup source can be one of the deep-sleep enabled wakeup pins, and an RTC Alarm. You can select multiple pins and the RTC alarm to wake up the board.
37
+
## 💻 Usage
38
+
### Selecting a Wake-Up Source
39
+
The wake-up source can be one of the deep-sleep enabled wake-up pins, and an RTC Alarm. You can select multiple pins and the RTC alarm to wake up the board.
40
40
41
-
#### Wakeup Pins
42
-
This feature can be used when you want to wake up the board from external stimuli, such as sensors or user input. Some sensors have an interrupt pin that you can connect to one of the wakeup pins (eg: most motion sensors), while some output voltage on a pin, (eg: Passive Infrared Sensors or user buttons).
41
+
#### 📍 Wake-Up Pins
42
+
This feature can be used when you want to wake up the board from external stimuli, such as sensors or user input. Some sensors have an interrupt pin that you can connect to one of the wake-up pins (eg: most motion sensors), while others output a voltage on a pin when triggered (eg: Passive Infrared Sensors or user buttons).
43
43
44
-
To select a wakeup pin just call `lowPower.setWakeupPin(<pin_number>, <direction>)`. The direction can be either **RISING** if you want to wake up when voltage is applied to a pin, or **FALLING** if you want to wake when no voltage is applied anymore.
44
+
To set up a wake-up pin call `lowPower.setWakeupPin(<pin_number>, <direction>)`. The direction can be either `RISING` if you want to wake up when voltage is applied to a pin, or `FALLING` if you want to wake when no voltage is applied anymore.
45
45
46
46
Here is a list of the usable interrupts:
47
47
@@ -57,15 +57,14 @@ Here is a list of the usable interrupts:
57
57
| D7 | P402 | IRQ4 |
58
58
59
59
> [!IMPORTANT]
60
-
> Not all IRQs are created equal, the number of the IRQ represents it's priority. (IRQ0 being the highest priority and IRQ15 the lowest). Be careful when selecting your IRQ pin to make sure the board behaves as expected.
61
-
62
-
#### RTC Alarm
63
-
This feature is particularly useful when you want to set the board to wake up at specific times. You can use this in conjunction with the [RTC library]().
64
-
To make your board wake up on an RTC alarm you simply need to call `lowPower.setWakeupRTC()` and it will enable that functionality. Check out [this example]() for more details about setting up the RTC.
60
+
> Not all IRQs are created equal. The number of the IRQ represents it's priority. (`IRQ0` being the highest priority and `IRQ15` the lowest). Be careful when selecting your IRQ pin to make sure the board behaves as expected.
65
61
62
+
#### ⏰ RTC Alarm
63
+
This feature is particularly useful when you want to set the board to wake up at specific times. You can use this in conjunction with the [RTC library](https://github.com/arduino/ArduinoCore-renesas/tree/main/libraries/RTC).
64
+
To make your board wake up on an RTC alarm you simply need to call `lowPower.setWakeUpAlarm(time)` or `lowPower.setWakeUpAlarm(hours, minutes, seconds)`. Check out this [example](./examples/WakeFromRTC/) for more details about setting up the RTC.
66
65
67
-
### Initiating sleep modes:
68
-
Use lowPower.sleep() for Sleep Mode and lowPower.deepSleep() for Deep Sleep Mode. Upon calling these methods the board will sleep until one of the wakeup events mentioned earlier arises.
69
66
67
+
### 🛏️ Initiating sleep modes
68
+
Use `lowPower.sleep()` to enter the Sleep Mode and `lowPower.deepSleep()` to enter the Deep Sleep Mode. Upon calling these methods the board will sleep until one of the wake-up events mentioned earlier arises.
70
69
71
-
For more information about this library check the [API Reference](https://github.com/arduino-libraries/Arduino_LowPowerPortentaC33/blob/main/docs/api.md)
70
+
For more information on how to use this library check the [API Reference](./docs/api.md)
Copy file name to clipboardExpand all lines: docs/api.md
+12-4
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,8 @@ This class allows the user to put the device into different low-power states and
18
18
|[`sleep`](#class_low_power_1a351563f87f8d1f118e9d77201fd59a55)| Puts the device into a standard sleep mode. This sleep mode consumes less power than the active mode but more than the deep sleep mode. The device will resume execution from the point where it entered the sleep mode. |
19
19
|[`deepSleep`](#class_low_power_1ada3410c10d04970e0898eb5f7f36ce55)| Puts the device into a deep sleep mode. The device consumes the least power in this mode but will reset when it wakes up effectively running the setup() function again. |
20
20
|[`enableWakeupFromPin`](#class_low_power_1a9ee83fbc2b670ac9490cd179b2e08138)| Enables wake-up of the device from a specified pin (A0, A1, A2, A3, A4, A5, D4, D7 ) |
21
-
|[`enableWakeupFromRTC`](#class_low_power_1a91d86cab239a56506bf15e9d2139c097)| Enables wake-up of the device based on the Real-Time Clock (RTC). |
0 commit comments