|
1 | 1 | .. _index: |
2 | 2 |
|
3 | | -Welcome to `npmx-zephyr`! |
4 | | -######################### |
| 3 | +.. image:: _static/images/npm_family_logo_primary.png |
| 4 | + :align: center |
| 5 | + :width: 200 |
5 | 6 |
|
6 | | -:ref:`npmx-zephyr <index>` is a repository showcasing the integration of `npmx library`_ into an RTOS environment, using `Zephyr`_ RTOS as an example. |
| 7 | +npmx-zephyr |
| 8 | +########### |
7 | 9 |
|
8 | | -If you want to see how samples work in Zephyr, see `Samples and Demos`_ section. |
| 10 | +Overview |
| 11 | +******** |
| 12 | + |
| 13 | +:ref:`npmx-zephyr <index>` provides an example of `npmx library`_ integration with the `Zephyr`_ RTOS environment. |
| 14 | +This can be used as a starting point for an integration with other RTOS or bare-metal environments. |
| 15 | + |
| 16 | +For the user's convenience, this repository includes also a variety of sample applications demonstrating how to use the `npmx drivers`_. |
| 17 | +Their code is available on the GitHub `npmx-zephyr repository`_. |
| 18 | + |
| 19 | +Supported devices |
| 20 | +***************** |
| 21 | + |
| 22 | +- nPM1300 Engineering B |
| 23 | + |
| 24 | +Supported drivers |
| 25 | +***************** |
| 26 | + |
| 27 | +The following matrix provides a comparative overview of which drivers are supported by specific Nordic nPMs. |
| 28 | + |
| 29 | + ======================= ===== ====== ========= ======= ====== ====== ===== ===== ====== ======= ======== |
| 30 | + Driver ADC BUCK CHARGER EVENT GPIO LDSW LED POF SHIP TIMER VBUSIN |
| 31 | + ======================= ===== ====== ========= ======= ====== ====== ===== ===== ====== ======= ======== |
| 32 | + nPM1300 Engineering B ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ |
| 33 | + ======================= ===== ====== ========= ======= ====== ====== ===== ===== ====== ======= ======== |
| 34 | + |
| 35 | +For more information about the features of a specific peripheral, refer to the official documentation of the specific nPM device. |
| 36 | + |
| 37 | +How to use |
| 38 | +********** |
| 39 | + |
| 40 | +Repository initialization |
| 41 | +========================= |
| 42 | + |
| 43 | +The recommended way to clone the repositories is by using the ``west`` tool. |
| 44 | +Information about the installation, available commands, configuration and more can be found in the `Zephyr's west`_ tool documentation. |
| 45 | + |
| 46 | +To initalize the npmx-zephyr repository, run the following commands: |
| 47 | + |
| 48 | +.. code:: bash |
| 49 | +
|
| 50 | + mkdir <new_directory> |
| 51 | + cd <new_directory> |
| 52 | + west init -m https://github.com/NordicSemiconductor/npmx-zephyr |
| 53 | + cd npmx-zephyr |
| 54 | + west update |
| 55 | +
|
| 56 | +Alternatively, you can clone repositories by using git only. |
| 57 | +In this case pay special attention to revisions - both Zephyr and npmx revisions should match the ones specified in the ``west.yml``. |
| 58 | +Moreover, the ``npmx`` folder should be placed in the ``zephyr/modules`` subdirectory. |
| 59 | + |
| 60 | +Building and running sample application |
| 61 | +======================================= |
| 62 | + |
| 63 | +To run one of the :doc:`sample applications <samples>`, do the following: |
| 64 | + |
| 65 | +* Configure the setup based on the relevant sample documentation. |
| 66 | +* Build and flash the application to the target device by using the following commands: |
| 67 | + |
| 68 | + .. code:: bash |
| 69 | +
|
| 70 | + cd <path_to_npmx-zephyr>/samples/<desired_sample> |
| 71 | + west build -b <target> |
| 72 | + west flash |
| 73 | +
|
| 74 | +For instance, if you want to run the LED sample for nPM1300 Engineering B used with nRF52840DK, you must configure the setup as specified in the :doc:`LED sample <../samples/led/README>` description. |
| 75 | +After that, run the following commands: |
| 76 | + |
| 77 | +.. code:: bash |
| 78 | +
|
| 79 | + cd npmx-zephyr/samples/led |
| 80 | + west build -b nrf52840dk_nrf52840 |
| 81 | + west flash |
| 82 | +
|
| 83 | +As a result, you should see LEDs blinking on the board. |
| 84 | + |
| 85 | +.. note:: |
| 86 | + Make sure that the ``ZEPHYR_BASE`` variable is set as a path to your Zephyr folder (the one you have cloned with west). |
| 87 | + |
| 88 | + If not, set this variable manually with the following command: |
| 89 | + |
| 90 | + .. code:: bash |
| 91 | +
|
| 92 | + export ZEPHYR_BASE=<path_to_zephyr_directory> |
| 93 | +
|
| 94 | +Generating documentation |
| 95 | +======================== |
| 96 | + |
| 97 | +All files that are required to compile the Sphinx-based documentation for the ``npmx-zephyr`` repository are located under the ``doc`` folder. |
| 98 | + |
| 99 | +Requirements |
| 100 | +------------ |
| 101 | + |
| 102 | +Install Python 3 and its dependencies with the following command: |
| 103 | + |
| 104 | +.. code:: bash |
| 105 | +
|
| 106 | + pip install -r scripts/requirements.txt |
| 107 | +
|
| 108 | +Build |
| 109 | +----- |
| 110 | + |
| 111 | +You can build the documentation in two ways: |
| 112 | + |
| 113 | +* Use the provided script ``doc/sphinx_build_local.sh`` and open the ``doc/build/html/index.html`` file to see the output. |
| 114 | +* Build it manually by going to the ``doc`` directory and running the following command: |
| 115 | + |
| 116 | + .. code:: bash |
| 117 | +
|
| 118 | + sphinx-build -M html . build |
9 | 119 |
|
10 | 120 | .. toctree:: |
11 | | - :maxdepth: 1 |
12 | | - :glob: |
| 121 | + :maxdepth: 2 |
13 | 122 | :caption: Contents: |
14 | 123 |
|
15 | 124 | samples |
| 125 | + |
| 126 | +.. toctree:: |
| 127 | + :maxdepth: 1 |
| 128 | + |
16 | 129 | additional_resources |
17 | 130 | release_notes |
0 commit comments