Coder Social home page Coder Social logo

nordic-auko / npmx-zephyr Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nordicsemiconductor/npmx-zephyr

0.0 0.0 0.0 841 KB

npmx integration with Zephyr

Home Page: https://nordicsemiconductor.github.io/npmx-zephyr/

Python 0.18% C 98.26% CMake 1.56%

npmx-zephyr's Introduction

npmx-zephyr

NPM LOGO

Overview

npmx-zephyr repository provides an example of npmx library integration with the Zephyr RTOS environment. This can be used as a starting point for an integration with other RTOS or bare-metal environments.

For the user's convenience, this repository includes also a variety of sample applications demonstrating how to use the npmx drivers.

Supported devices

  • nPM1300

How to use

Repository initialization

The recommended way to clone the repositories is by using the west tool. Information about the installation, available commands, configuration and more can be found in the Zephyr's west tool documentation.

To initalize the npmx-zephyr repository, run the following commands:

mkdir <new_directory>
cd <new_directory>
west init -m https://github.com/NordicSemiconductor/npmx-zephyr
cd npmx-zephyr
west update

Alternatively, you can clone repositories by using git only. In this case pay special attention to revisions - both Zephyr and npmx revisions should match the ones specified in the west.yml. Moreover, the npmx folder should be placed in the zephyr/modules subdirectory.

Building and running sample application

To run one of the sample applications, do the following:

  • Configure the setup based on the relevant sample documentation.
  • Build and flash the application to the target device by using the following commands:
    cd <path_to_npmx-zephyr>/samples/<desired_sample>
    west build -b <target>
    west flash

For instance, if you want to run the LED sample for nPM1300 used with nRF52840DK, you must configure the setup as specified in the LED sample README. After that, run the following commands:

cd npmx-zephyr/samples/led
west build -b nrf52840dk_nrf52840
west flash

As a result, you should see LEDs blinking on the board.

Make sure that the ZEPHYR_BASE variable is set as a path to your Zephyr folder (the one you have cloned with west).

If not, set this variable manually with the following command:

export ZEPHYR_BASE=<path_to_zephyr_directory>

If you want to create a custom application, refer to the following guidelines:

Directories

.
├── doc         # Project documentation files
├── drivers     # npmx drivers files
├── dts	        # Devicetree source files for nPM devices
├── samples     # npmx samples files
│   ├── buck    # Samples related to BUCK peripheral
│   ├── ldo     # Samples related to LDO peripheral
│   .
│   .
│
├── scripts     # Various scripts
└── zephyr      # Zephyr configuration files

Generating documentation

All files that are required to compile the Sphinx-based documentation for the npmx-zephyr repository are located under the doc folder.

Requirements

Install Python 3 and its dependencies with the following command:

pip install -r scripts/requirements.txt

Build

You can build the documentation in two ways:

  • Use the provided script doc/generate_sphinx_doc.sh and open the doc/build/html/index.html file to see the output.

  • Build it manually by going to the doc directory and running the following command:

    sphinx-build -M html . build

pre-commit

For smoother workflow, npmx-zephyr includes hook scripts that are managed by using the pre-commit framework. These scripts help to identify common issues, such as trailing whitespaces or missing licenses, right before the code review.

Information about the usage, available commands, configuration and more can be found on the pre-commit page.

To enable or disable the pre-commit functionality, run the relevant command:

pre-commit install
pre-commit uninstall

npmx-zephyr's People

Contributors

wilu-nordic avatar jaz1-nordic avatar masz-nordic avatar magp-nordic avatar mkleszcz-no avatar nordic-piks avatar nordic-segl avatar nordic-babu avatar carlescufi avatar napl-nordic avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.