From f4ea2b97c8e6ed64a95e9f2acf058d0a859a06cd Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Tue, 19 May 2020 17:49:42 +0200 Subject: [PATCH] doc/creating-modules: add section about module generator --- doc/doxygen/src/creating-modules.md | 32 ++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/doc/doxygen/src/creating-modules.md b/doc/doxygen/src/creating-modules.md index 616e868041..a9c90cc257 100644 --- a/doc/doxygen/src/creating-modules.md +++ b/doc/doxygen/src/creating-modules.md @@ -154,4 +154,34 @@ the only parts of compounded module names and only match against part of that na See `sys/ztimer/Makefile` for an example in code. -`SUBMODULES` can also be true-pseudomodules. \ No newline at end of file +`SUBMODULES` can also be true-pseudomodules. + +# Helper tools + +To help you start writing a module, the RIOT build system provides the +`generate-module` make target. It is a wrapper around the +[riotgen](https://pypi.org/project/riotgen/) command line tool that is helpful +when starting to implement a module: all required files are generated with +copyright headers, doxygen groups, etc, so you can concentrate on the module +implementation. +The module source files are created in the `sys` directory. + +**Usage:** + +From the RIOT base directory, run: +``` +make generate-module +``` +Then answer a few questions about the driver: +- Module name: enter a name for your module. It will be used as both the name + of the module directory under sys, where the source files are created, and + the build system module (used with `USEMODULE`). +- Module doxygen name: Enter the name of module, as displayed in the + Doxygen documentation. +- Brief doxygen description: Describe in one line what is this module about. + +Other global information (author name, email, organization) should be retrieved +automatically from your git configuration. + +Once completed, the module files are located in +`sys//.c` and `sys/include/.h`.