mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
docs: more header files edited
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
parent
55e8076988
commit
04edb9be04
@ -50,7 +50,7 @@ namespace upm {
|
||||
*
|
||||
* @brief UPM module for the AD8232 Heart Rate Monitor
|
||||
*
|
||||
* Note: this sensor must be driven at 3.3v only.
|
||||
* Note: this sensor must be driven at 3.3V only.
|
||||
*
|
||||
* This module simply spits out the ADC values reported by the sensor, with
|
||||
* the intent to send that data, via serial or network port, somewhere to
|
||||
@ -58,7 +58,7 @@ namespace upm {
|
||||
* you, like an EKG.
|
||||
*
|
||||
* Processing (https://www.processing.org/) is software
|
||||
* that should work, using information from the SparkFun website.
|
||||
* that should work, using information from the SparkFun* website.
|
||||
*
|
||||
* This example just dumps the raw data:
|
||||
*
|
||||
|
@ -58,7 +58,7 @@ namespace upm {
|
||||
* can be connected to this Motor Shield.
|
||||
* Note: the two servo connections are not controlled by the PCA9685
|
||||
* controller (or this class). They are connected directly to digital
|
||||
* PWM pins 9 and 10 on the Arduino breakout board.
|
||||
* PWM pins 9 and 10 on the Arduino* breakout board.
|
||||
*
|
||||
* @image html adafruitms1438.jpg
|
||||
* An example using a DC motor connected to M3
|
||||
|
@ -49,9 +49,9 @@ namespace upm {
|
||||
* ADXL345 is a 3-axis digital accelerometer.
|
||||
* (http://www.seeedstudio.com/wiki/images/2/2c/ADXL345_datasheet.pdf)
|
||||
* The sensor has configurable resolutions to measure ±2g, ±4g, ±8g, or ±16g.
|
||||
* Note: the sensor is incompatible with and not detected on the I2C bus
|
||||
* by the Intel(R) Edison using an Arduino breakout board at 5V (3V works
|
||||
* fine).
|
||||
* Note: The Grove* version of the sensor is incompatible with and not detected
|
||||
* on the I2C bus by the Intel(R) Edison using an Arduino* breakout board at 5V
|
||||
* (3V works fine).
|
||||
*
|
||||
* @image html adxl345.jpeg
|
||||
* @snippet adxl345.cxx Interesting
|
||||
|
@ -35,7 +35,7 @@
|
||||
namespace upm
|
||||
{
|
||||
/**
|
||||
* @brief Atmel AT42QT1070 QTouch* Sensor library
|
||||
* @brief Atmel* AT42QT1070 QTouch* Sensor library
|
||||
* @defgroup at42qt1070 libupm-at42qt1070
|
||||
* @ingroup seeed i2c touch
|
||||
*/
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
namespace upm {
|
||||
/**
|
||||
* @brief BISS0001 motion sensor library
|
||||
* @brief BISS0001 Motion Sensor library
|
||||
* @defgroup biss0001 libupm-biss0001
|
||||
* @ingroup seeed gpio light tsk
|
||||
*/
|
||||
@ -56,17 +56,17 @@ namespace upm {
|
||||
/**
|
||||
* BISS0001 motion sensor constructor
|
||||
*
|
||||
* @param pin digital pin to use
|
||||
* @param pin Digital pin to use
|
||||
*/
|
||||
BISS0001(int pin);
|
||||
/**
|
||||
* BISS0001 Destructor
|
||||
* BISS0001 destructor
|
||||
*/
|
||||
~BISS0001();
|
||||
/**
|
||||
* Get the motion value from the sensor
|
||||
* Gets the motion value from the sensor
|
||||
*
|
||||
* @return the motion reading
|
||||
* @return Motion reading
|
||||
*/
|
||||
bool value();
|
||||
|
||||
|
@ -62,7 +62,7 @@
|
||||
namespace upm {
|
||||
|
||||
/**
|
||||
* @brief Bosch BMP & GY65 atmospheric pressure sensor library
|
||||
* @brief Bosch BMP & GY65 Atmospheric Pressure Sensor library
|
||||
* @defgroup bmpx8x libupm-bmpx8x
|
||||
* @ingroup seeed adafruit sparkfun i2c pressure
|
||||
*/
|
||||
@ -76,11 +76,11 @@ namespace upm {
|
||||
* @man seeed adafruit sparkfun
|
||||
* @con i2c
|
||||
*
|
||||
* @brief API for GY65/BMP085 and BMP180 chips (Atmospheric Pressure Sensor)
|
||||
* @brief API for the GY65/BMP085 and BMP180 Atmospheric Pressure Sensors
|
||||
*
|
||||
* The Bosch GY65/BMP085 and BMP180 are high precision, ultra-low
|
||||
* power consumption pressure sensors. They have a range of between
|
||||
* 30,000 and 110,000 Pa.
|
||||
* Bosch GY65/BMP085 and BMP180 are high-precision, ultra-low
|
||||
* power consumption pressure sensors. They operate in the range of
|
||||
* 30,000-110,000 Pa.
|
||||
*
|
||||
* This module has been tested on the GY65/BMP085 and BMP180 sensors.
|
||||
*
|
||||
@ -91,80 +91,80 @@ namespace upm {
|
||||
class BMPX8X {
|
||||
public:
|
||||
/**
|
||||
* Instanciates a BMPX8X object
|
||||
* Instantiates a BMPX8X object
|
||||
*
|
||||
* @param bus number of used bus
|
||||
* @param devAddr address of used i2c device
|
||||
* @param bus Number of the used bus
|
||||
* @param devAddr Address of the used I2C device
|
||||
* @param mode BMP085 mode
|
||||
*/
|
||||
BMPX8X (int bus, int devAddr=0x77, uint8_t mode=BMP085_ULTRAHIGHRES);
|
||||
|
||||
/**
|
||||
* BMPX8X object destructor, basicaly it close i2c connection.
|
||||
* BMPX8X object destructor; basically, it closes the I2C connection.
|
||||
*/
|
||||
~BMPX8X ();
|
||||
|
||||
/**
|
||||
* Return calculated pressure
|
||||
* Returns the calculated pressure
|
||||
*/
|
||||
int32_t getPressure ();
|
||||
|
||||
/**
|
||||
*
|
||||
* Get raw pressure data
|
||||
* Gets raw pressure data
|
||||
*/
|
||||
int32_t getPressureRaw ();
|
||||
|
||||
/**
|
||||
* Get raw temperature data from chip
|
||||
* Gets raw temperature data from the sensor
|
||||
*/
|
||||
int16_t getTemperatureRaw ();
|
||||
|
||||
/**
|
||||
* Return calculated temperature
|
||||
* Returns the calculated temperature
|
||||
*/
|
||||
float getTemperature ();
|
||||
|
||||
/**
|
||||
* With given absolute altitude sea level can be calculated
|
||||
* With a given absolute altitude, sea level can be calculated
|
||||
*
|
||||
* @param altitudeMeters altitude
|
||||
* @param altitudeMeters Altitude
|
||||
*/
|
||||
int32_t getSealevelPressure(float altitudeMeters = 0);
|
||||
|
||||
/**
|
||||
* With given sea level altitude in meters can be calculated
|
||||
* With a given sea level, altitude in meters can be calculated
|
||||
*
|
||||
* @param sealevelPressure Sea level
|
||||
*/
|
||||
float getAltitude (float sealevelPressure = 101325);
|
||||
|
||||
/**
|
||||
* Calculation of B5 (check spec for more information)
|
||||
* Calculates B5 (check the spec for more information)
|
||||
*
|
||||
* @param UT
|
||||
*/
|
||||
int32_t computeB5 (int32_t UT);
|
||||
|
||||
/**
|
||||
* Read two bytes register
|
||||
* Reads a two-byte register
|
||||
*
|
||||
* @param reg address of a register
|
||||
* @param reg Address of the register
|
||||
*/
|
||||
uint16_t i2cReadReg_16 (int reg);
|
||||
|
||||
/**
|
||||
* Write to one byte register
|
||||
* Writes to a one-byte register
|
||||
*
|
||||
* @param reg address of a register
|
||||
* @param value byte to be written
|
||||
* @param reg Address of the register
|
||||
* @param value Byte to be written
|
||||
*/
|
||||
mraa_result_t i2cWriteReg (uint8_t reg, uint8_t value);
|
||||
|
||||
/**
|
||||
* Read one byte register
|
||||
* Reads a one-byte register
|
||||
*
|
||||
* @param reg address of a register
|
||||
* @param reg Address of the register
|
||||
*/
|
||||
uint8_t i2cReadReg_8 (int reg);
|
||||
|
||||
|
@ -51,7 +51,7 @@ namespace upm {
|
||||
* @con pwm
|
||||
* @kit gsk
|
||||
*
|
||||
* @brief API for Buzzer component
|
||||
* @brief API for the Buzzer component
|
||||
*
|
||||
* This file defines the Buzzer interface for libbuzzer.
|
||||
* This sensor can make different tones when connected to
|
||||
@ -77,42 +77,42 @@ class Buzzer {
|
||||
~Buzzer ();
|
||||
|
||||
/**
|
||||
* Play a tone for a certain amount of time or indefinitely. When delay
|
||||
* Plays a tone for a certain amount of time or indefinitely. When delay
|
||||
* is not used, the sound can be stopped by calling stopSound().
|
||||
*
|
||||
* @param note the note to be played (DO, RE, MI, etc...) or frequency
|
||||
* @param delay time in microseconds for playing the sound, a value of
|
||||
* 0 plays the sound indefinitely
|
||||
* @param note Note to play (C, D, E, etc.) or frequency
|
||||
* @param delay Time in microseconds for which to play the sound; if the value is
|
||||
* 0, the sound is played indefinitely
|
||||
*
|
||||
* @return the note played
|
||||
* @return Note played
|
||||
*/
|
||||
int playSound (int note, int delay);
|
||||
|
||||
/**
|
||||
* Stops the sound currently playing. Has to be called when playSound()
|
||||
* does not set a delay value.
|
||||
* Stops the sound currently playing. Should be called when playSound()
|
||||
* does not have a delay value.
|
||||
*/
|
||||
void stopSound();
|
||||
|
||||
/**
|
||||
* Sets the volume for the buzzer, but may affect the sound timbre.
|
||||
* Works best with halved values, e.g. 1.0, 0.5, 0.25, ...
|
||||
* Works best with halved values; e.g., 1.0, 0.5, 0.25, etc.
|
||||
*
|
||||
* @param vol the value to set the volume to from 0.0 to 1.0
|
||||
* @param vol Value to set the volume to, from 0.0 to 1.0
|
||||
*/
|
||||
void setVolume(float vol);
|
||||
|
||||
/**
|
||||
* Gets the buzzer volume.
|
||||
*
|
||||
* @return the value the volume was set to
|
||||
* @return Value the volume was set to
|
||||
*/
|
||||
float getVolume();
|
||||
|
||||
/**
|
||||
* Return name of the component.
|
||||
* Returns the name of the sensor.
|
||||
*
|
||||
* @return name of the sensor
|
||||
* @return Name of the sensor
|
||||
*/
|
||||
std::string name()
|
||||
{
|
||||
|
@ -44,11 +44,11 @@ namespace upm {
|
||||
*
|
||||
* @brief API for the CJQ4435 MOSFET
|
||||
*
|
||||
* UPM module for the CJQ4435 MOSFET. It was developed using the
|
||||
* UPM module for the CJQ4435 MOSFET. It was developed using the
|
||||
* Grove MOSFET module. A MOSFET is like a switch, but it can
|
||||
* switch much faster than a mechanical relay. Here, we implement
|
||||
* support via MRAA's PWM (Pulse Width Modulation) functions.
|
||||
* Please note, that the available periods will vary depending on
|
||||
* support via MRAA pulse width modulation (PWM) functions.
|
||||
* Note: available periods vary depending on
|
||||
* the capabilities of your device.
|
||||
*
|
||||
* @image html cjq4435.jpg
|
||||
@ -59,60 +59,60 @@ namespace upm {
|
||||
/**
|
||||
* CJQ4435 constructor
|
||||
*
|
||||
* @param pin digital pin to use - this pin must be PWM capable
|
||||
* @param pin Digital pin to use; this pin must be PWM-capable
|
||||
*/
|
||||
CJQ4435(int pin);
|
||||
|
||||
/**
|
||||
* CJQ4435 Destructor
|
||||
* CJQ4435 destructor
|
||||
*/
|
||||
~CJQ4435();
|
||||
|
||||
/**
|
||||
* set the period in microseconds
|
||||
* Sets a period in microseconds
|
||||
*
|
||||
* @param us period in microseconds
|
||||
* @param us Period in microseconds
|
||||
*/
|
||||
void setPeriodUS(int us);
|
||||
|
||||
/**
|
||||
* set the period in milliseconds
|
||||
* Sets a period in milliseconds
|
||||
*
|
||||
* @param ms period in milliseconds
|
||||
* @param ms Period in milliseconds
|
||||
*/
|
||||
void setPeriodMS(int ms);
|
||||
|
||||
/**
|
||||
* set the period in seconds
|
||||
* Sets a period in seconds
|
||||
*
|
||||
* @param seconds period in seconds
|
||||
* @param seconds Period in seconds
|
||||
*/
|
||||
void setPeriodSeconds(float seconds);
|
||||
|
||||
/**
|
||||
* enable output
|
||||
* Enables output
|
||||
*
|
||||
* @param enable enable PWM output if true, disable if false
|
||||
* @param enable Enables PWM output if true, disables otherwise
|
||||
*/
|
||||
void enable(bool enable);
|
||||
|
||||
/**
|
||||
* set the duty cycle. The duty cycle is a floating point number
|
||||
* between 0.0 (always off) to 1.0 (always on). It represents how
|
||||
* much time as a percentage, per period, that the output will be
|
||||
* Sets a duty cycle. Duty cycle is a floating-point number
|
||||
* between 0.0 (always off) and 1.0 (always on). It represents a
|
||||
* proportion of time, per period, during which the output is
|
||||
* driven high.
|
||||
*
|
||||
* @param dutyCycle the duty cycle to use
|
||||
* @param dutyCycle Duty cycle to use
|
||||
*/
|
||||
void setDutyCycle(float dutyCycle);
|
||||
|
||||
/**
|
||||
* a shortcut for turning the output to continuous on (high)
|
||||
* Shortcut to turn the output to continuous on (high)
|
||||
*/
|
||||
void on();
|
||||
|
||||
/**
|
||||
* a shortcut for turning the output to continuous off (low)
|
||||
* Shortcut to turn the output to continuous off (low)
|
||||
*/
|
||||
void off();
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
||||
|
||||
namespace upm {
|
||||
/**
|
||||
* @brief DS1307 real-time clock library
|
||||
* @brief DS1307 Real-Time Clock library
|
||||
* @defgroup ds1307 libupm-ds1307
|
||||
* @ingroup seeed i2c time
|
||||
*/
|
||||
@ -57,11 +57,11 @@ namespace upm {
|
||||
* @man seeed
|
||||
* @con i2c
|
||||
*
|
||||
* @brief API for the DS1307 Real Time CLock
|
||||
* @brief API for the DS1307 Real-Time CLock
|
||||
*
|
||||
* UPM module for the DS1307 based RTC. The clock can provide information
|
||||
* about the seconds, minutes, hours, day of the week, day of the month,
|
||||
* month, and year. It can operate in either 24-hour or 12-hour format.
|
||||
* UPM module for the DS1307-based real-time clock. The clock can provide information
|
||||
* about seconds, minutes, hours, day of the week, day of the month,
|
||||
* month, and year. It can operate in either a 24-hour or a 12-hour format.
|
||||
* This device can also output a square wave at 1Khz, 4Khz, 8Khz, and 32Khz.
|
||||
* However, this capability is not implemented in this module.
|
||||
*
|
||||
@ -71,41 +71,41 @@ namespace upm {
|
||||
class DS1307 {
|
||||
public:
|
||||
/**
|
||||
* ds1307 Real Time Clock constructor
|
||||
* DS1307 constructor
|
||||
*
|
||||
* @param bus i2c bus to use
|
||||
* @param bus I2C bus to use
|
||||
*/
|
||||
DS1307(int bus);
|
||||
|
||||
/**
|
||||
* DS1307 Destructor
|
||||
* DS1307 destructor
|
||||
*/
|
||||
~DS1307();
|
||||
|
||||
/**
|
||||
* Load all of the time values
|
||||
* Loads all the time values
|
||||
*
|
||||
* @return True if time data loaded successfully
|
||||
*/
|
||||
bool loadTime();
|
||||
|
||||
/**
|
||||
* Set the time. You should call loadTime() beforehand to
|
||||
* Sets the time. You should call loadTime() beforehand to
|
||||
* maintain consistency
|
||||
*
|
||||
* @return True if time saved successfully
|
||||
* @return True if time is set successfully
|
||||
*/
|
||||
bool setTime();
|
||||
|
||||
/**
|
||||
* Enable the oscillator on the clock.
|
||||
* Enables an oscillator on the clock.
|
||||
*
|
||||
* @return 0 (MRAA_SUCCESS) if successful; non-zero otherwise
|
||||
*/
|
||||
mraa_result_t enableClock();
|
||||
|
||||
/**
|
||||
* Disable the oscillator on the clock. This will prevent the clock
|
||||
* Disables the oscillator on the clock. This prevents the clock
|
||||
* from updating any time/date values
|
||||
*
|
||||
* @return 0 (MRAA_SUCCESS) if successful; non-zero otherwise
|
||||
@ -113,80 +113,80 @@ namespace upm {
|
||||
mraa_result_t disableClock();
|
||||
|
||||
/**
|
||||
* Write value(s) into registers
|
||||
* Writes value(s) into registers
|
||||
*
|
||||
* @param reg register location to start writing into
|
||||
* @param buffer buffer for data storage
|
||||
* @param len number of bytes to write
|
||||
* @param reg Register location to start writing into
|
||||
* @param buffer Buffer for data storage
|
||||
* @param len Number of bytes to write
|
||||
* @return 0 (MRAA_SUCCESS) if successful; non-zero otherwise
|
||||
*/
|
||||
mraa_result_t writeBytes(uint8_t reg, uint8_t *buffer, unsigned int len);
|
||||
|
||||
/**
|
||||
* Read value(s) from registers
|
||||
* Reads value(s) from registers
|
||||
*
|
||||
* @param reg register location to start reading from
|
||||
* @param buffer buffer for data storage
|
||||
* @param len number of bytes to read
|
||||
* @return number of bytes read
|
||||
* @param reg Register location to start reading from
|
||||
* @param buffer Buffer for data storage
|
||||
* @param len Number of bytes to read
|
||||
* @return Number of bytes read
|
||||
*/
|
||||
uint8_t readBytes(uint8_t reg, uint8_t *buffer, unsigned int len);
|
||||
|
||||
/**
|
||||
* Convert a BCD value into decimal
|
||||
* Converts a BCD value into decimal
|
||||
*
|
||||
* @param val BCD value to convert
|
||||
* @return the converted value in decimal
|
||||
* @return Converted decimal value
|
||||
*/
|
||||
unsigned int bcdToDec(uint8_t val);
|
||||
|
||||
/**
|
||||
* Convert a decimal value into BCD
|
||||
* Converts a decimal value into BCD
|
||||
*
|
||||
* @param val decimal value to convert
|
||||
* @return the converted value in BCD
|
||||
* @param val Decimal value to convert
|
||||
* @return Converted BCD value
|
||||
*/
|
||||
uint8_t decToBcd(unsigned int val);
|
||||
|
||||
// These variables store the time data loaded with loadTime(), and
|
||||
// will be the source of data when setTime() is called. It is a
|
||||
// good idea call loadTime() to setup the current values before
|
||||
// are the source of data when setTime() is called. It is a
|
||||
// good idea to call loadTime() to set up the current values before
|
||||
// calling setTime() to ensure RTC data is consistent
|
||||
|
||||
/**
|
||||
* holds the seconds
|
||||
* Holds seconds
|
||||
*/
|
||||
unsigned int seconds;
|
||||
/**
|
||||
* holds the minutes
|
||||
* Holds minutes
|
||||
*/
|
||||
unsigned int minutes;
|
||||
/**
|
||||
* holds the hours, 1-12 in am/pm mode, 0-23 otherwise
|
||||
* Holds hours; 1-12 in the am/pm format, 0-23 otherwise
|
||||
*/
|
||||
unsigned int hours;
|
||||
/**
|
||||
* holds the day of the week, 1-7 where 1 is Sunday
|
||||
* Holds a day of the week; 1-7, where 1 is Sunday
|
||||
*/
|
||||
unsigned int dayOfWeek;
|
||||
/**
|
||||
* holds the day of the month, 1-31
|
||||
* Holds a day of the month, 1-31
|
||||
*/
|
||||
unsigned int dayOfMonth;
|
||||
/**
|
||||
* holds the month, 1-12
|
||||
* Holds a month, 1-12
|
||||
*/
|
||||
unsigned int month;
|
||||
/**
|
||||
* holds the year, 0-99
|
||||
* Holds a year, 0-99
|
||||
*/
|
||||
unsigned int year;
|
||||
/**
|
||||
* True if in AM/PM mode, false if 24h format.
|
||||
* True if the am/pm format is used, false otherwise
|
||||
*/
|
||||
bool amPmMode;
|
||||
/**
|
||||
* If in AmPmMode (12-hr), then this is true if it's PM, clear if AM
|
||||
* For the am/pm format, it is true if it's pm, false otherwise
|
||||
*/
|
||||
bool pm;
|
||||
|
||||
|
@ -61,12 +61,12 @@ namespace upm {
|
||||
* This non-invasive current sensor can be clamped around the supply line of
|
||||
* an electrical load to tell you how much current is passing through it. It
|
||||
* does this by acting as an inductor and responding to the magnetic field
|
||||
* around a current-carrying conductor. This particular current sensor will
|
||||
* measure a load up to 30 Amps which makes it great for building your own
|
||||
* around a current-carrying conductor. This particular current sensor
|
||||
* measures a load up to 30 A, which makes it great for building your own
|
||||
* energy monitors.
|
||||
*
|
||||
* @image html ecs1030.jpg
|
||||
* <br><em>ECS1030 Sensor image provided by Sparkfun under
|
||||
* <br><em>ECS1030 Sensor image provided by SparkFun* under
|
||||
* <a href=https://creativecommons.org/licenses/by-nc-sa/3.0/>
|
||||
* CC BY-NC-SA-3.0</a>.</em>
|
||||
*
|
||||
@ -79,39 +79,39 @@ class ECS1030 {
|
||||
static const uint8_t R_LOAD = 2000.0 / CURRENT_RATIO;
|
||||
|
||||
/**
|
||||
* Instanciates a ECS1030 (current sensor) object
|
||||
* Instantiates an ECS1030 object
|
||||
*
|
||||
* @param pinNumber number of the data pin
|
||||
* @param pinNumber Number of the data pin
|
||||
*/
|
||||
ECS1030 (uint8_t pinNumber);
|
||||
|
||||
/**
|
||||
* ECS1030 object destructor, basicaly it close the GPIO.
|
||||
* ECS1030 object destructor; basicaly, it closes the GPIO.
|
||||
*/
|
||||
~ECS1030 ();
|
||||
|
||||
/**
|
||||
* Return currency data for the sampled period
|
||||
* Returns electric current data for a sampled period
|
||||
*/
|
||||
double getCurrency_A ();
|
||||
|
||||
/**
|
||||
* Return power data for the sampled period
|
||||
* Returns power data for a sampled period
|
||||
*/
|
||||
double getPower_A ();
|
||||
|
||||
/**
|
||||
* Return currency data for the sampled period
|
||||
* Returns electric current data for a sampled period
|
||||
*/
|
||||
double getCurrency_B ();
|
||||
|
||||
/**
|
||||
* Return power data for the sampled period
|
||||
* Returns power data for a sampled period
|
||||
*/
|
||||
double getPower_B ();
|
||||
|
||||
/**
|
||||
* Return name of the component
|
||||
* Returns the name of the component
|
||||
*/
|
||||
std::string name() {
|
||||
return m_name;
|
||||
|
@ -46,8 +46,8 @@ namespace upm {
|
||||
*
|
||||
* @brief API for the ENC03R Single Axis Analog Gyro
|
||||
*
|
||||
* UPM module for the ENC03R Single Axis Analog Gyro.
|
||||
* This gyroscope measures the x-axis angular velocity; that is,
|
||||
* UPM module for the ENC03R single axis analog gyro.
|
||||
* This gyroscope measures x-axis angular velocity, that is
|
||||
* how fast the sensor is rotating around the x-axis.
|
||||
* Calibration of the sensor is necessary for accurate readings.
|
||||
*
|
||||
@ -60,45 +60,45 @@ namespace upm {
|
||||
/**
|
||||
* ENC03R sensor constructor
|
||||
*
|
||||
* @param pin analog pin to use
|
||||
* @param vref the voltage reference to use, default 5.0
|
||||
* @param pin Analog pin to use
|
||||
* @param vref Reference voltage to use; default is 5.0 V
|
||||
*/
|
||||
ENC03R(int pin, float vref=5.0);
|
||||
|
||||
/**
|
||||
* ENC03R Destructor
|
||||
* ENC03R destructor
|
||||
*/
|
||||
~ENC03R();
|
||||
|
||||
/**
|
||||
* Calibrate the sensor by determining an analog reading over many
|
||||
* samples with no movement of the sensor. This must be done
|
||||
* Calibrates the sensor by determining an analog reading over many
|
||||
* samples with no movement of the sensor. This must be done
|
||||
* before attempting to use the sensor.
|
||||
*
|
||||
* @param samples the number of samples to use for calibration
|
||||
* @param samples Number of samples to use for calibration
|
||||
*/
|
||||
void calibrate(unsigned int samples);
|
||||
|
||||
/**
|
||||
* Return the raw value of the sensor
|
||||
* Returns the raw value of the sensor
|
||||
*
|
||||
* @return raw value of sensor
|
||||
* @return Raw value of the sensor
|
||||
*/
|
||||
unsigned int value();
|
||||
|
||||
/**
|
||||
* Return the currently stored calibration value
|
||||
* Returns the currently stored calibration value
|
||||
*
|
||||
* @return current calibration value
|
||||
* @return Current calibration value
|
||||
*/
|
||||
float calibrationValue() { return m_calibrationValue; };
|
||||
|
||||
/**
|
||||
* Compute angular velocity based on value and stored calibration
|
||||
* Computes angular velocity based on the value and stored calibration
|
||||
* reference.
|
||||
*
|
||||
* @param val the value to use to compute the angular velocity
|
||||
* @return computed angular velocity
|
||||
* @param val Value to use to compute angular velocity
|
||||
* @return Computed angular velocity
|
||||
*/
|
||||
double angularVelocity(unsigned int val);
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
||||
namespace upm {
|
||||
|
||||
/**
|
||||
* @brief Spectra Symbol Flex sensor library
|
||||
* @brief Spectra Symbol Flex Sensor library
|
||||
* @defgroup flex libupm-flex
|
||||
* @ingroup sparkfun analog flexfor
|
||||
*/
|
||||
@ -43,14 +43,14 @@ namespace upm {
|
||||
* @web https://www.sparkfun.com/products/8606
|
||||
* @con analog
|
||||
*
|
||||
* @brief API for the Spectra Symbol Flex sensor
|
||||
* @brief API for the Spectra Symbol Flex Sensor
|
||||
*
|
||||
* A simple flex sensor, the resistance across the sensor increases when
|
||||
* bent. Patented technology by Spectra Symbol, these sensors were used in
|
||||
* the original Nintendo Power Glove.
|
||||
* A simple flex sensor. The resistance across the sensor increases when
|
||||
* flexed. Patented technology by Spectra Symbol, these sensors were used in
|
||||
* the original Nintendo* Power Glove.
|
||||
*
|
||||
* @image html flex.jpg
|
||||
* <br><em>Flex Sensor image provided by SparkFun under
|
||||
* <br><em>Flex Sensor image provided by SparkFun* under
|
||||
* <a href=https://creativecommons.org/licenses/by-nc-sa/3.0/>
|
||||
* CC BY-NC-SA-3.0</a>.</em>
|
||||
*
|
||||
@ -61,15 +61,15 @@ namespace upm {
|
||||
/**
|
||||
* Flex sensor constructor
|
||||
*
|
||||
* @param pin analog pin to use
|
||||
* @param pin Analog pin to use
|
||||
*/
|
||||
Flex(int pin);
|
||||
/**
|
||||
* Flex Destructor
|
||||
* Flex sensor destructor
|
||||
*/
|
||||
~Flex();
|
||||
/**
|
||||
* @return the analog flex value
|
||||
* @return Analog flex value
|
||||
*/
|
||||
int value();
|
||||
|
||||
|
@ -35,10 +35,10 @@ struct thresholdContext {
|
||||
|
||||
namespace upm {
|
||||
/**
|
||||
* @brief Gas sensor library
|
||||
* @brief Gas Sensor library
|
||||
*
|
||||
* Sensor Library for air quality and gas detecting sensors. Base class Gas provides buffered
|
||||
* sampling, threshold checking, a basic printing function and a standard read function.
|
||||
* Library for air quality and gas detecting sensors. Base class Gas provides buffered
|
||||
* sampling, threshold checking, basic printing function, and standard read function.
|
||||
*
|
||||
* @defgroup gas libupm-gas
|
||||
* @ingroup seeed analog gaseous eak hak
|
||||
@ -48,7 +48,7 @@ class Gas {
|
||||
/**
|
||||
* Instantiates a Gas object
|
||||
*
|
||||
* @param gasPin pin where gas is connected
|
||||
* @param gasPin Pin where gas is connected
|
||||
*/
|
||||
Gas(int gasPin);
|
||||
|
||||
@ -58,45 +58,45 @@ class Gas {
|
||||
~Gas();
|
||||
|
||||
/**
|
||||
* Get samples from gas sensor according to provided window and
|
||||
* Gets samples from the gas sensor according to the provided window and
|
||||
* number of samples
|
||||
*
|
||||
* @param freqMS time between each sample (in milliseconds)
|
||||
* @param numberOfSamples number of sample to sample for this window
|
||||
* @param buffer buffer with sampled data
|
||||
* @param freqMS Time between each sample (in milliseconds)
|
||||
* @param numberOfSamples Number of sample to sample for this window
|
||||
* @param buffer Buffer with sampled data
|
||||
*/
|
||||
virtual int getSampledWindow (unsigned int freqMS, unsigned int numberOfSamples, uint16_t * buffer);
|
||||
|
||||
/**
|
||||
* Given sampled buffer this method will return TRUE/FALSE if threshold
|
||||
* was reached
|
||||
* Given the sampled buffer, this method returns TRUE/FALSE if the threshold
|
||||
* is reached
|
||||
*
|
||||
* @param ctx threshold context
|
||||
* @param threshold sample threshold
|
||||
* @param buffer buffer with samples
|
||||
* @param len buffer length
|
||||
* @param ctx Threshold context
|
||||
* @param threshold Sample threshold
|
||||
* @param buffer Buffer with samples
|
||||
* @param len Buffer length
|
||||
*/
|
||||
virtual int findThreshold (thresholdContext* ctx, unsigned int threshold, uint16_t * buffer, unsigned int len);
|
||||
|
||||
/**
|
||||
* Return average data for the sampled window
|
||||
* Returns average data for the sampled window
|
||||
*
|
||||
* @param ctx threshold context
|
||||
* @param ctx Threshold context
|
||||
*/
|
||||
virtual int getSampledData (thresholdContext* ctx);
|
||||
|
||||
/**
|
||||
* Return one sample from the sensor
|
||||
* Returns one sample from the sensor
|
||||
*
|
||||
* @param ctx threshold context
|
||||
* @param ctx Threshold context
|
||||
*/
|
||||
virtual int getSample ();
|
||||
|
||||
/**
|
||||
*
|
||||
* Print running average of threshold context
|
||||
* Prints a running average of the threshold context
|
||||
*
|
||||
* @param ctx threshold context
|
||||
* @param ctx Threshold context
|
||||
*/
|
||||
virtual void printGraph (thresholdContext* ctx, uint8_t resolution);
|
||||
|
||||
|
@ -37,12 +37,12 @@ namespace upm {
|
||||
* @con analog
|
||||
* @kit hak
|
||||
*
|
||||
* @brief API for MQ2 Gas Sensor
|
||||
* @brief API for the Grove MQ2 Gas Sensor
|
||||
*
|
||||
* The Grove - Gas Sensor (MQ2) module is useful for gas leakage detecting
|
||||
* The Grove MQ2 Gas Sensor module is useful for gas leakage detection
|
||||
* (in home and industry). It can detect LPG, i-butane, methane, alcohol,
|
||||
* Hydrogen, smoke and other combustible gases. It's a medium sensitivity
|
||||
* sensor with a detect concentration of 300-10000 ppm.
|
||||
* hydrogen, smoke, and other combustible gases. It's a medium-sensitivity
|
||||
* sensor with a detection range of 300-10,000 ppm.
|
||||
*
|
||||
* @image html mq2-5.jpeg
|
||||
* @snippet mq2.cxx Interesting
|
||||
@ -52,7 +52,7 @@ namespace upm {
|
||||
/**
|
||||
* MQ2 constructor
|
||||
*
|
||||
* @param gasPin analog pin where sensor is connected
|
||||
* @param gasPin Analog pin where the sensor is connected
|
||||
*/
|
||||
MQ2 (int gasPin);
|
||||
|
||||
@ -62,7 +62,7 @@ namespace upm {
|
||||
~MQ2 ();
|
||||
|
||||
/**
|
||||
* Return name of the component
|
||||
* Returns the name of the sensor
|
||||
*/
|
||||
std::string name()
|
||||
{
|
||||
|
@ -36,12 +36,12 @@ namespace upm {
|
||||
* @man seeed
|
||||
* @con analog
|
||||
*
|
||||
* @brief API for MQ3 Gas Sensor
|
||||
* @brief API for the MQ3 Gas Sensor
|
||||
*
|
||||
* The Grove MQ3 Gas Sensor module is useful for gas leakage detecting (in
|
||||
* home and industry). It can detect Alcohol Vapour and Benzine. It's
|
||||
* The Grove MQ3 Gas Sensor module is useful for gas leakage detection (in
|
||||
* home and industry). It can detect alcohol vapors and benzine. It's
|
||||
* highly sensitive but has a long warm-up time of about 1 minute. It's
|
||||
* detect rate is of 0.04-4 mg/L Alcohol.
|
||||
* detection range is 0.04-4 mg/L Alcohol.
|
||||
*
|
||||
* @image html mq3-9.jpeg
|
||||
* @snippet mq3.cxx Interesting
|
||||
@ -51,7 +51,7 @@ namespace upm {
|
||||
/**
|
||||
* MQ3 constructor
|
||||
*
|
||||
* @param gasPin analog pin where sensor is connected
|
||||
* @param gasPin Analog pin where the sensor is connected
|
||||
*/
|
||||
MQ3 (int gasPin);
|
||||
|
||||
@ -61,7 +61,7 @@ namespace upm {
|
||||
~MQ3 ();
|
||||
|
||||
/**
|
||||
* Return name of the component
|
||||
* Returns the name of the sensor
|
||||
*/
|
||||
std::string name()
|
||||
{
|
||||
|
@ -37,12 +37,12 @@ namespace upm {
|
||||
* @con analog
|
||||
* @kit eak
|
||||
*
|
||||
* @brief API for MQ5 Gas Sensor
|
||||
* @brief API for the MQ5 Gas Sensor
|
||||
*
|
||||
* The Grove - Gas Sensor (MQ5) module is useful for gas leakage detecting
|
||||
* (in home and industry). It can detect LPG, natural gas, town gas and so
|
||||
* on. It is highly sensitive and has a detection concentration of
|
||||
* 300-10000 ppm.
|
||||
* The Grove MQ5 Gas Sensor module is useful for gas leakage detection
|
||||
* (in home and industry). It can detect LPG, natural gas, town gas, and so
|
||||
* on. It is highly sensitive and has a detection range of
|
||||
* 300-10,000 ppm.
|
||||
*
|
||||
* @image html mq2-5.jpeg
|
||||
* @snippet mq5.cxx Interesting
|
||||
@ -52,7 +52,7 @@ namespace upm {
|
||||
/**
|
||||
* MQ5 constructor
|
||||
*
|
||||
* @param gasPin analog pin where sensor is connected
|
||||
* @param gasPin Analog pin where the sensor is connected
|
||||
*/
|
||||
MQ5 (int gasPin);
|
||||
|
||||
@ -62,7 +62,7 @@ namespace upm {
|
||||
~MQ5 ();
|
||||
|
||||
/**
|
||||
* Return name of the component
|
||||
* Returns the name of the sensor
|
||||
*/
|
||||
std::string name()
|
||||
{
|
||||
|
@ -36,11 +36,11 @@ namespace upm {
|
||||
* @man seeed
|
||||
* @con analog
|
||||
*
|
||||
* @brief API for MQ9 Gas Sensor
|
||||
* @brief API for the MQ9 Gas Sensor
|
||||
*
|
||||
* The Grove MQ9 Gas Sensor module is useful for gas leakage detecting (in
|
||||
* home and industry). It can detect Carbon Monoxide, Coal Gas and
|
||||
* Liquefied Gas. It's sensitivity is 10-1000 ppm CO, 100-10000 ppm Gas.
|
||||
* The Grove MQ9 Gas Sensor module is useful for gas leakage detection (in
|
||||
* home and industry). It can detect carbon monoxide, coal gas, and
|
||||
* liquefied gas. Its sensitivity is 10-1,000 ppm CO, and 100-10,000 ppm Gas.
|
||||
*
|
||||
* @image html mq3-9.jpeg
|
||||
* @snippet mq9.cxx Interesting
|
||||
@ -48,9 +48,9 @@ namespace upm {
|
||||
class MQ9 : public Gas {
|
||||
public:
|
||||
/**
|
||||
* Jhd1313m1 constructor
|
||||
* MQ9 constructor
|
||||
*
|
||||
* @param gasPin analog pin where sensor is connected
|
||||
* @param gasPin Analog pin where the sensor is connected
|
||||
*/
|
||||
MQ9 (int gasPin);
|
||||
|
||||
@ -60,7 +60,7 @@ namespace upm {
|
||||
~MQ9 ();
|
||||
|
||||
/**
|
||||
* Return name of the component
|
||||
* Returns the name of the sensor
|
||||
*/
|
||||
std::string name()
|
||||
{
|
||||
|
@ -38,14 +38,14 @@ namespace upm {
|
||||
* @con analog
|
||||
* @kit hak
|
||||
*
|
||||
* @brief API for Grove TP401 Air Quality Sensor
|
||||
* @brief API for the Grove TP401 Air Quality Sensor
|
||||
*
|
||||
* The Grove TP401 Air Quality Sensor module is useful for monitoring air purity indoors.
|
||||
* It can detect CO and a wide range of other harmful gases, but due to limited sensing
|
||||
* range should be used only when qualitative results are needed. Example applications
|
||||
* It can detect CO and a wide range of other harmful gases, but, due to a limited detection
|
||||
* range, it should be used only when qualitative results are needed. Example applications
|
||||
* are air recirculation, ventilation systems, and refreshing sprayers.
|
||||
* The sensor is linear and should be roughly sensitive to 0 ~ 20 ppm CO from 0 ~ 4V.
|
||||
* Also note that the sensor requires 2-3 minutes to warm up initially and 48 hours of
|
||||
* The sensor is linear and should be roughly sensitive to 0-20 ppm CO from 0-4 V.
|
||||
* Note: the sensor requires 2-3 minutes to warm up initially and 48 hours of
|
||||
* operation to stabilize completely.
|
||||
*
|
||||
* @image html tp401.jpeg
|
||||
@ -56,7 +56,7 @@ namespace upm {
|
||||
/**
|
||||
* TP401 constructor
|
||||
*
|
||||
* @param gasPin analog pin where sensor was connected
|
||||
* @param gasPin Analog pin where the sensor is connected
|
||||
*/
|
||||
TP401 (int gasPin);
|
||||
|
||||
@ -66,9 +66,9 @@ namespace upm {
|
||||
~TP401 ();
|
||||
|
||||
/**
|
||||
* Return name of the component
|
||||
* Returns the name of the sensor
|
||||
*
|
||||
* @return a string with the name of the sensor
|
||||
* @return Name of the sensor
|
||||
*/
|
||||
std::string name()
|
||||
{
|
||||
@ -77,9 +77,9 @@ namespace upm {
|
||||
|
||||
/**
|
||||
* Returns one sample in parts per million (ppm) of CO in the air based on
|
||||
* the following sensor calibration: 0 ~ 4V is roughly 0 ~ 20 ppm CO
|
||||
* the following sensor calibration: 0-4 V is roughly 0-20 ppm CO
|
||||
*
|
||||
* @return a new sample converted to ppm CO
|
||||
* @return New sample converted to ppm CO
|
||||
*/
|
||||
float getPPM();
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
namespace upm {
|
||||
/**
|
||||
* @brief GP2Y0A based IR proximity sensor library
|
||||
* @brief GP2Y0A-based IR Proximity Sensor library
|
||||
* @defgroup gp2y0a libupm-gp2y0a
|
||||
* @ingroup seeed analog light
|
||||
*/
|
||||
@ -45,8 +45,8 @@ namespace upm {
|
||||
*
|
||||
* @brief API for the GP2Y0A family of IR Proximity Sensors
|
||||
*
|
||||
* This sensor family returns an analog voltage corresponding to the distance
|
||||
* of an object from the sensor. The voltage is lower when objects
|
||||
* Sensors of this family return an analog voltage corresponding to the distance
|
||||
* of an object from the sensor. The voltage is lower when objects
|
||||
* are far away; the voltage increases as objects get closer
|
||||
* to the sensor.
|
||||
*
|
||||
@ -59,21 +59,21 @@ namespace upm {
|
||||
/**
|
||||
* GP2Y0A sensor constructor
|
||||
*
|
||||
* @param pin analog pin to use
|
||||
* @param pin Analog pin to use
|
||||
*/
|
||||
GP2Y0A(int pin);
|
||||
|
||||
/**
|
||||
* GP2Y0A Destructor
|
||||
* GP2Y0A destructor
|
||||
*/
|
||||
~GP2Y0A();
|
||||
|
||||
/**
|
||||
* Get the averaged voltage value from the sensor
|
||||
* Gets an average voltage value from the sensor
|
||||
*
|
||||
* @param aref the reference voltage in use (5.0 or 3.3 usually)
|
||||
* @param samples number of samples to average over
|
||||
* @return the averaged voltage reading
|
||||
* @param aref Reference voltage in use (usually 5.0V or 3.3V)
|
||||
* @param samples Number of samples to average over
|
||||
* @return Average voltage reading
|
||||
*/
|
||||
float value(float aref, uint8_t samples);
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
||||
namespace upm {
|
||||
|
||||
/**
|
||||
* @brief generic library for basic grove sensors
|
||||
* @brief Generic library for basic Grove sensors
|
||||
* @defgroup grove libupm-grove
|
||||
* @ingroup seeed gpio pwm ainput button led light relay temp touch gsk eak hak
|
||||
*/
|
||||
@ -48,14 +48,14 @@ class Grove {
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief API for Grove LED
|
||||
* @brief API for the Grove LED
|
||||
*
|
||||
* UPM module for Grove LED (or other similar light-emitting diode).
|
||||
* An LED is a small lightbulb that will emit light (turn on) in
|
||||
* response to a small curent. The longer wire of an LED connects
|
||||
* UPM module for the Grove LED (or other similar light-emitting diodes).
|
||||
* An LED is a small lightbulb that emits light in
|
||||
* response to a small current. The longer wire of an LED connects
|
||||
* to the positive seat (anode); the shorter wire connects to the
|
||||
* negative seat (cathode). The flat side of the bulb corresponds
|
||||
* to the cathode while the rounded side corresponds to the anode.
|
||||
* negative seat (cathode). The flat side of the bulb corresponds
|
||||
* to the cathode, while the rounded side corresponds to the anode.
|
||||
*
|
||||
* @ingroup grove gpio
|
||||
* @snippet groveled.cxx Interesting
|
||||
@ -67,7 +67,7 @@ class GroveLed: public Grove {
|
||||
/**
|
||||
* Grove LED constructor
|
||||
*
|
||||
* @param gpio pin to use
|
||||
* @param gpio Pin to use
|
||||
*/
|
||||
GroveLed(int pin);
|
||||
/**
|
||||
@ -75,27 +75,27 @@ class GroveLed: public Grove {
|
||||
*/
|
||||
~GroveLed();
|
||||
/**
|
||||
* Turn the LED on or off, depending on the value.
|
||||
* Turns the LED on or off, depending on the value.
|
||||
* If the value is positive (greater than or equal
|
||||
* to 1), the LED is turned on. Otherwise, for 0
|
||||
* or negative values, the LED is turned off.
|
||||
*
|
||||
* @param value tells the LED to turn on (for value >=1)
|
||||
* or off (for value <1)
|
||||
* @param value Tells the LED to turn on (for values >=1)
|
||||
* or off (for values <1)
|
||||
*
|
||||
* @return 0 on success; non-zero otherwise
|
||||
* @return 0 if successful, non-zero otherwise
|
||||
*/
|
||||
mraa_result_t write(int value);
|
||||
/**
|
||||
* Turn the LED off
|
||||
* Turns the LED off
|
||||
*
|
||||
* @return 0 on success; non-zero otherwise
|
||||
* @return 0 if successful, non-zero otherwise
|
||||
*/
|
||||
mraa_result_t off();
|
||||
/**
|
||||
* Turn the LED on
|
||||
* Turns the LED on
|
||||
*
|
||||
* @return 0 on success; non-zero otherwise
|
||||
* @return 0 if successful, non-zero otherwise
|
||||
*/
|
||||
mraa_result_t on();
|
||||
private:
|
||||
@ -103,12 +103,12 @@ class GroveLed: public Grove {
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief API for Grove Relay
|
||||
* @brief API for the Grove Relay
|
||||
*
|
||||
* UPM module for Grove relay switch. The Grove relay is a
|
||||
* UPM module for the Grove relay switch. Grove relay is a
|
||||
* digital normally-open switch that uses low voltage or current to
|
||||
* control a higher voltage and/or higher current. When closed,
|
||||
* the indicator LED will light up and current is allowed to flow.
|
||||
* the indicator LED lights up and current is allowed to flow.
|
||||
*
|
||||
* @ingroup grove gpio
|
||||
* @snippet groverelay.cxx Interesting
|
||||
@ -119,7 +119,7 @@ class GroveRelay: public Grove {
|
||||
/**
|
||||
* Grove relay constructor
|
||||
*
|
||||
* @param gpio pin to use
|
||||
* @param gpio Pin to use
|
||||
*/
|
||||
GroveRelay(unsigned int pin);
|
||||
/**
|
||||
@ -127,29 +127,29 @@ class GroveRelay: public Grove {
|
||||
*/
|
||||
~GroveRelay();
|
||||
/**
|
||||
* Set the relay switch to on (close). This allows current
|
||||
* Sets the relay switch to on (closed). This allows current
|
||||
* to flow and lights up the indicator LED.
|
||||
*
|
||||
* @return 0 on success; non-zero otherwise
|
||||
* @return 0 if successful, non-zero otherwise
|
||||
*/
|
||||
mraa_result_t on();
|
||||
/**
|
||||
* Set the relay switch to off (open). This stops current
|
||||
* from flowing and the indicator LED will not be lit.
|
||||
* Sets the relay switch to off (open). This stops current
|
||||
* from flowing and the indicator LED is not lit.
|
||||
*
|
||||
* @return 0 on success; non-zero otherwise
|
||||
* @return 0 if successful, non-zero otherwise
|
||||
*/
|
||||
mraa_result_t off();
|
||||
/**
|
||||
* Returns whether or not the relay switch is closed.
|
||||
* Defines whether the relay switch is closed.
|
||||
*
|
||||
* @return true if the switch is on (closed); false otherwise
|
||||
* @return True if the switch is on (closed), false otherwise
|
||||
*/
|
||||
bool isOn();
|
||||
/**
|
||||
* Returns whether or not the relay switch is open.
|
||||
* Defines whether the relay switch is open.
|
||||
*
|
||||
* @return true if the switch is off (open); false otherwise
|
||||
* @return True if the switch is off (open), false otherwise
|
||||
*/
|
||||
bool isOff();
|
||||
private:
|
||||
@ -157,9 +157,9 @@ class GroveRelay: public Grove {
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief API for Grove temperature sensor
|
||||
* @brief API for the Grove Temperature Sensor
|
||||
*
|
||||
* Very basic UPM module for Grove temperature sensor on analog
|
||||
* Basic UPM module for the Grove temperature sensor on analog
|
||||
*
|
||||
* @ingroup grove analog
|
||||
* @snippet grovetemp.cxx Interesting
|
||||
@ -170,7 +170,7 @@ class GroveTemp: public Grove {
|
||||
/**
|
||||
* Grove analog temperature sensor constructor
|
||||
*
|
||||
* @param pin analog pin to use
|
||||
* @param pin Analog pin to use
|
||||
*/
|
||||
GroveTemp(unsigned int pin);
|
||||
/**
|
||||
@ -178,15 +178,15 @@ class GroveTemp: public Grove {
|
||||
*/
|
||||
~GroveTemp();
|
||||
/**
|
||||
* Get raw value from AIO pin
|
||||
* Gets the raw value from the AIO pin
|
||||
*
|
||||
* @return the raw value from the ADC
|
||||
* @return Raw value from the ADC
|
||||
*/
|
||||
float raw_value();
|
||||
/**
|
||||
* Get the temperature in Celsius from the sensor
|
||||
* Gets the temperature in Celsius from the sensor
|
||||
*
|
||||
* @return the normalized temperature in Celsius
|
||||
* @return Normalized temperature in Celsius
|
||||
*/
|
||||
int value();
|
||||
private:
|
||||
@ -194,12 +194,12 @@ class GroveTemp: public Grove {
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief API for Grove light sensor
|
||||
* @brief API for the Grove Light Sensor
|
||||
*
|
||||
* The Grove light sensor detects the intensity of the ambient light.
|
||||
* As the light intensity of the environment increases, the resistance
|
||||
* of the sensor decreases. This means that the raw value from the
|
||||
* analog pin will be larger in bright light and smaller in the dark.
|
||||
* of the sensor decreases. This means the raw value from the
|
||||
* analog pin is greater in bright light and smaller in the dark.
|
||||
* An approximate lux value can also be returned.
|
||||
*
|
||||
* @ingroup grove analog
|
||||
@ -211,23 +211,23 @@ class GroveLight: public Grove {
|
||||
/**
|
||||
* Grove analog light sensor constructor
|
||||
*
|
||||
* @param pin analog pin to use
|
||||
* @param pin Analog pin to use
|
||||
*/
|
||||
GroveLight(unsigned int pin);
|
||||
/**
|
||||
* GroveLight Destructor
|
||||
* GroveLight destructor
|
||||
*/
|
||||
~GroveLight();
|
||||
/**
|
||||
* Get raw value from AIO pin
|
||||
* Gets the raw value from the AIO pin
|
||||
*
|
||||
* @return the raw value from the ADC
|
||||
* @return Raw value from the ADC
|
||||
*/
|
||||
float raw_value();
|
||||
/**
|
||||
* Get the approximate light value, in lux, from the sensor
|
||||
* Gets an approximate light value, in lux, from the sensor
|
||||
*
|
||||
* @return the normalized light reading in lux
|
||||
* @return Normalized light reading in lux
|
||||
*/
|
||||
int value();
|
||||
private:
|
||||
@ -235,11 +235,11 @@ class GroveLight: public Grove {
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief API for Grove Rotary Angle Sensor (Knob)
|
||||
* @brief API for the Grove Rotary Angle Sensor (Knob)
|
||||
*
|
||||
* Very basic UPM module for Grove rotary angle sensor (knob) on analog. Provides
|
||||
* a set of functions to read the absolute pin value, degrees or radians and another
|
||||
* to do the same relative to the center of the knob's range.
|
||||
* Basic UPM module for the Grove rotary angle sensor (knob) on analog. Provides
|
||||
* a set of functions to read the absolute pin value, degrees or radians, and another set
|
||||
* to do the same relative to the center of the knob range.
|
||||
*
|
||||
* @ingroup grove analog
|
||||
* @snippet groverotary.cxx Interesting
|
||||
@ -250,47 +250,47 @@ class GroveRotary: public Grove {
|
||||
/**
|
||||
* Grove rotary angle sensor constructor
|
||||
*
|
||||
* @param pin number of analog pin to use
|
||||
* @param pin Number of the analog pin to use
|
||||
*/
|
||||
GroveRotary(unsigned int pin);
|
||||
/**
|
||||
* GroveRotary Destructor
|
||||
* GroveRotary destructor
|
||||
*/
|
||||
~GroveRotary();
|
||||
/**
|
||||
* Get absolute raw value from AIO pin
|
||||
* Gets the absolute raw value from the AIO pin
|
||||
*
|
||||
* @return the unsigned value from the ADC
|
||||
* @return Unsigned value from the ADC
|
||||
*/
|
||||
float abs_value();
|
||||
/**
|
||||
* Get absolute raw degrees from AIO pin
|
||||
* Gets absolute raw degrees from the AIO pin
|
||||
*
|
||||
* @return the unsigned degrees from the ADC
|
||||
* @return Unsigned degrees from the ADC
|
||||
*/
|
||||
float abs_deg();
|
||||
/**
|
||||
* Get absolute raw radians from AIO pin
|
||||
* Gets absolute raw radians from the AIO pin
|
||||
*
|
||||
* @return the unsigned radians from the ADC
|
||||
* @return Unsigned radians from the ADC
|
||||
*/
|
||||
float abs_rad();
|
||||
/**
|
||||
* Get the relative value from the pin
|
||||
* Gets the relative value from the AIO pin
|
||||
*
|
||||
* @return the signed value from the ADC
|
||||
* @return Signed value from the ADC
|
||||
*/
|
||||
float rel_value();
|
||||
/**
|
||||
* Get relative degrees from AIO pin
|
||||
* Gets relative degrees from the AIO pin
|
||||
*
|
||||
* @return the signed degrees from the ADC
|
||||
* @return Signed degrees from the ADC
|
||||
*/
|
||||
float rel_deg();
|
||||
/**
|
||||
* Get relative radians from AIO pin
|
||||
* Gets relative radians from the AIO pin
|
||||
*
|
||||
* @return the signed radians from the ADC
|
||||
* @return Signed radians from the ADC
|
||||
*/
|
||||
float rel_rad();
|
||||
private:
|
||||
@ -299,10 +299,10 @@ class GroveRotary: public Grove {
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief API for Grove Slide Potentiometer
|
||||
* @brief API for the Grove Slide Potentiometer
|
||||
*
|
||||
* Very basic UPM module for Grove slide potentiometer on analog,
|
||||
* returns either raw value or scaled voltage value.
|
||||
* Basic UPM module for the Grove slide potentiometer on analog that
|
||||
* returns either a raw value or a scaled voltage value.
|
||||
*
|
||||
* @ingroup grove analog
|
||||
* @snippet groveslide.cxx Interesting
|
||||
@ -313,31 +313,31 @@ class GroveSlide: public Grove {
|
||||
/**
|
||||
* Grove analog slide potentiometer constructor
|
||||
*
|
||||
* @param pin number of analog pin to use
|
||||
* @param pin Number of the analog pin to use
|
||||
*
|
||||
* @param ref_voltage the reference voltage the board is set to as float, e.g. 3.3 or 5.0 (default)
|
||||
* @param ref_voltage Reference voltage the board is set to, as a floating-point value; default is 5.0V
|
||||
*/
|
||||
GroveSlide(unsigned int pin, float ref_voltage = 5.0);
|
||||
/**
|
||||
* GroveSlide Destructor
|
||||
* GroveSlide destructor
|
||||
*/
|
||||
~GroveSlide();
|
||||
/**
|
||||
* Get raw value from AIO pin
|
||||
* Gets the raw value from the AIO pin
|
||||
*
|
||||
* @return the raw value from the ADC
|
||||
* @return Raw value from the ADC
|
||||
*/
|
||||
float raw_value();
|
||||
/**
|
||||
* Get the voltage value from the pin
|
||||
* Gets the voltage value from the pin
|
||||
*
|
||||
* @return the voltage reading based on the reference voltage
|
||||
* @return Voltage reading based on the reference voltage
|
||||
*/
|
||||
float voltage_value();
|
||||
/**
|
||||
* Get the board's reference voltage passed on object initialization
|
||||
* Gets the board's reference voltage passed on object initialization
|
||||
*
|
||||
* @return the reference voltage the class was set for
|
||||
* @return Reference voltage the class was set for
|
||||
*/
|
||||
float ref_voltage();
|
||||
private:
|
||||
@ -346,9 +346,9 @@ class GroveSlide: public Grove {
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief API for Grove button
|
||||
* @brief API for the Grove Button
|
||||
*
|
||||
* Very basic UPM module for Grove button
|
||||
* Basic UPM module for the Grove button
|
||||
*
|
||||
* @ingroup grove gpio
|
||||
* @snippet grovebutton.cxx Interesting
|
||||
@ -359,7 +359,7 @@ class GroveButton: public Grove {
|
||||
/**
|
||||
* Grove button constructor
|
||||
*
|
||||
* @param gpio pin to use
|
||||
* @param gpio Pin to use
|
||||
*/
|
||||
GroveButton(unsigned int pin);
|
||||
/**
|
||||
@ -367,15 +367,15 @@ class GroveButton: public Grove {
|
||||
*/
|
||||
~GroveButton();
|
||||
/**
|
||||
* Get name of sensor
|
||||
* Gets the name of the sensor
|
||||
*
|
||||
* @return the name of this sensor
|
||||
* @return Name of this sensor
|
||||
*/
|
||||
std::string name();
|
||||
/**
|
||||
* Get value from GPIO pin
|
||||
* Gets the value from the GPIO pin
|
||||
*
|
||||
* @return the value from the GPIO pin
|
||||
* @return Value from the GPIO pin
|
||||
*/
|
||||
int value();
|
||||
private:
|
||||
|
@ -33,9 +33,9 @@
|
||||
* @con gpio
|
||||
* @kit gsk
|
||||
*
|
||||
* @brief API for Grove Button
|
||||
* @brief API for the Grove Button
|
||||
*
|
||||
* Very basic UPM module for Grove button
|
||||
* Basic UPM module for the Grove button
|
||||
*
|
||||
* @image html grovebutton.jpg
|
||||
* @snippet grovebutton.cxx Interesting
|
||||
|
@ -32,14 +32,14 @@
|
||||
* @con gpio
|
||||
* @kit gsk
|
||||
*
|
||||
* @brief API for Grove LED
|
||||
* @brief API for the Grove LED
|
||||
*
|
||||
* UPM module for Grove LED (or other similar light-emitting diode).
|
||||
* An LED is a small lightbulb that will emit light (turn on) in
|
||||
* response to a small curent. The longer wire of an LED connects
|
||||
* UPM module for the Grove LED (or other similar light-emitting diodes).
|
||||
* An LED is a small lightbulb that emits light in
|
||||
* response to a small current. The longer wire of an LED connects
|
||||
* to the positive seat (anode); the shorter wire connects to the
|
||||
* negative seat (cathode). The flat side of the bulb corresponds
|
||||
* to the cathode while the rounded side corresponds to the anode.
|
||||
* negative seat (cathode). The flat side of the bulb corresponds
|
||||
* to the cathode, while the rounded side corresponds to the anode.
|
||||
*
|
||||
* @image html groveled.jpg
|
||||
* @snippet groveled.cxx Interesting
|
||||
|
@ -32,12 +32,12 @@
|
||||
* @con analog
|
||||
* @kit gsk
|
||||
*
|
||||
* @brief API for Grove Light Sensor
|
||||
* @brief API for the Grove Light Sensor
|
||||
*
|
||||
* The Grove light sensor detects the intensity of the ambient light.
|
||||
* As the light intensity of the environment increases, the resistance
|
||||
* of the sensor decreases. This means that the raw value from the
|
||||
* analog pin will be larger in bright light and smaller in the dark.
|
||||
* of the sensor decreases. This means the raw value from the
|
||||
* analog pin is larger in bright light and smaller in the dark.
|
||||
* An approximate lux value can also be returned.
|
||||
*
|
||||
* @image html grovelight.jpg
|
||||
|
@ -32,12 +32,12 @@
|
||||
* @con gpio
|
||||
* @kit gsk eak hak
|
||||
*
|
||||
* @brief API for Grove Relay
|
||||
* @brief API for the Grove Relay
|
||||
*
|
||||
* UPM module for Grove relay switch. The Grove relay is a
|
||||
* UPM module for the Grove relay switch. The Grove relay is a
|
||||
* digital normally-open switch that uses low voltage or current to
|
||||
* control a higher voltage and/or higher current. When closed,
|
||||
* the indicator LED will light up and current is allowed to flow.
|
||||
* the indicator LED lights up and current is allowed to flow.
|
||||
*
|
||||
* @image html groverelay.jpg
|
||||
* @snippet groverelay.cxx Interesting
|
||||
|
@ -33,10 +33,10 @@
|
||||
* @con analog
|
||||
* @kit gsk
|
||||
*
|
||||
* @brief API for Grove Rotary Angle Sensor (Knob)
|
||||
* @brief API for the Grove Rotary Angle Sensor (Knob)
|
||||
*
|
||||
* Very basic UPM module for Grove rotary angle sensor (knob) on analog. Provides
|
||||
* a set of functions to read the absolute pin value, degrees or radians and another
|
||||
* Basic UPM module for the Grove rotary angle sensor (knob) on analog. Provides
|
||||
* a set of functions to read the absolute pin value, degrees or radians, and another set
|
||||
* to do the same relative to the center of the knob's range.
|
||||
*
|
||||
* @image html groverotary.jpeg
|
||||
|
@ -31,10 +31,10 @@
|
||||
* @man seeed
|
||||
* @con analog
|
||||
*
|
||||
* @brief API for Grove Slide Potentiometer
|
||||
* @brief API for the Grove Slide Potentiometer
|
||||
*
|
||||
* Very basic UPM module for Grove slide potentiometer on analog,
|
||||
* returns either raw value or scaled voltage value.
|
||||
* Basic UPM module for the Grove slide potentiometer on analog that
|
||||
* returns either a raw value or a scaled voltage value.
|
||||
*
|
||||
* @image html groveslide.jpeg
|
||||
* @snippet groveslide.cxx Interesting
|
||||
|
@ -32,9 +32,9 @@
|
||||
* @con analog
|
||||
* @kit gsk
|
||||
*
|
||||
* @brief API for Grove Temperature Sensor
|
||||
* @brief API for the Grove Temperature Sensor
|
||||
*
|
||||
* Very basic UPM module for Grove temperature sensor on analog
|
||||
* Basic UPM module for the Grove temperature sensor on analog
|
||||
*
|
||||
* @image html grovetemp.jpg
|
||||
* @snippet grovetemp.cxx Interesting
|
||||
|
@ -55,7 +55,7 @@ namespace upm {
|
||||
* @web http://www.seeedstudio.com/wiki/Grove_-_Circular_LED
|
||||
* @con gpio
|
||||
*
|
||||
* @brief API for Grove Circular LED module
|
||||
* @brief API for the Grove Circular LED module
|
||||
*
|
||||
* This is a circular LED ring based on the MY9221 chip. It is often used
|
||||
* with a rotary encoder and has 24 controllable LEDs.
|
||||
@ -66,10 +66,10 @@ namespace upm {
|
||||
class GroveCircularLED {
|
||||
public:
|
||||
/**
|
||||
* Instantiates a MY9221 object
|
||||
* Instantiates an MY9221 object
|
||||
*
|
||||
* @param di data pin
|
||||
* @param dcki clock pin
|
||||
* @param di Data pin
|
||||
* @param dcki Clock pin
|
||||
*/
|
||||
GroveCircularLED (uint8_t di, uint8_t dcki);
|
||||
|
||||
@ -79,29 +79,29 @@ namespace upm {
|
||||
~GroveCircularLED ();
|
||||
|
||||
/**
|
||||
* Set the lighting status
|
||||
* Sets the lighting status
|
||||
*
|
||||
* @param level selected level for the circular led (0 - 24)
|
||||
* @param direction up or down, true is up and is the default
|
||||
* @param level Selected level for the circular LED (0-24)
|
||||
* @param direction Up or down; up is true and default
|
||||
*/
|
||||
mraa_result_t setLevel (uint8_t level, bool direction=true);
|
||||
|
||||
/**
|
||||
* Set the spinner (light up one but all the other LEDs)
|
||||
* Sets the spinner (lights up all the other LEDs but one)
|
||||
*
|
||||
* @param position selected position for the spinner (0 - 23)
|
||||
* @param position Selected position for the spinner (0-23)
|
||||
*/
|
||||
mraa_result_t setSpinner (uint8_t position);
|
||||
|
||||
/**
|
||||
* Set the lighting status
|
||||
* Sets the lighting status
|
||||
*
|
||||
* @param status boolean array (24 elements)
|
||||
* @param status Boolean array (24 elements)
|
||||
*/
|
||||
mraa_result_t setStatus (bool status[24]);
|
||||
|
||||
/**
|
||||
* Return name of the component
|
||||
* Returns the name of the component
|
||||
*/
|
||||
std::string name()
|
||||
{
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
namespace upm {
|
||||
/**
|
||||
* @brief Grove Collision sensor library
|
||||
* @brief Grove Collision Sensor library
|
||||
* @defgroup grovecollision libupm-grovecollision
|
||||
* @ingroup seeed gpio accelerometer
|
||||
*/
|
||||
@ -44,7 +44,7 @@ namespace upm {
|
||||
*
|
||||
* The Grove Collision Sensor can detect whether any
|
||||
* collision movement or vibration happens.
|
||||
* It will output a low pulse signal when vibration is detected.
|
||||
* It outputs a low pulse signal when vibration is detected.
|
||||
*
|
||||
* @image html grovecollision.jpg
|
||||
* @snippet grovecollision.cxx Interesting
|
||||
@ -52,17 +52,17 @@ namespace upm {
|
||||
class GroveCollision {
|
||||
public:
|
||||
/**
|
||||
* Grove Collision Constructor
|
||||
* Grove collision sensor constructor
|
||||
*
|
||||
* @param pin digital pin to use
|
||||
* @param pin Digital pin to use
|
||||
*/
|
||||
GroveCollision(int pin);
|
||||
/**
|
||||
* Grove Collision Destructor
|
||||
* GroveCollision destructor
|
||||
*/
|
||||
~GroveCollision();
|
||||
/**
|
||||
* @return bool returns whether something is colliding with sensor
|
||||
* @return bool Defines whether something is colliding with sensor
|
||||
*/
|
||||
bool isColliding();
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
namespace upm {
|
||||
/**
|
||||
* @brief Grove Ear-clip Heart Rate sensor library
|
||||
* @brief Grove Ear-clip Heart Rate Sensor library
|
||||
* @defgroup groveehr libupm-groveehr
|
||||
* @ingroup seeed gpio medical
|
||||
*/
|
||||
@ -43,10 +43,10 @@ namespace upm {
|
||||
* @man seeed
|
||||
* @con gpio
|
||||
*
|
||||
* @brief API for the Grove Ear-clip Heart Rate sensor
|
||||
* @brief API for the Grove Ear-clip Heart Rate Sensor
|
||||
*
|
||||
* UPM module for the GroveEHR sensor. It is used to measure your
|
||||
* heartbeat.
|
||||
* UPM module for the Grove ear-clip heart rate sensor. It is used to measure your
|
||||
* heart rate.
|
||||
*
|
||||
* @image html groveehr.jpg
|
||||
* @snippet groveehr.cxx Interesting
|
||||
@ -56,63 +56,63 @@ namespace upm {
|
||||
/**
|
||||
* GroveEHR constructor
|
||||
*
|
||||
* @param pin digital pin to use
|
||||
* @param pin Digital pin to use
|
||||
*/
|
||||
GroveEHR(int pin);
|
||||
/**
|
||||
* GroveEHR Destructor
|
||||
* GroveEHR destructor
|
||||
*/
|
||||
~GroveEHR();
|
||||
/**
|
||||
* Return the number of milliseconds elapsed since initClock()
|
||||
* Returns the time of milliseconds elapsed since initClock()
|
||||
* was last called.
|
||||
*
|
||||
* @return elapsed milliseconds
|
||||
* @return Elapsed milliseconds
|
||||
*/
|
||||
uint32_t getMillis();
|
||||
|
||||
/**
|
||||
* Reset the Clock
|
||||
* Resets the clock
|
||||
*
|
||||
*/
|
||||
void initClock();
|
||||
|
||||
/**
|
||||
* Reset the beat counter to 0. The beat Counter should be
|
||||
* Resets the beat counter to 0. The beat counter should be
|
||||
* stopped via stopBeatCounter() prior to calling this function.
|
||||
*
|
||||
*/
|
||||
void clearBeatCounter();
|
||||
|
||||
/**
|
||||
* Start the beat counter
|
||||
* Starts the beat counter
|
||||
*
|
||||
*/
|
||||
void startBeatCounter();
|
||||
|
||||
/**
|
||||
* Stop the beat counter
|
||||
* Stops the beat counter
|
||||
*
|
||||
*/
|
||||
void stopBeatCounter();
|
||||
|
||||
/**
|
||||
* Get the beat Counter
|
||||
* Gets the beat Counter
|
||||
*
|
||||
* @return the beat counter
|
||||
* @return Beat counter
|
||||
*/
|
||||
uint32_t beatCounter();
|
||||
|
||||
/**
|
||||
* Beat Interrupt Service Routine
|
||||
* Beat interrupt service routine (ISR)
|
||||
*
|
||||
*/
|
||||
static void beatISR(void *ctx);
|
||||
|
||||
/**
|
||||
* Compute the heart rate
|
||||
* Computes the heart rate
|
||||
*
|
||||
* @return the computed heart rate
|
||||
* @return Computed heart rate
|
||||
*/
|
||||
int heartRate();
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
namespace upm {
|
||||
/**
|
||||
* @brief Grove El Driver module library
|
||||
* @brief Grove EL Driver Module library
|
||||
* @defgroup groveeldriver libupm-groveeldriver
|
||||
* @ingroup seeed gpio electric
|
||||
*/
|
||||
@ -38,15 +38,15 @@ namespace upm {
|
||||
/**
|
||||
* @library groveeldriver
|
||||
* @sensor groveeldriver
|
||||
* @comname Grove El Driver
|
||||
* @comname Grove EL Driver
|
||||
* @type electric
|
||||
* @man seeed
|
||||
* @con gpio
|
||||
*
|
||||
* @brief API for the Grove El Driver Module
|
||||
* @brief API for the Grove EL Driver Module
|
||||
*
|
||||
* The Grove EL Driver allows you to easily light up an
|
||||
* EL Wire with just one single Grove cable.
|
||||
* EL wire with just one single Grove cable.
|
||||
*
|
||||
* @image html groveeldriver.jpg
|
||||
* @snippet groveeldriver.cxx Interesting
|
||||
@ -54,21 +54,21 @@ namespace upm {
|
||||
class GroveElDriver {
|
||||
public:
|
||||
/**
|
||||
* Grove El Driver Constructor
|
||||
* Grove EL Driver constructor
|
||||
*
|
||||
* @param pin digital pin to use
|
||||
* @param pin Digital pin to use
|
||||
*/
|
||||
GroveElDriver(int pin);
|
||||
/**
|
||||
* Grove El Driver Destructor
|
||||
* Grove EL Driver destructor
|
||||
*/
|
||||
~GroveElDriver();
|
||||
/**
|
||||
* Turn el wire on
|
||||
* Turns the EL wire on
|
||||
*/
|
||||
void on();
|
||||
/**
|
||||
* Turn el wire off
|
||||
* Turns the EL wire off
|
||||
*/
|
||||
void off();
|
||||
|
||||
|
@ -45,7 +45,7 @@ namespace upm {
|
||||
*
|
||||
* @brief API for the Grove Electromagnet
|
||||
*
|
||||
* The Grove Electromagnet can hold up to 1 KG (approximately 2.2 lbs)
|
||||
* The Grove Electromagnet can hold up to 1 kg (approximately 2.2 lbs)
|
||||
*
|
||||
* @image html groveelectromagnet.jpg
|
||||
* @snippet groveelectromagnet.cxx Interesting
|
||||
@ -53,21 +53,21 @@ namespace upm {
|
||||
class GroveElectromagnet {
|
||||
public:
|
||||
/**
|
||||
* Grove Electromagnet Constructor
|
||||
* Grove Electromagnet constructor
|
||||
*
|
||||
* @param pin digital pin to use
|
||||
* @param pin Digital pin to use
|
||||
*/
|
||||
GroveElectromagnet(int pin);
|
||||
/**
|
||||
* Grove Electromagnet Destructor
|
||||
* Grove Electromagnet destructor
|
||||
*/
|
||||
~GroveElectromagnet();
|
||||
/**
|
||||
* Turn magnet on
|
||||
* Turns the magnet on
|
||||
*/
|
||||
void on();
|
||||
/**
|
||||
* Turn magnet off
|
||||
* Turns the magnet off
|
||||
*/
|
||||
void off();
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
namespace upm {
|
||||
/**
|
||||
* @brief GroveEMG Muscle Signal reader sensor library
|
||||
* @brief Grove EMG Muscle Signal Reader library
|
||||
* @defgroup groveemg libupm-groveemg
|
||||
* @ingroup seeed analog electric
|
||||
*/
|
||||
@ -41,10 +41,10 @@ namespace upm {
|
||||
* @man seeed
|
||||
* @con analog
|
||||
*
|
||||
* @brief API for the GroveEMG Muscle Signal Reader Sensor
|
||||
* @brief API for the Grove EMG Muscle Signal Reader
|
||||
*
|
||||
* GroveEMG Muscle Signal reader gathers small muscle signals,
|
||||
* then processes and returns the result
|
||||
* Grove EMG muscle signal reader gathers small muscle signals,
|
||||
* then processes them, and returns the result
|
||||
*
|
||||
* @image html groveemg.jpg
|
||||
* @snippet groveemg.cxx Interesting
|
||||
@ -52,25 +52,25 @@ namespace upm {
|
||||
class GroveEMG {
|
||||
public:
|
||||
/**
|
||||
* GroveEMG sensor constructor
|
||||
* Grove EMG reader constructor
|
||||
*
|
||||
* @param pin analog pin to use
|
||||
* @param pin Analog pin to use
|
||||
*/
|
||||
GroveEMG(int pin);
|
||||
/**
|
||||
* GroveEMG Destructor
|
||||
* GroveEMG destructor
|
||||
*/
|
||||
~GroveEMG();
|
||||
|
||||
/**
|
||||
* Calibrate the GroveEMG Sensor
|
||||
* Calibrates the Grove EMG reader
|
||||
*/
|
||||
void calibrate();
|
||||
|
||||
/**
|
||||
* Measure the muscle signals from the sensor
|
||||
* Measures muscle signals from the reader
|
||||
*
|
||||
* @return the muscle output as analog voltage
|
||||
* @return Muscle output as analog voltage
|
||||
*/
|
||||
int value();
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
namespace upm {
|
||||
/**
|
||||
* @brief GroveGSR Galvanic Skin Response sensor library
|
||||
* @brief Grove GSR Galvanic Skin Response Sensor library
|
||||
* @defgroup grovegsr libupm-grovegsr
|
||||
* @ingroup seeed analog electric
|
||||
*/
|
||||
@ -41,10 +41,10 @@ namespace upm {
|
||||
* @man seeed
|
||||
* @con analog
|
||||
*
|
||||
* @brief API for the GroveGSR Galvanic Skin Response Sensor
|
||||
* @brief API for the Grove GSR Galvanic Skin Response Sensor
|
||||
*
|
||||
* Measure the electrical conductance of skin in order
|
||||
* to measure strong emotional reaction.
|
||||
* Measures the electrical conductance of skin
|
||||
* to measure strong emotional reactions.
|
||||
* In other words, it measures sweat on your fingers
|
||||
* as an indicator of strong emotional reactions.
|
||||
*
|
||||
@ -54,25 +54,25 @@ namespace upm {
|
||||
class GroveGSR {
|
||||
public:
|
||||
/**
|
||||
* GroveGSR sensor constructor
|
||||
* Grove GSR sensor constructor
|
||||
*
|
||||
* @param pin analog pin to use
|
||||
* @param pin Analog pin to use
|
||||
*/
|
||||
GroveGSR(int pin);
|
||||
/**
|
||||
* GroveGSR Destructor
|
||||
* GroveGSR destructor
|
||||
*/
|
||||
~GroveGSR();
|
||||
|
||||
/**
|
||||
* Calibrate the GroveGSR Sensor
|
||||
* Calibrates the Grove GSR sensor
|
||||
*/
|
||||
void calibrate();
|
||||
|
||||
/**
|
||||
* Measure the electrical conductance of the skin from the sensor
|
||||
* Gets the electrical conductance of the skin from the sensor
|
||||
*
|
||||
* @return the electrical conductance of the skin
|
||||
* @return Electrical conductance of the skin
|
||||
*/
|
||||
int value();
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
namespace upm {
|
||||
/**
|
||||
* @brief Grove Line Finder sensor library
|
||||
* @brief Grove Line Finder Sensor library
|
||||
* @defgroup grovelinefinder libupm-grovelinefinder
|
||||
* @ingroup seeed gpio color robok
|
||||
*/
|
||||
@ -42,7 +42,7 @@ namespace upm {
|
||||
* @con gpio
|
||||
* @kit robok
|
||||
*
|
||||
* @brief API for the Grove Line Finder sensor
|
||||
* @brief API for the Grove Line Finder Sensor
|
||||
*
|
||||
* UPM module for the Grove Line Finder sensor. It outputs a
|
||||
* digital signal indicating whether it is detecting black on a
|
||||
@ -56,23 +56,23 @@ namespace upm {
|
||||
/**
|
||||
* Grove Line Finder digital sensor constructor
|
||||
*
|
||||
* @param pin digital pin to use
|
||||
* @param pin Digital pin to use
|
||||
*/
|
||||
GroveLineFinder(int pin);
|
||||
/**
|
||||
* GroveLineFinder Destructor
|
||||
* GroveLineFinder destructor
|
||||
*/
|
||||
~GroveLineFinder();
|
||||
/**
|
||||
* Determine whether white has been detected
|
||||
* Determines whether white has been detected
|
||||
*
|
||||
* @return True if white is being detected
|
||||
* @return True if white is detected
|
||||
*/
|
||||
bool whiteDetected();
|
||||
/**
|
||||
* Determine whether black has been detected
|
||||
* Determines whether black has been detected
|
||||
*
|
||||
* @return True if black is being detected
|
||||
* @return True if black is detected
|
||||
*/
|
||||
bool blackDetected();
|
||||
|
||||
|
@ -43,7 +43,7 @@ namespace upm {
|
||||
*
|
||||
* @brief API for the Grove Loudness Sensor
|
||||
*
|
||||
* UPM module for the Grove Loudness Sensor. This sensor
|
||||
* UPM module for the Grove Loudness Sensor. This sensor
|
||||
* detects how loud the surrounding environment is.
|
||||
* The higher the output analog value, the louder the sound.
|
||||
*
|
||||
@ -55,17 +55,17 @@ namespace upm {
|
||||
/**
|
||||
* Grove analog loudness sensor constructor
|
||||
*
|
||||
* @param pin analog pin to use
|
||||
* @param pin Analog pin to use
|
||||
*/
|
||||
GroveLoudness(int pin);
|
||||
/**
|
||||
* GroveLoudness Destructor
|
||||
* GroveLoudness destructor
|
||||
*/
|
||||
~GroveLoudness();
|
||||
/**
|
||||
* Get the loudness value from the sensor
|
||||
* Gets the loudness value from the sensor
|
||||
*
|
||||
* @return the loudness reading
|
||||
* @return Loudness reading
|
||||
*/
|
||||
int value();
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
|
||||
namespace upm {
|
||||
/**
|
||||
* @brief Grove I2C motor driver library
|
||||
* @brief Grove I2C Motor Driver library
|
||||
* @defgroup grovemd libupm-grovemd
|
||||
* @ingroup seeed i2c motor robok
|
||||
*/
|
||||
@ -51,13 +51,13 @@ namespace upm {
|
||||
* @brief API for the Grove I2C Motor Driver
|
||||
*
|
||||
* This class implements support for the Grove I2C Motor Driver.
|
||||
* This device can support a single 4-wire stepper motor, OR two
|
||||
* 2-wire DC motors. The device contains an Atmel ATmega8L
|
||||
* This device can support a single 4-wire stepper motor, or two
|
||||
* 2-wire DC motors. The device contains an Atmel* ATmega8L
|
||||
* microcontroller that manages an L298N H-bridge driver chip.
|
||||
*
|
||||
* This device supports an i2c bus speed of 100Khz only.
|
||||
* This device supports an I2C bus speed of 100Khz only.
|
||||
*
|
||||
* The module does not provide any telemetry or status -- it only
|
||||
* The module does not provide any telemetry or status - it only
|
||||
* accepts I2C commands for its various operations.
|
||||
*
|
||||
* This module was tested with version 1.3 of the Grove I2C Motor
|
||||
@ -91,82 +91,82 @@ namespace upm {
|
||||
} DC_DIRECTION_T;
|
||||
|
||||
/**
|
||||
* grovemd constructor
|
||||
* GroveMD constructor
|
||||
*
|
||||
* @param bus i2c bus to use
|
||||
* @param address i2c address to use
|
||||
* @param bus I2C bus to use
|
||||
* @param address I2C address to use
|
||||
*/
|
||||
GroveMD(int bus=GROVEMD_I2C_BUS,
|
||||
uint8_t address=GROVEMD_DEFAULT_I2C_ADDR);
|
||||
|
||||
/**
|
||||
* GroveMD Destructor
|
||||
* GroveMD destructor
|
||||
*/
|
||||
~GroveMD();
|
||||
|
||||
/**
|
||||
* Compose and write a 3-byte packet to the controller
|
||||
* Composes and writes a 3-byte packet to the controller
|
||||
*
|
||||
* @param reg register location
|
||||
* @param data1 first byte of data
|
||||
* @param data2 second byte of data
|
||||
* @return true if write successful
|
||||
* @param reg Register location
|
||||
* @param data1 First byte of data
|
||||
* @param data2 Second byte of data
|
||||
* @return True if successful
|
||||
*/
|
||||
bool writePacket(REG_T reg, uint8_t data1, uint8_t data2);
|
||||
|
||||
/**
|
||||
* For controlling DC motors, set the speeds of motors A & B.
|
||||
* To control DC motors, sets the speed of motors A & B.
|
||||
* Valid values are 0-255.
|
||||
*
|
||||
* @param speedA speed of motor A
|
||||
* @param speedB speed of motor B
|
||||
* @return true if command successful
|
||||
* @param speedA Speed of motor A
|
||||
* @param speedB Speed of motor B
|
||||
* @return True if successful
|
||||
*/
|
||||
bool setMotorSpeeds(uint8_t speedA, uint8_t speedB);
|
||||
|
||||
/**
|
||||
* For controlling DC motors, set the PWM frequency prescale
|
||||
* factor. Note this register is not ducumented other than to say
|
||||
* that the default value is 0x03. Presumably this is the timer
|
||||
* pre-scale factor used on the ATMega MCU timer driving the PWM.
|
||||
* To control DC motors, sets the PWM frequency prescale
|
||||
* factor. Note: this register is not ducumented other than to say
|
||||
* the default value is 0x03. Presumably, this is the timer
|
||||
* prescale factor used on the ATMega MCU timer driving the PWM.
|
||||
*
|
||||
* @param freq PWM prescale frequency, default 0x03
|
||||
* @return true if command successful
|
||||
* @param freq PWM prescale frequency; default is 0x03
|
||||
* @return True if successful
|
||||
*/
|
||||
bool setPWMFrequencyPrescale(uint8_t freq=0x03);
|
||||
|
||||
/**
|
||||
* For controlling DC motors, set the directions of motors A & B
|
||||
* To control DC motors, sets the directions of motors A & B
|
||||
*
|
||||
* @param dirA direction for motor A, DIR_CW or DIR_CCW
|
||||
* @param dirB direction for motor B, DIR_CW or DIR_CCW
|
||||
* @return true if command successful
|
||||
* @param dirA Direction for motor A, DIR_CW or DIR_CCW
|
||||
* @param dirB Direction for motor B, DIR_CW or DIR_CCW
|
||||
* @return True if successful
|
||||
*/
|
||||
bool setMotorDirections(DC_DIRECTION_T dirA, DC_DIRECTION_T dirB);
|
||||
|
||||
/**
|
||||
* For controlling a stepper motor, set a direction, speed and
|
||||
* then enable.
|
||||
* To control a stepper motor, sets its direction and speed, and
|
||||
* then enables it.
|
||||
*
|
||||
* @param dir direction, STEP_DIR_CW or STEP_DIR_CCW
|
||||
* @param speed motor speed. Valid range is 1-255, higher is slower.
|
||||
* @return true if command successful
|
||||
* @param dir Direction, STEP_DIR_CW or STEP_DIR_CCW
|
||||
* @param speed Motor speed. Valid range is 1-255, higher is slower.
|
||||
* @return True if successful
|
||||
*/
|
||||
bool enableStepper(STEP_DIRECTION_T dir, uint8_t speed);
|
||||
|
||||
/**
|
||||
* For controlling a stepper motor, stop the stepper motor.
|
||||
* To control a stepper motor, stops the stepper motor.
|
||||
*
|
||||
* @return true if command successful
|
||||
* @return True if successful
|
||||
*/
|
||||
bool disableStepper();
|
||||
|
||||
/**
|
||||
* For controlling a stepper motor, specify the number of steps to
|
||||
* execute. Valid values are 1-255, 255 means to rotate continuously.
|
||||
* To control a stepper motor, specifies the number of steps to
|
||||
* execute. Valid values are 1-255, 255 means continuous rotation.
|
||||
*
|
||||
* @param steps number of steps to execute. 255 means rotate continously.
|
||||
* @return true if command successful
|
||||
* @param steps Number of steps to execute. 255 means continuous rotation.
|
||||
* @return True if successful
|
||||
*/
|
||||
bool setStepperSteps(uint8_t steps);
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
namespace upm {
|
||||
/**
|
||||
* @brief Grove Moisture sensor library
|
||||
* @brief Grove Moisture Sensor library
|
||||
* @defgroup grovemoisture libupm-grovemoisture
|
||||
* @ingroup seeed analog liquid eak hak
|
||||
*/
|
||||
@ -48,7 +48,7 @@ namespace upm {
|
||||
* This sensor can be used to detect the moisture content
|
||||
* of soil or whether there is water around the sensor.
|
||||
* As the moisture content increases, so does the value that is read.
|
||||
* Note that this sensor is not designed to be left in soil
|
||||
* Note: this sensor is not designed to be left in soil
|
||||
* nor to be used outdoors.
|
||||
*
|
||||
* @image html grovemoisture.jpg
|
||||
@ -59,17 +59,17 @@ namespace upm {
|
||||
/**
|
||||
* Grove analog moisture sensor constructor
|
||||
*
|
||||
* @param pin analog pin to use
|
||||
* @param pin Analog pin to use
|
||||
*/
|
||||
GroveMoisture(int pin);
|
||||
/**
|
||||
* GroveMoisture Destructor
|
||||
* GroveMoisture destructor
|
||||
*/
|
||||
~GroveMoisture();
|
||||
/**
|
||||
* Get the moisture value from the sensor
|
||||
* Gets the moisture value from the sensor
|
||||
*
|
||||
* @return the moisture reading
|
||||
* @return Moisture reading
|
||||
*/
|
||||
int value();
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
namespace upm {
|
||||
/**
|
||||
* @brief GroveO2 Oxygen Gas Sensor library
|
||||
* @brief Grove O2 Oxygen Gas Sensor library
|
||||
* @defgroup groveo2 libupm-groveo2
|
||||
* @ingroup seeed analog gaseous
|
||||
*/
|
||||
@ -41,9 +41,9 @@ namespace upm {
|
||||
* @man seeed
|
||||
* @con analog
|
||||
*
|
||||
* @brief API for the GroveO2 Oxygen Gas Sensor
|
||||
* @brief API for the Grove O2 Oxygen Gas Sensor
|
||||
*
|
||||
* The Grove O2 sensor measures the oxygen concentration in the air
|
||||
* The Grove O2 Oxygen Gas sensor measures the oxygen concentration in the air
|
||||
*
|
||||
* @image html groveo2.jpg
|
||||
* @snippet groveo2.cxx Interesting
|
||||
@ -51,19 +51,19 @@ namespace upm {
|
||||
class GroveO2 {
|
||||
public:
|
||||
/**
|
||||
* GroveO2 sensor constructor
|
||||
* Grove O2 Oxygen Gas sensor constructor
|
||||
*
|
||||
* @param pin analog pin to use
|
||||
* @param pin Analog pin to use
|
||||
*/
|
||||
GroveO2(int pin);
|
||||
/**
|
||||
* GroveO2 Destructor
|
||||
* GroveO2 destructor
|
||||
*/
|
||||
~GroveO2();
|
||||
/**
|
||||
* Measures O2 from the sensor
|
||||
*
|
||||
* @return the Oxygen concentration as voltage
|
||||
* @return Oxygen concentration as voltage
|
||||
*/
|
||||
float voltageValue();
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Author: Jon Trulson <jtrulson@ics.com>
|
||||
* Copyright (c) 2015 Intel Corporation.
|
||||
*
|
||||
@ -64,12 +64,12 @@ namespace upm {
|
||||
*
|
||||
* @brief API for the Grove Serial Camera
|
||||
*
|
||||
* The driver was tested with the Grove Serial Camera. There is
|
||||
* The driver was tested with the Grove Serial Camera. There is
|
||||
* no protocol documentation currently available, so this module
|
||||
* was developed based completely on the Seeed Studio Arduino
|
||||
* was developed based completely on the Seeed Studio* Arduino*
|
||||
* sketch.
|
||||
*
|
||||
* It is connected via a UART at 115200 baud.
|
||||
* It is connected via a UART at 115,200 baud.
|
||||
*
|
||||
* @image html grovescam.jpg
|
||||
* @snippet grovescam.cxx Interesting
|
||||
@ -87,95 +87,95 @@ namespace upm {
|
||||
} PIC_FORMATS_T;
|
||||
|
||||
/**
|
||||
* GROVESCAM module constructor
|
||||
* Grove Serial Camera constructor
|
||||
*
|
||||
* @param uart default uart to use (0 or 1)
|
||||
* @param camAddr the 3-bit address identifier of the camera, default 0
|
||||
* @param uart Default UART to use (0 or 1)
|
||||
* @param camAddr 3-bit address identifier of the camera; default is 0
|
||||
*/
|
||||
GROVESCAM(int uart, uint8_t camAddr=GROVESCAM_DEFAULT_CAMERA_ADDR);
|
||||
|
||||
/**
|
||||
* GROVESCAM module Destructor
|
||||
* GROVESCAM destructor
|
||||
*/
|
||||
~GROVESCAM();
|
||||
|
||||
/**
|
||||
* check to see if there is data available for reading
|
||||
* Checks to see if there is data available for reading
|
||||
*
|
||||
* @param millis number of milliseconds to wait, 0 means no wait.
|
||||
* @return true if there is data available to be read
|
||||
* @param millis Number of milliseconds to wait; 0 means no waiting.
|
||||
* @return True if there is data available for reading
|
||||
*/
|
||||
bool dataAvailable(unsigned int millis);
|
||||
|
||||
/**
|
||||
* read any available data into a user-supplied buffer. Note, the
|
||||
* call will block until data is available to be read. Use
|
||||
* Reads any available data into a user-supplied buffer. Note: the
|
||||
* call blocks until data is available to be read. Use
|
||||
* dataAvailable() to determine whether there is data available
|
||||
* beforehand, to avoid blocking.
|
||||
*
|
||||
* @param buffer the buffer to hold the data read
|
||||
* @param len the length of the buffer
|
||||
* @return the number of bytes read
|
||||
* @param buffer Buffer to hold the data read
|
||||
* @param len Length of the buffer
|
||||
* @return Number of bytes read
|
||||
*/
|
||||
int readData(uint8_t *buffer, size_t len);
|
||||
|
||||
/**
|
||||
* write the data in buffer to the device
|
||||
* Writes the data in the buffer to the device
|
||||
*
|
||||
* @param buffer the buffer to hold the data read
|
||||
* @param len the length of the buffer
|
||||
* @return the number of bytes written
|
||||
* @param buffer Buffer to hold the data read
|
||||
* @param len Length of the buffer
|
||||
* @return Number of bytes written
|
||||
*/
|
||||
int writeData(uint8_t *buffer, size_t len);
|
||||
|
||||
/**
|
||||
* setup the proper tty i/o modes and the baudrate. The default
|
||||
* baud rate is 9600 (B9600) for this device.
|
||||
* Sets up proper tty I/O modes and the baud rate. For this device, the default
|
||||
* baud rate is 9,600 (B9600).
|
||||
*
|
||||
* @param baud the desired baud rate.
|
||||
* @return true if successful
|
||||
* @param baud Desired baud rate
|
||||
* @return True if successful
|
||||
*/
|
||||
bool setupTty(speed_t baud=B115200);
|
||||
|
||||
/**
|
||||
* read serial input and discard until no more characters are available
|
||||
* Reads serial input and discards until no more characters are available
|
||||
*
|
||||
*/
|
||||
void drainInput();
|
||||
|
||||
/**
|
||||
* initialize the camera
|
||||
* Initializes the camera
|
||||
*
|
||||
*/
|
||||
bool init();
|
||||
|
||||
/**
|
||||
* tell camera to prepare for a capture
|
||||
* Tells the camera to prepare for a capture
|
||||
*
|
||||
* @param fmt one of the PIC_FORMATS_T values
|
||||
* @param fmt One of the PIC_FORMATS_T values
|
||||
*/
|
||||
bool preCapture(PIC_FORMATS_T fmt=FORMAT_VGA);
|
||||
|
||||
/**
|
||||
* start the capture
|
||||
* Starts the capture
|
||||
*
|
||||
* @return true if successful
|
||||
* @return True if successful
|
||||
*/
|
||||
bool doCapture();
|
||||
|
||||
/**
|
||||
* store the captured image in a file
|
||||
* Stores the captured image in a file
|
||||
*
|
||||
* @param fname the name of the file to write
|
||||
* @return true if successful
|
||||
* @param fname Name of the file to write
|
||||
* @return True if successful
|
||||
*/
|
||||
bool storeImage(char *fname);
|
||||
|
||||
/**
|
||||
* return the picture length. Note, this is only valid after
|
||||
* Returns the picture length. Note: this is only valid after
|
||||
* doCapture() has run successfully.
|
||||
*
|
||||
* @return the image length
|
||||
* @return Image length
|
||||
*/
|
||||
int getImageSize() { return m_picTotalLen; };
|
||||
|
||||
|
@ -55,9 +55,9 @@ typedef struct
|
||||
* @con gpio
|
||||
* @kit hak
|
||||
*
|
||||
* @brief API for the GroveSpeaker speaker
|
||||
* @brief API for the Grove Speaker
|
||||
*
|
||||
* UPM module for the GroveSpeaker.
|
||||
* UPM module for the Grove Speaker.
|
||||
* This sensor can generate different tones and sounds depending on the
|
||||
* frequency of the input signal.
|
||||
*
|
||||
@ -67,28 +67,28 @@ typedef struct
|
||||
class GroveSpeaker {
|
||||
public:
|
||||
/**
|
||||
* GroveSpeaker Constructor
|
||||
* Grove Speaker constructor
|
||||
*
|
||||
* @param pin digital pin to use
|
||||
* @param pin Digital pin to use
|
||||
*/
|
||||
GroveSpeaker(int pin);
|
||||
/**
|
||||
* GroveSpeaker Destructor
|
||||
* GroveSpeaker destructor
|
||||
*/
|
||||
~GroveSpeaker();
|
||||
/**
|
||||
* Play all alto notes (lowest notes)
|
||||
* Plays all alto notes (lowest notes)
|
||||
*
|
||||
*/
|
||||
void playAll();
|
||||
/**
|
||||
* Play a sound and note whether it's sharp or not
|
||||
* Plays a sound and a note whether it's sharp or not
|
||||
*
|
||||
* @param letter character name of note
|
||||
* @param letter Character name of the note
|
||||
* ('a', 'b', 'c', 'd', 'e', 'f', or 'g')
|
||||
* @param sharp if true, play sharp version of note; otherwise, do not
|
||||
* @param vocalWeight string to determine whether to play low ("low"),
|
||||
* medium ("med"), or high ("high") note
|
||||
* @param sharp If true, plays a sharp version of the note; otherwise, does not play the note
|
||||
* @param vocalWeight String to determine whether to play a low ("low"),
|
||||
* a medium ("med"), or a high ("high") note
|
||||
*/
|
||||
void playSound(char letter, bool sharp, std::string vocalWeight);
|
||||
|
||||
|
@ -28,15 +28,15 @@
|
||||
#include <stdint.h>
|
||||
#include <mraa/aio.h>
|
||||
|
||||
// ref voltage in millivolts
|
||||
// reference voltage in millivolts
|
||||
#define GROVEVDIV_VREF 4980
|
||||
|
||||
// default ADC resolution.
|
||||
// default ADC resolution
|
||||
#define GROVEVDIV_ADC_RES 1024
|
||||
|
||||
namespace upm {
|
||||
/**
|
||||
* @brief Grove Voltage Divider sensor library
|
||||
* @brief Grove Voltage Divider Sensor library
|
||||
* @defgroup grovevdiv libupm-grovevdiv
|
||||
* @ingroup seeed analog electric robok
|
||||
*/
|
||||
@ -52,7 +52,7 @@ namespace upm {
|
||||
*
|
||||
* @brief API for the Grove Voltage Divider Sensor
|
||||
*
|
||||
* UPM module for the Grove Voltage Divider Sensor
|
||||
* UPM module for the Grove Voltage Divider sensor
|
||||
*
|
||||
* @image html grovevdiv.jpg
|
||||
* @snippet grovevdiv.cxx Interesting
|
||||
@ -62,32 +62,32 @@ namespace upm {
|
||||
/**
|
||||
* Grove Voltage Divider sensor constructor
|
||||
*
|
||||
* @param pin analog pin to use
|
||||
* @param pin Analog pin to use
|
||||
*/
|
||||
GroveVDiv(int pin);
|
||||
|
||||
/**
|
||||
* Grove Voltage Divider Destructor
|
||||
* Grove Voltage Divider destructor
|
||||
*/
|
||||
~GroveVDiv();
|
||||
|
||||
/**
|
||||
* Get the conversion value from the sensor
|
||||
* Gets the conversion value from the sensor
|
||||
*
|
||||
* @param samples specifies how many samples to average over
|
||||
* @return the averaged ADC conversion value
|
||||
* @param samples Specifies how many samples to average over
|
||||
* @return Average ADC conversion value
|
||||
*/
|
||||
unsigned int value(unsigned int samples);
|
||||
|
||||
/**
|
||||
* Compute the measured voltage
|
||||
* Computes the measured voltage
|
||||
*
|
||||
* @param gain gain switch, either 3 or 10 for grove
|
||||
* @param val measured voltage (from value())
|
||||
* @param vref reference voltage in millivolts
|
||||
* @param gain Gain switch, either 3 or 10 for Grove
|
||||
* @param val Measured voltage (from value())
|
||||
* @param vref Reference voltage in millivolts
|
||||
* @param res ADC resolution
|
||||
*
|
||||
* @return the measured voltage
|
||||
* @return Measured voltage
|
||||
*/
|
||||
float computedValue(uint8_t gain, uint16_t val, int vref=GROVEVDIV_VREF,
|
||||
int res=GROVEVDIV_ADC_RES);
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
namespace upm {
|
||||
/**
|
||||
* @brief Grove Water sensor library
|
||||
* @brief Grove Water Sensor library
|
||||
* @defgroup grovewater libupm-grovewater
|
||||
* @ingroup seeed gpio liquid eak
|
||||
*/
|
||||
@ -44,7 +44,7 @@ namespace upm {
|
||||
*
|
||||
* @brief API for the Grove Water Sensor
|
||||
*
|
||||
* UPM module for the Grove Water Sensor
|
||||
* UPM module for the Grove Water sensor
|
||||
*
|
||||
* @image html grovewater.jpg
|
||||
* @snippet grovewater.cxx Interesting
|
||||
@ -54,15 +54,15 @@ namespace upm {
|
||||
/**
|
||||
* Grove digital water sensor constructor
|
||||
*
|
||||
* @param pin digital pin to use
|
||||
* @param pin Digital pin to use
|
||||
*/
|
||||
GroveWater(int pin);
|
||||
/**
|
||||
* GroveWater Destructor
|
||||
* GroveWater destructor
|
||||
*/
|
||||
~GroveWater();
|
||||
/**
|
||||
* Get the water (wet/not wet) value from the sensor
|
||||
* Gets the water (wet/not wet) value from the sensor
|
||||
*
|
||||
* @return True if the sensor is wet, false otherwise
|
||||
*/
|
||||
|
@ -31,7 +31,7 @@
|
||||
namespace upm {
|
||||
|
||||
/**
|
||||
* @brief Grove Water Flow sensor library
|
||||
* @brief Grove Water Flow Sensor library
|
||||
* @defgroup grovewfs libupm-grovewfs
|
||||
* @ingroup seeed gpio liquid eak
|
||||
*/
|
||||
@ -48,17 +48,17 @@ namespace upm {
|
||||
|
||||
* @brief API for the Grove Water Flow Sensor
|
||||
*
|
||||
* This sensor is used to measure water flow, in LPM (Liters Per
|
||||
* Minute). It incorporates a Hall Effect Sensor. The UPM module
|
||||
* This sensor is used to measure water flow in liters per
|
||||
* minute (LPM). It incorporates a Hall Effect sensor. The UPM module
|
||||
* defines an interrupt routine to be triggered on each low pulse,
|
||||
* keeping count. This device requires a 10K pullup resistor for
|
||||
* the signal line (yellow wire). There is a schematic diagram on
|
||||
* the seeedstudio site (3/2015):
|
||||
* keeping count. This device requires a 10K pull-up resistor for
|
||||
* the signal line (yellow wire). There is a schematic diagram on
|
||||
* the SeeedStudio site (3/2015):
|
||||
* http://www.seeedstudio.com/wiki/index.php?title=G1/2_Water_Flow_sensor
|
||||
*
|
||||
* However, be careful in wiring this up - the schematic appears to
|
||||
* However, be careful when wiring this up - the schematic appears to
|
||||
* have a bug in it: the lower left connection of the signal line
|
||||
* (yellow) to Vcc (red) should not be there. The sensor may work
|
||||
* (yellow) to Vcc (red) should not be there. The sensor can work
|
||||
* with this connection, but probably not for very long.
|
||||
*
|
||||
* @image html grovewfs.jpg
|
||||
@ -67,65 +67,65 @@ namespace upm {
|
||||
class GroveWFS {
|
||||
public:
|
||||
/**
|
||||
* GroveWFS constructor
|
||||
* Grove Water Flow sensor constructor
|
||||
*
|
||||
* @param pin digital pin to use
|
||||
* @param pin Digital pin to use
|
||||
*/
|
||||
GroveWFS(int pin);
|
||||
/**
|
||||
* GroveWFS Destructor
|
||||
* GroveWFS destructor
|
||||
*/
|
||||
~GroveWFS();
|
||||
/**
|
||||
* Return the number of milliseconds elapsed since initClock()
|
||||
* Returns the number of milliseconds elapsed since initClock()
|
||||
* was last called.
|
||||
*
|
||||
* @return elapsed milliseconds
|
||||
* @return Elapsed milliseconds
|
||||
*/
|
||||
uint32_t getMillis();
|
||||
|
||||
/**
|
||||
* Reset the Clock
|
||||
* Resets the clock
|
||||
*
|
||||
*/
|
||||
void initClock();
|
||||
|
||||
/**
|
||||
* Reset the flow counter to 0. The flow Counter should be
|
||||
* Resets the flow counter to 0. The flow counter should be
|
||||
* stopped via stopFlowCounter() prior to calling this function.
|
||||
*
|
||||
*/
|
||||
void clearFlowCounter() { m_flowCounter = 0; };
|
||||
|
||||
/**
|
||||
* Start the flow counter
|
||||
* Starts the flow counter
|
||||
*
|
||||
*/
|
||||
void startFlowCounter();
|
||||
|
||||
/**
|
||||
* Stop the flow counter
|
||||
* Stops the flow counter
|
||||
*
|
||||
*/
|
||||
void stopFlowCounter();
|
||||
|
||||
/**
|
||||
* Get the flow Counter
|
||||
* Gets the flow counter
|
||||
*
|
||||
* @return the flow counter
|
||||
* @return Flow counter
|
||||
*/
|
||||
uint32_t flowCounter() { return m_flowCounter; };
|
||||
|
||||
/**
|
||||
* Flow Interrupt Service Routine
|
||||
* Flow interrupt service routine (ISR)
|
||||
*
|
||||
*/
|
||||
static void flowISR(void *ctx);
|
||||
|
||||
/**
|
||||
* Compute the flow rate in liters per minute (LPM)
|
||||
* Computes the flow rate in liters per minute (LPM)
|
||||
*
|
||||
* @return the computed flow rate
|
||||
* @return Computed flow rate
|
||||
*/
|
||||
float flowRate();
|
||||
|
||||
|
@ -43,9 +43,9 @@ namespace upm {
|
||||
* @con analog
|
||||
* @kit eak
|
||||
*
|
||||
* @brief API for the GUVAS12D UV sensor module
|
||||
* @brief API for the GUVA-S12D UV Sensor
|
||||
*
|
||||
* UPM module for the GUVAS12D UV Sensor
|
||||
* UPM module for the GUVA-S12D UV sensor
|
||||
*
|
||||
* @image html guvas12d.jpg
|
||||
* @snippet guvas12d.cxx Interesting
|
||||
@ -53,21 +53,21 @@ namespace upm {
|
||||
class GUVAS12D {
|
||||
public:
|
||||
/**
|
||||
* GUVAS12D sensor constructor
|
||||
* GUVA-S12D UV sensor constructor
|
||||
*
|
||||
* @param pin analog pin to use
|
||||
* @param pin Analog pin to use
|
||||
*/
|
||||
GUVAS12D(int pin);
|
||||
/**
|
||||
* GUVAS12D Destructor
|
||||
* GUVAS12D destructor
|
||||
*/
|
||||
~GUVAS12D();
|
||||
/**
|
||||
* Get the averaged voltage value from the sensor
|
||||
* Gets the average voltage value from the sensor
|
||||
*
|
||||
* @param aref the reference voltage in use (5.0 or 3.3 usually)
|
||||
* @param samples number of samples to average over
|
||||
* @return the averaged voltage reading
|
||||
* @param aref Reference voltage in use (usually 5.0 V or 3.3 V)
|
||||
* @param samples Number of samples to average over
|
||||
* @return Average voltage reading
|
||||
*/
|
||||
float value(float aref, unsigned int samples);
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
||||
namespace upm {
|
||||
|
||||
/**
|
||||
* @brief H3LIS331DL I2C accelerometer (400g) library
|
||||
* @brief H3LIS331DL I2C Accelerometer (400g) library
|
||||
* @defgroup h3lis331dl libupm-h3lis331dl
|
||||
* @ingroup seeed i2c accelerometer
|
||||
*/
|
||||
@ -47,9 +47,9 @@ namespace upm {
|
||||
* @web http://www.seeedstudio.com/depot/Grove-3Axis-Digital-Accelerometer400g-p-1897.html
|
||||
* @con i2c
|
||||
*
|
||||
* @brief API for the H3LIS331DL based Grove 3-axis I2C (400G)
|
||||
* @brief API for the H3LIS331DL-based Grove 3-Axis Digital Accelerometer (400g)
|
||||
*
|
||||
* This is a high performance, high range accelerometer for extreme applications.
|
||||
* This is a high-performance, high-range accelerometer for extreme applications.
|
||||
*
|
||||
* @image html h3lis331dl.jpg
|
||||
* @snippet h3lis331dl.cxx Interesting
|
||||
@ -62,7 +62,7 @@ namespace upm {
|
||||
*/
|
||||
typedef enum {
|
||||
// Reserved bytes must not be written into as they contain
|
||||
// factory calibration data. Changing those values may lead to
|
||||
// factory calibration data. Changing those values may lead to
|
||||
// improper functioning of the device.
|
||||
|
||||
// 0x00-0x0E reserved
|
||||
@ -108,7 +108,7 @@ namespace upm {
|
||||
* REG1 bits
|
||||
*/
|
||||
typedef enum {
|
||||
REG1_XEN = 0x01, // X axis enable
|
||||
REG1_XEN = 0x01, // X-axis enable
|
||||
REG1_YEN = 0x02,
|
||||
REG1_ZEN = 0x04,
|
||||
|
||||
@ -133,7 +133,7 @@ namespace upm {
|
||||
} DR_BITS_T;
|
||||
|
||||
/**
|
||||
* REG1 PM (Power mode) bits
|
||||
* REG1 PM (power mode) bits
|
||||
*/
|
||||
typedef enum {
|
||||
PM_POWERDWN = 0x0,
|
||||
@ -165,7 +165,7 @@ namespace upm {
|
||||
} REG2_BITS_T;
|
||||
|
||||
/**
|
||||
* REG2 HPCF (High Pass Cutoff Frequency) bits
|
||||
* REG2 HPCF (high-pass cutoff frequency) bits
|
||||
*/
|
||||
typedef enum {
|
||||
HPCF_8 = 0x0,
|
||||
@ -175,7 +175,7 @@ namespace upm {
|
||||
} HPCF_BITS_T;
|
||||
|
||||
/**
|
||||
* REG2 HPM (High Pass Filter Mode) bits
|
||||
* REG2 HPM (high-pass filter mode) bits
|
||||
*/
|
||||
typedef enum {
|
||||
HPM_NORMAL0 = 0x0,
|
||||
@ -224,12 +224,12 @@ namespace upm {
|
||||
REG4_FS1 = 0x20,
|
||||
REG4_FS_SHIFT = 4,
|
||||
|
||||
REG4_BLE = 0x40, // big/little endian
|
||||
REG4_BLE = 0x40, // big/little-endian
|
||||
REG4_BDU = 0x80 // Block data update
|
||||
} REG4_BITS_T;
|
||||
|
||||
/**
|
||||
* REG4 FS (Full Scale) bits
|
||||
* REG4 FS (full scale) bits
|
||||
*/
|
||||
typedef enum {
|
||||
FS_100 = 0x0, // 100g scale
|
||||
@ -241,7 +241,7 @@ namespace upm {
|
||||
* REG5 TURNON (sleep to wake) bits
|
||||
*/
|
||||
typedef enum {
|
||||
REG5_TURNON0 = 0x01, // turnon mode for sleep-to-wake
|
||||
REG5_TURNON0 = 0x01, // turn-on mode for sleep-to-wake
|
||||
REG5_TURNON1 = 0x02
|
||||
|
||||
// bits 04-80 reserved
|
||||
@ -290,314 +290,314 @@ namespace upm {
|
||||
} INT_SRC_BITS_T;
|
||||
|
||||
/**
|
||||
* h3lis331dl constructor
|
||||
* H3LIS331DL constructor
|
||||
*
|
||||
* @param bus i2c bus to use
|
||||
* @param address the address for this device
|
||||
* @param bus I2C bus to use
|
||||
* @param address Address for this device
|
||||
*/
|
||||
H3LIS331DL(int bus, uint8_t address = H3LIS331DL_DEFAULT_I2C_ADDR);
|
||||
|
||||
/**
|
||||
* H3LIS331DL Destructor
|
||||
* H3LIS331DL destructor
|
||||
*/
|
||||
~H3LIS331DL();
|
||||
|
||||
/**
|
||||
* set up initial values and start operation
|
||||
* Sets up initial values and starts operation
|
||||
*
|
||||
* @param odr the data rate: one of the DR_BITS_T values
|
||||
* @param pm the power mode: one of the PM_BITS_T values
|
||||
* @param fs the FullScale: one of the FS_BITS_T values
|
||||
* @return true if successful
|
||||
* @param odr Data rate: one of the DR_BITS_T values
|
||||
* @param pm Power mode: one of the PM_BITS_T values
|
||||
* @param fs FullScale: one of the FS_BITS_T values
|
||||
* @return True if successful
|
||||
*/
|
||||
bool init(DR_BITS_T odr=DR_50_37, PM_BITS_T pm=PM_NORMAL,
|
||||
FS_BITS_T fs=FS_100);
|
||||
|
||||
/**
|
||||
* read and return the Chip ID (WHO_AM_I register)
|
||||
* Reads and returns the chip ID (WHO_AM_I register)
|
||||
*
|
||||
* @return true if successful
|
||||
* @return True if successful
|
||||
*/
|
||||
uint8_t getChipID();
|
||||
|
||||
/**
|
||||
* set the output data rate
|
||||
* Sets the output data rate
|
||||
*
|
||||
* @param one of the DR_BITS_T values
|
||||
* @return true if successful
|
||||
* @param One of the DR_BITS_T values
|
||||
* @return True if successful
|
||||
*/
|
||||
bool setDataRate(DR_BITS_T odr);
|
||||
|
||||
/**
|
||||
* set the power mode
|
||||
* Sets the power mode
|
||||
*
|
||||
* @param one of the PM_BITS_T values
|
||||
* @return true if successful
|
||||
* @param One of the PM_BITS_T values
|
||||
* @return True if successful
|
||||
*/
|
||||
bool setPowerMode(PM_BITS_T pm);
|
||||
|
||||
/**
|
||||
* enable one or more of the 3 axes. The arguement is a bitmsk
|
||||
* composed of REG1_XEN, REG1_YEN and/or REG1_ZEN corresponding
|
||||
* Enables one or more of the 3 axes. The arguement is a bitmask
|
||||
* composed of REG1_XEN, REG1_YEN, and/or REG1_ZEN corresponding to
|
||||
* the axes you want enabled.
|
||||
*
|
||||
* @param axisEnable bitmask of axes to enable
|
||||
* @param axisEnable Bitmask of axes to enable
|
||||
* (REG1_XEN | REG1_YEN | REG1_ZEN)
|
||||
* @return true if successful
|
||||
* @return True if successful
|
||||
*/
|
||||
bool enableAxis(uint8_t axisEnable);
|
||||
|
||||
/**
|
||||
* set the scaling factor to 100, 200, or 400G's
|
||||
* Sets the scaling factor to 100g, 200g, or 400g
|
||||
*
|
||||
* @param fs one of the FS_BITS_T values
|
||||
* @return true if successful
|
||||
* @param fs One of the FS_BITS_T values
|
||||
* @return True if successful
|
||||
*/
|
||||
bool setFullScale(FS_BITS_T fs);
|
||||
|
||||
/**
|
||||
* set high pass cutoff filter
|
||||
* Sets a high-pass cutoff filter
|
||||
*
|
||||
* @param val one of the HPCF_BITS_T values
|
||||
* @return true if successful
|
||||
* @param val One of the HPCF_BITS_T values
|
||||
* @return True if successful
|
||||
*/
|
||||
bool setHPCF(HPCF_BITS_T val);
|
||||
|
||||
/**
|
||||
* set high pass filter mode
|
||||
* Sets a high-pass filter mode
|
||||
*
|
||||
* @param val one of the HPM_BITS_T values
|
||||
* @return true if successful
|
||||
* @param val One of the HPM_BITS_T values
|
||||
* @return True if successful
|
||||
*/
|
||||
bool setHPM(HPM_BITS_T val);
|
||||
|
||||
/**
|
||||
* boot the device. Booting the device causes internal flash
|
||||
* calibration values to be reloaded into the visible registers,
|
||||
* in the event they have been corrupted. This function will
|
||||
* return when boot is complete.
|
||||
* Boots the device. Booting the device causes internal flash
|
||||
* calibration values to be reloaded into the visible registers
|
||||
* in case they have been corrupted. This function
|
||||
* returns when the booting is complete.
|
||||
*
|
||||
* @return true if successful
|
||||
* @return True if successful
|
||||
*/
|
||||
bool boot();
|
||||
|
||||
/**
|
||||
* enable high pass filter for interrupt 1 source
|
||||
* Enables a high-pass filter for interrupt 1 source
|
||||
*
|
||||
* @param enable true to enable the filter, false otherwise
|
||||
* @return true if successful
|
||||
* @param enable True to enable the filter, false otherwise
|
||||
* @return True if successful
|
||||
*/
|
||||
bool enableHPF1(bool enable);
|
||||
|
||||
/**
|
||||
* enable high pass filter for interrupt 2 source
|
||||
* Enables a high-pass filter for interrupt 2 source
|
||||
*
|
||||
* @param enable true to enable the filter, false otherwise
|
||||
* @return true if successful
|
||||
* @param enable True to enable the filter, false otherwise
|
||||
* @return True if successful
|
||||
*/
|
||||
bool enableHPF2(bool enable);
|
||||
|
||||
/**
|
||||
* enable filtered data selection
|
||||
* Enables filtered data selection
|
||||
*
|
||||
* @param enable true to enable, false otherwise
|
||||
* @return true if successful
|
||||
* @param enable True to enable, false otherwise
|
||||
* @return True if successful
|
||||
*/
|
||||
bool enableFDS(bool enable);
|
||||
|
||||
/**
|
||||
* set interrupts to be active low instead of high
|
||||
* Sets interrupts to be active low instead of high
|
||||
*
|
||||
* @param enable true to enable, false otherwise
|
||||
* @return true if successful
|
||||
* @param enable True to enable, false otherwise
|
||||
* @return True if successful
|
||||
*/
|
||||
bool setInterruptActiveLow(bool enable);
|
||||
|
||||
/**
|
||||
* set interrupt output mode to open drain rather than push/pull
|
||||
* Sets an interrupt output mode to open drain rather than push/pull
|
||||
*
|
||||
* @param enable true to enable, false otherwise
|
||||
* @return true if successful
|
||||
* @param enable True to enable, false otherwise
|
||||
* @return True if successful
|
||||
*/
|
||||
bool setInterruptOpenDrain(bool enable);
|
||||
|
||||
/**
|
||||
* set interrupt 1 latch enable
|
||||
* Enables interrupt 1 latch
|
||||
*
|
||||
* @param enable true to enable, false otherwise
|
||||
* @return true if successful
|
||||
* @param enable True to enable, false otherwise
|
||||
* @return True if successful
|
||||
*/
|
||||
bool setInterrupt1Latch(bool enable);
|
||||
|
||||
/**
|
||||
* set interrupt 2 latch enable
|
||||
* Enables interrupt 2 latch
|
||||
*
|
||||
* @param enable true to enable, false otherwise
|
||||
* @return true if successful
|
||||
* @param enable True to enable, false otherwise
|
||||
* @return True if successful
|
||||
*/
|
||||
bool setInterrupt2Latch(bool enable);
|
||||
|
||||
/**
|
||||
* set the interrupt 1 pad configuration
|
||||
* Sets the interrupt 1 pad configuration
|
||||
*
|
||||
* @param val one fo the I_CFG_BITS_T values
|
||||
* @return true if successful
|
||||
* @param val One fo the I_CFG_BITS_T values
|
||||
* @return True if successful
|
||||
*/
|
||||
bool setInterrupt1PadConfig(I_CFG_BITS_T val);
|
||||
|
||||
/**
|
||||
* set the interrupt 2 pad configuration
|
||||
* Sets the interrupt 2 pad configuration
|
||||
*
|
||||
* @param val one fo the I_CFG_BITS_T values
|
||||
* @return true if successful
|
||||
* @param val One fo the I_CFG_BITS_T values
|
||||
* @return True if successful
|
||||
*/
|
||||
bool setInterrupt2PadConfig(I_CFG_BITS_T val);
|
||||
|
||||
/**
|
||||
* enable block data update. When enabled, low/high output
|
||||
* registers are not update until both low and high values have
|
||||
* Enables block data update. When enabled, low/high output
|
||||
* registers are not updated until both low and high values have
|
||||
* been read.
|
||||
*
|
||||
* @param enable true to enable, false otherwise
|
||||
* @return true if successful
|
||||
* @param enable True to enable, false otherwise
|
||||
* @return True if successful
|
||||
*/
|
||||
bool enableBDU(bool enable);
|
||||
|
||||
/**
|
||||
* enable big endian output for 16b reads
|
||||
* Enables big-endian output for 16b reads
|
||||
*
|
||||
* @param enable true to enable, false otherwise
|
||||
* @return true if successful
|
||||
* @param enable True to enable, false otherwise
|
||||
* @return True if successful
|
||||
*/
|
||||
bool enableBLE(bool enable);
|
||||
|
||||
/**
|
||||
* enable sleep to wake functionality.
|
||||
* Enables sleep-to-wake functionality
|
||||
*
|
||||
* @param enable true to enable, false otherwise
|
||||
* @return true if successful
|
||||
* @param enable True to enable, false otherwise
|
||||
* @return True if successful
|
||||
*/
|
||||
bool enableSleepToWake(bool enable);
|
||||
|
||||
/**
|
||||
* return the contents of the REG_STATUS register
|
||||
* Returns the contents of the REG_STATUS register
|
||||
*
|
||||
* @return the contents of the REG_STATUS register
|
||||
* @return Contents of the REG_STATUS register
|
||||
*/
|
||||
uint8_t getStatus();
|
||||
|
||||
/**
|
||||
* setup the interrupt 1 config register
|
||||
* Sets up the interrupt 1 config register
|
||||
*
|
||||
* @param val a bitmask of desired INT_CFG_BITS_T bits
|
||||
* @return true if successful
|
||||
* @param val Bitmask of desired INT_CFG_BITS_T bits
|
||||
* @return True if successful
|
||||
*/
|
||||
bool setInterrupt1Config(uint8_t val);
|
||||
|
||||
/**
|
||||
* setup the interrupt 2 config register
|
||||
* Sets up the interrupt 2 config register
|
||||
*
|
||||
* @param val a bitmask of desired INT_CFG_BITS_T bits
|
||||
* @return true if successful
|
||||
* @param val Bitmask of desired INT_CFG_BITS_T bits
|
||||
* @return True if successful
|
||||
*/
|
||||
bool setInterrupt2Config(uint8_t val);
|
||||
|
||||
/**
|
||||
* setup the interrupt 1 source register
|
||||
* Sets up the interrupt 1 source register
|
||||
*
|
||||
* @param val a bitmask of desired INT_SRC_BITS_T bits
|
||||
* @return true if successful
|
||||
* @param val Bitmask of desired INT_SRC_BITS_T bits
|
||||
* @return True if successful
|
||||
*/
|
||||
bool setInterrupt1Source(uint8_t val);
|
||||
|
||||
/**
|
||||
* setup the interrupt 2 source register
|
||||
* Sets up the interrupt 2 source register
|
||||
*
|
||||
* @param val a bitmask of desired INT_SRC_BITS_T bits
|
||||
* @return true if successful
|
||||
* @param val Bitmask of desired INT_SRC_BITS_T bits
|
||||
* @return True if successful
|
||||
*/
|
||||
bool setInterrupt2Source(uint8_t val);
|
||||
|
||||
/**
|
||||
* setup the interrupt 1 threshold register
|
||||
* Sets up the interrupt 1 threshold register
|
||||
*
|
||||
* @param val the threshhold to set
|
||||
* @return true if successful
|
||||
* @param val Threshhold to set
|
||||
* @return True if successful
|
||||
*/
|
||||
bool setInterrupt1Threshold(uint8_t val);
|
||||
|
||||
/**
|
||||
* setup the interrupt 2 threshold register
|
||||
* Sets up the interrupt 2 threshold register
|
||||
*
|
||||
* @param val the threshhold to set
|
||||
* @return true if successful
|
||||
* @param val Threshhold to set
|
||||
* @return True if successful
|
||||
*/
|
||||
bool setInterrupt2Threshold(uint8_t val);
|
||||
|
||||
/**
|
||||
* setup the interrupt 1 duration register
|
||||
* Sets up the interrupt 1 duration register
|
||||
*
|
||||
* @param val the duration to set
|
||||
* @return true if successful
|
||||
* @param val Duration to set
|
||||
* @return True if successful
|
||||
*/
|
||||
bool setInterrupt1Duration(uint8_t val);
|
||||
|
||||
/**
|
||||
* setup the interrupt 2 duration register
|
||||
* Sets up the interrupt 2 duration register
|
||||
*
|
||||
* @param val the duration to set
|
||||
* @return true if successful
|
||||
* @param val Duration to set
|
||||
* @return True if successful
|
||||
*/
|
||||
bool setInterrupt2Duration(uint8_t val);
|
||||
|
||||
/**
|
||||
* read the sensor and store current values internally
|
||||
* Reads the sensor and stores current values internally
|
||||
*/
|
||||
void update();
|
||||
|
||||
/**
|
||||
* set adjustment offsets for each of the axes. This can be used
|
||||
* for calibration. The values supplied here will be subtracted
|
||||
* Sets adjustment offsets for each of the axes. This can be used
|
||||
* for calibration. The values supplied here are subtracted
|
||||
* from the axis data read from the device.
|
||||
*
|
||||
* @param adjX the amount by which to correct the X axis measurement
|
||||
* @param adjY the amount by which to correct the Y axis measurement
|
||||
* @param adjZ the amount by which to correct the Z axis measurement
|
||||
* @param adjX Amount by which to correct the X-axis measurement
|
||||
* @param adjY Amount by which to correct the Y-axis measurement
|
||||
* @param adjZ Amount by which to correct the Z-axis measurement
|
||||
*/
|
||||
void setAdjustmentOffsets(int adjX, int adjY, int adjZ);
|
||||
|
||||
/**
|
||||
* get the acceleration values for each of the axes
|
||||
* Gets acceleration values for each of the axes
|
||||
*
|
||||
* @param aX the returned X acceleration
|
||||
* @param aY the returned Y acceleration
|
||||
* @param aZ the returned Z acceleration
|
||||
* @param aX Returned X-axis acceleration
|
||||
* @param aY Returned Y-axis acceleration
|
||||
* @param aZ Returned Z-axis acceleration
|
||||
*/
|
||||
void getAcceleration(float *aX, float *aY, float *aZ);
|
||||
|
||||
/**
|
||||
* get the raw axis values
|
||||
* Gets raw axis values
|
||||
*
|
||||
* @param x the returned raw X value
|
||||
* @param y the returned raw Y value
|
||||
* @param z the returned raw Z value
|
||||
* @param x Returned raw X-axis value
|
||||
* @param y Returned raw Y-axis value
|
||||
* @param z Returned raw Z-axis value
|
||||
*/
|
||||
void getRawXYZ(int *x, int *y, int *z);
|
||||
|
||||
/**
|
||||
* get the adjusted axis values
|
||||
* Gets adjusted axis values
|
||||
*
|
||||
* @param x the returned X value
|
||||
* @param y the returned Y value
|
||||
* @param z the returned Z value
|
||||
* @param x Returned X-axis value
|
||||
* @param y Returned Y-axis value
|
||||
* @param z Returned Z-axis value
|
||||
*/
|
||||
void getXYZ(int *x, int *y, int *z);
|
||||
|
||||
/**
|
||||
* provide public access to the class's MRAA i2C context for
|
||||
* Provides public access to the MRAA I2C context of the class for
|
||||
* direct user access
|
||||
*
|
||||
* @return a reference to the class i2c context
|
||||
* @return Reference to the class I2C context
|
||||
*/
|
||||
mraa::I2c& i2cContext() { return m_i2c; };
|
||||
|
||||
|
@ -37,7 +37,7 @@
|
||||
|
||||
namespace upm {
|
||||
/**
|
||||
* @brief HC-SR04 ultrasonic sensor library
|
||||
* @brief HC-SR04 Ultrasonic Sensor library
|
||||
* @defgroup hcsr04 libupm-hcsr04
|
||||
* @ingroup generic gpio sound
|
||||
*/
|
||||
@ -45,50 +45,50 @@ namespace upm {
|
||||
/**
|
||||
* @library hcsr04
|
||||
* @sensor hcsr04
|
||||
* @comname HCSR04 Ultrasonic Sensor
|
||||
* @comname HC-SR04 Ultrasonic Sensor
|
||||
* @type sound
|
||||
* @man generic
|
||||
* @con gpio
|
||||
*
|
||||
* @brief API for HCSR04 (ultrasonic ranging module) component
|
||||
* @brief API for the HC-SR04 Ultrasonic Sensor
|
||||
*
|
||||
* This file defines the HCSR04 interface for libhcsr04
|
||||
* This file defines the HC-SR04 interface for libhcsr04
|
||||
*
|
||||
* @snippet hcsr04.cxx Interesting
|
||||
*/
|
||||
class HCSR04 {
|
||||
public:
|
||||
/**
|
||||
* Instanciates a HCSR04 object
|
||||
* Instantiates an HCSR04 object
|
||||
*
|
||||
* @param triggerPin pin for triggering the sensor for distance
|
||||
* @param echoPin pulse response to triggering
|
||||
* @param fptr function pointer for handling raising and
|
||||
* falling interrupts
|
||||
* @param triggerPin Pin to trigger the sensor for distance
|
||||
* @param echoPin Pulse response to triggering
|
||||
* @param fptr Function pointer to handle rising-edge and
|
||||
* falling-edge interrupts
|
||||
*/
|
||||
HCSR04 (uint8_t triggerPin, uint8_t echoPin, void (*fptr)(void *));
|
||||
|
||||
/**
|
||||
* HCSR04 object destructor.
|
||||
* HCSR04 object destructor
|
||||
*/
|
||||
~HCSR04 ();
|
||||
|
||||
/**
|
||||
* Get the distance from the sensor.
|
||||
* Gets the distance from the sensor
|
||||
*/
|
||||
int getDistance ();
|
||||
|
||||
/**
|
||||
* On each interrupt this function will detect if the interrupt
|
||||
* was falling edge or rising.
|
||||
* On each interrupt, this function detects if the interrupt
|
||||
* was falling-edge or rising-edge.
|
||||
* Should be called from the interrupt handler.
|
||||
*/
|
||||
void ackEdgeDetected ();
|
||||
|
||||
uint8_t m_doWork; /**< Flag to controll blocking function while waiting for falling edge interrupt */
|
||||
uint8_t m_doWork; /**< Flag to control blocking function while waiting for a falling-edge interrupt */
|
||||
|
||||
/**
|
||||
* Return name of the component
|
||||
* Returns the name of the sensor
|
||||
*/
|
||||
std::string name()
|
||||
{
|
||||
|
@ -47,7 +47,7 @@
|
||||
|
||||
namespace upm {
|
||||
/**
|
||||
* @brief HM-11 Bluetooth 4.0 Low Energy module library
|
||||
* @brief HM-11 Bluetooth 4.0 Low Energy Module library
|
||||
* @defgroup hm11 libupm-hm11
|
||||
* @ingroup seeed uart wifi
|
||||
*/
|
||||
@ -63,16 +63,16 @@ namespace upm {
|
||||
* @con uart
|
||||
* @web http://www.seeedstudio.com/wiki/images/c/cd/Bluetooth4_en.pdf
|
||||
*
|
||||
* @brief API HM-11 4.0 Bluetooth Low Energy Module
|
||||
* @brief API for the HM-11 4.0 Bluetooth Low Energy Module
|
||||
*
|
||||
* The driver was tested with the Grove BLE module. Its an HM-11
|
||||
* The driver was tested with the Grove BLE module. It's an HM-11
|
||||
* BLE 4.0 module based on a TI CC2541 chip. It operates using a
|
||||
* standard 'AT' command set. See the datasheet for a full list
|
||||
* of available commands and their possible responses.
|
||||
* of available commands and their possible responses:
|
||||
*
|
||||
* http://www.seeedstudio.com/wiki/images/c/cd/Bluetooth4_en.pdf
|
||||
*
|
||||
* It is connected via a UART at 9600 baud.
|
||||
* It is connected via a UART at 9,600 baud.
|
||||
*
|
||||
* @image html hm11.jpg
|
||||
* @snippet hm11.cxx Interesting
|
||||
@ -82,52 +82,52 @@ namespace upm {
|
||||
public:
|
||||
|
||||
/**
|
||||
* HM11 module constructor
|
||||
* HM11 object constructor
|
||||
*
|
||||
* @param uart default uart to use (0 or 1)
|
||||
* @param uart Default UART to use (0 or 1)
|
||||
*/
|
||||
HM11(int uart);
|
||||
|
||||
/**
|
||||
* HM11 module Destructor
|
||||
* HM11 object destructor
|
||||
*/
|
||||
~HM11();
|
||||
|
||||
/**
|
||||
* check to see if there is data available for reading
|
||||
* Checks to see if there is data available for reading
|
||||
*
|
||||
* @param millis number of milliseconds to wait, 0 means no wait.
|
||||
* @return true if there is data available to be read
|
||||
* @param millis Number of milliseconds to wait; 0 means no waiting
|
||||
* @return True if there is data available for reading
|
||||
*/
|
||||
bool dataAvailable(unsigned int millis);
|
||||
|
||||
/**
|
||||
* read any available data into a user-supplied buffer. Note, the
|
||||
* call will block until data is available to be read. Use
|
||||
* Reads any available data into a user-supplied buffer. Note: the
|
||||
* call blocks until data is available for reading. Use
|
||||
* dataAvailable() to determine whether there is data available
|
||||
* beforehand, to avoid blocking.
|
||||
*
|
||||
* @param buffer the buffer to hold the data read
|
||||
* @param len the length of the buffer
|
||||
* @return the number of bytes read
|
||||
* @param buffer Buffer to hold the data read
|
||||
* @param len Length of the buffer
|
||||
* @return Number of bytes read
|
||||
*/
|
||||
int readData(char *buffer, size_t len);
|
||||
|
||||
/**
|
||||
* write the data in buffer to the device
|
||||
* Writes the data in the buffer to the device
|
||||
*
|
||||
* @param buffer the buffer to hold the data read
|
||||
* @param len the length of the buffer
|
||||
* @return the number of bytes written
|
||||
* @param buffer Buffer to hold the data read
|
||||
* @param len Length of the buffer
|
||||
* @return Number of bytes written
|
||||
*/
|
||||
int writeData(char *buffer, size_t len);
|
||||
|
||||
/**
|
||||
* setup the proper tty i/o modes and the baudrate. The default
|
||||
* baud rate is 9600 (B9600) for this device.
|
||||
* Sets up proper tty I/O modes and the baud rate. For this device, the default
|
||||
* baud rate is 9,600 (B9600).
|
||||
*
|
||||
* @param baud the desired baud rate.
|
||||
* @return true if successful
|
||||
* @param baud Desired baud rate.
|
||||
* @return True if successful
|
||||
*/
|
||||
bool setupTty(speed_t baud=B9600);
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
namespace upm {
|
||||
|
||||
/**
|
||||
* @brief Hmc5883l magnometer library
|
||||
* @brief HMC5883L Magnometer library
|
||||
* @defgroup hmc5883l libupm-hmc5883l
|
||||
* @ingroup seeed i2c compass robok
|
||||
*/
|
||||
@ -46,13 +46,13 @@ namespace upm {
|
||||
* @con i2c
|
||||
* @kit robok
|
||||
*
|
||||
* @brief API for Hmc5883l (3-axis digital compass)
|
||||
* @brief API for the HMC5883L 3-Axis Digital Compass
|
||||
*
|
||||
* The Honeywell [HMC5883L]
|
||||
* Honeywell [HMC5883L]
|
||||
* (http://www.adafruit.com/datasheets/HMC5883L_3-Axis_Digital_Compass_IC.pdf)
|
||||
* is a 3-axis digital compass. Communication with the HMC5883L is simple and
|
||||
* all done through an I2C interface. Different breakout boards are available,
|
||||
* typically a 3V supply is all that is needed to power the sensor.
|
||||
* is a 3-axis digital compass. Communication with HMC5883L is simple and
|
||||
* all done through an I2C interface. Different breakout boards are available.
|
||||
* Typically, a 3V supply is all that is needed to power the sensor.
|
||||
*
|
||||
* @image html hmc5883l.jpeg
|
||||
* @snippet hmc5883l.cxx Interesting
|
||||
@ -60,9 +60,9 @@ namespace upm {
|
||||
class Hmc5883l {
|
||||
public:
|
||||
/**
|
||||
* Creates a Hmc5883l object
|
||||
* Creates an Hmc5883l object
|
||||
*
|
||||
* @param bus number of used i2c bus
|
||||
* @param bus Number of the used I2C bus
|
||||
*/
|
||||
Hmc5883l(int bus);
|
||||
|
||||
@ -84,9 +84,9 @@ public:
|
||||
int16_t* coordinates();
|
||||
|
||||
/**
|
||||
* Updates the values by reading from i2c
|
||||
* Updates the values by reading from I2C
|
||||
*
|
||||
* @return 0 for success
|
||||
* @return 0 if successful
|
||||
*/
|
||||
mraa_result_t update();
|
||||
|
||||
@ -98,7 +98,7 @@ public:
|
||||
/**
|
||||
* Gets the current magnetic declination value
|
||||
*
|
||||
* @return magnetic declination as a float
|
||||
* @return Magnetic declination as a floating-point value
|
||||
*/
|
||||
float get_declination();
|
||||
private:
|
||||
|
@ -58,10 +58,10 @@ namespace upm {
|
||||
* @man seeed
|
||||
* @con uart
|
||||
*
|
||||
* @brief API for the HMTRP Serial RF Pro
|
||||
* @brief API for the HM-TRP Serial RF Pro transceiver
|
||||
*
|
||||
* UPM support for the HMTRP Serial RF Pro. This was tested
|
||||
* specifically with the Grove Serial RF Pro module. In theory,
|
||||
* UPM support for the HM-TRP Serial RF Pro transceiver. This was tested
|
||||
* specifically with the Grove Serial RF Pro transceiver. In theory,
|
||||
* this class should work with the following devices:
|
||||
*
|
||||
* HM-TRP-433: 414000000-454000000Hz
|
||||
@ -69,12 +69,12 @@ namespace upm {
|
||||
* HM-TRP-868: 849000000-889000000Hz
|
||||
* HM-TRP-915: 895000000-935000000Hz
|
||||
*
|
||||
* The only difference being the transmit and receive frequencies
|
||||
* The only difference is the transmit and receive frequencies
|
||||
* supported.
|
||||
*
|
||||
* By default, the device will simply send and receive any data
|
||||
* presented on it's UART interface. It can be placed into a
|
||||
* configuration mode by grounding the CONFIG pin on the module.
|
||||
* By default, the device simply sends and receives any data
|
||||
* presented on its UART interface. It can be put into a
|
||||
* configuration mode by grounding the CONFIG pin on the transceiver.
|
||||
*
|
||||
* @image html hmtrp.jpg
|
||||
* @snippet hmtrp.cxx Interesting
|
||||
@ -96,150 +96,150 @@ namespace upm {
|
||||
} HMTRP_OPCODE_T;
|
||||
|
||||
/**
|
||||
* HMTRP Serial RF Pro module constructor
|
||||
* HMTRP Serial RF Pro transceiver constructor
|
||||
*
|
||||
* @param uart default uart to use (0 or 1)
|
||||
* @param uart Default UART to use (0 or 1)
|
||||
*/
|
||||
HMTRP(int uart=HMTRP_DEFAULT_UART);
|
||||
|
||||
/**
|
||||
* HMTRP Serial RF Pro module Destructor
|
||||
* HMTRP destructor
|
||||
*/
|
||||
~HMTRP();
|
||||
|
||||
/**
|
||||
* Check to see if there is data available for reading
|
||||
* Checks to see if there is data available for reading
|
||||
*
|
||||
* @param millis number of milliseconds to wait, 0 means no wait (default).
|
||||
* @return true if there is data available to be read
|
||||
* @param millis Number of milliseconds to wait; 0 means no waiting (default).
|
||||
* @return True if there is data available for reading
|
||||
*/
|
||||
bool dataAvailable(unsigned int millis=0);
|
||||
|
||||
/**
|
||||
* read any available data into a user-supplied buffer.
|
||||
* Reads any available data in a user-supplied buffer
|
||||
*
|
||||
* @param buffer the buffer to hold the data read
|
||||
* @param len the length of the buffer
|
||||
* @param millis maxim time in milliseconds to wait for input. -1 means
|
||||
* wait forever (default).
|
||||
* @return the number of bytes read, 0 if timed out and millis >= 0
|
||||
* @param buffer Buffer to hold the data read
|
||||
* @param len Length of the buffer
|
||||
* @param millis Maximum time in milliseconds to wait for input. -1 means
|
||||
* waiting forever (default).
|
||||
* @return Number of bytes read; 0 if timed out and millis is >= 0
|
||||
*/
|
||||
int readData(char *buffer, size_t len, int millis=-1);
|
||||
|
||||
/**
|
||||
* write the data in buffer to the device
|
||||
* Writes the data in the buffer to the device
|
||||
*
|
||||
* @param buffer the buffer to hold the data read
|
||||
* @param len the length of the buffer
|
||||
* @return the number of bytes written
|
||||
* @param buffer Buffer to hold the data read
|
||||
* @param len Length of the buffer
|
||||
* @return Number of bytes written
|
||||
*/
|
||||
int writeData(char *buffer, size_t len);
|
||||
|
||||
/**
|
||||
* setup the proper tty i/o modes and the baudrate. The default
|
||||
* baud rate is 9600 (B9600).
|
||||
* Sets up proper tty I/O modes and the baud rate. The default
|
||||
* baud rate is 9,600 (B9600).
|
||||
*
|
||||
* @param baud the desired baud rate.
|
||||
* @return true if successful
|
||||
* @param baud Desired baud rate.
|
||||
* @return True if successful
|
||||
*/
|
||||
bool setupTty(speed_t baud=B9600);
|
||||
|
||||
/**
|
||||
* Look for and verify an OK response. This will look like "OK\r\n"
|
||||
* Looks for and verifies an OK response. This looks like "OK\r\n"
|
||||
*
|
||||
* @return true if OK received
|
||||
* @return True if OK received
|
||||
*/
|
||||
bool checkOK();
|
||||
|
||||
/**
|
||||
* reset the device to default parameters, except for UART baud rate
|
||||
* Resets the device to default parameters, except for the UART baud rate
|
||||
*
|
||||
* @return true if successful
|
||||
* @return True if successful
|
||||
*/
|
||||
bool reset();
|
||||
|
||||
/**
|
||||
* Query the radio to determine it's configuration
|
||||
* Queries the radio to determine its configuration
|
||||
*
|
||||
* @param freq operating frequency
|
||||
* @param dataRate tx/rx bit rate
|
||||
* @param rxBandwidth receiving bandwidth in Khz
|
||||
* @param modulation modulation frequency in Khz
|
||||
* @param txPower transmission power (1-7)
|
||||
* @param freq Operating frequency
|
||||
* @param dataRate TX/RX bit rate
|
||||
* @param rxBandwidth Receiving bandwidth in Khz
|
||||
* @param modulation Modulation frequency in Khz
|
||||
* @param txPower Transmission power (1-7)
|
||||
* @param uartBaud UART baud rate
|
||||
* @return true if successful
|
||||
* @return True if successful
|
||||
*/
|
||||
bool getConfig(uint32_t *freq, uint32_t *dataRate, uint16_t *rxBandwidth,
|
||||
uint8_t *modulation, uint8_t *txPower, uint32_t *uartBaud);
|
||||
|
||||
/**
|
||||
* set the frequency. Note, this is limited depending on which
|
||||
* HM-TRP device you are using. Consult the datasheet.
|
||||
* Sets the frequency. Note: this is limited depending on which
|
||||
* HM-TRP device you are using. Consult the datasheet.
|
||||
*
|
||||
* @param freq operating frequency
|
||||
* @return true if successful
|
||||
* @param freq Operating frequency
|
||||
* @return True if successful
|
||||
*/
|
||||
bool setFrequency(uint32_t freq);
|
||||
|
||||
/**
|
||||
* set the RF data transmission rate. Valid values are between
|
||||
* 1200-115200.
|
||||
* Sets the RF data transmission rate. Valid values are between
|
||||
* 1,200 and 115,200.
|
||||
*
|
||||
* @param rate radio transmission rate in baud (1200-115200)
|
||||
* @return true if successful
|
||||
* @param rate Radio transmission rate in baud (1,200-115,200)
|
||||
* @return True if successful
|
||||
*/
|
||||
bool setRFDataRate(uint32_t rate);
|
||||
|
||||
/**
|
||||
* set the RX bandwidth. Valid values are between 30-620 (in Khz)
|
||||
* Sets the RX bandwidth. Valid values are between 30 and 620 (in Khz)
|
||||
*
|
||||
* @param rxBand set receive bandwidth (30-620) Khz
|
||||
* @return true if successful
|
||||
* @param rxBand RX bandwidth in Khz (30-620)
|
||||
* @return True if successful
|
||||
*/
|
||||
bool setRXBandwidth(uint16_t rxBand);
|
||||
|
||||
/**
|
||||
* set the frequency modulation. Valid values are between 10-160 (in Khz)
|
||||
* Sets the frequency modulation. Valid values are between 10 and 160 (in Khz)
|
||||
*
|
||||
* @param modulation frequency modulation to use (10-160) Khz
|
||||
* @return true if successful
|
||||
* @param modulation Frequency modulation to use, in Khz (10-160)
|
||||
* @return True if successful
|
||||
*/
|
||||
bool setFrequencyModulation(uint8_t modulation);
|
||||
|
||||
/**
|
||||
* set the transmit power level. Valid values are between 0-7,
|
||||
* with 7 being maximum power.
|
||||
* Sets the transmit power level. Valid values are between 0 and 7,
|
||||
* 7 being the maximum power.
|
||||
*
|
||||
* @param power power level to use during transmit. Vaild values
|
||||
* are between 0-7.
|
||||
* @return true if successful
|
||||
* @param power Power level to use during transmission. Valid values
|
||||
* are between 0 and 7.
|
||||
* @return True if successful
|
||||
*/
|
||||
bool setTransmitPower(uint8_t power);
|
||||
|
||||
/**
|
||||
* set the configured baud rate of the UART. It is strongly
|
||||
* recommended that you do not change this or you may lose the
|
||||
* ability to communicate with the module. Valid values are 1200-115200.
|
||||
* Sets the configured baud rate of the UART. It is strongly
|
||||
* recommended you do not change this, or you may lose the
|
||||
* ability to communicate with the transceiver. Valid values are 1,200-115,200.
|
||||
*
|
||||
* @param speed desired baud rate to configure the device to use.
|
||||
* Valid values are between 1200-115200.
|
||||
* @return true if successful
|
||||
* @param speed Desired baud rate to configure the device to use
|
||||
* Valid values are between 1,200 and 115,200.
|
||||
* @return True if successful
|
||||
*/
|
||||
bool setUARTSpeed(uint32_t speed);
|
||||
|
||||
/**
|
||||
* get the RF signal strength.
|
||||
* Gets the RF signal strength
|
||||
*
|
||||
* @param strength the returned strength
|
||||
* @return true if successful
|
||||
* @param strength Returned strength
|
||||
* @return True if successful
|
||||
*/
|
||||
bool getRFSignalStrength(uint8_t *strength);
|
||||
|
||||
/**
|
||||
* get the Modulation signal strength.
|
||||
* Gets the modulation signal strength.
|
||||
*
|
||||
* @param strength the returned strength
|
||||
* @return true if successful
|
||||
* @param strength Returned strength
|
||||
* @return True if successful
|
||||
*/
|
||||
bool getModSignalStrength(uint8_t *strength);
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
||||
namespace upm {
|
||||
|
||||
/**
|
||||
* @brief HP20X I2C Barometer (high accuracy) library
|
||||
* @brief HP20X I2C Barometer (High-Accuracy) library
|
||||
* @defgroup hp20x libupm-hp20x
|
||||
* @ingroup seeed i2c pressure
|
||||
*/
|
||||
@ -40,21 +40,21 @@ namespace upm {
|
||||
/**
|
||||
* @library hp20x
|
||||
* @sensor hp20x
|
||||
* @comname Grove Barometer (high accuracy)
|
||||
* @altname HP20X Barometer (high accuracy)
|
||||
* @comname Grove Barometer (High-Accuracy)
|
||||
* @altname HP20X Barometer (High-Accuracy)
|
||||
* @type pressure
|
||||
* @man seeed
|
||||
* @web http://www.seeedstudio.com/depot/Grove-Barometer-HighAccuracy-p-1865.html
|
||||
* @con i2c
|
||||
*
|
||||
* @brief API for the HP20X based Grove Barometer (high accuracy)
|
||||
* @brief API for the HP20X-based Grove Barometer (High-Accuracy)
|
||||
*
|
||||
* This is a high accuracy barometer providing pressure, altitude
|
||||
* and temperature data. It can be calabrated for a given altitude
|
||||
* This is a high-accuracy barometer providing pressure, altitude,
|
||||
* and temperature data. It can be calibrated for a given altitude
|
||||
* offset, and a wide range of interrupt generating capabilities are
|
||||
* supported. As usual, see the HP20x datasheet for more detail.
|
||||
* supported. As usual, see the HP20X datasheet for more details.
|
||||
*
|
||||
* This module was developed using a Grove Barometer (High Accuracy)
|
||||
* This module was developed using a Grove Barometer (High-Accuracy)
|
||||
* based on an HP206C chip.
|
||||
*
|
||||
* @image html hp20x.jpg
|
||||
@ -183,7 +183,7 @@ namespace upm {
|
||||
|
||||
INT_SRC_DEV_RDY = 0x40, // device is ready
|
||||
|
||||
INT_SRC_TH_ERR = 0x80 // threshhold error
|
||||
INT_SRC_TH_ERR = 0x80 // threshold error
|
||||
} INT_SRC_BITS_T;
|
||||
|
||||
/**
|
||||
@ -195,178 +195,178 @@ namespace upm {
|
||||
} PARA_BITS_T;
|
||||
|
||||
/**
|
||||
* hp20x constructor
|
||||
* HP20X constructor
|
||||
*
|
||||
* @param bus i2c bus to use
|
||||
* @param address the address for this device
|
||||
* @param bus I2C bus to use
|
||||
* @param address Address for this device
|
||||
*/
|
||||
HP20X(int bus=HP20X_I2C_BUS, uint8_t address=HP20X_DEFAULT_I2C_ADDR);
|
||||
|
||||
/**
|
||||
* HP20X Destructor
|
||||
* HP20X destructor
|
||||
*/
|
||||
~HP20X();
|
||||
|
||||
/**
|
||||
* set up initial values and start operation
|
||||
* Sets up initial values and starts operation
|
||||
*
|
||||
* @param dsr the data sampling rate: one of the DSR_BITS_T values
|
||||
* @return true if successful
|
||||
* @param dsr Data sampling rate; one of the DSR_BITS_T values
|
||||
* @return True if successful
|
||||
*/
|
||||
bool init(DSR_BITS_T dsr=DSR_4096);
|
||||
|
||||
/**
|
||||
* send a command to the device
|
||||
* Sends a command to the device
|
||||
*
|
||||
* @param cmd command to send, one of the HP20X_CMD_T values, usually
|
||||
* @return true if successful
|
||||
* @param cmd Command to send; usually, one of the HP20X_CMD_T values
|
||||
* @return True if successful
|
||||
*/
|
||||
bool writeCmd(uint8_t cmd);
|
||||
|
||||
/**
|
||||
* write a value to a register
|
||||
* Writes a value to a register
|
||||
*
|
||||
* @param reg register to write, one of the HP20X_REG_T values
|
||||
* @param data value to write
|
||||
* @return true if successful
|
||||
* @param reg Register to write to; one of the HP20X_REG_T values
|
||||
* @param data Value to write
|
||||
* @return True if successful
|
||||
*/
|
||||
bool writeReg(HP20X_REG_T reg, uint8_t data);
|
||||
|
||||
/**
|
||||
* read a register and return it's value
|
||||
* Reads a register and returns its value
|
||||
*
|
||||
* @param reg register to read, one of the HP20X_REG_T values
|
||||
* @return value of specified register
|
||||
* @param reg Register to read; one of the HP20X_REG_T values
|
||||
* @return Value of a specified register
|
||||
*/
|
||||
uint8_t readReg(HP20X_REG_T reg);
|
||||
|
||||
/**
|
||||
* read 3 bytes of data in response to a conversion request, and
|
||||
* convert to an integer
|
||||
* Reads 3 bytes of data in response to a conversion request, and
|
||||
* converts it to an integer
|
||||
*
|
||||
* @return value read back (temperature, pressure, etc)
|
||||
* @return Value read back (temperature, pressure, etc.)
|
||||
*/
|
||||
int readData();
|
||||
|
||||
/**
|
||||
* check to see if the DR_RDY bit is set, indicating the device
|
||||
* Checks to see if the DR_RDY bit is set, indicating the device
|
||||
* can accept commands
|
||||
*
|
||||
* @return true if device is ready, false otherwise
|
||||
* @return True if the device is ready, false otherwise
|
||||
*/
|
||||
bool isReady();
|
||||
|
||||
/**
|
||||
* check to see if device is ready and sleep/retry if not.
|
||||
* Returns once device indicates it's ready.
|
||||
* Checks to see if the device is ready, and sleeps/retries if not.
|
||||
* Returns once the device indicates it's ready.
|
||||
*
|
||||
* @return true if device is ready, false if retries exhausted
|
||||
* @return True if the device is ready; false if retries are exhausted
|
||||
*/
|
||||
bool waitforDeviceReady();
|
||||
|
||||
/**
|
||||
* return the temperature in celcius
|
||||
* Returns the temperature in Celsius
|
||||
*
|
||||
* @return the temperature
|
||||
* @return Temperature
|
||||
*/
|
||||
float getTemperature();
|
||||
|
||||
/**
|
||||
* return the pressure in millibars
|
||||
* Returns the pressure in millibars
|
||||
*
|
||||
* @return the pressure
|
||||
* @return Pressure
|
||||
*/
|
||||
float getPressure();
|
||||
|
||||
/**
|
||||
* return the computed altitude in meters
|
||||
* Returns the computed altitude in meters
|
||||
*
|
||||
* @return the altitude
|
||||
* @return Altitude
|
||||
*/
|
||||
float getAltitude();
|
||||
|
||||
/**
|
||||
* enable or disable the on-chip compensator. This allows the
|
||||
* Enables or disables the on-chip compensator. This allows the
|
||||
* chip to filter and clean up the output data.
|
||||
*
|
||||
* @param enable true to enable, false otherwise
|
||||
* @param enable True to enable, false otherwise
|
||||
*/
|
||||
void compensationEnable(bool enable);
|
||||
|
||||
/**
|
||||
* setup the interrupt enable register. This register defines
|
||||
* Sets up the interrupt enable register. This register defines
|
||||
* which events can cause a hardware interrupt pin to be pulled high
|
||||
* (active).
|
||||
*
|
||||
* @param bits one or more of the INT_EN_BITS_T bits
|
||||
* @return true if successful, false otherwise
|
||||
* @param bits One or more of the INT_EN_BITS_T bits
|
||||
* @return True if successful, false otherwise
|
||||
*/
|
||||
bool setInterruptEnable(uint8_t bits);
|
||||
|
||||
/**
|
||||
* setup the interrupt configuration register. This register
|
||||
* Sets up the interrupt configuration register. This register
|
||||
* defines which events can cause an interrupt to be indicated.
|
||||
*
|
||||
* @param bits one or more of the INT_EN_BITS_T bits
|
||||
* @return true if successful, false otherwise
|
||||
* @param bits One or more of the INT_EN_BITS_T bits
|
||||
* @return True if successful, false otherwise
|
||||
*/
|
||||
bool setInterruptConfig(uint8_t bits);
|
||||
|
||||
/**
|
||||
* get the interrupt source register. This register indicates
|
||||
* which interrupts have been triggered. In addition, it
|
||||
* Gets the interrupt source register. This register indicates
|
||||
* which interrupts have been triggered. In addition, it
|
||||
* indicates when certain operations have been completed.
|
||||
*
|
||||
* @return one of more of the INT_SRC_BITS_T values
|
||||
* @return One of more of the INT_SRC_BITS_T values
|
||||
*/
|
||||
uint8_t getInterruptSource();
|
||||
|
||||
/**
|
||||
* set the data sampling rate. Higher rates are more precise, but
|
||||
* Sets the data sampling rate. Higher rates are more precise, but
|
||||
* take more time per measurement.
|
||||
*
|
||||
* @param dsr one of the DSR_BITS_T values
|
||||
* @param dsr One of the DSR_BITS_T values
|
||||
*/
|
||||
void setDSR(DSR_BITS_T dsr);
|
||||
|
||||
|
||||
/**
|
||||
* start an internal recalibration of the analog blocks. This is
|
||||
* Starts an internal recalibration of analog blocks. This is
|
||||
* faster than a soft reset.
|
||||
*/
|
||||
void recalibrateInternal();
|
||||
|
||||
/**
|
||||
* execute a soft reset. All register values are reset to power
|
||||
* on defaults. This function will return when the reset is
|
||||
* complete and the device reports that it is ready.
|
||||
* Executes a soft reset. All register values are reset to power-on
|
||||
* defaults. This function returns when the reset is
|
||||
* complete and the device reports it is ready.
|
||||
*/
|
||||
void softReset();
|
||||
|
||||
/**
|
||||
* Set the altitude offset for your region. See the datasheet for
|
||||
* more details. Setting this correctly for your region is
|
||||
* Sets the altitude offset for your region. See the datasheet for
|
||||
* more details. Setting this correctly for your region is
|
||||
* required for accurate altitude data.
|
||||
*
|
||||
* @param off the offset
|
||||
* @param off Offset
|
||||
*/
|
||||
void setAltitudeOffset(int16_t off);
|
||||
|
||||
/**
|
||||
* set the pressure/altitude thresholds for interrupt generation.
|
||||
* Sets pressure/altitude thresholds for interrupt generation
|
||||
*
|
||||
* @param low the low threshold for generating an interrupt
|
||||
* @param med the medium threshold for generating an interrupt
|
||||
* @param high the high threshold for generating an interrupt
|
||||
* @param low Low threshold to generate an interrupt
|
||||
* @param med Medium threshold to generate an interrupt
|
||||
* @param high High threshold to generate an interrupt
|
||||
*/
|
||||
void setPAThreshholds(int16_t low, int16_t med, int16_t high);
|
||||
|
||||
/**
|
||||
* set the temperature thresholds for interrupt generation.
|
||||
* Sets temperature thresholds for interrupt generation
|
||||
*
|
||||
* @param low the low threshold for generating an interrupt
|
||||
* @param med the medium threshold for generating an interrupt
|
||||
* @param high the high threshold for generating an interrupt
|
||||
* @param low Low threshold to generate an interrupt
|
||||
* @param med Medium threshold to generate an interrupt
|
||||
* @param high High threshold to generate an interrupt
|
||||
*/
|
||||
void setTemperatureThreshholds(int8_t low, int8_t med, int8_t high);
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
namespace upm {
|
||||
/**
|
||||
* @brief HT9170 DTMF decoder library
|
||||
* @brief HT9170 DTMF Decoder library
|
||||
* @defgroup ht9170 libupm-ht9170
|
||||
* @ingroup seeed gpio other
|
||||
*/
|
||||
@ -46,9 +46,9 @@ namespace upm {
|
||||
*
|
||||
* @brief API for the HT9170 DTMF Decoder
|
||||
*
|
||||
* This driver was developed using the Seeed DTMF (Dual Tone
|
||||
* Multi-Frequency) Shield. It can decode DTMF signals presented at
|
||||
* it's audio input. It does not generate DTMF signals.
|
||||
* This driver was developed using the DTMF (Dual-Tone
|
||||
* Multi-Frequency) Shield by Seeed Studio*. It can decode DTMF signals presented at
|
||||
* its audio input. It does not generate DTMF signals.
|
||||
*
|
||||
* @image html ht9170.jpg
|
||||
* @snippet ht9170.cxx Interesting
|
||||
@ -59,28 +59,28 @@ namespace upm {
|
||||
/**
|
||||
* HT9170 constructor
|
||||
*
|
||||
* @param dr data ready pin
|
||||
* @param o1 digital pin for data output 1
|
||||
* @param o2 digital pin for data output 2
|
||||
* @param o3 digital pin for data output 3
|
||||
* @param o4 digital pin for data output 4
|
||||
* @param dr Data ready pin
|
||||
* @param o1 Digital pin for data output 1
|
||||
* @param o2 Digital pin for data output 2
|
||||
* @param o3 Digital pin for data output 3
|
||||
* @param o4 Digital pin for data output 4
|
||||
*/
|
||||
HT9170(int dr, int o1, int o2, int o3, int o4);
|
||||
|
||||
/**
|
||||
* HT9170 Destructor
|
||||
* HT9170 destructor
|
||||
*/
|
||||
~HT9170();
|
||||
|
||||
/**
|
||||
* check to see if a DTMF number is ready to be read
|
||||
* Checks to see if a DTMF number is ready to be read
|
||||
*
|
||||
* @return true if there is a digit available to decode
|
||||
* @return True if there is a digit available to decode
|
||||
*/
|
||||
bool digitReady();
|
||||
|
||||
/**
|
||||
* decode a digit and return it
|
||||
* Decodes a digit and returns it
|
||||
*
|
||||
*/
|
||||
char decodeDigit();
|
||||
|
@ -49,7 +49,7 @@
|
||||
namespace upm {
|
||||
|
||||
/**
|
||||
* @brief HTU21D humidity sensor library
|
||||
* @brief HTU21D Humidity Sensor library
|
||||
* @defgroup htu21d libupm-htu21d
|
||||
* @ingroup seeed adafruit sparkfun i2c temp
|
||||
*/
|
||||
@ -63,17 +63,17 @@ namespace upm {
|
||||
* @web http://www.meas-spec.com/downloads/HTU21D.pdf
|
||||
* @con i2c
|
||||
*
|
||||
* @brief API for HTU21D chip (Atmospheric Pressure Sensor)
|
||||
* @brief API for the HTU21D Temperature & Humidity Sensor
|
||||
*
|
||||
* Measurement Specialties [HTU21D] is a digital humidity sensor with
|
||||
* HTU21D by Measurement Specialties is a digital humidity sensor with
|
||||
* temperature output.
|
||||
* RH will report between 0 and 100% and temperature range is
|
||||
* -40 to +125 degC. Note that the getCompRH is the preferred
|
||||
* function below (passing true to cause a measurement cycle). If
|
||||
* the actual values used for the compensated ready are necessary, use
|
||||
* RH reports between 0 and 100%, and the temperature range is
|
||||
* -40 to +125 degC. Note: getCompRH is the preferred
|
||||
* function below (passing true to cause a measurement cycle). If
|
||||
* actual values used for the compensated ready are necessary, use
|
||||
* the getHumidity(false) and getTemperature(false) functions following
|
||||
* the getCompRH call.
|
||||
* Also note that the sensor should not perform more than a couple of
|
||||
* Also note the sensor should not perform more than a couple of
|
||||
* measurements per second to limit the heating of the sensor.
|
||||
*
|
||||
* @image html htu21d.jpeg
|
||||
@ -82,98 +82,98 @@ namespace upm {
|
||||
class HTU21D {
|
||||
public:
|
||||
/**
|
||||
* Instanciates a HTU21D object
|
||||
* Instantiates an HTU21D object
|
||||
*
|
||||
* @param bus number of used bus
|
||||
* @param devAddr address of used i2c device
|
||||
* @param bus Number of the used bus
|
||||
* @param devAddr Address of the used I2C device
|
||||
* @param mode HTU21D oversampling
|
||||
*/
|
||||
HTU21D (int bus, int devAddr=HTU21D_I2C_ADDRESS);
|
||||
|
||||
/**
|
||||
* HTU21D object destructor, basicaly it close i2c connection.
|
||||
* HTU21D object destructor; basically, it closes the I2C connection.
|
||||
*/
|
||||
~HTU21D ();
|
||||
|
||||
/**
|
||||
* Initiate a temp/pressure mesasurement and wait for function
|
||||
* to complete. The humidity and temp registers can be read
|
||||
* Initiates a temperature/pressure mesasurement and waits for the function
|
||||
* to complete. The humidity and temperature registers can be read
|
||||
* after this call.
|
||||
*/
|
||||
int sampleData(void);
|
||||
|
||||
/**
|
||||
* Get the current measured humidity [RH]
|
||||
* Gets the current measured humidity [RH]
|
||||
*/
|
||||
float getHumidity(int bSampleData = false);
|
||||
|
||||
/**
|
||||
* Get the humidity cell temperature [degC]
|
||||
* Gets the humidity cell temperature [degC]
|
||||
*/
|
||||
float getTemperature(int bSampleData = false);
|
||||
|
||||
/**
|
||||
* Using the current humidity and temperature the function
|
||||
* will calculate the compensated RH using the equation from
|
||||
* Using the current humidity and temperature, the function
|
||||
* calculates the compensated RH using the equation from
|
||||
* the datasheet.
|
||||
*/
|
||||
float getCompRH(int bSampleData = true);
|
||||
|
||||
/**
|
||||
* Set the heater state. The heater is used to either test
|
||||
* the sensor functionality since the temp should increase
|
||||
* 0.5 to 1.5 degC and the humidity should decrease. The
|
||||
* testSensor() function below will use the heater.
|
||||
* Sets the heater state. The heater is used to test
|
||||
* the sensor functionality since the temperature should increase
|
||||
* 0.5 to 1.5 degC, and the humidity should decrease. The
|
||||
* testSensor() function below uses the heater.
|
||||
*
|
||||
* @param bEnable Set to non-zero to turn on heater
|
||||
* @param bEnable Sets to non-zero to turn the heater on
|
||||
*/
|
||||
int setHeater(int bEnable = false);
|
||||
|
||||
/**
|
||||
* Perform a soft RESET of the MPL3115A2 device to ensure
|
||||
* it is in a known state. This function can be used to reset
|
||||
* Performs a soft reset of the MPL3115A2 device to ensure
|
||||
* it is in a known state. This function can be used to reset
|
||||
* the min/max temperature and pressure values.
|
||||
*/
|
||||
void resetSensor(void);
|
||||
|
||||
/**
|
||||
* Function intended to test the device and verify it
|
||||
* is correctly operating.
|
||||
* Tests the device and verifies it
|
||||
* is operating correctly.
|
||||
*
|
||||
*/
|
||||
int testSensor(void);
|
||||
|
||||
/**
|
||||
* Write to one byte register
|
||||
* Writes to a one-byte register
|
||||
*
|
||||
* @param reg address of a register
|
||||
* @param value byte to be written
|
||||
* @param reg Address of the register
|
||||
* @param value Byte to be written
|
||||
*/
|
||||
mraa_result_t i2cWriteReg (uint8_t reg, uint8_t value);
|
||||
|
||||
/**
|
||||
* Read two bytes register
|
||||
* Reads a two-byte register
|
||||
*
|
||||
* @param reg address of a register
|
||||
* @param reg Address of the register
|
||||
*/
|
||||
uint16_t i2cReadReg_16 (int reg);
|
||||
|
||||
/**
|
||||
* Read one byte register
|
||||
* Reads a one-byte register
|
||||
*
|
||||
* @param reg address of a register
|
||||
* @param reg Address of the register
|
||||
*/
|
||||
uint8_t i2cReadReg_8 (int reg);
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
* Convert temp register to degC * 1000
|
||||
* Converts the temperature register to degC * 1000
|
||||
*/
|
||||
int32_t convertTemp(int32_t regval);
|
||||
|
||||
/**
|
||||
* Convert RH register to %RH * 1000
|
||||
* Converts the RH register to %RH * 1000
|
||||
*/
|
||||
int32_t convertRH(int32_t regval);
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
namespace upm {
|
||||
/**
|
||||
* @brief HX711 24bit ADC library
|
||||
* @brief HX711 24-bit ADC library
|
||||
* @defgroup hx711 libupm-hx711
|
||||
* @ingroup generic gpio electric
|
||||
*/
|
||||
@ -43,12 +43,12 @@ namespace upm {
|
||||
* @web http://www.dfrobot.com/image/data/SEN0160/hx711_english.pdf
|
||||
* @con gpio
|
||||
*
|
||||
* @brief API for HX711
|
||||
* @brief API for the HX711 Analog-to-Digital Converter
|
||||
*
|
||||
* The HX711 is a precision 24-bit analog-to-digital converter (ADC)
|
||||
* designed for weigh scales and industrial control applications to
|
||||
* HX711 is a precision 24-bit analog-to-digital converter (ADC)
|
||||
* designed for weight scales and industrial control applications to
|
||||
* interface directly with a bridge sensor. This module was tested on
|
||||
* the Intel Galileo Gen2.
|
||||
* the Intel(R) Galileo Gen 2 board.
|
||||
*
|
||||
* @image html hx711.jpeg
|
||||
* @snippet hx711.cxx Interesting
|
||||
@ -56,66 +56,66 @@ namespace upm {
|
||||
class HX711 {
|
||||
public:
|
||||
/**
|
||||
* HX711 module constructor
|
||||
* HX711 constructor
|
||||
*
|
||||
* @param data define the data pin
|
||||
* @param sck define the clock pin
|
||||
* @param gain define the gain factor
|
||||
* Valid values are 128 or 64 for channel A; channel B works with 32 gain factor only
|
||||
* @param data Defines the data pin
|
||||
* @param sck Defines the clock pin
|
||||
* @param gain Defines the gain factor
|
||||
* Valid values are 128 or 64 for channel A; channel B works with a 32-gain factor only
|
||||
*/
|
||||
HX711(uint8_t data, uint8_t sck, uint8_t gain = 128);
|
||||
|
||||
/**
|
||||
* HX711 module Destructor
|
||||
* HX711 destructor
|
||||
*/
|
||||
~HX711();
|
||||
|
||||
/**
|
||||
* Waits for the chip to be ready and returns a reading
|
||||
*
|
||||
* @return raw adc read
|
||||
* @return Raw ADC reading
|
||||
*/
|
||||
unsigned long read();
|
||||
|
||||
/**
|
||||
* Set the gain factor; takes effect only after a call to read()
|
||||
* channel A can be set for a 128 or 64 gain; channel B has a fixed 32 gain
|
||||
* depending on the parameter, the channel is also set to either A or B
|
||||
* @param gain define the gain factor
|
||||
* Sets the gain factor; takes effect only after a call to read()
|
||||
* channel A can be set for a 128 or 64 gain; channel B has a fixed 32-gain
|
||||
* factor depending on the parameter; the channel is also set to either A or B
|
||||
* @param gain Defines the gain factor
|
||||
*/
|
||||
void setGain(uint8_t gain = 128);
|
||||
|
||||
/**
|
||||
* Returns an average reading
|
||||
* @param times define how many times to read
|
||||
* @return the avarage reading
|
||||
* @param times Defines how many reading to do
|
||||
* @return Average reading
|
||||
*/
|
||||
unsigned long readAverage(uint8_t times = 10);
|
||||
|
||||
/**
|
||||
* Returns (readAverage() - OFFSET)
|
||||
* @param times define how many readings to do
|
||||
* @return the current value without the tare weight
|
||||
* @param times Defines how many readings to do
|
||||
* @return Current value without the tare weight
|
||||
*/
|
||||
double getValue(uint8_t times = 10);
|
||||
|
||||
/**
|
||||
* Returns getValue() divided by SCALE
|
||||
* @param times define how many readings to do
|
||||
* @return the raw value divided by a value obtained via calibration
|
||||
* @param times Defines how many readings to do
|
||||
* @return Raw value divided by a value obtained via calibration
|
||||
*/
|
||||
float getUnits(uint8_t times = 1);
|
||||
|
||||
/**
|
||||
* Set the OFFSET value for tare weight
|
||||
* @param times define how many times to read the tare value
|
||||
* Sets the OFFSET value for the tare weight
|
||||
* @param times Defines how many times to read the tare value
|
||||
*/
|
||||
void tare(uint8_t times = 10);
|
||||
|
||||
/**
|
||||
* Set the SCALE value
|
||||
* This value is used to convert the raw data to "human readable" data (measure units)
|
||||
* @param scale value obtained via calibration
|
||||
* Sets the SCALE value
|
||||
* This value is used to convert the raw data to human-readable data (measurement units)
|
||||
* @param scale Value obtained via calibration
|
||||
*/
|
||||
void setScale(float scale = 1.f);
|
||||
private:
|
||||
@ -128,9 +128,9 @@ namespace upm {
|
||||
|
||||
|
||||
/**
|
||||
* Set the OFFSET value
|
||||
* The value that's subtracted from the actual reading (tare weight)
|
||||
* @param scale value obtained via calibration
|
||||
* Sets the OFFSET value
|
||||
* This value is subtracted from the actual reading (tare weight)
|
||||
* @param scale Value obtained via calibration
|
||||
*/
|
||||
void setOffset(long offset = 0);
|
||||
};
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
namespace upm {
|
||||
/**
|
||||
* @brief INA132 differential amplifier sensor library
|
||||
* @brief INA132 Differential Amplifier Sensor library
|
||||
* @defgroup ina132 libupm-ina132
|
||||
* @ingroup seeed analog electric
|
||||
*/
|
||||
@ -47,7 +47,7 @@ namespace upm {
|
||||
* for precise differential-input amplification.
|
||||
*
|
||||
* This sensor was tested amplifying the signal
|
||||
* from a Weight Sensor (Load Cell)0-500g
|
||||
* from a Weight Sensor (Load Cell) 0-500g
|
||||
*
|
||||
* @image html ina132.jpg
|
||||
* @snippet ina132.cxx Interesting
|
||||
@ -55,20 +55,20 @@ namespace upm {
|
||||
class INA132 {
|
||||
public:
|
||||
/**
|
||||
* INA132 sensor constructor
|
||||
* INA132 constructor
|
||||
*
|
||||
* @param pin analog pin to use
|
||||
* @param pin Analog pin to use
|
||||
*/
|
||||
INA132(int pin);
|
||||
/**
|
||||
* INA132 Destructor
|
||||
* INA132 destructor
|
||||
*/
|
||||
~INA132();
|
||||
|
||||
/**
|
||||
* Measure precise differential-input amplification from the sensor
|
||||
* Measures precise differential-input amplification from the sensor
|
||||
*
|
||||
* @return precise differential-input amplification
|
||||
* @return Precise differential-input amplification
|
||||
*/
|
||||
float value();
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
namespace upm {
|
||||
/**
|
||||
* @brief ISD1820 recorder module library
|
||||
* @brief ISD1820 Voice Recorder Module library
|
||||
* @defgroup isd1820 libupm-isd1820
|
||||
* @ingroup seeed gpio sound
|
||||
*/
|
||||
@ -43,10 +43,10 @@ namespace upm {
|
||||
* @man seeed
|
||||
* @con gpio
|
||||
*
|
||||
* @brief API support for the ISD1820 based Grove Recorder
|
||||
* @brief API support for the ISD1820-based Grove Voice Recorder
|
||||
*
|
||||
* This class implements support for the Grove Recorder. There
|
||||
* are two digital pins, one that enables recording, and the other
|
||||
* This class implements support for the Grove Voice Recorder. There
|
||||
* are two digital pins: one that enables recording, and the other
|
||||
* that plays back what was previously recorded.
|
||||
*
|
||||
* @image html isd1820.jpg
|
||||
@ -56,29 +56,29 @@ namespace upm {
|
||||
public:
|
||||
|
||||
/**
|
||||
* ISD1820 module constructor
|
||||
* ISD1820 constructor
|
||||
*
|
||||
* @param recPin the pin to use for recording
|
||||
* @param playPin the pin to use for playback
|
||||
* @param recPin Pin to use for recording
|
||||
* @param playPin Pin to use for playback
|
||||
*/
|
||||
ISD1820(int playPin, int recPin);
|
||||
|
||||
/**
|
||||
* ISD1820 module Destructor
|
||||
* ISD1820 destructor
|
||||
*/
|
||||
~ISD1820();
|
||||
|
||||
/**
|
||||
* Start or stop playback
|
||||
* Starts or stops playback
|
||||
*
|
||||
* @param enable start playback if true, stop if false
|
||||
* @param enable Starts playback if true, stops if false
|
||||
*/
|
||||
void play(bool enable);
|
||||
|
||||
/**
|
||||
* Start or stop recording
|
||||
* Starts or stops recording
|
||||
*
|
||||
* @param enable start recording if true, stop if false
|
||||
* @param enable Starts recording if true, stops if false
|
||||
*/
|
||||
void record(bool enable);
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
namespace upm {
|
||||
|
||||
/**
|
||||
* @brief ITG3200 gyroscope library
|
||||
* @brief ITG-3200 Gyroscope library
|
||||
* @defgroup itg3200 libupm-itg3200
|
||||
* @ingroup seeed i2c compass
|
||||
*/
|
||||
@ -38,19 +38,19 @@ namespace upm {
|
||||
/**
|
||||
* @library itg3200
|
||||
* @sensor itg3200
|
||||
* @comname ITG3200 3-Axis Digital Gyroscope
|
||||
* @comname ITG-3200 3-Axis Digital Gyroscope
|
||||
* @altname Grove 3-Axis Digital Gyroscope
|
||||
* @type compass
|
||||
* @man seeed
|
||||
* @con i2c
|
||||
*
|
||||
* @brief API for Itg3200 (3-Axis Digital Gyroscope)
|
||||
* @brief API for the ITG-3200 3-Axis Digital Gyroscope
|
||||
*
|
||||
* The InvenSense Itg3200 is a 3-axis digital gyroscope.
|
||||
* InvenSense* ITG-3200 is a 3-axis digital gyroscope.
|
||||
* (https://www.sparkfun.com/datasheets/Sensors/Gyro/PS-ITG-3200-00-01.4.pdf)
|
||||
* This sensor has been tested and can run at either 3V3 or 5V on the Intel Galileo.<br>
|
||||
* <strong>However</strong>, it is incompatible and will not be detected on the I2C bus
|
||||
* by the Intel Edison using the Arduino breakout board.
|
||||
* This sensor has been tested and can run at either 3.3V or 5V on Intel(R) Galileo.<br>
|
||||
* <strong>However</strong>, it is incompatible with and not detected on the I2C bus
|
||||
* by Intel(R) Edison using the Arduino* breakout board.
|
||||
*
|
||||
* @image html itg3200.jpeg
|
||||
* @snippet itg3200.cxx Interesting
|
||||
@ -60,7 +60,7 @@ public:
|
||||
/**
|
||||
* Creates an Itg3200 object
|
||||
*
|
||||
* @param bus number of used i2c bus
|
||||
* @param bus Number of the used I2C bus
|
||||
*/
|
||||
Itg3200(int bus);
|
||||
|
||||
@ -70,28 +70,28 @@ public:
|
||||
~Itg3200();
|
||||
|
||||
/**
|
||||
* Calibrates the sensor to 0 on all axes. Sensor needs to be resting for accurate calibration.
|
||||
* Takes about 3 seconds and is also called by constructor on object creation.
|
||||
* Calibrates the sensor to 0 on all axes. The sensor needs to be resting for accurate calibration.
|
||||
* It takes about 3 seconds and is also called by the constructor on object creation.
|
||||
*
|
||||
*/
|
||||
void calibrate();
|
||||
|
||||
/**
|
||||
* Returns the temperature reading from the integrated temperature sensor in Celsius degrees
|
||||
* Returns the temperature reading, in Celsius, from the integrated temperature sensor
|
||||
*
|
||||
* @return float temperature in Celsius degrees
|
||||
* @return float Temperature in Celsius
|
||||
*/
|
||||
float getTemperature();
|
||||
|
||||
/**
|
||||
* Returns a pointer to an float[3] that contains computed rotational speeds (angular velocities)
|
||||
* Returns a pointer to a float[3] that contains computed rotational speeds (angular velocities)
|
||||
*
|
||||
* @return float* to an float[3]
|
||||
* @return float* to a float[3]
|
||||
*/
|
||||
float* getRotation();
|
||||
|
||||
/**
|
||||
* Returns a pointer to an int[3] that contains the raw register values for X, Y and Z
|
||||
* Returns a pointer to an int[3] that contains raw register values for X, Y, and Z
|
||||
*
|
||||
* @return int* to an int[3]
|
||||
*/
|
||||
@ -100,14 +100,14 @@ public:
|
||||
/**
|
||||
* Returns an int that contains the raw register value for the temperature
|
||||
*
|
||||
* @return int raw temperature
|
||||
* @return int Raw temperature
|
||||
*/
|
||||
int16_t getRawTemp();
|
||||
|
||||
/**
|
||||
* Updates the rotational values and temperature by reading from i2c bus
|
||||
* Updates the rotational values and temperature by reading from the I2C bus
|
||||
*
|
||||
* @return 0 for success
|
||||
* @return 0 if successful
|
||||
*/
|
||||
mraa_result_t update();
|
||||
private:
|
||||
|
@ -44,12 +44,12 @@ namespace upm {
|
||||
* @con analog
|
||||
* @kit robok
|
||||
*
|
||||
* @brief API for Elecfreaks Joystick v 1.2-1.4 breakout
|
||||
* @brief API for the ElecFreaks* Joystick v 1.2-1.4 Breakout
|
||||
*
|
||||
* This file defines the Joystick API and implementation for X, Y
|
||||
* button could be treated as normal GPIO, this enables easier
|
||||
* This file defines the Joystick API, and implementation for the X and Y
|
||||
* buttons could be treated as normal GPIO - this enables easier
|
||||
* interrupt support. This driver should be compatible with any
|
||||
* 2 axis analog joystick.
|
||||
* 2-axis analog joystick.
|
||||
*
|
||||
* @image html joystick12.jpg
|
||||
* @snippet joystick12-example.cxx Interesting
|
||||
@ -59,8 +59,8 @@ class Joystick12 {
|
||||
/**
|
||||
* Instantiates a Joystick object
|
||||
*
|
||||
* @param pinX analog pin where X input is connected
|
||||
* @param pinY analog pin where Y input is connected
|
||||
* @param pinX Analog pin where the X input is connected
|
||||
* @param pinY Analog pin where the Y input is connected
|
||||
*/
|
||||
Joystick12(int pinX, int pinY);
|
||||
|
||||
@ -70,15 +70,15 @@ class Joystick12 {
|
||||
~Joystick12();
|
||||
|
||||
/**
|
||||
* Get X input
|
||||
* @return float X value, range from -1 to 1. 0 is mid
|
||||
* Gets the X input
|
||||
* @return float X value, ranging from -1 to 1; 0 is mid
|
||||
*/
|
||||
float getXInput();
|
||||
|
||||
/**
|
||||
* Get Y input
|
||||
* Gets the Y input
|
||||
*
|
||||
* @return float Y value, range from -1 to 1. 0 is mid
|
||||
* @return float Y value, ranging from -1 to 1; 0 is mid
|
||||
*/
|
||||
float getYInput();
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
|
||||
namespace upm {
|
||||
/**
|
||||
* @brief L298 dual H-bridge motor driver library
|
||||
* @brief L298 Dual H-Bridge Motor Driver library
|
||||
* @defgroup l298 libupm-l298
|
||||
* @ingroup seeed sparkfun gpio pwm motor
|
||||
*/
|
||||
@ -48,16 +48,16 @@ namespace upm {
|
||||
* @web https://www.sparkfun.com/products/9670
|
||||
* @con gpio pwm
|
||||
*
|
||||
* @brief API for the L298 Dual H-Bridge module
|
||||
* @brief API for the L298 Dual H-Bridge Motor Driver
|
||||
*
|
||||
* It was developed using the RobotBase Dual H-Bridge module.
|
||||
*
|
||||
* This module can support 2 DC motors, or 1 2-phase stepper motor.
|
||||
* It requires 3 pins per DC motor (or h-bridge), or 4 pins for
|
||||
* the stepper (uses both h-bridges).
|
||||
* This module can support 2 DC motors, or one 2-phase stepper motor.
|
||||
* It requires 3 pins per DC motor (or H-bridge), or 4 pins for
|
||||
* the stepper motor (uses both H-bridges).
|
||||
*
|
||||
* @image html l298.jpg
|
||||
* <br><em>L298 Dual H-Bridge Motor Driver image provided by SparkFun under
|
||||
* <br><em>L298 Dual H-Bridge Motor Driver image provided by SparkFun* under
|
||||
* <a href=https://creativecommons.org/licenses/by-nc-sa/3.0/>
|
||||
* CC BY-NC-SA-3.0</a>.</em>
|
||||
*
|
||||
@ -81,77 +81,77 @@ namespace upm {
|
||||
/**
|
||||
* L298 constructor for DC motor(s) connected.
|
||||
*
|
||||
* @param pwm digital pin to use for DC motor - must be PWM capable
|
||||
* @param dir1 digital pin to use for motor direction pin 1
|
||||
* @param dir2 digital pin to use for motor direction pin 2
|
||||
* @param pwm Digital pin to use for a DC motor - must be PWM-capable
|
||||
* @param dir1 Digital pin to use for motor direction pin 1
|
||||
* @param dir2 Digital pin to use for motor direction pin 2
|
||||
*/
|
||||
L298(int pwm, int dir1, int dir2);
|
||||
|
||||
/**
|
||||
* L298 constructor for 4-wire stepper motor
|
||||
* L298 constructor for a 4-wire stepper motor
|
||||
*
|
||||
* @param stepsPerRev number of steps per full revolution
|
||||
* @param en enable pin
|
||||
* @param i1 digital pin to use for stepper input 1
|
||||
* @param i2 digital pin to use for stepper input 2
|
||||
* @param i3 digital pin to use for stepper input 3
|
||||
* @param i4 digital pin to use for stepper input 4
|
||||
* @param stepsPerRev Number of steps per full revolution
|
||||
* @param en Enables the pin
|
||||
* @param i1 Digital pin to use for stepper input 1
|
||||
* @param i2 Digital pin to use for stepper input 2
|
||||
* @param i3 Digital pin to use for stepper input 3
|
||||
* @param i4 Digital pin to use for stepper input 4
|
||||
*/
|
||||
L298(int stepsPerRev, int en, int i1, int i2, int i3, int i4);
|
||||
|
||||
/**
|
||||
* L298 Destructor
|
||||
* L298 destructor
|
||||
*/
|
||||
~L298();
|
||||
|
||||
/**
|
||||
* Return the number of milliseconds elapsed since initClock()
|
||||
* Returns the number of milliseconds elapsed since initClock()
|
||||
* was last called.
|
||||
*
|
||||
* @return elapsed milliseconds
|
||||
* @return Elapsed milliseconds
|
||||
*/
|
||||
uint32_t getMillis();
|
||||
|
||||
/**
|
||||
* Reset the Clock
|
||||
* Resets the clock
|
||||
*
|
||||
*/
|
||||
void initClock();
|
||||
|
||||
/**
|
||||
* set the period in milliseconds
|
||||
* Sets the period in milliseconds
|
||||
*
|
||||
* @param ms period in milliseconds
|
||||
* @param ms Period in milliseconds
|
||||
*/
|
||||
void setPeriodMS(int ms);
|
||||
|
||||
/**
|
||||
* enable PWM output for a motor
|
||||
* Enables the PWM output for a motor
|
||||
*
|
||||
* @param enable enable PWM output if true, disable if false
|
||||
* @param enable Enables the PWM output if true, disables if false
|
||||
*/
|
||||
void enable(bool enable);
|
||||
|
||||
/**
|
||||
* set the speed of a DC or stepp motor. For a DC motor, Values
|
||||
* can range from 0 (off) to 100 (full speed). For a stepper
|
||||
* Sets the speed of a DC or stepper motor. For a DC motor, values
|
||||
* can range from 0 (off) to 100 (full speed). For a stepper
|
||||
* motor, specify the desired RPM.
|
||||
*
|
||||
* @param speed speed to set the motor to
|
||||
* @param speed Speed to set the motor to
|
||||
*/
|
||||
void setSpeed(int speed);
|
||||
|
||||
/**
|
||||
* set the direction of the motor, clockwise or counter clockwise
|
||||
* Sets the direction of the motor, clockwise or counterclockwise
|
||||
*
|
||||
* @param dir direction to set the motor to
|
||||
* @param dir Direction to set the motor to
|
||||
*/
|
||||
void setDirection(L298_DIRECTION_T dir);
|
||||
|
||||
/**
|
||||
* step the stepper motor a specified number of steps
|
||||
* Steps the stepper motor a specified number of steps
|
||||
*
|
||||
* @param steps number of steps to move the stepper motor
|
||||
* @param steps Number of steps to move the stepper motor
|
||||
*/
|
||||
void stepperSteps(unsigned int steps);
|
||||
|
||||
@ -181,12 +181,12 @@ namespace upm {
|
||||
uint32_t m_stepDelay;
|
||||
|
||||
/**
|
||||
* step the motor one tick
|
||||
* Steps the motor one tick
|
||||
*
|
||||
*/
|
||||
void stepperStep();
|
||||
|
||||
// step direction - 1 = forward, -1 = backward
|
||||
// step direction: - 1 = forward, -1 = backward
|
||||
int m_stepDirection;
|
||||
};
|
||||
}
|
||||
|
@ -41,13 +41,13 @@ namespace upm
|
||||
* @con i2c
|
||||
* @kit gsk
|
||||
*
|
||||
* @brief API for Jhd1313m1 i2c controller for HD44780 based displays with
|
||||
* an RGB backlight such as the Grove RGB i2c LCD display
|
||||
* @brief API for the JHD1313M1 I2C controller for HD44780-based displays with
|
||||
* an RGB backlight, such as a Grove RGB I2C LCD display
|
||||
*
|
||||
* The Jhd1313m1 has two i2c addreses, one belongs to a controller very similar
|
||||
* to the upm::Lcm1602 LCD driver which controls the HD44780 based display and the
|
||||
* other controls solely the backlight. This module was tested with the Seed
|
||||
* Grove LCD RGB Backlight v2.0 display which requires 5V to operate.
|
||||
* JHD1313M1 has two I2C addreses: one belongs to a controller, very similar
|
||||
* to the upm::Lcm1602 LCD driver, that controls the HD44780-based display, and the
|
||||
* other controls only the backlight. This module was tested with the Seeed
|
||||
* Grove LCD RGB Backlight v2.0 display that requires 5V to operate.
|
||||
*
|
||||
* @image html grovergblcd.jpg
|
||||
* @snippet jhd1313m1-lcd.cxx Interesting
|
||||
@ -58,9 +58,9 @@ class Jhd1313m1 : public Lcm1602
|
||||
/**
|
||||
* Jhd1313m1 constructor
|
||||
*
|
||||
* @param bus i2c bus to use
|
||||
* @param address the slave address the lcd is registered on
|
||||
* @param address the slave address the rgb backlight is on
|
||||
* @param bus I2C bus to use
|
||||
* @param address Slave address the LCD is registered on
|
||||
* @param address Slave address the RGB backlight is registered on
|
||||
*/
|
||||
Jhd1313m1(int bus, int lcdAddress = 0x3E, int rgbAddress = 0x62);
|
||||
/**
|
||||
@ -68,19 +68,19 @@ class Jhd1313m1 : public Lcm1602
|
||||
*/
|
||||
~Jhd1313m1();
|
||||
/**
|
||||
* Make the LCD scroll text
|
||||
* Makes the LCD scroll text
|
||||
*
|
||||
* @param direction, true is typical scrolling to the right
|
||||
* @return Result of operation
|
||||
* @param direction True if scrolling to the right
|
||||
* @return Result of the operation
|
||||
*/
|
||||
mraa_result_t scroll(bool direction);
|
||||
/**
|
||||
* Set the color of the backlight
|
||||
* Sets the color of the backlight
|
||||
*
|
||||
* @param r 0-255 value for red
|
||||
* @param g 0-255 value for green
|
||||
* @param b 0-255 value for blue
|
||||
* @return Result of operation
|
||||
* @return Result of the operation
|
||||
*/
|
||||
mraa_result_t setColor(uint8_t r, uint8_t g, uint8_t b);
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
||||
namespace upm
|
||||
{
|
||||
/**
|
||||
* @brief I2C LCD display library
|
||||
* @brief I2C LCD Display library
|
||||
* @defgroup i2clcd libupm-i2clcd
|
||||
* @ingroup seeed sparkfun adafruit i2c display gsk
|
||||
*/
|
||||
|
@ -48,13 +48,13 @@ namespace upm
|
||||
* @web https://www.adafruit.com/datasheets/TC1602A-01T.pdf
|
||||
* @con i2c
|
||||
*
|
||||
* @brief API for LCM1602 i2c controller for HD44780 based displays
|
||||
* @brief API for the LCM1602 I2C controller for HD44780-based displays
|
||||
*
|
||||
* This supports all sizes of HD44780 displays from 16x2 to 4x20, the
|
||||
* controller has no idea of the actual display hardware so will let you write
|
||||
* further than you can see. These displays with such controllers are available
|
||||
* from various manufacturers with different i2c addresses. The adafruit
|
||||
* TC1602A-01T seems to be a well documented example.
|
||||
* This supports all sizes of HD44780 displays, from 16x2 to 4x20. The
|
||||
* controller has no idea of the actual display hardware, so it lets you write
|
||||
* farther than you can see. These displays with such controllers are available
|
||||
* from various manufacturers with different I2C addresses. Adafruit*
|
||||
* TC1602A-01T seems to be a well-documented example.
|
||||
*
|
||||
* @image html lcm1602.jpeg
|
||||
* @snippet lcm1602-lcd.cxx Interesting
|
||||
@ -63,11 +63,11 @@ class Lcm1602 : public LCD
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Lcm1602 Constructor, calls libmraa initialisation functions
|
||||
* Lcm1602 constructor; calls libmraa initialisation functions
|
||||
*
|
||||
* @param bus i2c bus to use
|
||||
* @param address the slave address the lcd is registered on
|
||||
* @param isExpander true if we are dealing with an I2C expander,
|
||||
* @param bus I2C bus to use
|
||||
* @param address Slave address the LCD is registered on
|
||||
* @param isExpander True if we are dealing with an I2C expander,
|
||||
* false otherwise. Default is true.
|
||||
*/
|
||||
Lcm1602(int bus, int address, bool isExpander=true);
|
||||
@ -77,46 +77,46 @@ class Lcm1602 : public LCD
|
||||
* controllers supporting RS, Enable, and 4 data pins in 4-bit
|
||||
* mode.
|
||||
*
|
||||
* @param rs register select pin
|
||||
* @param enable enable pin
|
||||
* @param d0 data 0 pin
|
||||
* @param d1 data 1 pin
|
||||
* @param d2 data 2 pin
|
||||
* @param d3 data 3 pin
|
||||
* @param rs Register select pin
|
||||
* @param enable Enable pin
|
||||
* @param d0 Data 0 pin
|
||||
* @param d1 Data 1 pin
|
||||
* @param d2 Data 2 pin
|
||||
* @param d3 Data 3 pin
|
||||
*/
|
||||
Lcm1602(uint8_t rs, uint8_t enable,
|
||||
uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3);
|
||||
|
||||
/**
|
||||
* Lcm1602 Destructor
|
||||
* Lcm1602 destructor
|
||||
*/
|
||||
~Lcm1602();
|
||||
/**
|
||||
* Write a string to LCD
|
||||
* Writes a string to the LCD
|
||||
*
|
||||
* @param msg The std::string to write to display, note only ascii
|
||||
* chars are supported
|
||||
* @return Result of operation
|
||||
* @param msg std::string to write to the display; note: only ASCII
|
||||
* characters are supported
|
||||
* @return Result of the operation
|
||||
*/
|
||||
mraa_result_t write(std::string msg);
|
||||
/**
|
||||
* Set cursor to a coordinate
|
||||
* Sets the cursor to specified coordinates
|
||||
*
|
||||
* @param row The row to set cursor to
|
||||
* @param column The column to set cursor to
|
||||
* @return Result of operation
|
||||
* @param row Row to set the cursor to
|
||||
* @param column Column to set the cursor to
|
||||
* @return Result of the operation
|
||||
*/
|
||||
mraa_result_t setCursor(int row, int column);
|
||||
/**
|
||||
* Clear display from characters
|
||||
* Clears the display of all characters
|
||||
*
|
||||
* @return Result of operation
|
||||
* @return Result of the operation
|
||||
*/
|
||||
mraa_result_t clear();
|
||||
/**
|
||||
* Return to coordinate 0,0
|
||||
* Returns to the original coordinates (0,0)
|
||||
*
|
||||
* @return Result of operation
|
||||
* @return Result of the operation
|
||||
*/
|
||||
mraa_result_t home();
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Author: Yevgeniy Kiveisha <yevgeniy.kiveisha@intel.com>
|
||||
* Copyright (c) 2014 Intel Corporation.
|
||||
*
|
||||
@ -44,11 +44,11 @@ const uint8_t DISPLAY_CMD_SET_NORMAL_1308 = 0xA6;
|
||||
* @web http://www.seeedstudio.com/wiki/Grove_-_OLED_Display_0.96%22
|
||||
* @con i2c
|
||||
*
|
||||
* @brief API for SSD1308 i2c controlled OLED displays
|
||||
* @brief API for SSD1308 I2C-controlled OLED displays
|
||||
*
|
||||
* The SSD1308 is a 128x64 Dot matrix OLED/PLED segment driver with
|
||||
* SSD1308 is a 128x64 dot-matrix OLED/PLED segment driver with a
|
||||
* controller. This implementation was tested using the Grove LED 128×64
|
||||
* Display module which is an OLED monochrome display.
|
||||
* Display module, which is an OLED monochrome display.
|
||||
*
|
||||
* @image html ssd1308.jpeg
|
||||
* @snippet ssd1308-oled.cxx Interesting
|
||||
@ -57,51 +57,51 @@ class SSD1308 : public LCD
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* SSD1308 Constructor, calls libmraa initialisation functions
|
||||
* SSD1308 constructor; calls libmraa initialisation functions
|
||||
*
|
||||
* @param bus i2c bus to use
|
||||
* @param address the slave address the lcd is registered on
|
||||
* @param bus I2C bus to use
|
||||
* @param address Slave address the LCD is registered on
|
||||
*/
|
||||
SSD1308(int bus, int address = 0x3C);
|
||||
/**
|
||||
* SSD1308 Destructor
|
||||
* SSD1308 destructor
|
||||
*/
|
||||
~SSD1308();
|
||||
/**
|
||||
* Draw an image, see examples/python/make_oled_pic.py for an
|
||||
* explanation on how the pixels are mapped to bytes
|
||||
* Draws an image; see examples/python/make_oled_pic.py for an
|
||||
* explanation of how pixels are mapped to bytes
|
||||
*
|
||||
* @param data the buffer to read
|
||||
* @param bytes the amount of bytes to read from the pointer
|
||||
* @return Result of operation
|
||||
* @param data Buffer to read
|
||||
* @param bytes Number of bytes to read from the pointer
|
||||
* @return Result of the operation
|
||||
*/
|
||||
mraa_result_t draw(uint8_t* data, int bytes);
|
||||
/**
|
||||
* Write a string to LCD
|
||||
* Writes a string to the LCD
|
||||
*
|
||||
* @param msg The std::string to write to display, note only ascii
|
||||
* chars are supported
|
||||
* @return Result of operation
|
||||
* @param msg std::string to write to the display; note: only ASCII
|
||||
* characters are supported
|
||||
* @return Result of the operation
|
||||
*/
|
||||
mraa_result_t write(std::string msg);
|
||||
/**
|
||||
* Set cursor to a coordinate
|
||||
* Sets the cursor to specified coordinates
|
||||
*
|
||||
* @param row The row to set cursor to
|
||||
* @param column The column to set cursor to
|
||||
* @return Result of operation
|
||||
* @param row Row to set the cursor to
|
||||
* @param column Column to set the cursor to
|
||||
* @return Result of the operation
|
||||
*/
|
||||
mraa_result_t setCursor(int row, int column);
|
||||
/**
|
||||
* Clear display from characters
|
||||
* Clears the display of all characters
|
||||
*
|
||||
* @return Result of operatio
|
||||
* @return Result of the operation
|
||||
*/
|
||||
mraa_result_t clear();
|
||||
/**
|
||||
* Return to coordinate 0,0
|
||||
* Returns to the original coordinates (0,0)
|
||||
*
|
||||
* @return Result of operation
|
||||
* @return Result of the operation
|
||||
*/
|
||||
mraa_result_t home();
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Author: Yevgeniy Kiveisha <yevgeniy.kiveisha@intel.com>
|
||||
* Copyright (c) 2014 Intel Corporation.
|
||||
*
|
||||
@ -44,10 +44,10 @@ const uint8_t DISPLAY_CMD_SET_NORMAL = 0xA4;
|
||||
* @web http://www.seeedstudio.com/wiki/Grove_-_OLED_Display_1.12%22
|
||||
* @con i2c
|
||||
*
|
||||
* @brief API for SSD1327 i2c controlled OLED displays
|
||||
* @brief API for SSD1327 I2C-controlled OLED displays
|
||||
*
|
||||
* The SSD1327 is a 96x96 Dot matrix OLED/PLED segment driver with controller.
|
||||
* This implementation was tested using the Grove LED 96×96 Display module
|
||||
* SSD1327 is a 96x96 dot-matrix OLED/PLED segment driver with a controller.
|
||||
* This implementation was tested using the Grove LED 96×96 Display module,
|
||||
* which is an OLED monochrome display.
|
||||
*
|
||||
* @image html ssd1327.jpeg
|
||||
@ -57,10 +57,10 @@ class SSD1327 : public LCD
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* SSD1327 Constructor, calls libmraa initialisation functions
|
||||
* SSD1327 constructor; calls libmraa initialisation functions
|
||||
*
|
||||
* @param bus i2c bus to use
|
||||
* @param address the slave address the lcd is registered on
|
||||
* @param bus I2C bus to use
|
||||
* @param address Slave address the LCD is registered on
|
||||
*/
|
||||
SSD1327(int bus, int address = 0x3C);
|
||||
/**
|
||||
@ -68,47 +68,47 @@ class SSD1327 : public LCD
|
||||
*/
|
||||
~SSD1327();
|
||||
/**
|
||||
* Draw an image, see examples/python/make_oled_pic.py for an
|
||||
* explanation on how the pixels are mapped to bytes
|
||||
* Draws an image; see examples/python/make_oled_pic.py for an
|
||||
* explanation of how pixels are mapped to bytes
|
||||
*
|
||||
* @param data the buffer to read
|
||||
* @param bytes the amount of bytes to read from the pointer
|
||||
* @return Result of operation
|
||||
* @param data Buffer to read
|
||||
* @param bytes Number of bytes to read from the pointer
|
||||
* @return Result of the operation
|
||||
*/
|
||||
mraa_result_t draw(uint8_t* data, int bytes);
|
||||
/**
|
||||
* Set gray level for LCD panel
|
||||
* Sets the gray level for the LCD panel
|
||||
*
|
||||
* @param gray level from 0-255
|
||||
* @return Result of operation
|
||||
* @param gray level from 0 to 255
|
||||
* @return Result of the operation
|
||||
*/
|
||||
void setGrayLevel(uint8_t level);
|
||||
/**
|
||||
* Write a string to LCD
|
||||
* Writes a string to the LCD
|
||||
*
|
||||
* @param msg The std::string to write to display, note only ascii
|
||||
* chars are supported
|
||||
* @return Result of operation
|
||||
* @param msg std::string to write to the display; note: only ASCII
|
||||
* characters are supported
|
||||
* @return Result of the operation
|
||||
*/
|
||||
mraa_result_t write(std::string msg);
|
||||
/**
|
||||
* Set cursor to a coordinate
|
||||
* Sets the cursor to specified coordinates
|
||||
*
|
||||
* @param row The row to set cursor to
|
||||
* @param column The column to set cursor to
|
||||
* @return Result of operation
|
||||
* @param row Row to set the cursor to
|
||||
* @param column Column to set the cursor to
|
||||
* @return Result of the operation
|
||||
*/
|
||||
mraa_result_t setCursor(int row, int column);
|
||||
/**
|
||||
* Clear display from characters
|
||||
* Clears the display of all characters
|
||||
*
|
||||
* @return Result of operatio
|
||||
* @return Result of the operation
|
||||
*/
|
||||
mraa_result_t clear();
|
||||
/**
|
||||
* Return to coordinate 0,0
|
||||
* Returns to the original coordinates (0,0)
|
||||
*
|
||||
* @return Result of operation
|
||||
* @return Result of the operation
|
||||
*/
|
||||
mraa_result_t home();
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
||||
namespace upm {
|
||||
|
||||
/**
|
||||
* @brief LDT0-028 piezo vibration sensor library
|
||||
* @brief LDT0-028 Piezo Vibration Sensor library
|
||||
* @defgroup ldt0028 libupm-ldt0028
|
||||
* @ingroup seeed analog flexfor
|
||||
*/
|
||||
@ -44,9 +44,9 @@ namespace upm {
|
||||
* @con analog
|
||||
*
|
||||
* @brief API for LDT0-028 PZT film-based sensors,
|
||||
* such as the Grove Piezo Vibration sensor
|
||||
* such as a Grove Piezo Vibration sensor
|
||||
*
|
||||
* This file defines the LDT0028 interface for libupm-ldt0028
|
||||
* This file defines the LDT0-028 interface for libupm-ldt0028
|
||||
*
|
||||
* @image html ldt0028.jpg
|
||||
* @snippet ldt0028.cxx Interesting
|
||||
@ -54,9 +54,9 @@ namespace upm {
|
||||
class LDT0028 {
|
||||
public:
|
||||
/**
|
||||
* LDT0028 Piezo Vibration sensor constructor
|
||||
* LDT0028 constructor
|
||||
*
|
||||
* @param pin AIO pin where sensor is connected
|
||||
* @param pin AIO pin where the sensor is connected
|
||||
*/
|
||||
LDT0028(unsigned int pin);
|
||||
|
||||
@ -66,16 +66,16 @@ class LDT0028 {
|
||||
~LDT0028();
|
||||
|
||||
/**
|
||||
* Return name of this sensor
|
||||
* Returns the name of this sensor
|
||||
*
|
||||
* @return the name of this sensor
|
||||
* @return Name of this sensor
|
||||
*/
|
||||
std::string name();
|
||||
|
||||
/**
|
||||
* Return one sample from this sensor
|
||||
* Returns one sample from this sensor
|
||||
*
|
||||
* @return one value from this sensor
|
||||
* @return One value from this sensor
|
||||
*/
|
||||
int getSample();
|
||||
|
||||
|
@ -34,7 +34,7 @@ namespace upm {
|
||||
#define LOL_Y 9
|
||||
|
||||
/**
|
||||
* @brief Olimex LoL array library
|
||||
* @brief Olimex LoL Array library
|
||||
* @defgroup lol libupm-lol
|
||||
* @ingroup adafruit gpio display
|
||||
*/
|
||||
@ -42,14 +42,14 @@ namespace upm {
|
||||
/**
|
||||
* @library lol
|
||||
* @sensor lol
|
||||
* @comname Olimex LoL LED Array
|
||||
* @comname Olimex LoL Array
|
||||
* @type display
|
||||
* @man adafruit
|
||||
* @con gpio
|
||||
*
|
||||
* @brief API for Olimex LoL array
|
||||
* @brief API for the Olimex LoL array
|
||||
*
|
||||
* This file defines the LoL API and implementation for a simple frame buffer.
|
||||
* This file defines the LoL API and implementation for a simple framebuffer.
|
||||
*
|
||||
* @image html lolshield.jpg
|
||||
* @snippet lol-example.cxx Interesting
|
||||
@ -57,7 +57,7 @@ namespace upm {
|
||||
class LoL {
|
||||
public:
|
||||
/**
|
||||
* Instantiates a LoL object
|
||||
* Instantiates an LoL object
|
||||
* singleton
|
||||
*/
|
||||
LoL();
|
||||
@ -68,25 +68,25 @@ class LoL {
|
||||
~LoL();
|
||||
|
||||
/**
|
||||
* Get framebuffer pointer
|
||||
* @return 0 on success
|
||||
* Gets a framebuffer pointer
|
||||
* @return 0 if successful
|
||||
*/
|
||||
unsigned char *getFramebuffer();
|
||||
|
||||
/**
|
||||
* Gets pixel at coordinates
|
||||
* @param x coordinate x
|
||||
* @param y coordinate y
|
||||
* @return 1 if pixel is on, 0 if off, -1 on error
|
||||
* Gets a pixel at specified coordinates
|
||||
* @param x Coordinate x
|
||||
* @param y Coordinate y
|
||||
* @return 1 if the pixel is on, 0 if off, -1 on error
|
||||
*/
|
||||
unsigned char getPixel(int x, int y);
|
||||
|
||||
/**
|
||||
* sets pixel at coordinates
|
||||
* @param x coordinate x
|
||||
* @param y coordinate y
|
||||
* Sets a pixel at specified coordinates
|
||||
* @param x Coordinate x
|
||||
* @param y Coordinate y
|
||||
* @param pixel 0 is off, 1 is on
|
||||
* @return 0 on success, -1 on error
|
||||
* @return 0 if successful, -1 on error
|
||||
*/
|
||||
unsigned char setPixel(int x, int y, unsigned char pixel);
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
namespace upm {
|
||||
|
||||
/**
|
||||
* @brief FastPixel lpd8806 library
|
||||
* @brief FastPixel LPD8806 library
|
||||
* @defgroup lpd8806 libupm-lpd8806
|
||||
* @ingroup adafruit spi led
|
||||
*/
|
||||
@ -47,9 +47,9 @@ namespace upm {
|
||||
* @man adafruit
|
||||
* @con spi
|
||||
*
|
||||
* @brief API for LPD8806
|
||||
* @brief API for the LPD8806 RGB LED Strip Controller
|
||||
*
|
||||
* The FastPixel lpd8806 is an RGB led strip controller.
|
||||
* FastPixel* LPD8806 is an RGB LED strip controller.
|
||||
*
|
||||
* @image html lpd8806.jpg
|
||||
* @snippet lpd8806.cxx Interesting
|
||||
@ -58,38 +58,38 @@ class LPD8806 {
|
||||
public:
|
||||
|
||||
/**
|
||||
* Instanciates a LPD8806 object
|
||||
* Instantiates an LPD8806 object
|
||||
*
|
||||
* @param pixelCount number of pixels in the strip
|
||||
* @param csn chip select pin
|
||||
* @param pixelCount Number of pixels in the strip
|
||||
* @param csn Chip select pin
|
||||
*/
|
||||
LPD8806 (uint16_t pixelCount, uint8_t csn);
|
||||
|
||||
/**
|
||||
* LPD8806 object destructor, basicaly it close SPI and the GPIO.
|
||||
* LPD8806 object destructor; basically, it closes the SPI and the GPIO.
|
||||
*/
|
||||
~LPD8806 ();
|
||||
|
||||
/**
|
||||
* @param pixelOffset pixel offset in the strip of pixel
|
||||
* @param r red led
|
||||
* @param g green led
|
||||
* @param b blue led
|
||||
* @param pixelOffset Pixel offset in the strip of the pixel
|
||||
* @param r Red LED
|
||||
* @param g Green LED
|
||||
* @param b Blue LED
|
||||
*/
|
||||
void setPixelColor (uint16_t pixelOffset, uint8_t r, uint8_t g, uint8_t b);
|
||||
|
||||
/**
|
||||
* Write the data stored in array of pixels to the chip
|
||||
* Writes the data stored in the array of pixels to the chip
|
||||
*/
|
||||
void show (void);
|
||||
|
||||
/**
|
||||
* Return length of the led strip
|
||||
* Returns the length of the LED strip
|
||||
*/
|
||||
uint16_t getStripLength (void);
|
||||
|
||||
/**
|
||||
* Return name of the component
|
||||
* Returns the name of the component
|
||||
*/
|
||||
std::string name()
|
||||
{
|
||||
@ -107,12 +107,12 @@ class LPD8806 {
|
||||
void writeRegister (uint8_t reg, uint8_t data);
|
||||
|
||||
/**
|
||||
* Set chip select pin LOW
|
||||
* Sets the chip select pin to LOW
|
||||
*/
|
||||
mraa_result_t CSOn ();
|
||||
|
||||
/**
|
||||
* Set chip select pin HIGH
|
||||
* Sets the chip select pin to HIGH
|
||||
*/
|
||||
mraa_result_t CSOff ();
|
||||
};
|
||||
|
@ -61,7 +61,7 @@ namespace upm {
|
||||
#define Z 2
|
||||
|
||||
/**
|
||||
* @brief LSM303 accelerometer/compass library
|
||||
* @brief LSM303 Accelerometer/Compass library
|
||||
* @defgroup lsm303 libupm-lsm303
|
||||
* @ingroup seeed adafruit i2c accelerometer compass
|
||||
*/
|
||||
@ -76,12 +76,12 @@ namespace upm {
|
||||
* @web http://www.seeedstudio.com/wiki/Grove_-_6-Axis_Accelerometer%26Compass
|
||||
* @con i2c
|
||||
*
|
||||
* @brief API for LSM303 Accelerometer & Compass
|
||||
* @brief API for the LSM303 Accelerometer & Compass
|
||||
*
|
||||
* This file defines the LSM303DLH 3-axis magnetometer/3-axis accelerometer.
|
||||
* This module was tested with the SeedStudio Grove [6-Axis Accelerometer&Compass]
|
||||
* module that is used over i2c. The magnometer and acceleromter are accessed
|
||||
* at two seperate i2c addresses.
|
||||
* This module was tested with the Seeed Studio* Grove 6-Axis Accelerometer & Compass
|
||||
* module used over I2C. The magnometer and acceleromter are accessed
|
||||
* at two seperate I2C addresses.
|
||||
*
|
||||
* @image html lsm303.jpeg
|
||||
* @snippet lsm303.cxx Interesting
|
||||
@ -89,11 +89,11 @@ namespace upm {
|
||||
class LSM303 {
|
||||
public:
|
||||
/**
|
||||
* Instanciates a LSM303 object
|
||||
* Instantiates an LSM303 object
|
||||
*
|
||||
* @param i2c bus
|
||||
* @param addr magometer
|
||||
* @param addr accelerometer
|
||||
* @param addr Magnetometer
|
||||
* @param addr Accelerometer
|
||||
*/
|
||||
LSM303 (int bus,
|
||||
int addrMag=LSM303_MAG,
|
||||
@ -106,60 +106,60 @@ class LSM303 {
|
||||
~LSM303 ();
|
||||
|
||||
/**
|
||||
* Get Current Heading, headings <0 indicate an error occured
|
||||
* Gets the current heading; headings <0 indicate an error has occurred
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
float getHeading();
|
||||
|
||||
/**
|
||||
* Get the coordinates in XYZ order
|
||||
* Gets the coordinates in the XYZ order
|
||||
*/
|
||||
mraa_result_t getCoordinates();
|
||||
|
||||
/**
|
||||
* Get accelerometer values
|
||||
* Call before calling other "get" functions for acceleration
|
||||
* Gets accelerometer values
|
||||
* Should be called before other "get" functions for acceleration
|
||||
*/
|
||||
mraa_result_t getAcceleration();
|
||||
|
||||
/**
|
||||
* Get the raw coordinate data, this will get updated when getCoordinates() is called
|
||||
* Gets raw coordinate data; it is updated when getCoordinates() is called
|
||||
*/
|
||||
int16_t* getRawCoorData();
|
||||
|
||||
/**
|
||||
* Just get the X component of the coordinate data
|
||||
* Gets the X component of the coordinates data
|
||||
*/
|
||||
int16_t getCoorX();
|
||||
|
||||
/**
|
||||
* Just get the Y component of the coordinate data
|
||||
* Gets the Y component of the coordinates data
|
||||
*/
|
||||
int16_t getCoorY();
|
||||
|
||||
/**
|
||||
* Just get the Z component of the coordinate data
|
||||
* Gets the Z component of the coordinates data
|
||||
*/
|
||||
int16_t getCoorZ();
|
||||
|
||||
/**
|
||||
* Get the raw accelerometer data, this will get updated when getAcceleration() is called
|
||||
* Gets raw accelerometer data; it is updated when getAcceleration() is called
|
||||
*/
|
||||
int16_t* getRawAccelData();
|
||||
|
||||
/**
|
||||
* Just get the X component of the acceleration
|
||||
* Gets the X component of the acceleration data
|
||||
*/
|
||||
int16_t getAccelX();
|
||||
|
||||
/**
|
||||
* Just get the Y component of the acceleration
|
||||
* Gets the Y component of the acceleration data
|
||||
*/
|
||||
int16_t getAccelY();
|
||||
|
||||
/**
|
||||
* Just get the Z component of the acceleration
|
||||
* Gets the Z component of the acceleration data
|
||||
*/
|
||||
int16_t getAccelZ();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user