Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions doc/_utils/redirects.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""
Copyright (c) 2022 Nordic Semiconductor
SPDX-License-Identifier: Apache-2.0
Expand Down Expand Up @@ -441,6 +441,7 @@
("samples/wifi/sr_coex/README", "samples/wifi/ble_coex/README"), # Wi-Fi: Bluetooth LE coexistence
("samples/samples_zigbee", "samples/zigbee"), # Zigbee samples (landing)
("samples/samples_other", "samples/other"), # Other samples (landing)
("samples/pmic/native/npm1300_fuel_gauge/README", "samples/pmic/native/npm13xx_fuel_gauge/README"),
("libraries/bluetooth_services/index", "libraries/bluetooth/index"), # Changed the folder name libraries/bluetooth_services to libraries/bluetooth to better match the include folder structure
("libraries/bluetooth_services/adv_prov", "libraries/bluetooth/adv_prov"),
("libraries/bluetooth_services/conn_ctx", "libraries/bluetooth/conn_ctx"),
Expand Down
2 changes: 1 addition & 1 deletion doc/nrf/app_dev/device_guides/pmic/npm1300.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Connecting the development kit to nPM1300
=========================================

If you are using the nRF5340 DK, follow the steps in `Use the nPM1300 EK with an nRF5340 DK`_ in the `nPM1300 EK User Guide`_.
For other Nordic Semiconductor kits, use the wiring steps in the documentation for :ref:`pmic_samples` as reference (:ref:`wiring for the Fuel gauge sample <npm1300_fuel_gauge_wiring>` and :ref:`wiring for the One button sample <npm1300_one_button_wiring>`, respectively).
For other Nordic Semiconductor kits, use the wiring steps in the documentation for :ref:`pmic_samples` as reference (:ref:`wiring for the Fuel gauge sample <npm13xx_fuel_gauge_wiring>` and :ref:`wiring for the One button sample <npm1300_one_button_wiring>`, respectively).

If you are using custom hardware, the wiring process is similar to the `one for the nRF5340 DK <Use the nPM1300 EK with an nRF5340 DK_>`_, but board-specific steps will be different.

Expand Down
2 changes: 2 additions & 0 deletions doc/nrf/links.txt
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,8 @@
.. _`nPM1300 EK product page`: https://www.nordicsemi.com/Products/Development-hardware/nPM1300-EK
.. _`nPM1300 EK get started`: https://www.nordicsemi.com/Products/Development-hardware/nPM1300-EK/Get-started?lang=en#infotabs

.. _`nPM1304 product website`: https://www.nordicsemi.com/products/npm1304

.. _`nPM2100 product website`: https://www.nordicsemi.com/Products/nPM2100
.. _`nRF Desktop reference design page`: https://www.nordicsemi.com/Products/Reference-designs/nRF-Desktop
.. _`Nordic Semiconductor's IoT cloud platform`: https://www.nordicsemi.com/Products/Cloud-services
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ The following list includes the summary of the most relevant changes introduced
* PMIC: nPM1300 PMIC and nPM1300 EK:

* Charger, BUCKs, LDOs, Load Switches, and GPIOs.
* :ref:`Sample showing fuel gauge functionality <npm1300_fuel_gauge>`.
* :ref:`Sample showing fuel gauge functionality <npm13xx_fuel_gauge>`.
The sample calculates battery state of charge, time to empty, time to full and provides updates of these over the terminal once every second.
* The nPM1300 EK sample that supports PMIC features: regulators (BUCKs, LDO) and GPIOs.

Expand Down Expand Up @@ -622,7 +622,7 @@ nRF9160 samples
PMIC samples
------------

* Added :ref:`npm1300_fuel_gauge` sample that demonstrates how to calculate the battery state of charge using the :ref:`nrfxlib:nrf_fuel_gauge`.
* Added the :ref:`nPM1300: Fuel gauge <npm13xx_fuel_gauge>` sample that demonstrates how to calculate the battery state of charge using the :ref:`nrfxlib:nrf_fuel_gauge`.

Trusted Firmware-M (TF-M) samples
---------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ PMIC samples

* Added :ref:`npm1300_one_button` sample that demonstrates how to support wake-up, shutdown, and user interactions through a single button connected to the nPM1300.

* :ref:`npm1300_fuel_gauge` sample:
* :ref:`nPM1300: Fuel gauge <npm13xx_fuel_gauge>` sample:

* Updated to accommodate API changes in the :ref:`nrfxlib:nrf_fuel_gauge`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ PMIC samples

* Added support for the :zephyr:board:`nrf54l15dk` and :zephyr:board:`nrf54h20dk` to the PMIC samples.

* :ref:`npm1300_fuel_gauge` sample:
* :ref:`nPM1300: Fuel gauge <npm13xx_fuel_gauge>` sample:

* Updated to accommodate API changes in nRF Fuel Gauge library v0.11.1.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ PMIC samples

* Added support for the :zephyr:board:`nrf54l15dk` and :zephyr:board:`nrf54h20dk` to the PMIC samples.

* :ref:`npm1300_fuel_gauge` sample:
* :ref:`nPM1300: Fuel gauge <npm13xx_fuel_gauge>` sample:

* Updated to accommodate API changes in nRF Fuel Gauge library v0.11.1.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ Peripheral samples
PMIC samples
------------

* :ref:`npm1300_fuel_gauge` sample:
* :ref:`nPM1300: Fuel gauge <npm13xx_fuel_gauge>` sample:

* Updated to accommodate API changes in nRF Fuel Gauge library v1.0.0.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ PMIC samples
* The :ref:`npm2100_one_button` sample that demonstrates how to support wake-up, shutdown, and user interactions through a single button connected to the nPM2100 PMIC.
* The :ref:`npm2100_fuel_gauge` sample that demonstrates how to calculate the battery state of charge of primary cell batteries using the :ref:`nrfxlib:nrf_fuel_gauge`.

* :ref:`npm1300_fuel_gauge` sample:
* :ref:`nPM1300: Fuel gauge <npm13xx_fuel_gauge>` sample:

* Updated to accommodate API changes in nRF Fuel Gauge library v1.0.0.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ PMIC samples
* The :ref:`npm2100_one_button` sample that demonstrates how to support wake-up, shutdown, and user interactions through a single button connected to the nPM2100 PMIC.
* The :ref:`npm2100_fuel_gauge` sample that demonstrates how to calculate the battery state of charge of primary cell batteries using the :ref:`nrfxlib:nrf_fuel_gauge`.

* :ref:`npm1300_fuel_gauge` sample:
* :ref:`nPM1300: Fuel gauge <npm13xx_fuel_gauge>` sample:

* Updated to accommodate API changes in nRF Fuel Gauge library v1.0.0.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ Peripheral samples
PMIC samples
------------

* :ref:`npm1300_fuel_gauge` sample:
* :ref:`nPM1300: Fuel gauge <npm13xx_fuel_gauge>` sample:

* Updated current sign when calling the ``nrf_fuel_gauge`` lib functions.
In the Zephyr sensor API the convention for the gauge current is ``negative=discharging``, while the :ref:`nrfxlib:nrf_fuel_gauge` lib uses the opposite.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ cmake_minimum_required(VERSION 3.20.0)

list(APPEND BOARD_ROOT ${CMAKE_CURRENT_SOURCE_DIR})

set(SHIELD npm1300_ek)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})

project(npm1300_fuel_gauge)
project(npm13xx_fuel_gauge)

add_subdirectory(src)
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
.. _npm1300_fuel_gauge:
.. _npm13xx_fuel_gauge:

nPM1300: Fuel gauge
###################
nPM1300 and nPM1304: Fuel gauge
###############################

.. contents::
:local:
:depth: 2

The Fuel gauge sample demonstrates how to calculate the state of charge of a development kit battery using `nPM1300 <nPM1300 product website_>`_ and the :ref:`nrfxlib:nrf_fuel_gauge`.
The Fuel gauge sample demonstrates how to calculate the state of charge of a development kit battery using `nPM1300 <nPM1300 product website_>`_ or `nPM1304 <nPM1304 product website_>`_ and the :ref:`nrfxlib:nrf_fuel_gauge`.

For more information about fuel gauging with the nPM1300, see `Using the nPM1300 Fuel Gauge`_.
For more information about fuel gauging with the nPM1300 or nPM1304, see `Using the nPM1300 Fuel Gauge`_.

Requirements
************
Expand All @@ -18,27 +18,27 @@ The sample supports the following development kits:

.. table-from-sample-yaml::

The sample also requires an `nPM1300 EK <nPM1300 EK product page_>`_ that you need to connect to the development kit as described in `Wiring`_.
The sample also requires an `nPM1300 EK <nPM1300 EK product page_>`_ or nPM1304 EK that you need to connect to the development kit as described in `Wiring`_.

Overview
********

This sample allows to calculate the state of charge, time to empty, and time to full information from a battery on the development kit connected to the nPM1300 PMIC.
This sample allows to calculate the state of charge, time to empty, and time to full information from a battery on the development kit connected to the nPM1300 or nPM1304 PMIC.

.. _npm1300_fuel_gauge_wiring:
.. _npm13xx_fuel_gauge_wiring:

Wiring
******

To connect your DK to the nPM1300 EK, complete the following steps:
To connect your DK to the nPM1300 or nPM1304 EK, complete the following steps:

#. Connect the TWI interface between the chosen DK and the nPM1300 EK as in the following table:
#. Connect the TWI interface between the chosen DK and the nPM1300 or nPM1304 EK as in the following table:

.. list-table:: nPM1300 EK connections.
.. list-table:: nPM1300/nPM1304 EK connections.
:widths: auto
:header-rows: 1

* - nPM1300 EK pins
* - EK pins
- nRF52 DK pins
- nRF52840 DK pins
- nRF5340 DK pins
Expand All @@ -50,7 +50,7 @@ To connect your DK to the nPM1300 EK, complete the following steps:
- P0.26
- P1.02
- P1.11
- P0.04
- P0.05
- P0.30
* - SCL
- P0.27
Expand All @@ -60,12 +60,12 @@ To connect your DK to the nPM1300 EK, complete the following steps:
- P0.00
- P0.31
* - GPIO3
- P0.22
- P1.12
- P1.12
- P1.10
- P0.05
- P0.10
- P0.04
- P0.04
- P0.04
- P0.04
- P0.04
- P0.04
* - VDDIO
- VDD
- VDD
Expand All @@ -81,26 +81,52 @@ To connect your DK to the nPM1300 EK, complete the following steps:
- GND
- GND

#. Make the following connections on the nPM1300 EK:
#. Make the following connections on the nPM1300 or nPM1304 EK:

* Remove all existing connections.
* Connect a USB power supply to the **J3** connector.
* Connect a USB power supply to the connector **J3** (on nPM1300) or **J4** (on nPM1304).
* Connect a suitable battery to the **J2** connector.
* On the **P2** pin header, connect **VBAT** and **VBATIN** pins with a jumper.
* On the **P1** pin header, connect **VBAT** and **VBATIN** pins with a jumper.
* On the **P17** pin header, connect all LEDs with jumpers.
* On the **P13** pin header, connect **RSET1** and **VSET1** pins with a jumper.
* On the **P14** pin header, connect **RSET2** and **VSET2** pins with a jumper.

.. note::
When using the :zephyr:board:`nrf54l15dk`, the nPM1300 **GPIO3** interrupt pin assignment uses the DK's **LED 1** pin.
When using the :zephyr:board:`nrf54l15dk`, the PMIC **GPIO3** interrupt pin assignment uses the DK's **BUTTON 3** pin.

Building and running
********************

.. |sample path| replace:: :file:`samples/pmic/native/npm1300_fuel_gauge`
.. |sample path| replace:: :file:`samples/pmic/native/npm13xx_fuel_gauge`

.. include:: /includes/build_and_run.txt

To build this sample for either nPM1300 or nPM1304, you need to apply an appropriate build configuration.
The build configuration consist of choosing a Zephyr shield (``npm1300_ek`` or ``npm1304_ek``) and
applying an extra devicetree overlay file (``npm1300.overlay`` or ``npm1304.overlay``)
You can use either the nRF Connect for VS Code extension or the command line.

.. tabs::

.. group-tab:: nRF Connect for VS Code

To choose a shield, add an **Extra CMake argument** in your build configuration, for example:

.. code-block:: bash

-DSHIELD=npm1300_ek

To apply an extra overlay, choose the respective file from the **Extra Devicetree overlays** drop-down menu

.. group-tab:: Command line

To apply the appropriate configuration, use the ``-T`` argument of the ``west build`` command.
For example, to build for an nRF54L15 DK and an nPM1300 EK use the following command:

.. code-block:: bash

west build -b nrf54l15dk/nrf54l15/cpuapp samples/pmic/native/npm13xx_fuel_gauge -T sample.npm1300_fuel_gauge_compile

Testing
*******

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
&pinctrl {
i2c130_default: i2c130_default {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 4)>,
psels = <NRF_PSEL(TWIM_SDA, 0, 5)>,
<NRF_PSEL(TWIM_SCL, 0, 0)>;
};
};

i2c130_sleep: i2c130_sleep {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 4)>,
psels = <NRF_PSEL(TWIM_SDA, 0, 5)>,
<NRF_PSEL(TWIM_SCL, 0, 0)>;
low-power-enable;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,3 @@
bias-pull-up;
};
};

&npm1300_ek_pmic {
host-int-gpios = <&gpio1 12 0>;
pmic-int-pin = <3>;
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,3 @@
bias-pull-up;
};
};

&npm1300_ek_pmic {
host-int-gpios = <&gpio0 22 0>;
pmic-int-pin = <3>;
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,3 @@
bias-pull-up;
};
};

&npm1300_ek_pmic {
host-int-gpios = <&gpio1 12 0>;
pmic-int-pin = <3>;
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

#include <dt-bindings/regulator/npm13xx.h>

&i2c130_default {
group1 {
bias-pull-up;
Expand All @@ -19,8 +17,3 @@
&gpio0 {
status = "okay";
};

&npm1300_ek_pmic {
host-int-gpios = <&gpio0 5 0>;
pmic-int-pin = <3>;
};
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,3 @@
&i2c21 {
status = "okay";
};

&npm1300_ek_pmic {
host-int-gpios = <&gpio1 10 0>;
pmic-int-pin = <3>;
};
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,3 @@
&i2c21 {
status = "okay";
};

&npm1300_ek_pmic {
host-int-gpios = <&gpio1 10 0>;
pmic-int-pin = <3>;
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,3 @@
bias-pull-up;
};
};

&npm1300_ek_pmic {
host-int-gpios = <&gpio0 10 0>;
pmic-int-pin = <3>;
};
10 changes: 10 additions & 0 deletions samples/pmic/native/npm13xx_fuel_gauge/npm1300.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

&npm1300_ek_pmic {
host-int-gpios = <&gpio0 4 0>;
pmic-int-pin = <3>;
};
10 changes: 10 additions & 0 deletions samples/pmic/native/npm13xx_fuel_gauge/npm1304.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

&npm1304_ek_pmic {
host-int-gpios = <&gpio0 4 0>;
pmic-int-pin = <3>;
};
Loading
Loading