Skip to content

Commit 80fc350

Browse files
fg-cfhcarlescufi
authored andcommitted
doc: ieee802154: improved API documentation structure
Improves the API documentation including it's structure and integration into the Zephyr documentation. Previously the API status of the IEEE 802.15.4 API (and its sub-APIs) was unclear. This change adds three APIs in an "unstable" state: - IEEE 802.15.4 L2 for subsystem developers - IEEE 802.15.4 drivers for driver developers - IEEE 802.15.4 net_mgmt for application developers The corresponding APIs are documented at a group level. These sub-APIs need to be separately versioned as they have different audiences, change velocities and levels of stability. Signed-off-by: Florian Grandel <[email protected]>
1 parent 0fad581 commit 80fc350

File tree

5 files changed

+175
-23
lines changed

5 files changed

+175
-23
lines changed

doc/connectivity/networking/api/ieee802154.rst

Lines changed: 68 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,81 @@ IEEE 802.15.4
77
:local:
88
:depth: 2
99

10-
Overview
11-
********
10+
Introduction
11+
************
12+
1213
IEEE 802.15.4 is a technical standard which defines the operation of low-rate
13-
wireless personal area networks (LR-WPANs). For more detailed overview of this
14-
standard, see this
15-
`IEEE 802.15.4 Wikipedia article <https://en.wikipedia.org/wiki/IEEE_802.15.4>`_.
16-
Also, see `IEEE GET Program
17-
<https://ieeexplore.ieee.org/browse/standards/get-program/page/series?id=68>`_
18-
for creating an IEEE account and downloading the specification.
19-
20-
Zephyr supports IEEE 802.15.4 with Thread and 6LoWPAN. The Thread implementation
21-
is based on `OpenThread <https://openthread.io/>`_.
22-
The IPv6 header compression in 6LoWPAN is shared with
23-
the Bluetooth IPSP (IP support profile).
14+
wireless personal area networks (LR-WPANs). For a more detailed overview of this
15+
standard, see the `IEEE 802.15.4 Wikipedia article
16+
<https://en.wikipedia.org/wiki/IEEE_802.15.4>`_.
17+
18+
The most recent version of the standard is accessible through the `IEEE GET
19+
Program
20+
<https://ieeexplore.ieee.org/browse/standards/get-program/page/series?id=68>`_.
21+
You need to create a free IEEE account and can then downloading it.
22+
23+
We're currently following the IEEE 802.15.4-2020 specification. This version is
24+
backwards compatible with IEEE 802.15.4-2015, parts of which are contained in
25+
the Thread protocol stack. The 2020 version also includes prior extensions that
26+
were accepted into the standard, namely IEEE 802.15.4g (SUN FSK) and IEEE
27+
802.15.4e (TSCH) which are of relevance to industrial IoT and automation. For
28+
recent developments in UWB ranging technology, see IEEE 802.15.4z which is not
29+
yet integrated into the standard's mainline.
30+
31+
Whenever sections from the standard are cited in the documentation, they refer
32+
to IEEE 802.15.4-2020 section, table and figure numbering - unless otherwise
33+
specified.
34+
35+
Zephyr supports bot native IEEE 802.15.4 and Thread with 6LoWPAN. The Thread
36+
implementation is based on `OpenThread <https://openthread.io/>`_. The IPv6
37+
header compression in 6LoWPAN is shared among native IEEE 802.15.4, OpenThread
38+
and the Bluetooth IPSP (IP support profile).
2439

2540
API Reference
2641
*************
2742

28-
IEEE 802.15.4
29-
=============
43+
IEEE 802.15.4 API Overview
44+
==========================
45+
46+
Gives an introduction and overview over the whole IEEE 802.15.4 subsystem and
47+
all of its APIs, configuration and user interfaces for all audiences.
3048

3149
.. doxygengroup:: ieee802154
3250

33-
IEEE 802.15.4 Management
34-
========================
51+
52+
.. _ieee802154_mgmt_api:
53+
54+
IEEE 802.15.4 Management API
55+
============================
56+
57+
This is the main subsystem-specific API of interest to IEEE 802.15.4
58+
**application developers** as it allows to configure the IEEE 802.15.4 subsystem
59+
at runtime. Other relevant interfaces for application developers are the
60+
typical shell, socket, Kconfig and devicetree APIs that can be accessed through
61+
Zephyr's generic subsystem-independent documentation. Look out for
62+
IEEE802154/ieee802154 prefixes there.
3563

3664
.. doxygengroup:: ieee802154_mgmt
65+
66+
67+
.. _ieee802154_driver_api:
68+
69+
IEEE 802.15.4 Driver API
70+
========================
71+
72+
This is the main API of interest to IEEE 802.15.4 **driver developers**.
73+
74+
.. doxygengroup:: ieee802154_driver
75+
76+
77+
.. _ieee802154_l2_api:
78+
79+
IEEE 802.15.4 L2 / Native Stack API
80+
===================================
81+
82+
This documents the IEEE 802.15.4 L2 native stack, which neither applications nor
83+
drivers will ever access directly. It is called internally by Zephyr's upper
84+
network layers (L3+), its socket and network context abstractions. This API is
85+
therefore of interest to IEEE 802.15.4 **subsystem contributors** only.
86+
87+
.. doxygengroup:: ieee802154_l2

doc/develop/api/overview.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,18 @@ between major releases are available in the :ref:`zephyr_release_notes`.
169169
- Experimental
170170
- 3.2
171171

172+
* - :ref:`ieee802154_driver_api`
173+
- Unstable
174+
- 1.0
175+
176+
* - :ref:`ieee802154_l2_api`
177+
- Unstable
178+
- 1.0
179+
180+
* - :ref:`ieee802154_mgmt_api`
181+
- Unstable
182+
- 1.0
183+
172184
* - :ref:`input`
173185
- Experimental
174186
- 3.4

include/zephyr/net/ieee802154.h

Lines changed: 58 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,64 @@ extern "C" {
2323
#endif
2424

2525
/**
26-
* @brief IEEE 802.15.4 library
27-
* @defgroup ieee802154 IEEE 802.15.4 Library
28-
* @ingroup networking
26+
* @defgroup ieee802154 IEEE 802.15.4 APIs
27+
* @ingroup connectivity
28+
*
29+
* @brief IEEE 802.15.4 L2, configuration and driver APIs
30+
*
31+
* @details The IEEE 802.15.4 subsystem API comprises the native IEEE 802.15.4
32+
* L2 subsystem ("Soft" MAC), a mostly vendor and protocol agnostic driver API
33+
* shared between the OpenThread and native L2 stacks ("Hard" MAC and PHY) as
34+
* well as several APIs to configure the subsystem (shell, net management,
35+
* Kconfig, devicetree, etc.).
36+
*
37+
* The IEEE 802.15.4 subsystem APIs are exposed at different levels and address
38+
* several audiences:
39+
* - shell (end users, application developers):
40+
* - a set of IEEE 802.15.4 shell commands (see `shell> ieee802154 help`)
41+
* - application API (application developers):
42+
* - IPv6, DGRAM and RAW sockets for actual peer-to-peer, multicast and
43+
* broadcast data exchange between nodes including connection specific
44+
* configuration (sample coming soon, see
45+
* https://github.com/linux-wpan/wpan-tools/tree/master/examples for now
46+
* which inspired our API and therefore has a similar socket API),
47+
* - Kconfig and devicetree configuration options (net config library
48+
* extension, subsystem-wide MAC and PHY Kconfig/DT options, driver/vendor
49+
* specific Kconfig/DT options, watch out for options prefixed with
50+
* IEEE802154/ieee802154),
51+
* - Network Management: runtime configuration of the IEEE 802.15.4
52+
* protocols stack at the MAC (L2) and PHY (L1) levels
53+
* (see @ref ieee802154_mgmt),
54+
* - driver API (driver maintainers/contributors):
55+
* - see @ref ieee802154_driver
56+
* - a basic, mostly PHY-level driver API to be implemented by all drivers,
57+
* - several "hard MAC" (hardware/firmware offloading) extension points for
58+
* performance critical or timing sensitive aspects of the protocol
59+
* - L2 integration (subsystem contributors):
60+
* - see @ref ieee802154_l2
61+
* - implementation of Zephyr's internal L2-level socket and network context
62+
* abstractions (context/socket operations, see @ref net_l2),
63+
* - protocol-specific extension to the interface structure (see @ref net_if)
64+
* - protocol-specific extensions to the network packet structure
65+
* (see @ref net_pkt),
66+
*/
67+
68+
/**
69+
* @defgroup ieee802154_l2 IEEE 802.15.4 L2
70+
* @ingroup ieee802154
71+
*
72+
* @brief IEEE 802.15.4 L2 APIs
73+
*
74+
* @details This API provides integration with Zephyr's sockets and network
75+
* contexts. **Application and driver developers should never interface directly
76+
* with this API.** It is of interest to subsystem maintainers only.
77+
*
78+
* The API implements and extends the following structures:
79+
* - implements Zephyr's internal L2-level socket and network context
80+
* abstractions (context/socket operations, see @ref net_l2),
81+
* - protocol-specific extension to the interface structure (see @ref net_if)
82+
* - protocol-specific extensions to the network packet structure
83+
* (see @ref net_pkt),
2984
* @{
3085
*/
3186

include/zephyr/net/ieee802154_mgmt.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,17 @@ extern "C" {
2222
#endif
2323

2424
/**
25+
* @defgroup ieee802154_mgmt IEEE 802.15.4 Net Management
26+
* @ingroup ieee802154
27+
*
2528
* @brief IEEE 802.15.4 net management library
26-
* @defgroup ieee802154_mgmt IEEE 802.15.4 Net Management Library
27-
* @ingroup networking
29+
*
30+
* @details The IEEE 802.15.4 net management library provides runtime
31+
* configuration features that applications can interface with directly.
32+
*
33+
* Most of these commands are also accessible via shell commands. See the
34+
* shell's help feature (`shell> ieee802154 help`).
35+
*
2836
* @{
2937
*/
3038

include/zephyr/net/ieee802154_radio.h

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,33 @@ extern "C" {
2727
#endif
2828

2929
/**
30-
* @addtogroup ieee802154
30+
* @defgroup ieee802154_driver IEEE 802.15.4 Drivers
31+
* @ingroup ieee802154
32+
*
33+
* @brief IEEE 802.15.4 driver API
34+
*
35+
* @details This API provides a common representation of vendor-specific
36+
* hardware and firmware to the native IEEE 802.15.4 L2 and OpenThread stacks.
37+
* **Application developers should never interface directly with this API.** It
38+
* is of interest to driver maintainers only.
39+
*
40+
* The IEEE 802.15.4 driver API consists of two separate parts:
41+
* - a basic, mostly PHY-level driver API to be implemented by all drivers,
42+
* - several optional MAC-level extension points to offload performance
43+
* critical or timing sensitive aspects at MAC level to the driver hardware
44+
* or firmware ("hard" MAC).
45+
*
46+
* Implementing the basic driver API will ensure integration with the native L2
47+
* stack as well as basic support for OpenThread. Depending on the hardware,
48+
* offloading to vendor-specific hardware or firmware features may be required
49+
* to achieve full compliance with the Thread protocol or IEEE 802.15.4
50+
* subprotocols (e.g. fast enough ACK packages, precise timing of timed TX/RX in
51+
* the TSCH or CSL subprotocols).
52+
*
53+
* Whether or not MAC-level offloading extension points need to be implemented
54+
* is to be decided by individual driver maintainers. Upper layers SHOULD
55+
* provide a "soft" MAC fallback whenever possible.
56+
*
3157
* @{
3258
*/
3359

0 commit comments

Comments
 (0)