Skip to content

Revamp API #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 56 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
0b710da
Fix compile error in deep sleep example
sebromero May 7, 2024
9a87c65
Rename wire utils file
sebromero May 8, 2024
bdf5ba6
Apply style guide to enums
sebromero May 8, 2024
b366d88
Update docs in charger sketch
sebromero May 8, 2024
0ade3a4
Refactorings
sebromero May 8, 2024
8505b4c
Simplify API
sebromero May 8, 2024
7a61e9f
Refactor example
sebromero May 8, 2024
c36ad19
Use new target identifier for M4
sebromero May 8, 2024
68623a0
Revamp standby example
sebromero May 8, 2024
9cbeed3
Rename sketches
sebromero May 8, 2024
ae3693e
Use new m4 define
sebromero May 8, 2024
5dc466a
Update readme
sebromero May 8, 2024
375d186
Add documentation to low power sketch
sebromero May 10, 2024
c567771
Add fuel gauge driver
sebromero May 10, 2024
1a42481
Add comments
sebromero May 10, 2024
1c2a957
Enable shutdown mode of fuel gauge
sebromero May 10, 2024
a444d96
Add destructor for Board
sebromero May 13, 2024
6a9cae5
Fix compile errors
sebromero May 13, 2024
a38f4a3
Remove double instantiation
sebromero May 13, 2024
24de629
Reorder print statements
sebromero May 13, 2024
539baaa
Improve readability
sebromero May 13, 2024
eb7cd60
Refactor C33 RTC wakeup example
sebromero May 13, 2024
7b9c6d7
Removed unused variable
sebromero May 13, 2024
e4b3750
Replace references to old repo location
sebromero May 13, 2024
b297792
Fix CI workflow for compiling sketches
sebromero May 13, 2024
a2a5092
Fix: include file for C33 low power library is called "Arduino_LowPow…
aentinger May 15, 2024
3409f89
Reorganize RTC standby example
sebromero May 15, 2024
d716bd0
Only end I2C when turning off power
sebromero May 15, 2024
7de86c5
Add snippet to handle non-callback alarm
sebromero May 15, 2024
9fbd9b3
Add commented out code that may be required
sebromero May 15, 2024
ded196a
fixed WakeFromRTC_C33
cristidragomir97 May 17, 2024
bb6a43e
Use RTC alarm without callback
sebromero May 23, 2024
3bad6de
Apply adjustments from the library review
cristidragomir97 Jun 3, 2024
f6b6057
fixed compilation workflow
cristidragomir97 Jun 3, 2024
cd4b7e6
Fix compile-examples.yaml
cristidragomir97 Jun 3, 2024
d4020b8
Adjust indentation
sebromero Jun 3, 2024
71326df
Make I2C address configurable
sebromero Jun 4, 2024
a61a6e5
Extract hibernate features into function
sebromero Jun 4, 2024
cc79c9e
Change parameter order
sebromero Jun 4, 2024
0a8a7e2
Add charging complete function
sebromero Jun 4, 2024
31c8bb1
Remove charging complete function from battery API
sebromero Jun 4, 2024
6f5d4e0
Remove obsolete comment
sebromero Jun 4, 2024
f098ca8
Preserve hibernation config
sebromero Jun 4, 2024
195d4fe
Add function to shut down fuel gauge
sebromero Jun 4, 2024
2f2d900
Fix compile issue
sebromero Jun 4, 2024
2747199
Adjust comments
sebromero Jun 4, 2024
6911507
Use correct Wire instance depending on board
sebromero Jun 4, 2024
3e615f1
Command fuel gauge shutdown
sebromero Jun 4, 2024
6631167
Convert keys to lists
sebromero Jun 4, 2024
560d265
Add missing library to dependencies
sebromero Jun 4, 2024
598c6ce
Add missing info to properties file
sebromero Jun 4, 2024
424e3fd
Swap example sketches in workflow file
sebromero Jun 4, 2024
5ca3c24
Eliminate extra white space
sebromero Jun 4, 2024
4db9acd
Add documentation
sebromero Jun 4, 2024
a1e512f
Add documentation
sebromero Jun 4, 2024
887a061
Update documentation
actions-user Jun 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 17 additions & 35 deletions .github/workflows/compile-examples.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Source: https://github.com/per1234/.github/blob/main/workflow-templates/compile-examples-private.md
name: Compile Examples

# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
Expand All @@ -22,11 +23,9 @@ on:

env:
UNIVERSAL_SKETCH_PATHS: |
- examples/Battery
- examples/Charger
- examples/DeepSleep_WakeFromPin
- examples/DeepSleep_WakeFromRTC
- examples/Powershell
- examples/Battery
- examples/Charger
- examples/Standby_WakeFromPin
SKETCHES_REPORTS_PATH: sketches-reports
SKETCHES_REPORTS_ARTIFACT_NAME: sketches-reports

Expand All @@ -43,10 +42,18 @@ jobs:

matrix:
board:
- fqbn: arduino:mbed_portenta:envie_m7
platforms: |
- name: arduino:mbed_portenta
artifact-name-suffix: arduino-mbed_portenta-envie_m7
additional-sketch-paths: |
- examples/Standby_WakeFromRTC_H7
- fqbn: arduino:renesas_portenta:portenta_c33
platforms: |
- name: arduino:renesas_portenta

artifact-name-suffix: arduino-renesas_portenta-portenta_c33
additional-sketch-paths: |
- examples/Standby_WakeFromRTC_C33

steps:
- name: Checkout repository
Expand All @@ -59,11 +66,10 @@ jobs:
fqbn: ${{ matrix.board.fqbn }}
platforms: ${{ matrix.board.platforms }}
libraries: |
# Install the library from the local path.
- source-path: ./
# - name: Arduino_PF1550
- source-url: https://github.com/cristidragomir97/Arduino_PF1550_old.git
- source-url: https://github.com/cristidragomir97/Arduino_Portenta_C33_LowPower.git
- name: Arduino_PF1550
- name: Arduino_LowPowerPortentaH7
- source-url: https://github.com/arduino-libraries/Arduino_LowPowerPortentaC33.git
sketch-paths: |
${{ env.UNIVERSAL_SKETCH_PATHS }}
${{ matrix.board.additional-sketch-paths }}
Expand All @@ -74,29 +80,5 @@ jobs:
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: sketches-report-${{ matrix.board.artifact-name-suffix }}
path: ${{ env.SKETCHES_REPORTS_PATH }}
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}

report-size-deltas:
needs: build
# Run even if some compilations failed.
if: always() && github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
pull-requests: write

steps:
- name: Download sketches reports artifact
id: download-artifact
continue-on-error: true # If compilation failed for all boards then there are no artifacts
uses: actions/download-artifact@v4
with:
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
path: ${{ env.SKETCHES_REPORTS_PATH }}

- name: Comment size deltas report to PR
uses: arduino/report-size-deltas@v1
# If actions/download-artifact failed, there are no artifacts to report from.
if: steps.download-artifact.outcome == 'success'
with:
sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ⚡ Arduino PowerManagement

[![Check Arduino](https://github.com/cristidragomir97/Arduino_PowerManagement/actions/workflows/check-arduino.yml/badge.svg)](https://github.com/cristidragomir97/Arduino_PowerManagement/actions/workflows/check-arduino.yml) [![Compile Examples](https://github.com/cristidragomir97/Arduino_PowerManagement/actions/workflows/compile-examples.yml/badge.svg)](https://github.com/cristidragomir97/Arduino_PowerManagement/actions/workflows/compile-examples.yml) [![Spell Check](https://github.com/cristidragomir97/Arduino_PowerManagement/actions/workflows/spell-check.yml/badge.svg)](https://github.com/cristidragomir97/Arduino_PowerManagement/actions/workflows/spell-check.yml) [![Sync Labels](https://github.com/cristidragomir97/Arduino_PowerManagement/actions/workflows/sync-labels.yml/badge.svg)](https://github.com/cristidragomir97/Arduino_PowerManagement/actions/workflows/sync-labels.yml)
[![Check Arduino](https://github.com/arduino-libraries/Arduino_PowerManagement/actions/workflows/check-arduino.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_PowerManagement/actions/workflows/check-arduino.yml) [![Compile Examples](https://github.com/arduino-libraries/Arduino_PowerManagement/actions/workflows/compile-examples.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_PowerManagement/actions/workflows/compile-examples.yml) [![Spell Check](https://github.com/arduino-libraries/Arduino_PowerManagement/actions/workflows/spell-check.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_PowerManagement/actions/workflows/spell-check.yml) [![Sync Labels](https://github.com/arduino-libraries/Arduino_PowerManagement/actions/workflows/sync-labels.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_PowerManagement/actions/workflows/sync-labels.yml)

The Arduino Pro Power Management Library serves as a comprehensive and sophisticated power management toolkit tailored for Arduino Pro boards, encompassing the Portenta H7, Portenta C33, and Nicla Vision.

Expand All @@ -9,7 +9,7 @@ This library streamlines the interaction with complex hardware components such a
## ✅ Supported Boards

- Arduino Portenta H7
- Arduino Nicla Vision
- Arduino Nicla Vision (Low power features not supported yet)
- Arduino Portenta C33

## Core Components of the Library
Expand Down
10 changes: 5 additions & 5 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,19 +221,19 @@ To simplify things, we have added a convenience function in `Board` called `slee
Here's an overview of the reduction in power usage that you can expect from this library on the Portenta C33. The screenshots below are taken from the nRF Power Profiler application using a Nordic PPK2 while running the blink sketch on the same board.

#### Without power optimisations
![](https://raw.githubusercontent.com/cristidragomir97/Arduino_Portenta_C33_LowPower/main/extras/results/normal_usage_blink.png)
![](https://raw.githubusercontent.com/arduino-libraries/Arduino_Portenta_C33_LowPower/main/extras/results/normal_usage_blink.png)

#### Sleep (ADC, RGB LED, Secure Element, Wifi and Bluetooth off)
![](https://raw.githubusercontent.com/cristidragomir97/Arduino_Portenta_C33_LowPower/main/extras/results/sleep_no_peripherals.png)
![](https://raw.githubusercontent.com/arduino-libraries/Arduino_Portenta_C33_LowPower/main/extras/results/sleep_no_peripherals.png)

#### Deep Sleep (ADC, RGB LED, Secure Element, Wifi and Bluetooth off)
![](https://raw.githubusercontent.com/cristidragomir97/Arduino_Portenta_C33_LowPower/main/extras/results/deep_sleep_no_peripherals.png)
![](https://raw.githubusercontent.com/arduino-libraries/Arduino_Portenta_C33_LowPower/main/extras/results/deep_sleep_no_peripherals.png)

#### Sleep (ADC, RGB LED, Secure Element, Wifi and Bluetooth on)
![](https://raw.githubusercontent.com/cristidragomir97/Arduino_Portenta_C33_LowPower/main/extras/results/sleep_peripherals_on.png)
![](https://raw.githubusercontent.com/arduino-libraries/Arduino_Portenta_C33_LowPower/main/extras/results/sleep_peripherals_on.png)

#### Deep Sleep (ADC, RGB LED, Secure Element, Wifi and Bluetooth on)
![](https://raw.githubusercontent.com/cristidragomir97/Arduino_Portenta_C33_LowPower/main/extras/results/deep_sleep_peripherals_on.png)
![](https://raw.githubusercontent.com/arduino-libraries/Arduino_Portenta_C33_LowPower/main/extras/results/deep_sleep_peripherals_on.png)



Expand Down
Loading