Skip to content

examples/npzero: add the nPZero G1S power-saving example - #4031

Merged
xiaoxiang781216 merged 1 commit into
apache:masterfrom
acassis:npzero
Nov 13, 2026
Merged

xiaoxiang781216 merged 1 commit into
apache:masterfrom
acassis:npzero

Conversation

@acassis

@acassis acassis commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

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:

  • 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.

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:

  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

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
@xiaoxiang781216
xiaoxiang781216 merged commit e1f174e into apache:master Nov 13, 2026
22 of 41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants