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:
Brendan Le Foll 2014-10-02 10:28:29 +01:00
parent 79e8a261ba
commit 397af51d7c
33 changed files with 97 additions and 39 deletions

View File

@ -49,7 +49,7 @@ namespace upm {
/** /**
* @brief C++ API for ECS1030 (electricity sensor) * @brief C++ API for ECS1030 (electricity sensor)
* *
* @ingroup ecs1030 * @ingroup ecs1030 analog
* @snippet ecs1030.cxx Interesting * @snippet ecs1030.cxx Interesting
*/ */

View File

@ -36,7 +36,7 @@ namespace upm {
* Hydrogen, smoke and other combustible gases. It's a medium sensitivity * Hydrogen, smoke and other combustible gases. It's a medium sensitivity
* sensor with a detect concentration of 300-10000ppm. * sensor with a detect concentration of 300-10000ppm.
* *
* @ingroup gas * @ingroup gas analog
* @snippet mq2.cxx Interesting * @snippet mq2.cxx Interesting
* @image html grovegas.jpeg * @image html grovegas.jpeg
*/ */

View File

@ -36,7 +36,7 @@ namespace upm {
* highly sensitive but has a long warmup time of about 1minute. It's * highly sensitive but has a long warmup time of about 1minute. It's
* detect rate is of 0.04-4mg/L Alcohol. * detect rate is of 0.04-4mg/L Alcohol.
* *
* @ingroup gas * @ingroup gas analog
* @snippet mq3.cxx Interesting * @snippet mq3.cxx Interesting
* @image html grovegas.jpeg * @image html grovegas.jpeg
*/ */

View File

@ -36,7 +36,7 @@ namespace upm {
* on. It is highly sensitive and has a detection concentration of * on. It is highly sensitive and has a detection concentration of
* 300-10000ppm. * 300-10000ppm.
* *
* @ingroup gas * @ingroup gas analog
* @snippet mq5.cxx Interesting * @snippet mq5.cxx Interesting
* @image html grovegas.jpeg * @image html grovegas.jpeg
*/ */

View File

@ -35,7 +35,7 @@ namespace upm {
* home and industry). It can detect Carbon Monoxide, Coal Gas and * home and industry). It can detect Carbon Monoxide, Coal Gas and
* Liquefied Gas. It's sensitivty is 10-1000ppmCO 100-10000PPm Gas. * Liquefied Gas. It's sensitivty is 10-1000ppmCO 100-10000PPm Gas.
* *
* @ingroup gas * @ingroup gas analog
* @snippet mq9.cxx Interesting * @snippet mq9.cxx Interesting
* @image html mq9.jpeg * @image html mq9.jpeg
*/ */

View File

@ -49,7 +49,7 @@ class Grove {
* *
* Very basic UPM module for grove LED, or any LED for that matter * Very basic UPM module for grove LED, or any LED for that matter
* *
* @ingroup grove * @ingroup grove gpio
* @snippet groveled.cxx Interesting * @snippet groveled.cxx Interesting
*/ */
class GroveLed: public Grove { class GroveLed: public Grove {
@ -68,7 +68,7 @@ class GroveLed: public Grove {
* *
* Very basic UPM module for grove temperature sensor on analog * Very basic UPM module for grove temperature sensor on analog
* *
* @ingroup grove * @ingroup grove analog
* @snippet grovetemp.cxx Interesting * @snippet grovetemp.cxx Interesting
*/ */
class GroveTemp: public Grove { class GroveTemp: public Grove {
@ -104,7 +104,7 @@ class GroveTemp: public Grove {
* *
* Very basic UPM module for grove Light sensor on analog * Very basic UPM module for grove Light sensor on analog
* *
* @ingroup grove * @ingroup grove analog
* @snippet grovelight.cxx Interesting * @snippet grovelight.cxx Interesting
*/ */
class GroveLight: public Grove { class GroveLight: public Grove {

View File

@ -73,7 +73,7 @@ namespace upm {
* is a high precision, ultra-low power consumption pressure sensor. It has a * is a high precision, ultra-low power consumption pressure sensor. It has a
* range of between 30,000 and 110,000 Pa. * range of between 30,000 and 110,000 Pa.
* *
* @ingroup gy65 * @ingroup gy65 i2c
* @snippet gy65.cxx Interesting * @snippet gy65.cxx Interesting
* @image html bmp085.jpeg * @image html bmp085.jpeg
*/ */

View File

@ -47,7 +47,7 @@ namespace upm {
* *
* This file defines the HCSR04 C++ interface for libhcsr04 * This file defines the HCSR04 C++ interface for libhcsr04
* *
* @ingroup hcsr04 * @ingroup hcsr04 gpio
* @snippet hcsr04.cxx Interesting * @snippet hcsr04.cxx Interesting
*/ */
class HCSR04 { class HCSR04 {

View File

@ -43,7 +43,7 @@ namespace upm {
* all done through an I2C interface. Different breakout boards are available, * all done through an I2C interface. Different breakout boards are available,
* typically a 3V supply is all that is needed to power the sensor. * typically a 3V supply is all that is needed to power the sensor.
* *
* @ingroup hmc5883l * @ingroup hmc5883l i2c
* @snippet hmc5883l.cxx Interesting * @snippet hmc5883l.cxx Interesting
* @image html hmc5883l.jpeg * @image html hmc5883l.jpeg
*/ */
@ -53,7 +53,6 @@ public:
* Creates a Hmc5883l object * Creates a Hmc5883l object
* *
* @param bus number of used i2c bus * @param bus number of used i2c bus
*
*/ */
Hmc5883l(int bus); Hmc5883l(int bus);

View File

@ -41,7 +41,7 @@ namespace upm {
* button could be treated as normal GPIO, this enables easier * button could be treated as normal GPIO, this enables easier
* interrupt support * interrupt support
* *
* @ingroup joystick * @ingroup joystick analog
* @snippet joystick12-example.cxx Interesting * @snippet joystick12-example.cxx Interesting
*/ */
class Joystick12 { class Joystick12 {

View File

@ -38,7 +38,7 @@ namespace upm {
* [Grove LCD RGB Backlight v2.0 display] * [Grove LCD RGB Backlight v2.0 display]
* (http://www.seeedstudio.com/depot/Grove-LCD-RGB-Backlight-p-1643.html?cPath=34_36) * (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 * @snippet rgb-lcd.cxx Interesting
* @image html grovergblcd.jpeg * @image html grovergblcd.jpeg
*/ */

View File

@ -42,7 +42,7 @@ namespace upm {
* [TC1602A-01T](https://www.adafruit.com/datasheets/TC1602A-01T.pdf) seems to * [TC1602A-01T](https://www.adafruit.com/datasheets/TC1602A-01T.pdf) seems to
* the best documented example. * the best documented example.
* *
* @ingroup i2clcd * @ingroup i2clcd i2c
* @snippet lcm-lcd.cxx Interesting * @snippet lcm-lcd.cxx Interesting
* @image html lcm1602.jpeg * @image html lcm1602.jpeg
*/ */

View File

@ -42,7 +42,7 @@ namespace upm {
* (http://www.seeedstudio.com/wiki/Grove_-_OLED_Display_0.96%22) * (http://www.seeedstudio.com/wiki/Grove_-_OLED_Display_0.96%22)
* which is an OLED monochrome display * which is an OLED monochrome display
* *
* @ingroup i2clcd * @ingroup i2clcd i2c
* @snippet oled-1308.cxx Interesting * @snippet oled-1308.cxx Interesting
* @image html ssd1308.jpeg * @image html ssd1308.jpeg
*/ */

View File

@ -42,7 +42,7 @@ namespace upm {
* (http://www.seeedstudio.com/wiki/Grove_-_OLED_Display_1.12%22) * (http://www.seeedstudio.com/wiki/Grove_-_OLED_Display_1.12%22)
* which is an OLED monochrome display * which is an OLED monochrome display
* *
* @ingroup i2clcd * @ingroup i2clcd i2c
* @snippet oled-1327.cxx Interesting * @snippet oled-1327.cxx Interesting
* @image html ssd1327.jpeg * @image html ssd1327.jpeg
*/ */

View File

@ -43,7 +43,7 @@ namespace upm {
* *
* This file defines the LoL API and implemntation for a simple framebuffer * This file defines the LoL API and implemntation for a simple framebuffer
* *
* @ingroup lol * @ingroup lol gpio
* @snippet lol-example.cxx Interesting * @snippet lol-example.cxx Interesting
*/ */
class LoL { class LoL {

View File

@ -43,7 +43,7 @@ namespace upm {
* *
* The FastPixel lpd8806 is an RGB led strip controller. * The FastPixel lpd8806 is an RGB led strip controller.
* *
* @ingroup lpd8806 * @ingroup lpd8806 spi
* @snippet lpd8806.cxx Interesting * @snippet lpd8806.cxx Interesting
* @image html lpd8806.jpeg * @image html lpd8806.jpeg
*/ */

View File

@ -74,7 +74,7 @@ namespace upm {
* module that is used over i2c. The magnometer and acceleromter are accessed * module that is used over i2c. The magnometer and acceleromter are accessed
* at two seperate i2c addresses. * at two seperate i2c addresses.
* *
* @ingroup lsm303 * @ingroup lsm303 i2c
* @snippet lsm303.cxx Interesting * @snippet lsm303.cxx Interesting
* @image html lsm303.jpeg * @image html lsm303.jpeg
*/ */

View File

@ -48,7 +48,7 @@ namespace upm {
* module](http://datasheets.maximintegrated.com/en/ds/MAX31723PMB1.pdf) from * module](http://datasheets.maximintegrated.com/en/ds/MAX31723PMB1.pdf) from
* the analog PMOD kit. * the analog PMOD kit.
* *
* @ingroup max31723 * @ingroup max31723 spi
* @snippet max31723.cxx Interesting * @snippet max31723.cxx Interesting
* @image html max31723.jpeg * @image html max31723.jpeg
*/ */

View File

@ -45,7 +45,7 @@ namespace upm {
* (http://datasheets.maximintegrated.com/en/ds/MAX31855PMB1.pdf) from the * (http://datasheets.maximintegrated.com/en/ds/MAX31855PMB1.pdf) from the
* analog PMOD kit. * analog PMOD kit.
* *
* @ingroup max31855 * @ingroup max31855 spi
* @snippet max31855.cxx Interesting * @snippet max31855.cxx Interesting
* @image html max31855.jpeg * @image html max31855.jpeg
*/ */

View File

@ -68,6 +68,7 @@ namespace upm {
* (http://datasheets.maximintegrated.com/en/ds/MAX44000PMB1.pdf) from the * (http://datasheets.maximintegrated.com/en/ds/MAX44000PMB1.pdf) from the
* analog PMOD kit. * analog PMOD kit.
* *
* @ingroup max44000 i2c
* @snippet max44000.cxx Interesting * @snippet max44000.cxx Interesting
* @image html max44000.jpeg * @image html max44000.jpeg
*/ */

View File

@ -48,7 +48,7 @@ namespace upm {
* PMOD module](http://datasheets.maximintegrated.com/en/ds/MAX5487PMB1.pdf) * PMOD module](http://datasheets.maximintegrated.com/en/ds/MAX5487PMB1.pdf)
* from the analog PMOD kit. * from the analog PMOD kit.
* *
* @ingroup max5847 * @ingroup max5847 spi
* @snippet max5487.cxx Interesting * @snippet max5487.cxx Interesting
* @image html max5487.jpeg * @image html max5487.jpeg
*/ */

View File

@ -70,7 +70,7 @@ struct Time3231 {
/** /**
* @brief C++ API for MAXDS3231M chip (Ambient and Infrared Proximity Sensor) * @brief C++ API for MAXDS3231M chip (Ambient and Infrared Proximity Sensor)
* *
* @ingroup maxds3231m * @ingroup maxds3231m i2c
*/ */
class MAXDS3231M { class MAXDS3231M {
public: public:
@ -80,7 +80,7 @@ class MAXDS3231M {
* @param bus number of used bus * @param bus number of used bus
* @param devAddr addres of used i2c device * @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. * MAXDS3231M object destructor, basicaly it close i2c connection.

View File

@ -45,7 +45,7 @@ namespace upm {
* *
* This file defines the Microphone Analog sensor * This file defines the Microphone Analog sensor
* *
* @ingroup mic * @ingroup mic pwm
* @snippet mic-example.cxx Interesting * @snippet mic-example.cxx Interesting
*/ */
class Microphone { class Microphone {

View File

@ -62,7 +62,7 @@ namespace upm {
* *
* This file defines the MLX90614 C++ interface for libmlx90614 * This file defines the MLX90614 C++ interface for libmlx90614
* *
* @ingroup mlx90641 * @ingroup mlx90641 i2c
* @snippet mlx90641.cxx Interesting * @snippet mlx90641.cxx Interesting
*/ */
class MLX90614 { class MLX90614 {
@ -74,7 +74,7 @@ class MLX90614 {
* @param bus number of used bus * @param bus number of used bus
* @param devAddr addres of used i2c device * @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. * MLX90614 object destructor, basicaly it close i2c connection.

View File

@ -159,7 +159,7 @@ union accelData {
* *
* This file defines the MMA7455 C++ interface for libmma7455 * This file defines the MMA7455 C++ interface for libmma7455
* *
* @ingroup mma7455 * @ingroup mma7455 i2c
* @snippet mma7455.cxx Interesting * @snippet mma7455.cxx Interesting
*/ */
class MMA7455 { class MMA7455 {
@ -170,7 +170,7 @@ class MMA7455 {
* @param bus number of used bus * @param bus number of used bus
* @param devAddr addres of used i2c device * @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. * MMA7455 object destructor, basicaly it close i2c connection.

View File

@ -118,7 +118,7 @@ struct AxisData {
* *
* This file defines the MPU9150 C++ interface for libmpu9150 * This file defines the MPU9150 C++ interface for libmpu9150
* *
* @ingroup mpu9150 * @ingroup mpu9150 i2c
* @snippet mpu9150-example.cxx Interesting * @snippet mpu9150-example.cxx Interesting
*/ */
class MPU9150 { class MPU9150 {
@ -129,7 +129,7 @@ class MPU9150 {
* @param bus number of used bus * @param bus number of used bus
* @param devAddr addres of used i2c device * @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. * MPU9150 object destructor, basicaly it close i2c connection.

View File

@ -47,7 +47,7 @@ namespace upm {
* *
* This file defines the MY9221 C++ interface for libmy9221 * This file defines the MY9221 C++ interface for libmy9221
* *
* @ingroup my9221 * @ingroup my9221 gpio
* @snippet led-bar.cxx Interesting * @snippet led-bar.cxx Interesting
*/ */
class MY9221 { class MY9221 {

View File

@ -33,7 +33,7 @@ namespace upm {
* *
* This file defines the ES08A C++ interface for libes08a * This file defines the ES08A C++ interface for libes08a
* *
* @ingroup servo * @ingroup servo pwm
* @snippet es08a.cxx Interesting * @snippet es08a.cxx Interesting
*/ */
class ES08A : public Servo { class ES08A : public Servo {

View File

@ -503,7 +503,7 @@ const unsigned char font[] = {
* *
* This file defines the ST7735 C++ interface for libst7735 * This file defines the ST7735 C++ interface for libst7735
* *
* @ingroup st7735 * @ingroup st7735 spi
* @snippet st7735.cxx Interesting * @snippet st7735.cxx Interesting
*/ */
class ST7735 : public GFX { class ST7735 : public GFX {

View File

@ -51,7 +51,7 @@ namespace upm {
* *
* This file defines the stepmotor C++ interface for libstepmotor * This file defines the stepmotor C++ interface for libstepmotor
* *
* @ingroup stepmotor * @ingroup stepper pwm
* @snippet stepmotor.cxx Interesting * @snippet stepmotor.cxx Interesting
*/ */
class StepMotor { class StepMotor {
@ -59,8 +59,8 @@ class StepMotor {
/** /**
* Instanciates a StepMotor object * Instanciates a StepMotor object
* *
* @param dirPin direction pin * @param dirPin direction GPIO pin
* @param stePin steper pulse pin * @param stePin steper pulse PWM pin
*/ */
StepMotor (int dirPin, int stePin); StepMotor (int dirPin, int stePin);

View File

@ -114,6 +114,7 @@ typedef struct {
* *
* This file defines the TCS3414CS C++ interface for libtcs3414cs * This file defines the TCS3414CS C++ interface for libtcs3414cs
* *
* @ingroup tcs3414cs i2c
* @snippet tcs3414cs-example.cxx Interesting * @snippet tcs3414cs-example.cxx Interesting
*/ */
class TCS3414CS { class TCS3414CS {

View File

@ -56,7 +56,7 @@ namespace upm {
* *
* This file defines the TM1637 C++ interface for lib4digitdisplay * This file defines the TM1637 C++ interface for lib4digitdisplay
* *
* @ingroup tm1637 * @ingroup tm1637 gpio
* @snippet 4digitdisplay.cxx Interesting * @snippet 4digitdisplay.cxx Interesting
* *
* A * A

57
src/upm.h Normal file
View 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
*/