Skip to content

Commit 9d195bd

Browse files
seov-nordicrlubos
authored andcommitted
[nrf fromtree] boards: shields: add npm1304_ek shield
Add an nPM1304 EK shield, update samples/shields/npm1300_ek to support both shields, improve the sample description. Signed-off-by: Sergei Ovchinnikov <[email protected]> (cherry picked from commit f0f2b94)
1 parent 8485ba9 commit 9d195bd

File tree

17 files changed

+348
-113
lines changed

17 files changed

+348
-113
lines changed

boards/shields/npm1300_ek/doc/index.rst

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,5 @@ Usage
2222
*****
2323

2424
The shield can be used in any application by setting ``--shield npm1300_ek``
25-
when invoking ``west build``. You can check :zephyr:code-sample:`npm1300_ek` for a
25+
when invoking ``west build``. You can check :zephyr:code-sample:`npm13xx_ek` for a
2626
comprehensive sample.
27-
28-
References
29-
**********
30-
31-
TBC
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2025 Nordic Semiconductor ASA
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SHIELD_NPM1304_EK
5+
def_bool $(shields_list_contains,npm1304_ek)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
.. _npm1304_ek:
2+
3+
nPM1304 EK
4+
##########
5+
6+
Overview
7+
********
8+
9+
The nPM1304 EK lets you test different functions and features of the nPM1304
10+
Power Management Integrated Circuit (PMIC).
11+
12+
Requirements
13+
************
14+
15+
The nPM1304 EK board is not a direct fit into an Arduino connector. However,
16+
the Zephyr shield is expected to be connected to the Arduino shield connectors.
17+
That is, you need to connect the I2C lines to the ``arduino_i2c`` bus. This allows to
18+
use the shield with any host board that supports the Arduino connector.
19+
20+
Usage
21+
*****
22+
23+
To use the shield in any application, build it with the following command:
24+
25+
.. zephyr-app-commands::
26+
:board: your_board
27+
:shield: npm1304_ek
28+
:goals: build
29+
30+
For a comprehensive sample, refer to :zephyr:code-sample:`npm13xx_ek`.
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
/*
2+
* Copyright (C) 2025 Nordic Semiconductor ASA
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include <dt-bindings/regulator/npm13xx.h>
7+
#include <zephyr/dt-bindings/input/input-event-codes.h>
8+
9+
&arduino_i2c {
10+
npm1304_ek_pmic: pmic@6b {
11+
compatible = "nordic,npm1304";
12+
reg = <0x6b>;
13+
14+
npm1304_ek_gpio: gpio-controller {
15+
compatible = "nordic,npm1304-gpio";
16+
gpio-controller;
17+
#gpio-cells = <2>;
18+
ngpios = <5>;
19+
};
20+
21+
npm1304_ek_regulators: regulators {
22+
compatible = "nordic,npm1304-regulator";
23+
24+
/* limits are set to min/max allowed values */
25+
npm1304_ek_buck1: BUCK1 {
26+
regulator-min-microvolt = <1000000>;
27+
regulator-max-microvolt = <3300000>;
28+
};
29+
30+
npm1304_ek_buck2: BUCK2 {
31+
regulator-min-microvolt = <1000000>;
32+
regulator-max-microvolt = <3300000>;
33+
};
34+
35+
npm1304_ek_ldo1: LDO1 {
36+
regulator-min-microvolt = <1000000>;
37+
regulator-max-microvolt = <3300000>;
38+
};
39+
40+
npm1304_ek_ldo2: LDO2 {
41+
regulator-min-microvolt = <1000000>;
42+
regulator-max-microvolt = <3300000>;
43+
};
44+
};
45+
46+
npm1304_ek_charger: charger {
47+
compatible = "nordic,npm1304-charger";
48+
term-microvolt = <4150000>;
49+
term-warm-microvolt = <4000000>;
50+
current-microamp = <4000>;
51+
vbus-limit-microamp = <500000>;
52+
thermistor-ohms = <10000>;
53+
thermistor-beta = <3380>;
54+
charging-enable;
55+
};
56+
57+
npm1304_ek_buttons: buttons {
58+
compatible = "gpio-keys";
59+
60+
pmic_button0: pmic_button_0 {
61+
gpios = <&npm1304_ek_gpio 0 GPIO_ACTIVE_LOW>;
62+
label = "Pmic button switch 0";
63+
zephyr,code = <INPUT_KEY_0>;
64+
};
65+
66+
pmic_button1: pmic_button_1 {
67+
gpios = <&npm1304_ek_gpio 1 GPIO_ACTIVE_LOW>;
68+
label = "Pmic button switch 1";
69+
zephyr,code = <INPUT_KEY_1>;
70+
};
71+
72+
pmic_button2: pmic_button_2 {
73+
gpios = <&npm1304_ek_gpio 2 GPIO_ACTIVE_LOW>;
74+
label = "Pmic button switch 2";
75+
zephyr,code = <INPUT_KEY_2>;
76+
};
77+
};
78+
79+
npm1304_ek_leds: leds {
80+
compatible = "nordic,npm1304-led";
81+
nordic,led0-mode = "error";
82+
nordic,led1-mode = "charging";
83+
nordic,led2-mode = "host";
84+
};
85+
};
86+
};

boards/shields/npm1304_ek/shield.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
shield:
2+
name: npm1304_ek
3+
full_name: nPM1304 EK
4+
vendor: nordic
5+
supported_features:
6+
- mfd
7+
- input
8+
- gpio
9+
- led
10+
- regulator
11+
- sensor

doc/_scripts/redirects.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@
302302
('samples/sensor/max44009/README', 'samples/sensor/light_polling/README'),
303303
('samples/sensor/wsen_hids/README', 'samples/sensor/sensor'),
304304
('samples/sensor/wsen_itds/README', 'samples/sensor/sensor'),
305+
('samples/shields/npm1300_ek/doc/index', 'samples/shields/npm13xx_ek/doc/index'),
305306
('samples/subsys/video/capture/README', 'samples/drivers/video/capture/README'),
306307
('samples/subsys/video/tcpserversink/README', 'samples/drivers/video/tcpserversink/README'),
307308
('samples/subsys/video/video', 'samples/drivers/video/video'),

samples/shields/npm1300_ek/CMakeLists.txt

Lines changed: 0 additions & 11 deletions
This file was deleted.

samples/shields/npm1300_ek/doc/index.rst

Lines changed: 0 additions & 71 deletions
This file was deleted.

samples/shields/npm1300_ek/sample.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright (c) 2023 Nordic Semiconductor ASA
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
cmake_minimum_required(VERSION 3.20.0)
5+
6+
if(SHIELD STREQUAL "npm1300_ek")
7+
set(EXTRA_DTC_OVERLAY_FILE npm1300.overlay)
8+
elseif(SHIELD STREQUAL "npm1304_ek")
9+
set(EXTRA_DTC_OVERLAY_FILE npm1304.overlay)
10+
else()
11+
message(FATAL_ERROR "either npm1300_ek or npm1304_ek must be selected with --shield")
12+
endif()
13+
14+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
15+
16+
project(npm13xx_ek)
17+
target_sources(app PRIVATE src/main.c)

0 commit comments

Comments
 (0)