Table of Contents | ||
---|---|---|
|
1.
Anchor | ||||
---|---|---|---|---|
|
This application note describes how to configure nPM1300 LEDs in Zephyr BSP and use it in the user application.
2.
Anchor | ||||
---|---|---|---|---|
|
The nPM1300 LEDs device is declared in nrf9151som_nrf9151_ns.dts
as a child node of the npm1300_pmic device:
...
Parameter | Value | Description |
---|---|---|
|
| Enables the |
|
| LED |
|
| |
|
|
3.
Anchor | ||||
---|---|---|---|---|
|
3.1.
Anchor | ||||
---|---|---|---|---|
|
The Customized Asset Tracker v2 application makes use of the Zephyr LED API to control nPM1300 LEDs:
Function | Description | Comments |
| Turn on the LED. |
Returns zero on success, otherwise a negative error code is returned. |
| Turn off the LED. |
Returns zero on success, otherwise a negative error code is returned. |
3.2.
Anchor | ||||
---|---|---|---|---|
|
The Customized Asset Tracker v2 application provides a set of Zephyr shell commands for nPM1300 LEDs:
Command | Parameters | Comments |
|
| Turn the LED on. |
|
| Turn the LED off. |
4.
Anchor | ||||
---|---|---|---|---|
|
Turn on the Charging LED and verify that the green LED has been turned on:
Code Block uart:~$ led on npm1300_leds 0 npm1300_leds: turning on LED 0
Turn on the Charging LED and verify that the green LED has been turned off:
Code Block uart:~$ led off npm1300_leds 0 npm1300_leds: turning off LED 0
Turn on the Error LED and verify that the red LED has been turned on:
Code Block uart:~$ led on npm1300_leds 1 npm1300_leds: turning on LED 1
Turn on the Error LED and verify that the red LED has been turned off:
Code Block uart:~$ led off npm1300_leds 1 npm1300_leds: turning off LED 1