upm
1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
|
It is highly encouraged to provide at least some basic documentation for the sensors that you want to add to UPM:
We currently document our libraries in the following way:
When submitting a new driver, you will have to at least fill out the mandatory fields as described below.
Let's use the BME280 class snippet from the bmp280.json file as an example:
For the library:
Library
The name of the library. This is appended to the upm prefix during a build.Description
A short description of the library and what it contains.For the sensor classes:
Sensor Class
This is the object containing the sensor class(es) within the library. Class objects need to match the name used in code.Name
Title Case descriptive names for your sensor. Multiple values can be used to capture the chip name, generic name, or specific name for a vendor. Examples: Digital Pressure Sensor, Serial MP3 ModuleDescription
A more detailed explanation what the sensor does and how it works.Categories
Mention one or more categories the sensor fits in. Accepted values are listed in the groups.md file.Connections
Specifies how does the sensor connect to the board. Accepted values are listed in the groups.md file.Project Type
What time of projects is the sensor suited for. For example: prototyping, industrial, commercial.Manufacturers
List of sensor manufacturers or vendors. Can be 'generic', other accepted values in groups.md.Examples
Names of the example files provided with the library. At a minimum, the C++
example needs to be provided.Urls
At least one link for Product Pages
needs to be provided. Additional links to Datasheets
or Schematics
can be added.Kits
Specifies if the sensor is part of a kit. Accepted values are listed in the groups.md file.Image
Name of the image file provided with the sensor class.Specifications
Relevant sensor specifications as listed in the datasheet.Platforms
Platform specific notes or known limitations and workarounds.As mentioned, accepted values for some of the fields are listed under the ../src/groups.md "groups.md" file. If needed, you can add new categories for your sensor library following the existing format.
JSON files are automatically checked for correctness and required fields on code submissions.
Please do not use copyrighted images with your sensors!
Images from Seeed, DFRobot, Sparkfun or Adafruit are permitted.
New libraries must have the "@brief", "@defgroup" and "@ingroup" tags in one block. This usually follows the namespace and it is common to have one sensor per library.
You should end up with something like this (disregard the "@verbatim" tags in your actual code):
```
/** * @brief Short description for entire library * * Optional longer description. * * @defgroup <lib-name> libupm-<lib-name> * @ingroup <manufacturer> <connection> <category> (<kit>) */
/** * @library <lib-name> * @brief Short class/sensor description * * Then add a longer * description here. */
```
When adding to an existing library, <lib-name>
needs to match that library's "@defgroup".
For more examples take a look at the existing headers in our github repository. Also, make sure to check our sensortemplate as it can facilitate new sensor additions.
Existing header files might have additional fields under the sensor block. These have been used in the past to generate sensor pages outside of doxygen, but they are now deprecated and not required for new additions.