From 79fe7274cac4da2b3b47c87694e863eee012d538 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Fri, 29 Jan 2021 13:27:27 +0100 Subject: [PATCH] doc: add documentation on default configurations --- doc/doxygen/src/getting-started.md | 12 ++++++++++++ doc/doxygen/src/porting-boards.md | 23 +++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/doc/doxygen/src/getting-started.md b/doc/doxygen/src/getting-started.md index 7fb91c7adff4..1077412eae86 100644 --- a/doc/doxygen/src/getting-started.md +++ b/doc/doxygen/src/getting-started.md @@ -153,6 +153,18 @@ For instructions on how to configure via `CFLAGS` check the @ref config "identified compile-time configurations". To learn how to use Kconfig in RIOT, please refer to the @ref kconfig-users-guide. +Default configurations {#default-configurations} +---------------------- +When devices have a common access interface, having a default configuration to +enable them across platforms, without having to explicitly specify which modules +to include, comes in handy. For this, two pseudomodules are defined: + +- `saul_default`: will enable all the drivers of sensors and actuators that are +present in the target platform. + +- `netdev_default`: will enable all the drivers of network devices +present in the target platform. + Use Docker to build RIOT {#docker} ======================== [Docker](https://www.docker.com/) is a platform that allows packaging software into containers that can easily be run on any Linux that has Docker installed. diff --git a/doc/doxygen/src/porting-boards.md b/doc/doxygen/src/porting-boards.md index f5d025348f89..69a9f90f9075 100644 --- a/doc/doxygen/src/porting-boards.md +++ b/doc/doxygen/src/porting-boards.md @@ -105,6 +105,29 @@ endif the dependency block for your board *before* its dependencies pull in their own dependencies. +#### Default configurations +As explained in @ref default-configurations "Default Configurations", there are +two pseudomodules that are used to indicate that certain drivers of devices +present in the platform should be enabled. Each board (or CPU) has knowledge as +to which drivers should be enabled in each case. + +The previous code snippet shows how a board which has a @ref drivers_sx127x +device, pulls in its driver when the default network interfaces are required. + +When the pseudomodule `saul_default` is enabled, the board should pull in all +the drivers of the devices it has which provide a @ref drivers_saul interface. This is +usually done as following: + +```mk +ifneq (,$(filter saul_default,$(USEMODULE))) + USEMODULE += saul_gpio + USEMODULE += apds9960 + USEMODULE += bmp280_i2c + USEMODULE += lis3mdl + USEMODULE += sht3x +endif +``` + ### Makefile.features {#makefile-features} This file defines all the features provided by the BOARD. These features