mirror of
https://github.com/eclipse/upm.git
synced 2025-03-14 20:47:30 +03:00
upm: Add sensor groups based on IO types
This commit also fixes adds some default constructor arguments to some i2c sensors. Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
parent
79e8a261ba
commit
397af51d7c
@ -49,7 +49,7 @@ namespace upm {
|
||||
/**
|
||||
* @brief C++ API for ECS1030 (electricity sensor)
|
||||
*
|
||||
* @ingroup ecs1030
|
||||
* @ingroup ecs1030 analog
|
||||
* @snippet ecs1030.cxx Interesting
|
||||
*/
|
||||
|
||||
|
@ -36,7 +36,7 @@ namespace upm {
|
||||
* Hydrogen, smoke and other combustible gases. It's a medium sensitivity
|
||||
* sensor with a detect concentration of 300-10000ppm.
|
||||
*
|
||||
* @ingroup gas
|
||||
* @ingroup gas analog
|
||||
* @snippet mq2.cxx Interesting
|
||||
* @image html grovegas.jpeg
|
||||
*/
|
||||
|
@ -36,7 +36,7 @@ namespace upm {
|
||||
* highly sensitive but has a long warmup time of about 1minute. It's
|
||||
* detect rate is of 0.04-4mg/L Alcohol.
|
||||
*
|
||||
* @ingroup gas
|
||||
* @ingroup gas analog
|
||||
* @snippet mq3.cxx Interesting
|
||||
* @image html grovegas.jpeg
|
||||
*/
|
||||
|
@ -36,7 +36,7 @@ namespace upm {
|
||||
* on. It is highly sensitive and has a detection concentration of
|
||||
* 300-10000ppm.
|
||||
*
|
||||
* @ingroup gas
|
||||
* @ingroup gas analog
|
||||
* @snippet mq5.cxx Interesting
|
||||
* @image html grovegas.jpeg
|
||||
*/
|
||||
|
@ -35,7 +35,7 @@ namespace upm {
|
||||
* home and industry). It can detect Carbon Monoxide, Coal Gas and
|
||||
* Liquefied Gas. It's sensitivty is 10-1000ppmCO 100-10000PPm Gas.
|
||||
*
|
||||
* @ingroup gas
|
||||
* @ingroup gas analog
|
||||
* @snippet mq9.cxx Interesting
|
||||
* @image html mq9.jpeg
|
||||
*/
|
||||
|
@ -49,7 +49,7 @@ class Grove {
|
||||
*
|
||||
* Very basic UPM module for grove LED, or any LED for that matter
|
||||
*
|
||||
* @ingroup grove
|
||||
* @ingroup grove gpio
|
||||
* @snippet groveled.cxx Interesting
|
||||
*/
|
||||
class GroveLed: public Grove {
|
||||
@ -68,7 +68,7 @@ class GroveLed: public Grove {
|
||||
*
|
||||
* Very basic UPM module for grove temperature sensor on analog
|
||||
*
|
||||
* @ingroup grove
|
||||
* @ingroup grove analog
|
||||
* @snippet grovetemp.cxx Interesting
|
||||
*/
|
||||
class GroveTemp: public Grove {
|
||||
@ -104,7 +104,7 @@ class GroveTemp: public Grove {
|
||||
*
|
||||
* Very basic UPM module for grove Light sensor on analog
|
||||
*
|
||||
* @ingroup grove
|
||||
* @ingroup grove analog
|
||||
* @snippet grovelight.cxx Interesting
|
||||
*/
|
||||
class GroveLight: public Grove {
|
||||
|
@ -73,7 +73,7 @@ namespace upm {
|
||||
* is a high precision, ultra-low power consumption pressure sensor. It has a
|
||||
* range of between 30,000 and 110,000 Pa.
|
||||
*
|
||||
* @ingroup gy65
|
||||
* @ingroup gy65 i2c
|
||||
* @snippet gy65.cxx Interesting
|
||||
* @image html bmp085.jpeg
|
||||
*/
|
||||
|
@ -47,7 +47,7 @@ namespace upm {
|
||||
*
|
||||
* This file defines the HCSR04 C++ interface for libhcsr04
|
||||
*
|
||||
* @ingroup hcsr04
|
||||
* @ingroup hcsr04 gpio
|
||||
* @snippet hcsr04.cxx Interesting
|
||||
*/
|
||||
class HCSR04 {
|
||||
|
@ -43,7 +43,7 @@ namespace upm {
|
||||
* all done through an I2C interface. Different breakout boards are available,
|
||||
* typically a 3V supply is all that is needed to power the sensor.
|
||||
*
|
||||
* @ingroup hmc5883l
|
||||
* @ingroup hmc5883l i2c
|
||||
* @snippet hmc5883l.cxx Interesting
|
||||
* @image html hmc5883l.jpeg
|
||||
*/
|
||||
@ -53,7 +53,6 @@ public:
|
||||
* Creates a Hmc5883l object
|
||||
*
|
||||
* @param bus number of used i2c bus
|
||||
*
|
||||
*/
|
||||
Hmc5883l(int bus);
|
||||
|
||||
|
@ -41,7 +41,7 @@ namespace upm {
|
||||
* button could be treated as normal GPIO, this enables easier
|
||||
* interrupt support
|
||||
*
|
||||
* @ingroup joystick
|
||||
* @ingroup joystick analog
|
||||
* @snippet joystick12-example.cxx Interesting
|
||||
*/
|
||||
class Joystick12 {
|
||||
|
@ -38,7 +38,7 @@ namespace upm {
|
||||
* [Grove LCD RGB Backlight v2.0 display]
|
||||
* (http://www.seeedstudio.com/depot/Grove-LCD-RGB-Backlight-p-1643.html?cPath=34_36)
|
||||
*
|
||||
* @ingroup i2clcd
|
||||
* @ingroup i2clcd i2c
|
||||
* @snippet rgb-lcd.cxx Interesting
|
||||
* @image html grovergblcd.jpeg
|
||||
*/
|
||||
|
@ -42,7 +42,7 @@ namespace upm {
|
||||
* [TC1602A-01T](https://www.adafruit.com/datasheets/TC1602A-01T.pdf) seems to
|
||||
* the best documented example.
|
||||
*
|
||||
* @ingroup i2clcd
|
||||
* @ingroup i2clcd i2c
|
||||
* @snippet lcm-lcd.cxx Interesting
|
||||
* @image html lcm1602.jpeg
|
||||
*/
|
||||
|
@ -42,7 +42,7 @@ namespace upm {
|
||||
* (http://www.seeedstudio.com/wiki/Grove_-_OLED_Display_0.96%22)
|
||||
* which is an OLED monochrome display
|
||||
*
|
||||
* @ingroup i2clcd
|
||||
* @ingroup i2clcd i2c
|
||||
* @snippet oled-1308.cxx Interesting
|
||||
* @image html ssd1308.jpeg
|
||||
*/
|
||||
|
@ -42,7 +42,7 @@ namespace upm {
|
||||
* (http://www.seeedstudio.com/wiki/Grove_-_OLED_Display_1.12%22)
|
||||
* which is an OLED monochrome display
|
||||
*
|
||||
* @ingroup i2clcd
|
||||
* @ingroup i2clcd i2c
|
||||
* @snippet oled-1327.cxx Interesting
|
||||
* @image html ssd1327.jpeg
|
||||
*/
|
||||
|
@ -43,7 +43,7 @@ namespace upm {
|
||||
*
|
||||
* This file defines the LoL API and implemntation for a simple framebuffer
|
||||
*
|
||||
* @ingroup lol
|
||||
* @ingroup lol gpio
|
||||
* @snippet lol-example.cxx Interesting
|
||||
*/
|
||||
class LoL {
|
||||
|
@ -43,7 +43,7 @@ namespace upm {
|
||||
*
|
||||
* The FastPixel lpd8806 is an RGB led strip controller.
|
||||
*
|
||||
* @ingroup lpd8806
|
||||
* @ingroup lpd8806 spi
|
||||
* @snippet lpd8806.cxx Interesting
|
||||
* @image html lpd8806.jpeg
|
||||
*/
|
||||
|
@ -74,7 +74,7 @@ namespace upm {
|
||||
* module that is used over i2c. The magnometer and acceleromter are accessed
|
||||
* at two seperate i2c addresses.
|
||||
*
|
||||
* @ingroup lsm303
|
||||
* @ingroup lsm303 i2c
|
||||
* @snippet lsm303.cxx Interesting
|
||||
* @image html lsm303.jpeg
|
||||
*/
|
||||
|
@ -48,7 +48,7 @@ namespace upm {
|
||||
* module](http://datasheets.maximintegrated.com/en/ds/MAX31723PMB1.pdf) from
|
||||
* the analog PMOD kit.
|
||||
*
|
||||
* @ingroup max31723
|
||||
* @ingroup max31723 spi
|
||||
* @snippet max31723.cxx Interesting
|
||||
* @image html max31723.jpeg
|
||||
*/
|
||||
|
@ -45,7 +45,7 @@ namespace upm {
|
||||
* (http://datasheets.maximintegrated.com/en/ds/MAX31855PMB1.pdf) from the
|
||||
* analog PMOD kit.
|
||||
*
|
||||
* @ingroup max31855
|
||||
* @ingroup max31855 spi
|
||||
* @snippet max31855.cxx Interesting
|
||||
* @image html max31855.jpeg
|
||||
*/
|
||||
|
@ -68,6 +68,7 @@ namespace upm {
|
||||
* (http://datasheets.maximintegrated.com/en/ds/MAX44000PMB1.pdf) from the
|
||||
* analog PMOD kit.
|
||||
*
|
||||
* @ingroup max44000 i2c
|
||||
* @snippet max44000.cxx Interesting
|
||||
* @image html max44000.jpeg
|
||||
*/
|
||||
|
@ -48,7 +48,7 @@ namespace upm {
|
||||
* PMOD module](http://datasheets.maximintegrated.com/en/ds/MAX5487PMB1.pdf)
|
||||
* from the analog PMOD kit.
|
||||
*
|
||||
* @ingroup max5847
|
||||
* @ingroup max5847 spi
|
||||
* @snippet max5487.cxx Interesting
|
||||
* @image html max5487.jpeg
|
||||
*/
|
||||
|
@ -70,7 +70,7 @@ struct Time3231 {
|
||||
/**
|
||||
* @brief C++ API for MAXDS3231M chip (Ambient and Infrared Proximity Sensor)
|
||||
*
|
||||
* @ingroup maxds3231m
|
||||
* @ingroup maxds3231m i2c
|
||||
*/
|
||||
class MAXDS3231M {
|
||||
public:
|
||||
@ -80,7 +80,7 @@ class MAXDS3231M {
|
||||
* @param bus number of used bus
|
||||
* @param devAddr addres of used i2c device
|
||||
*/
|
||||
MAXDS3231M (int bus, int devAddr);
|
||||
MAXDS3231M (int bus=0, int devAddr=0x68);
|
||||
|
||||
/**
|
||||
* MAXDS3231M object destructor, basicaly it close i2c connection.
|
||||
|
@ -45,7 +45,7 @@ namespace upm {
|
||||
*
|
||||
* This file defines the Microphone Analog sensor
|
||||
*
|
||||
* @ingroup mic
|
||||
* @ingroup mic pwm
|
||||
* @snippet mic-example.cxx Interesting
|
||||
*/
|
||||
class Microphone {
|
||||
|
@ -62,7 +62,7 @@ namespace upm {
|
||||
*
|
||||
* This file defines the MLX90614 C++ interface for libmlx90614
|
||||
*
|
||||
* @ingroup mlx90641
|
||||
* @ingroup mlx90641 i2c
|
||||
* @snippet mlx90641.cxx Interesting
|
||||
*/
|
||||
class MLX90614 {
|
||||
@ -74,7 +74,7 @@ class MLX90614 {
|
||||
* @param bus number of used bus
|
||||
* @param devAddr addres of used i2c device
|
||||
*/
|
||||
MLX90614 (int bus, int devAddr);
|
||||
MLX90614 (int bus=0, int devAddr=0x5A);
|
||||
|
||||
/**
|
||||
* MLX90614 object destructor, basicaly it close i2c connection.
|
||||
|
@ -159,7 +159,7 @@ union accelData {
|
||||
*
|
||||
* This file defines the MMA7455 C++ interface for libmma7455
|
||||
*
|
||||
* @ingroup mma7455
|
||||
* @ingroup mma7455 i2c
|
||||
* @snippet mma7455.cxx Interesting
|
||||
*/
|
||||
class MMA7455 {
|
||||
@ -170,7 +170,7 @@ class MMA7455 {
|
||||
* @param bus number of used bus
|
||||
* @param devAddr addres of used i2c device
|
||||
*/
|
||||
MMA7455 (int bus, int devAddr);
|
||||
MMA7455 (int bus=0, int devAddr=0x1D);
|
||||
|
||||
/**
|
||||
* MMA7455 object destructor, basicaly it close i2c connection.
|
||||
|
@ -118,7 +118,7 @@ struct AxisData {
|
||||
*
|
||||
* This file defines the MPU9150 C++ interface for libmpu9150
|
||||
*
|
||||
* @ingroup mpu9150
|
||||
* @ingroup mpu9150 i2c
|
||||
* @snippet mpu9150-example.cxx Interesting
|
||||
*/
|
||||
class MPU9150 {
|
||||
@ -129,7 +129,7 @@ class MPU9150 {
|
||||
* @param bus number of used bus
|
||||
* @param devAddr addres of used i2c device
|
||||
*/
|
||||
MPU9150 (int bus, int devAddr);
|
||||
MPU9150 (int bus=0, int devAddr=0x68);
|
||||
|
||||
/**
|
||||
* MPU9150 object destructor, basicaly it close i2c connection.
|
||||
|
@ -47,7 +47,7 @@ namespace upm {
|
||||
*
|
||||
* This file defines the MY9221 C++ interface for libmy9221
|
||||
*
|
||||
* @ingroup my9221
|
||||
* @ingroup my9221 gpio
|
||||
* @snippet led-bar.cxx Interesting
|
||||
*/
|
||||
class MY9221 {
|
||||
|
@ -33,7 +33,7 @@ namespace upm {
|
||||
*
|
||||
* This file defines the ES08A C++ interface for libes08a
|
||||
*
|
||||
* @ingroup servo
|
||||
* @ingroup servo pwm
|
||||
* @snippet es08a.cxx Interesting
|
||||
*/
|
||||
class ES08A : public Servo {
|
||||
|
@ -503,7 +503,7 @@ const unsigned char font[] = {
|
||||
*
|
||||
* This file defines the ST7735 C++ interface for libst7735
|
||||
*
|
||||
* @ingroup st7735
|
||||
* @ingroup st7735 spi
|
||||
* @snippet st7735.cxx Interesting
|
||||
*/
|
||||
class ST7735 : public GFX {
|
||||
|
@ -51,7 +51,7 @@ namespace upm {
|
||||
*
|
||||
* This file defines the stepmotor C++ interface for libstepmotor
|
||||
*
|
||||
* @ingroup stepmotor
|
||||
* @ingroup stepper pwm
|
||||
* @snippet stepmotor.cxx Interesting
|
||||
*/
|
||||
class StepMotor {
|
||||
@ -59,8 +59,8 @@ class StepMotor {
|
||||
/**
|
||||
* Instanciates a StepMotor object
|
||||
*
|
||||
* @param dirPin direction pin
|
||||
* @param stePin steper pulse pin
|
||||
* @param dirPin direction GPIO pin
|
||||
* @param stePin steper pulse PWM pin
|
||||
*/
|
||||
StepMotor (int dirPin, int stePin);
|
||||
|
||||
|
@ -114,6 +114,7 @@ typedef struct {
|
||||
*
|
||||
* This file defines the TCS3414CS C++ interface for libtcs3414cs
|
||||
*
|
||||
* @ingroup tcs3414cs i2c
|
||||
* @snippet tcs3414cs-example.cxx Interesting
|
||||
*/
|
||||
class TCS3414CS {
|
||||
|
@ -56,7 +56,7 @@ namespace upm {
|
||||
*
|
||||
* This file defines the TM1637 C++ interface for lib4digitdisplay
|
||||
*
|
||||
* @ingroup tm1637
|
||||
* @ingroup tm1637 gpio
|
||||
* @snippet 4digitdisplay.cxx Interesting
|
||||
*
|
||||
* A
|
||||
|
57
src/upm.h
Normal file
57
src/upm.h
Normal file
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Author: Brendan Le Foll <brendan.le.foll@intel.com>
|
||||
* Copyright (c) 2014 Intel Corporation.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
/// @cond DEV
|
||||
/**
|
||||
* This file only serves to describe sensor groups based on libmraa groups.
|
||||
* Sensors may belong to multiple groups. This is purely a documentation header
|
||||
* and is not meant to be installed anywhere.
|
||||
*/
|
||||
/// @endcond DEV
|
||||
|
||||
/**
|
||||
* @brief Sensors requiring an ADC value to be read
|
||||
* @defgroup analog Analog Sensors
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Modules using the i2c bus
|
||||
* @defgroup i2c I2c
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Modules using the SPI bus
|
||||
* @defgroup spi SPI
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Modules using GPIOs directly
|
||||
* @defgroup gpio GPIO
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Modules using a PWM capable GPIO pin
|
||||
* @defgroup pwm PWM
|
||||
*/
|
Loading…
x
Reference in New Issue
Block a user