Repository navigation
examples/npzero: add the nPZero G1S power-saving example - #4031
Merged
Merged
Conversation
xiaoxiang781216
approved these changes
Nov 12, 2026
Add an example of the nPZero G1S driver for the sensors of the nPZero G1S Development Kit, like the example of the Nanopower driver API: * LIS2DW12 accelerometer on peripheral 3 (SPI), read every 5 s, wakes the host up above about 61 mg on X. * AS6212 temperature sensor on peripheral 4 (I2C), read every 30 s, wakes the host up above 25 C or below 10 C. * Global time-out of 300 s. At each boot of the host it shows the ID and the wake-up reason (with the values of the peripherals and of the ADC that triggered it), sends the configuration and, after CONFIG_EXAMPLES_NPZERO_IDLE_DELAY ms, enters Idle state, which switches the host off. "npzero -s" shows the status only. Both sensors are kept powered while the host is on (pswint): an unpowered AS6212 board blocks the shared I2C bus. Tested on the DevKit with npzero-g1s-dk:nsh: nsh> npzero -s nPZero G1S ID: 0x60 STA1: 0x01 STA2: 0x00 nsh> npzero nPZero G1S ID: 0x60 STA1: 0x01 STA2: 0x00 Configured, Idle state in 1000 ms Signed-off-by: Alan C. Assis <acassis@gmail.com> Assisted-by: Claude:claude-opus-5-5
GUIDINGLI
approved these changes
Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add an example of the nPZero G1S driver for the sensors of the nPZero G1S Development Kit, like the example of the Nanopower driver API:
At each boot of the host it shows the ID and the wake-up reason (with the values of the peripherals and of the ADC that triggered it), sends the configuration and, after CONFIG_EXAMPLES_NPZERO_IDLE_DELAY ms, enters Idle state, which switches the host off. "npzero -s" shows the status only. Both sensors are kept powered while the host is on (pswint): an unpowered AS6212 board blocks the shared I2C bus.
Impact
Users will be able to use this app as reference to implement their own low power sensor configuration
Testing
Tested on the DevKit with npzero-g1s-dk:nsh: