Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update example documentation #23

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
40 changes: 40 additions & 0 deletions .github/workflows/build-using-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build and test app in NCS docker container

on:
pull_request:

jobs:
build-and-test-in-docker:
runs-on: ubuntu-22.04
container: ghcr.io/nrfconnect/sdk-nrf-toolchain:v2.6.99
defaults:
run:
# Bash shell is needed to set toolchain related environment variables in docker container
# It is a workaround for GitHub Actions limitation https://github.com/actions/runner/issues/1964
shell: bash
steps:
- name: Checkout repository with example application
uses: actions/checkout@v4
with:
path: example-application

- name: Prepare west project
run: |
west init -l example-application
west update -o=--depth=1 -n

- name: Build firmware
working-directory: example-application
run: |
west twister -T app -v --inline-logs --integration

- name: Store hex files
uses: actions/upload-artifact@v4
with:
name: built-applications
path: example-application/twister-out/**/zephyr/zephyr.hex

- name: Twister Tests
working-directory: example-application
run: |
west twister -T tests -v --inline-logs --integration
49 changes: 0 additions & 49 deletions .github/workflows/build.yml

This file was deleted.

1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @gmarull @carlescufi
45 changes: 22 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Zephyr Example Application
# nRF Connect SDK example application

<a href="https://zephyrproject-rtos.github.io/example-application">
<a href="https://nrfconnect.github.io/ncs-example-application">
<img alt="Documentation" src="https://img.shields.io/badge/documentation-3D578C?logo=sphinx&logoColor=white">
</a>
<a href="https://zephyrproject-rtos.github.io/example-application/doxygen">
<a href="https://nrfconnect.github.io/ncs-example-application/doxygen">
<img alt="API Documentation" src="https://img.shields.io/badge/API-documentation-3D578C?logo=c&logoColor=white">
</a>

This repository contains a Zephyr example application. The main purpose of this
repository is to serve as a reference on how to structure Zephyr-based
applications. Some of the features demonstrated in this example are:
This repository contains an nRF Connect SDK example application. The main
purpose of this repository is to serve as a reference on how to structure nRF Connect
SDK based applications. Some of the features demonstrated in this example are:

- Basic [Zephyr application][app_dev] skeleton
- [Zephyr workspace applications][workspace_app]
Expand All @@ -23,12 +23,12 @@ applications. Some of the features demonstrated in this example are:
- Custom [west extension][west_ext]
- Doxygen and Sphinx documentation boilerplate

This repository is versioned together with the [Zephyr main tree][zephyr]. This
means that every time that Zephyr is tagged, this repository is tagged as well
This repository is versioned together with the [nRF Connect SDK main tree][sdk-nrf]. This
means that every time that nRF Connect SDK is tagged, this repository is tagged as well
with the same version number, and the [manifest](west.yml) entry for `zephyr`
will point to the corresponding Zephyr tag. For example, the `example-application`
v2.6.0 will point to Zephyr v2.6.0. Note that the `main` branch always
points to the development branch of Zephyr, also `main`.
will point to the corresponding nRF Connect SDK tag. For example, the `ncs-example-application`
v2.5.0 will point to nRF Connect SDK v2.5.0. Note that the `main` branch always
points to the development branch of nRF Connect SDK, also `main`.

[app_dev]: https://docs.zephyrproject.org/latest/develop/application/index.html
[workspace_app]: https://docs.zephyrproject.org/latest/develop/application/index.html#zephyr-workspace-app
Expand All @@ -37,25 +37,25 @@ points to the development branch of Zephyr, also `main`.
[board_porting]: https://docs.zephyrproject.org/latest/guides/porting/board_porting.html
[bindings]: https://docs.zephyrproject.org/latest/guides/dts/bindings.html
[drivers]: https://docs.zephyrproject.org/latest/reference/drivers/index.html
[zephyr]: https://github.com/zephyrproject-rtos/zephyr
[sdk-nrf]: https://github.com/nrfconnect/sdk-nrf
[west_ext]: https://docs.zephyrproject.org/latest/develop/west/extensions.html

## Getting Started
## Getting started

Before getting started, make sure you have a proper Zephyr development
environment. Follow the official
[Zephyr Getting Started Guide](https://docs.zephyrproject.org/latest/getting_started/index.html).
Before getting started, make sure you have a proper nRF Connect SDK development environment.
Follow the official
[Installation guide](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/installation/install_ncs.html).

### Initialization

The first step is to initialize the workspace folder (``my-workspace``) where
the ``example-application`` and all Zephyr modules will be cloned. Run the following
the ``example-application`` and all nRF Connect SDK modules will be cloned. Run the following
command:

```shell
# initialize my-workspace for the example-application (main branch)
west init -m https://github.com/zephyrproject-rtos/example-application --mr main my-workspace
# update Zephyr modules
# initialize my-workspace for the ncs-example-application (main branch)
west init -m https://github.com/nrfconnect/ncs-example-application --mr main my-workspace
# update nRF Connect SDK modules
cd my-workspace
west update
```
Expand All @@ -71,9 +71,8 @@ west build -b $BOARD app

where `$BOARD` is the target board.

You can use the `custom_plank` board found in this
repository. Note that Zephyr sample boards may be used if an
appropriate overlay is provided (see `app/boards`).
You can use the `custom_plank` board found in this repository. Note that you can use
Zephyr and nRF Connect SDK sample boards if an appropriate overlay is provided (see `app/boards`).

A sample debug configuration is also provided. To apply it, run the following
command:
Expand Down
27 changes: 0 additions & 27 deletions app/boards/nucleo_f302r8.overlay

This file was deleted.

4 changes: 2 additions & 2 deletions app/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
# so that you can easily test all of them locally or in CI.
sample:
description: Example application
name: example-application
name: example-application
common:
sysbuild: true
build_only: true
integration_platforms:
- custom_plank
- nucleo_f302r8
tests:
app.default: {}
app.debug:
Expand Down
4 changes: 2 additions & 2 deletions doc/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ DOXYFILE_ENCODING = UTF-8
# title of most generated pages and in a few other places.
# The default value is: My Project.

PROJECT_NAME = "Example Application"
PROJECT_NAME = "NCS Example Application"

# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version
Expand All @@ -54,7 +54,7 @@ PROJECT_NUMBER = 1.0.0
# for a project that appears at the top of each page and should give viewer a
# quick idea about the purpose of the project. Keep the description short.

PROJECT_BRIEF = A Zephyr-based example application
PROJECT_BRIEF = An NCS-based example application

# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
# in the documentation. The maximum height of the logo should not exceed 55
Expand Down
4 changes: 2 additions & 2 deletions doc/_doxygen/main.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Introduction

This is the Doxygen documentation for [example-application].
This is the Doxygen documentation for [ncs-example-application].

[example-application]: https://github.com/zephyrproject-rtos/example-application
[ncs-example-application]: https://github.com/nrfconnect/ncs-example-application
78 changes: 78 additions & 0 deletions doc/about.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
.. _example_about:

About the Example Application
#############################

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

The About page is where more detailed information about the application should be placed.
For this example, it contains information on the documentation structure.

Table of contents
*****************

When a page other than the landing page is long and contains headers, you should also add a table of contents to that page.
To generate the table of contents, add the following after the page title:

.. code-block:: RST

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

.. _example_about_naming:

Naming page files and page links
********************************

When naming the file for a page, use simple and descriptive names.
Keep in mind that the file name will also be visible in the URL.

You should attach a reference target to every every page title as well.
The reference target is used when linking from one page to another.
In most cases, it's good to match the reference target to the page name, as this makes it easier to know which page is linked when the target is used.
For example, the the reference target for this page is ``example_about``, and it is defined with the following line just before the page title:

.. code-block:: RST

.. _example_about:

If you want to link to a subheading on a page, you should also add a reference target for that heading.
The best practice for naming subheading reference targets is to use the page reference target and add some or all of the heading.
For example, the reference target for this section is ``example_about_naming``, and it is defined in the same way as the page reference target.

When you want to link to a reference target, you can use either of the following:

.. code-block:: RST

:ref:`example_about`
:ref:`replaced link text <example_about>`

The first one uses the name of the heading or title that is linked (:ref:`example_about`), while the second one replaces that with a custom link text (:ref:`replaced link text <example_about>`).

External links
==============

For links outside of the documentation set, use the :file:`links.txt` file.
This file makes it easier to update and re-use links.
Define the links according to the existing examples, then use either of the following to place the link in the text:

.. code-block:: RST

`nRF Connect SDK`_
`replaced link text <nRF Connect SDK_>`_

The first one uses the name of the link (`nRF Connect SDK`_), while the second one replaces that with a custom link text (`replaced link text <nRF Connect SDK_>`_).

Recommended pages
*****************

In addition to the About page, the following pages are recommended for all applications.

Requirements and setup
The :ref:`example_setup` details what the user needs to have so they can work with the application.

Release notes
The release notes page documents changes for each release.
24 changes: 12 additions & 12 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,35 @@
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'Example Application'
copyright = '2024, The Zephyr Community'
author = 'The Zephyr Community'
project = 'NCS Example Application'
copyright = '2024, Nordic Semiconductor'
author = 'Nordic Semiconductor'
release = '1.0.0'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = ['sphinx.ext.intersphinx', 'breathe']
extensions = ['breathe']

templates_path = ['_templates']
exclude_patterns = ['_build_sphinx', 'Thumbs.db', '.DS_Store']

# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'alabaster'

# -- Options for Intersphinx -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html

intersphinx_mapping = {'zephyr': ('https://docs.zephyrproject.org/latest/', None)}
html_theme = 'sphinx_ncs_theme'

## -- Options for Breathe ----------------------------------------------------
# https://breathe.readthedocs.io/en/latest/index.html
#
# WARNING: please, check breathe maintainership status before using this
# extension in production!

breathe_projects = {'example-application': '_build_doxygen/xml'}
breathe_default_project = 'example-application'
breathe_projects = {'ncs-example-application': '_build_doxygen/xml'}
breathe_default_project = 'ncs-example-application'
breathe_default_members = ('members', )

# Include following files at the end of each .rst file.
rst_epilog = """
.. include:: /links.txt
"""
8 changes: 5 additions & 3 deletions doc/drivers/blink.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
.. _example_driver_blink:

Blink
=====
#####

.. doxygengroup:: drivers_blink

Driver operations
-----------------
*****************

.. doxygengroup:: drivers_blink_ops

Public API
----------
**********

.. doxygengroup:: drivers_blink_api
Loading
Loading