docs: final batch of header files reviewed

Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
VadimPopov 2015-08-10 18:53:31 +03:00 committed by Mihai Tudor Panu
parent 04edb9be04
commit 1fe9b9eb1d
53 changed files with 1182 additions and 1191 deletions

View File

@ -89,7 +89,7 @@ class AM2315 {
AM2315 (int bus, int devAddr=AM2315_I2C_ADDRESS); AM2315 (int bus, int devAddr=AM2315_I2C_ADDRESS);
/** /**
* AM2315 object destructor; basicaly, it closes the I2C connection. * AM2315 object destructor; basically, it closes the I2C connection.
*/ */
~AM2315 (); ~AM2315 ();

View File

@ -86,7 +86,7 @@ class ECS1030 {
ECS1030 (uint8_t pinNumber); ECS1030 (uint8_t pinNumber);
/** /**
* ECS1030 object destructor; basicaly, it closes the GPIO. * ECS1030 object destructor; basically, it closes the GPIO.
*/ */
~ECS1030 (); ~ECS1030 ();

View File

@ -337,7 +337,7 @@ namespace upm {
bool setPowerMode(PM_BITS_T pm); bool setPowerMode(PM_BITS_T pm);
/** /**
* Enables one or more of the 3 axes. The arguement is a bitmask * Enables one or more of the 3 axes. The argument is a bitmask
* composed of REG1_XEN, REG1_YEN, and/or REG1_ZEN corresponding to * composed of REG1_XEN, REG1_YEN, and/or REG1_ZEN corresponding to
* the axes you want enabled. * the axes you want enabled.
* *

View File

@ -56,21 +56,21 @@ namespace upm {
* @web http://www.seeedstudio.com/wiki/Grove_-_NFC_Tag * @web http://www.seeedstudio.com/wiki/Grove_-_NFC_Tag
* @con i2c * @con i2c
* *
* @brief C++ API for the M24LR64E based Grove NFC Tag * @brief C++ API for the M24LR64E-based Grove NFC Tag
* *
* The Grove NFC tag is, in essence, an 8KB EEPROM that can be written * Grove NFC tag is an 8KB electrically erasable programmable read-only memory (EEPROM)
* to or read from using I2C and NFC equipped devices. * that can be written to or read from using I2C and NFC-equipped devices.
* *
* The USER mode (default) allows read and write access to all 8KB * The user mode (default) allows read and write access to all 8KB
* of space, provided the sector security status (SSS) allows it. * of space, provided the sector security status (SSS) allows it.
* The ROOT mode allows modification of the SSS data and other * The root mode allows modification of the SSS data and other
* information, provided the proper password is submitted. The * information, provided the proper password is submitted. The
* default password for a new tag is 0x00000000. See the data sheet * default password for a new tag is 0x00000000. See the datasheet
* for much more detailed information. * for more details.
* *
* The Seeed Studio wiki page for this device includes a link to an * The Seeed Studio* wiki page for this device includes a link to an
* Android application that can be used to also read and write the * Android* application that can be used to also read and write the
* device via NFC, as well as set the NFC passwords, which cannot be * device via NFC, as well as set NFC passwords, which cannot be
* done via I2C. * done via I2C.
* *
* @image html m24lr64e.jpg * @image html m24lr64e.jpg
@ -92,12 +92,12 @@ namespace upm {
static const unsigned int I2C_WRITE_TIME = 5; // 5ms static const unsigned int I2C_WRITE_TIME = 5; // 5ms
/** /**
* M24LR64E addresses, accessable only in root mode * M24LR64E addresses, accessible only in the root mode
*/ */
typedef enum { typedef enum {
I2C_PASSWORD_ADDR = 2304, I2C_PASSWORD_ADDR = 2304,
RF_PASSWORD_1_ADDR = 2308, // RF pwds not available in RF_PASSWORD_1_ADDR = 2308, // RF pwds not available in
RF_PASSWORD_2_ADDR = 2312, // i2c access modes RF_PASSWORD_2_ADDR = 2312, // I2C access modes
RF_PASSWORD_3_ADDR = 2316, RF_PASSWORD_3_ADDR = 2316,
DSFID_ADDR = 2320, // 1 byte DSFID_ADDR = 2320, // 1 byte
AFI_ADDR = 2321, // 1 byte AFI_ADDR = 2321, // 1 byte
@ -110,8 +110,8 @@ namespace upm {
} M24LR64E_ADDR_T; } M24LR64E_ADDR_T;
enum AccessMode { enum AccessMode {
USER_MODE = 0x0, // offer simple read/write access right USER_MODE = 0x0, // offers simple read/write access right
ROOT_MODE = 0x1 // offer password change access right ROOT_MODE = 0x1 // offers password change access right
}; };
enum SectorAccessRight { enum SectorAccessRight {
@ -141,39 +141,39 @@ namespace upm {
}; };
/** /**
* m24lr64e constructor * M24LR64E constructor
* *
* @param bus i2c bus to use * @param bus I2C bus to use
* @param mode the access mode (user or root) to use * @param mode Access mode (user or root) to use
*/ */
M24LR64E(int bus, AccessMode mode = USER_MODE); M24LR64E(int bus, AccessMode mode = USER_MODE);
/** /**
* M24LR64E Destructor * M24LR64E destructor
*/ */
~M24LR64E(); ~M24LR64E();
/** /**
* submit an i2c access password * Submits an I2C access password
* *
* @param passwd the 4-byte access password * @param passwd 4-byte access password
*/ */
bool submitPasswd(uint32_t passwd); bool submitPasswd(uint32_t passwd);
/** /**
* write a new i2c password * Writes a new I2C password
* *
* @param passwd the 4-byte access password * @param passwd 4-byte access password
*/ */
bool writePasswd(uint32_t passwd); bool writePasswd(uint32_t passwd);
/** /**
* Set the protection bit for a sector. Must be in ROOT mode * Sets a protection bit for a sector. Must be in the root mode
* *
* @param sectorNumber the sector whose protection you are modifying * @param sectorNumber Sector whose protection you are modifying
* @param protectEnable true if you are enabling protection * @param protectEnable True if you are enabling protection
* @param accessRight the access rights to set * @param accessRight Access rights to set
* @param passwd the password number to enable, if any * @param passwd Password number to enable, if any
*/ */
void sectorProtectConfig(unsigned int sectorNumber, void sectorProtectConfig(unsigned int sectorNumber,
bool protectEnable, bool protectEnable,
@ -181,88 +181,88 @@ namespace upm {
SectorSelectPassWd passwd); SectorSelectPassWd passwd);
/** /**
* Clear the sector protection bits. Must be in ROOT mode. * Clears sector protection bits. Must be in the root mode.
*/ */
void clearSectorProtect(void); void clearSectorProtect(void);
/** /**
* Set or clear the Sector Security Status Lock bit for a sector. * Sets or clears a sector security status lock bit for a sector.
* Must be in ROOT mode. * Must be in the root mode.
* *
* @param sectorNumber the sector who's SSS you want to modify * @param sectorNumber Sector whose SSS you want to modify
* @param sockEnable true r false to set or clear the bit * @param sockEnable True to set the bit, false to clear it
*/ */
void sectorWriteLockBit(unsigned int sectorNumber, void sectorWriteLockBit(unsigned int sectorNumber,
bool sockEnable); bool sockEnable);
/** /**
* return the Data Storage Familiy Identifier * Returns a data storage family identifier (DSFID)
* Must be in ROOT mode. * Must be in the root mode.
* *
* @return the DSFID * @return DSFID
*/ */
uint8_t getDSFID(); uint8_t getDSFID();
/** /**
* return the Application Family Identifier * Returns an application family identifier (AFI)
* Must be in ROOT mode. * Must be in the root mode.
* *
* @return the AFI * @return AFI
*/ */
uint8_t getAFI(); uint8_t getAFI();
/** /**
* return the Unique ID. * Returns a unique ID.
* Must be in ROOT mode. * Must be in the root mode.
* *
* @param buf buffer to hold returned UID. Must be UID_LENGTH bytes. * @param buf Buffer to hold the returned UID. Must be UID_LENGTH bytes.
*/ */
void getUID(uint8_t* buf); void getUID(uint8_t* buf);
/** /**
* return the memory size * Returns the memory size
* Must be in ROOT mode. * Must be in the root mode.
* *
* @return the amount of memory present * @return Amount of memory present
*/ */
uint32_t getMemorySize(); uint32_t getMemorySize();
/** /**
* set all memory to 0, if permissions allow * Sets all memory to 0, if permissions allow
*/ */
void clearMemory(); void clearMemory();
/** /**
* write a byte to EEPROM * Writes a byte to the EEPROM
* *
* @param address address to write to * @param address Address to write to
* @param data data to write * @param data Data to write
*/ */
void writeByte(unsigned int address, uint8_t data); void writeByte(unsigned int address, uint8_t data);
/** /**
* write bytes to EEPROM * Writes bytes to the EEPROM
* *
* @param address address to write to * @param address Address to write to
* @param data data to write * @param data Data to write
* @param data length of data buffer * @param data Length of the data buffer
*/ */
void writeBytes(unsigned int address, uint8_t* buf, unsigned int len); void writeBytes(unsigned int address, uint8_t* buf, unsigned int len);
/** /**
* read a byte from EEPROM * Reads a byte from the EEPROM
* *
* @param address address to read from * @param address Address to read from
* @return data value read * @return data Value read
*/ */
uint8_t readByte(unsigned int address); uint8_t readByte(unsigned int address);
/** /**
* read multiple bytes from EEPROM * Reads multiple bytes from the EEPROM
* *
* @param address address to read from * @param address Address to read from
* @param buffer buffer to store data * @param buffer Buffer to store data
* @param len number of bytes to read * @param len Number of bytes to read
*/ */
void readBytes(unsigned int address, uint8_t* buf, unsigned int len); void readBytes(unsigned int address, uint8_t* buf, unsigned int len);

View File

@ -34,7 +34,7 @@
namespace upm { namespace upm {
/** /**
* @brief MAX31723 temperature sensor library * @brief MAX31723 Temperature Sensor library
* @defgroup max31723 libupm-max31723 * @defgroup max31723 libupm-max31723
* @ingroup maxim spi temperature * @ingroup maxim spi temperature
*/ */
@ -46,11 +46,11 @@ namespace upm {
* @man maxim * @man maxim
* @con spi * @con spi
* *
* @brief API for MAX31723 chip (Temperature Sensor) * @brief API for the MAX31723 Temperature Sensor
* *
* The Maxim Integrated * Maxim Integrated*
* [MAX31723](http://datasheets.maximintegrated.com/en/ds/MAX31722-MAX31723.pdf) * [MAX31723](http://datasheets.maximintegrated.com/en/ds/MAX31722-MAX31723.pdf)
* is a Low-Voltage 3-Wire/SPI Temperature Sensor controller. This module was * is a low-voltage 3-wire/SPI temperature sensor controller. This module was
* tested on the Maxim Integrated [MAX31732PMB1 PMOD * tested on the Maxim Integrated [MAX31732PMB1 PMOD
* module](http://datasheets.maximintegrated.com/en/ds/MAX31723PMB1.pdf) from * module](http://datasheets.maximintegrated.com/en/ds/MAX31723PMB1.pdf) from
* the analog PMOD kit. * the analog PMOD kit.
@ -67,25 +67,25 @@ class MAX31723 {
static const uint8_t B_CONT_READING = 0x00; static const uint8_t B_CONT_READING = 0x00;
/** /**
* Instanciates a MAX31723 object * Instantiates an MAX31723 object
* *
* @param bus number of used bus * @param bus Number of the used bus
* @param devAddr addres of used i2c device * @param devAddr Address of the used I2C device
*/ */
MAX31723 (int csn); MAX31723 (int csn);
/** /**
* MAXDS3231M object destructor, basicaly it close i2c connection. * MAXDS3231M object destructor; basically, it closes the I2C connection.
*/ */
~MAX31723 (); ~MAX31723 ();
/** /**
* Get on board temperature. * Gets the on-board temperature.
*/ */
short getTemperature (); short getTemperature ();
/** /**
* Return name of the component * Returns the name of the component
*/ */
std::string name() std::string name()
{ {
@ -100,12 +100,12 @@ class MAX31723 {
void writeRegister (uint8_t reg, uint8_t data); void writeRegister (uint8_t reg, uint8_t data);
/** /**
* Set chip select pin LOW * Sets the chip select pin to LOW
*/ */
mraa_result_t CSOn (); mraa_result_t CSOn ();
/** /**
* Set chip select pin HIGH * Sets the chip select pin to HIGH
*/ */
mraa_result_t CSOff (); mraa_result_t CSOff ();
}; };

View File

@ -30,7 +30,7 @@
namespace upm { namespace upm {
/** /**
* @brief MAX31855 thermocouple library * @brief MAX31855 Thermocouple library
* @defgroup max31855 libupm-max31855 * @defgroup max31855 libupm-max31855
* @ingroup maxim adafruit spi other * @ingroup maxim adafruit spi other
*/ */
@ -42,12 +42,12 @@ namespace upm {
* @man maxim adafruit * @man maxim adafruit
* @con spi * @con spi
* *
* @brief API for MAX31855 Thermocouple Amplifier * @brief API for the MAX31855 Thermocouple Amplifier
* *
* The Maxim Integrated * Maxim Integrated*
* [MAX31855](http://datasheets.maximintegrated.com/en/ds/MAX31855.pdf) * [MAX31855](http://datasheets.maximintegrated.com/en/ds/MAX31855.pdf)
* is a Cold-Junction Compensated Thermocouple-to-Digital Converter. This * is a cold-junction compensated thermocouple-to-digital converter. This
* module was * tested on the Maxim Integrated * module was tested on the Maxim Integrated
* [MAX31855PMB1 PMOD module] * [MAX31855PMB1 PMOD module]
* (http://datasheets.maximintegrated.com/en/ds/MAX31855PMB1.pdf) from the * (http://datasheets.maximintegrated.com/en/ds/MAX31855PMB1.pdf) from the
* analog PMOD kit. * analog PMOD kit.
@ -58,10 +58,10 @@ namespace upm {
class MAX31855 { class MAX31855 {
public: public:
/** /**
* Instanciates a MAX31855 object * Instantiates an MAX31855 object
* *
* @param bus The spi bus to use * @param bus SPI bus to use
* @param cs The chip select pin * @param cs Chip select pin
*/ */
MAX31855(int bus, int cs); MAX31855(int bus, int cs);
@ -71,9 +71,9 @@ class MAX31855 {
~MAX31855(); ~MAX31855();
/** /**
* Get the distance from the sensor * Gets the distance from the sensor
* *
* @return value in degrees celcius * @return Value in Celsius
*/ */
//! [Interesting] //! [Interesting]
double getTemp(); double getTemp();

View File

@ -38,7 +38,7 @@
#define PRXDATA 0x15 // proximity sensor data #define PRXDATA 0x15 // proximity sensor data
#define ALS_UP_THRESH_HIGH 0x06 // ALS Interrupt Threshold Registers High #define ALS_UP_THRESH_HIGH 0x06 // ALS Interrupt Threshold Registers High
#define ALS_UP_THRESH_LOW 0x07 // ALS Interrupt Threshold Registers LOW #define ALS_UP_THRESH_LOW 0x07 // ALS Interrupt Threshold Registers Low
#define ALS_LO_THRESH_HIGH 0x08 // ALS Interrupt Threshold Registers High #define ALS_LO_THRESH_HIGH 0x08 // ALS Interrupt Threshold Registers High
#define ALS_LO_THRESH_LOW 0x09 // ALS Interrupt Threshold Registers Low #define ALS_LO_THRESH_LOW 0x09 // ALS Interrupt Threshold Registers Low
#define TPTR 0x0A // ALS/PROX Threshold Persist Timer Register #define TPTR 0x0A // ALS/PROX Threshold Persist Timer Register
@ -53,7 +53,7 @@
namespace upm { namespace upm {
/** /**
* @brief MAX44000 proximity sensor library * @brief MAX44000 Proximity Sensor library
* @defgroup max44000 libupm-max44000 * @defgroup max44000 libupm-max44000
* @ingroup maxim i2c light * @ingroup maxim i2c light
*/ */
@ -65,11 +65,11 @@ namespace upm {
* @man maxim * @man maxim
* @con i2c * @con i2c
* *
* @brief API for MAX44000 chip (Ambient and Infrared Proximity Sensor) * @brief API for the MAX44000 Ambient and Infrared Proximity Sensor
* *
* The Maxim Integrated * Maxim Integrated*
* [MAX44000](http://datasheets.maximintegrated.com/en/ds/MAX44000.pdf) * [MAX44000](http://datasheets.maximintegrated.com/en/ds/MAX44000.pdf)
* is Ambient and Infrared Proximity Sensor. This module was tested on the * is an ambient and infrared proximity sensor. This module was tested on the
* Maxim Integrated * Maxim Integrated
* [MAX44000PMB1 PMOD module] * [MAX44000PMB1 PMOD module]
* (http://datasheets.maximintegrated.com/en/ds/MAX44000PMB1.pdf) from the * (http://datasheets.maximintegrated.com/en/ds/MAX44000PMB1.pdf) from the
@ -80,29 +80,29 @@ namespace upm {
class MAX44000 { class MAX44000 {
public: public:
/** /**
* Instanciates a MAX44000 object * Instantiates an MAX44000 object
* *
* @param bus number of used bus * @param bus Number of the used bus
* @param devAddr addres of used i2c device * @param devAddr Address of the used I2C device
*/ */
MAX44000 (int bus, int devAddr); MAX44000 (int bus, int devAddr);
/** /**
* MAX44000 object destructor, basicaly it close i2c connection. * MAX44000 object destructor; basically, it closes the I2C connection.
*/ */
~MAX44000 (); ~MAX44000 ();
/** /**
* Read the proximity value from the chip (based on ambient data). * Reads the proximity value from the sensor (based on ambient data).
*/ */
uint16_t getProximity (); uint16_t getProximity ();
/** /**
* Read the ambient value from the chip (based on ambient data). * Reads the ambient value from the sensor (based on ambient data).
*/ */
uint16_t getAmbient (); uint16_t getAmbient ();
/** /**
* Return name of the component * Returns the name of the component
*/ */
std::string name() std::string name()
{ {
@ -110,24 +110,24 @@ class MAX44000 {
} }
/** /**
* 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); uint8_t i2cReadReg_8 (int reg);
/** /**
* 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); uint16_t i2cReadReg_16 (int reg);
/** /**
* Write to one byte register * Writes to a one-byte register
* *
* @param reg address of a register * @param reg Address of the register
* @param value byte to be written * @param value Byte to be written
*/ */
mraa_result_t i2cWriteReg (uint8_t reg, uint8_t value); mraa_result_t i2cWriteReg (uint8_t reg, uint8_t value);

View File

@ -34,7 +34,7 @@
namespace upm { namespace upm {
/** /**
* @brief MAX5487 digital potentiometer library * @brief MAX5487 Digital Potentiometer library
* @defgroup max5487 libupm-max5487 * @defgroup max5487 libupm-max5487
* @ingroup maxim spi digipot * @ingroup maxim spi digipot
*/ */
@ -46,12 +46,12 @@ namespace upm {
* @man maxim * @man maxim
* @con spi * @con spi
* *
* @brief API for MAX5487 chip (SPI digital potentiometer) * @brief API for the MAX5487 SPI Digital Potentiometer
* *
* The Maxim Integrated * Maxim Integrated*
* [MAX5487](http://datasheets.maximintegrated.com/en/ds/MAX5487-MAX5489.pdf) * [MAX5487](http://datasheets.maximintegrated.com/en/ds/MAX5487-MAX5489.pdf)
* is a Dual, 256-Tap, Nonvolatile, SPI-Interface, Linear-Taper Digital * is a dual, 256-tap, nonvolatile, SPI, linear-taper digital
* Potentiometer. This module was tested on the Maxim Integrated [MAX5487PMB1 * potentiometer. This module was tested on the Maxim Integrated [MAX5487PMB1
* PMOD module](http://datasheets.maximintegrated.com/en/ds/MAX5487PMB1.pdf) * PMOD module](http://datasheets.maximintegrated.com/en/ds/MAX5487PMB1.pdf)
* from the analog PMOD kit. * from the analog PMOD kit.
* *
@ -63,9 +63,9 @@ class MAX5487 {
static const uint8_t R_WR_WIPER_B = 0x02; static const uint8_t R_WR_WIPER_B = 0x02;
/** /**
* Instanciates a MAX5487 object * Instantiates an MAX5487 object
* *
* @param csn to use if any, by default will use ICSP CS (-1) * @param csn CSN to use, if any; by default, ICSP CS (-1) is used
*/ */
MAX5487 (int csn = -1); MAX5487 (int csn = -1);
@ -75,17 +75,17 @@ class MAX5487 {
~MAX5487 (); ~MAX5487 ();
/** /**
* Set wiper for port A. * Sets a wiper for port A.
*/ */
void setWiperA (uint8_t wiper); void setWiperA (uint8_t wiper);
/** /**
* Set wiper for port B. * Sets a wiper for port B.
*/ */
void setWiperB (uint8_t wiper); void setWiperB (uint8_t wiper);
/** /**
* Return name of the component * Returns the name of the component
*/ */
std::string name() std::string name()
{ {
@ -97,12 +97,12 @@ class MAX5487 {
mraa_gpio_context m_csnPinCtx; mraa_gpio_context m_csnPinCtx;
/** /**
* Set chip select pin LOW * Sets the chip select pin to LOW
*/ */
mraa_result_t CSOn (); mraa_result_t CSOn ();
/** /**
* Set chip select pin HIGH * Sets the chip select pin to HIGH
*/ */
mraa_result_t CSOff (); mraa_result_t CSOff ();
}; };

View File

@ -63,7 +63,7 @@ struct Time3231 {
}; };
/** /**
* @brief MAXDS3231M proximity sensor library * @brief MAXDS3231M Proximity Sensor library
* @defgroup maxds3231m libupm-maxds3231m * @defgroup maxds3231m libupm-maxds3231m
* @ingroup maxim i2c light * @ingroup maxim i2c light
*/ */
@ -75,48 +75,48 @@ struct Time3231 {
* @man maxim * @man maxim
* @con i2c * @con i2c
* *
* @brief API for MAXDS3231M chip (I2C Real-Time Clock) * @brief API for the MAXDS3231M I2C Real-Time Clock
* *
* This file defines the API for maxds3231m * This file defines the API for MAXDS3231M
* *
* @snippet maxds3231m.cxx Interesting * @snippet maxds3231m.cxx Interesting
*/ */
class MAXDS3231M { class MAXDS3231M {
public: public:
/** /**
* Instanciates a MAXDS3231M object * Instantiates an MAXDS3231M object
* *
* @param bus number of used bus * @param bus Number of the used bus
* @param devAddr addres of used i2c device * @param devAddr Address of the used I2C device
*/ */
MAXDS3231M (int bus=0, int devAddr=0x68); MAXDS3231M (int bus=0, int devAddr=0x68);
/** /**
* MAXDS3231M object destructor, basicaly it close i2c connection. * MAXDS3231M object destructor; basically, it closes the I2C connection.
*/ */
~MAXDS3231M (); ~MAXDS3231M ();
/** /**
* Set date and time on the chip. * Sets the date and time on the chip.
* *
* @param time staracture * @param time Time structure
*/ */
void setDate (Time3231 &time); void setDate (Time3231 &time);
/** /**
* Get date and time located on the chip. * Gets the date and time from the chip.
* *
* @param time staracture * @param time Time structure
*/ */
bool getDate (Time3231 &time); bool getDate (Time3231 &time);
/** /**
* Get on board temperature. * Gets the on-board temperature.
*/ */
uint16_t getTemperature (); uint16_t getTemperature ();
/** /**
* Return name of the component * Returns the name of the component
*/ */
std::string name() std::string name()
{ {

View File

@ -32,7 +32,7 @@
namespace upm { namespace upm {
/** /**
* @brief MaxSonar-EZ family of ultrasonic rangers library * @brief MaxSonar-EZ Family of Ultrasonic Rangers library
* @defgroup maxsonarez libupm-maxsonarez * @defgroup maxsonarez libupm-maxsonarez
* @ingroup seeed analog sound * @ingroup seeed analog sound
*/ */
@ -47,20 +47,20 @@ namespace upm {
* @web https://www.sparkfun.com/products/8502 * @web https://www.sparkfun.com/products/8502
* @con analog * @con analog
* *
* @brief API for the LV-MaxSonar-EZ family of ultrasonic rangers * @brief API for the LV-MaxSonar-EZ Family of Ultrasonic Rangers
* *
* This sensor family returns an analog voltage corresponding to the * Sensors of this family return an analog voltage corresponding to the
* distance of an object from the sensor in inches. It has a * distance of an object from the sensor in inches. They have a
* resolution of about 9.7 millivolts per inch with a 5.0 AREF. The * resolution of about 9.7 millivolts per inch with an analog reference voltage of 5.0 V. The
* differences between the various versions (EZ1, EZ2, etc) are * differences between various versions (EZ1, EZ2, etc.) are
* related to the narrowness of the beam angle. * related to the narrowness of the beam angle.
* *
* This class supports these sensors with an analog input only. * This class supports these sensors with an analog input only.
* *
* This driver was developed using an LV-MaxSonar-EZ3. * This driver was developed using an LV-MaxSonar-EZ3 ultrasonic ranger.
* *
* @image html maxsonarez.jpg * @image html maxsonarez.jpg
* <br><em>LV-MaxSonar-EZ Ultrasonic Ranger image provided by SparkFun under * <br><em>LV-MaxSonar-EZ Ultrasonic Ranger image provided by SparkFun* under
* <a href=https://creativecommons.org/licenses/by-nc-sa/3.0/> * <a href=https://creativecommons.org/licenses/by-nc-sa/3.0/>
* CC BY-NC-SA-3.0</a>.</em> * CC BY-NC-SA-3.0</a>.</em>
* *
@ -71,22 +71,22 @@ namespace upm {
public: public:
/** /**
* MAXSONAREZ sensor constructor * MAXSONAREZ constructor
* *
* @param pin analog pin to use * @param pin Analog pin to use
* @param aref the analog reference voltage, default: 5.0 * @param aref Analog reference voltage; default is 5.0 V
*/ */
MAXSONAREZ(int pin, float aref=5.0); MAXSONAREZ(int pin, float aref=5.0);
/** /**
* MAXSONAREZ Destructor * MAXSONAREZ destructor
*/ */
~MAXSONAREZ(); ~MAXSONAREZ();
/** /**
* get the distance to the object in inches * Gets the distance to the object in inches
* *
* @return the distance to the object in inches * @return Distance to the object in inches
*/ */
int inches(); int inches();
@ -95,7 +95,7 @@ namespace upm {
float m_aref; float m_aref;
// ADC resolution // ADC resolution
int m_aRes; int m_aRes;
// computed Volts per Inch // computed volts per inch
float m_vI; float m_vI;
}; };
} }

View File

@ -48,7 +48,7 @@ const uint8_t MHZ16_END = 0x7e;
namespace upm { namespace upm {
/** /**
* @brief MHZ16 Serial CO2 sensor library * @brief MHZ16 Serial CO2 Sensor library
* @defgroup mhz16 libupm-mhz16 * @defgroup mhz16 libupm-mhz16
* @ingroup seeed uart gaseous * @ingroup seeed uart gaseous
*/ */
@ -66,8 +66,8 @@ namespace upm {
* *
* This class implements support for the Grove CO2 sensor. * This class implements support for the Grove CO2 sensor.
* *
* It's CO2 detection ranges from 0PPM to 2000PPM. It requires a * Its CO2 detection range is 0-2,000 ppm. It requires a
* 2-3 minute warm up time before reporting valid data. * 2-3 minute warm-up time before reporting valid data.
* *
* @image html mhz16.jpg * @image html mhz16.jpg
* @snippet mhz16.cxx Interesting * @snippet mhz16.cxx Interesting
@ -77,75 +77,75 @@ namespace upm {
/** /**
* MHZ16 module constructor * MHZ16 constructor
* *
* @param uart default uart to use (0 or 1) * @param uart Default UART to use (0 or 1)
*/ */
MHZ16(int uart); MHZ16(int uart);
/** /**
* MHZ16 module Destructor * MHZ16 destructor
*/ */
~MHZ16(); ~MHZ16();
/** /**
* 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. * @param millis Number of milliseconds to wait; 0 means no waiting.
* @return true if there is data available to be read * @return True if there is data available for reading
*/ */
bool dataAvailable(unsigned int millis); bool dataAvailable(unsigned int millis);
/** /**
* read any available data into a user-supplied buffer. Note, the * Reads any available data in a user-supplied buffer. Note: the
* call will block until data is available to be read. Use * call blocks until data is available to be read. Use
* dataAvailable() to determine whether there is data available * dataAvailable() to determine whether there is data available
* beforehand, to avoid blocking. * beforehand, to avoid blocking.
* *
* @param buffer the buffer to hold the data read * @param buffer Buffer to hold the data read
* @param len the length of the buffer * @param len Length of the buffer
* @return the number of bytes read * @return Number of bytes read
*/ */
int readData(char *buffer, size_t len); 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 buffer Buffer to hold the data read
* @param len the length of the buffer * @param len Length of the buffer
* @return the number of bytes written * @return Number of bytes written
*/ */
int writeData(char *buffer, size_t len); int writeData(char *buffer, size_t len);
/** /**
* setup the proper tty i/o modes and the baudrate. The default * Sets up proper tty I/O modes and the baud rate. The default
* baud rate is 9600 (B9600). * baud rate is 9,600 (B9600).
* *
* @param baud the desired baud rate. * @param baud Desired baud rate.
* @return true if successful * @return True if successful
*/ */
bool setupTty(speed_t baud=B9600); bool setupTty(speed_t baud=B9600);
/** /**
* verify the packet header and indicate it's validity * Verifies the packet header and indicates its validity
* *
* @param pkt the packet to check * @param pkt Packet to check
* @return true if valid checksum, false otherwise * @return True if the checksum is valid, false otherwise
*/ */
bool verifyPacket(unsigned char *pkt); bool verifyPacket(unsigned char *pkt);
/** /**
* Query the sensor and return gas (CO2) concentration and * Queries the sensor and returns gas (CO2) concentration and
* temperature data. * temperature data.
* *
* @param gas the returned gas concentration * @param gas Returned gas concentration
* @param temp the returned temperature in celsius * @param temp Returned temperature in Celsius
* @return true if successful * @return True if successful
*/ */
bool getData(int *gas, int *temp); bool getData(int *gas, int *temp);
/** /**
* Set the zero point of the sensor * Sets the zero point of the sensor
* *
*/ */
void calibrateZeroPoint(); void calibrateZeroPoint();

View File

@ -36,7 +36,7 @@ struct thresholdContext {
namespace upm { namespace upm {
/** /**
* @brief Analog microphone library * @brief Analog Microphone library
* @defgroup mic libupm-mic * @defgroup mic libupm-mic
* @ingroup seeed pwm sound gsk * @ingroup seeed pwm sound gsk
*/ */
@ -51,9 +51,9 @@ namespace upm {
* @con pwm * @con pwm
* @kit gsk * @kit gsk
* *
* @brief API for Microphone * @brief API for the Analog Microphone
* *
* This file defines the Microphone Analog sensor * This file defines the Analog Microphone sensor
* *
* @image html mic.jpg * @image html mic.jpg
* @snippet mic.cxx Interesting * @snippet mic.cxx Interesting
@ -61,43 +61,43 @@ namespace upm {
class Microphone { class Microphone {
public: public:
/** /**
* Instanciates a Microphone object * Instantiates a Microphone object
* *
* @param micPin pin where microphone is connected * @param micPin Pin where the microphone is connected
*/ */
Microphone(int micPin); Microphone(int micPin);
/** /**
* MAX31723 object destructor * Microphone object destructor
*/ */
~Microphone(); ~Microphone();
/** /**
* Get samples from microphone according to provided window and * Gets samples from the microphone according to the provided window and
* number of samples * number of samples
* *
* @param freqMS time between each sample (in microseconds) * @param freqMS Time between each sample (in microseconds)
* @param numberOfSamples number of sample to sample for this window * @param numberOfSamples Number of sample to sample for this window
* @param buffer bufer with sampled data * @param buffer Buffer with sampled data
*/ */
int getSampledWindow (unsigned int freqMS, unsigned int numberOfSamples, uint16_t * buffer); int getSampledWindow (unsigned int freqMS, unsigned int numberOfSamples, uint16_t * buffer);
/** /**
* Given sampled buffer this method will return TRUE/FALSE if threshold * Given the sampled buffer, this method returns TRUE/FALSE if threshold
* was reached * is reached
* *
* @param ctx threshold context * @param ctx Threshold context
* @param threshold sample threshold * @param threshold Sample threshold
* @param buffer buffer with samples * @param buffer Buffer with samples
* @param len bufer len * @param len Buffer length
*/ */
int findThreshold (thresholdContext* ctx, unsigned int threshold, uint16_t * buffer, unsigned int len); int findThreshold (thresholdContext* ctx, unsigned int threshold, uint16_t * buffer, unsigned int len);
/** /**
* *
* Print running average of threshold context * Prints a running average of the threshold context
* *
* @param ctx threshold context * @param ctx Threshold context
*/ */
void printGraph (thresholdContext* ctx); void printGraph (thresholdContext* ctx);

View File

@ -53,7 +53,7 @@
namespace upm { namespace upm {
/** /**
* @brief MLX90614 temperature sensor library * @brief MLX90614 Temperature Sensor library
* @defgroup mlx90614 libupm-mlx90614 * @defgroup mlx90614 libupm-mlx90614
* @ingroup generic i2c temperature * @ingroup generic i2c temperature
*/ */
@ -65,7 +65,7 @@ namespace upm {
* @man generic * @man generic
* @con i2c * @con i2c
* *
* @brief API for MLX90614 * @brief API for the MLX90614 Temperature Sensor
* *
* This file defines the MLX90614 interface for libmlx90614 * This file defines the MLX90614 interface for libmlx90614
* *
@ -76,39 +76,39 @@ class MLX90614 {
public: public:
/** /**
* Instanciates a MLX90614 object * Instantiates an MLX90614 object
* *
* @param bus number of used bus * @param bus Number of the used bus
* @param devAddr addres of used i2c device * @param devAddr Address of the used I2C device
*/ */
MLX90614 (int bus=0, int devAddr=0x5A); MLX90614 (int bus=0, int devAddr=0x5A);
/** /**
* MLX90614 object destructor, basicaly it close i2c connection. * MLX90614 object destructor; basically, it closes the I2C connection.
*/ */
~MLX90614 (); ~MLX90614 ();
/** /**
* Read object temperature in Fahrenheit * Reads the object temperature in Fahrenheit
*/ */
float readObjectTempF(void); float readObjectTempF(void);
/** /**
* Read ambient temperature in Fahrenheit * Reads the ambient temperature in Fahrenheit
*/ */
float readAmbientTempF(void); float readAmbientTempF(void);
/** /**
* Read object temperature in Celsius * Reads the object temperature in Celsius
*/ */
float readObjectTempC(void); float readObjectTempC(void);
/** /**
* Read ambient temperature in Celsius * Reads the ambient temperature in Celsius
*/ */
float readAmbientTempC(void); float readAmbientTempC(void);
/** /**
* Return name of the component * Returns the name of the component
*/ */
std::string name() std::string name()
{ {

View File

@ -30,7 +30,7 @@
// Register names according to the datasheet. // Register names according to the datasheet.
// Register 0x1C is sometimes called 'PW', and sometimes 'PD'. // Register 0x1C is sometimes called 'PW', and sometimes 'PD'.
// The two reserved registers can not be used. // The two reserved registers cannot be used.
#define MMA7455_XOUTL 0x00 // Read only, Output Value X LSB #define MMA7455_XOUTL 0x00 // Read only, Output Value X LSB
#define MMA7455_XOUTH 0x01 // Read only, Output Value X MSB #define MMA7455_XOUTH 0x01 // Read only, Output Value X MSB
#define MMA7455_YOUTL 0x02 // Read only, Output Value Y LSB #define MMA7455_YOUTL 0x02 // Read only, Output Value Y LSB
@ -64,9 +64,9 @@
#define MMA7455_TW 0x1E // Read/Write, Time Window for Second Pulse Value #define MMA7455_TW 0x1E // Read/Write, Time Window for Second Pulse Value
#define MMA7455_RESERVED2 0x1F // Reserved #define MMA7455_RESERVED2 0x1F // Reserved
// Defines for the bits, to be able to change // Defines for the bits to be able to change
// between bit number and binary definition. // between the bit number and the binary definition.
// By using the bit number, programming the MMA7455 // By using the bit number, programming MMA7455
// is like programming an AVR microcontroller. // is like programming an AVR microcontroller.
// But instead of using "(1<<X)", or "_BV(X)", // But instead of using "(1<<X)", or "_BV(X)",
// the Arduino "bit(X)" is used. // the Arduino "bit(X)" is used.
@ -150,7 +150,7 @@ union accelData {
#define BIT(n) (1<<n) #define BIT(n) (1<<n)
/** /**
* @brief MMA7455 accelerometer library * @brief MMA7455 Accelerometer library
* @defgroup mma7455 libupm-mma7455 * @defgroup mma7455 libupm-mma7455
* @ingroup generic i2c accelerometer * @ingroup generic i2c accelerometer
*/ */
@ -162,7 +162,7 @@ union accelData {
* @man generic * @man generic
* @con i2c * @con i2c
* *
* @brief API for MMA7455 chip (accelerometer) * @brief API for the MMA7455 Accelerometer
* *
* This file defines the MMA7455 interface for libmma7455 * This file defines the MMA7455 interface for libmma7455
* *
@ -172,20 +172,20 @@ union accelData {
class MMA7455 { class MMA7455 {
public: public:
/** /**
* Instanciates a MMA7455 object * Instantiates an MMA7455 object
* *
* @param bus number of used bus * @param bus Number of the used bus
* @param devAddr addres of used i2c device * @param devAddr Address of the used I2C device
*/ */
MMA7455 (int bus=0, int devAddr=0x1D); MMA7455 (int bus=0, int devAddr=0x1D);
/** /**
* MMA7455 object destructor, basicaly it close i2c connection. * MMA7455 object destructor; basically, it closes the I2C connection.
*/ */
~MMA7455 (); ~MMA7455 ();
/** /**
* Return name of the component * Returns the name of the component
*/ */
std::string name() std::string name()
{ {
@ -193,34 +193,34 @@ class MMA7455 {
} }
/** /**
* Calibrate the sensor * Calibrates the sensor
*/ */
mraa_result_t calibrate (); mraa_result_t calibrate ();
/** /**
* Read X, Y and Z acceleration data * Reads X-axis, Y-axis, and Z-axis acceleration data
* *
* @param ptrX X axis * @param ptrX X-axis
* @param ptrY Y axis * @param ptrY Y-axis
* @param ptrZ Z axis * @param ptrZ Z-axis
*/ */
mraa_result_t readData (short * ptrX, short * ptrY, short * ptrZ); mraa_result_t readData (short * ptrX, short * ptrY, short * ptrZ);
/** /**
* *
* *
* @param reg register address * @param reg Register address
* @param buf register data buffer * @param buf Register data buffer
* @param size buffer size * @param size Buffer size
*/ */
int ic2ReadReg (unsigned char reg, unsigned char * buf, unsigned char size); int ic2ReadReg (unsigned char reg, unsigned char * buf, unsigned char size);
/** /**
* *
* *
* @param reg register address * @param reg Register address
* @param buf register data buffer * @param buf Register data buffer
* @param size buffer size * @param size Buffer size
*/ */
mraa_result_t ic2WriteReg (unsigned char reg, unsigned char * buf, unsigned char size); mraa_result_t ic2WriteReg (unsigned char reg, unsigned char * buf, unsigned char size);

View File

@ -33,7 +33,7 @@
namespace upm { namespace upm {
/** /**
* @brief MMA7660 I2C 3-axis digital accelerometer library * @brief MMA7660 I2C 3-Axis Digital Accelerometer library
* @defgroup mma7660 libupm-mma7660 * @defgroup mma7660 libupm-mma7660
* @ingroup seeed i2c gpio accelerometer * @ingroup seeed i2c gpio accelerometer
*/ */
@ -46,12 +46,12 @@ namespace upm {
* @man seeed * @man seeed
* @con i2c gpio * @con i2c gpio
* *
* @brief API for the MMA7660 I2C 3-axis digital accelerometer * @brief API for the MMA7660 I2C 3-Axis Digital Accelerometer
* *
* UPM module for the MMA7660 I2C 3-axis digital accelerometer. * UPM module for the MMA7660 I2C 3-axis digital accelerometer.
* This device supports a variety of capabilities, including the * This device supports a variety of capabilities, including the
* generation of interrupts for various conditions, tilt and basic * generation of interrupts for various conditions, tilt and basic
* gesture detection, and of course X/Y/Z measurements of g-forces * gesture detection, and X/Y/Z-axis measurements of g-forces
* being applied (up to 1.5g) * being applied (up to 1.5g)
* *
* This module was tested with the Grove 3-Axis Digital * This module was tested with the Grove 3-Axis Digital
@ -72,7 +72,7 @@ namespace upm {
REG_SPCNT = 0x05, // sleep count REG_SPCNT = 0x05, // sleep count
REG_INTSU = 0x06, // Interrupt setup REG_INTSU = 0x06, // Interrupt setup
REG_MODE = 0x07, // operating mode REG_MODE = 0x07, // operating mode
REG_SR = 0x08, // auto wake/sleep, SPS and debounce REG_SR = 0x08, // auto-wake/sleep, SPS, and debounce
REG_PDET = 0x09, // tap detection REG_PDET = 0x09, // tap detection
REG_PD = 0x0a // tap debounce count REG_PD = 0x0a // tap debounce count
// 0x0b-0x1f reserved // 0x0b-0x1f reserved
@ -83,7 +83,7 @@ namespace upm {
INTR_FBINT = 0x01, // front/back INTR_FBINT = 0x01, // front/back
INTR_PLINT = 0x02, // up/down/right/left INTR_PLINT = 0x02, // up/down/right/left
INTR_PDINT = 0x04, // tap detection INTR_PDINT = 0x04, // tap detection
INTR_ASINT = 0x08, // exit autosleep INTR_ASINT = 0x08, // exit auto-sleep
INTR_GINT = 0x10, // measurement intr INTR_GINT = 0x10, // measurement intr
INTR_SHINTZ = 0x20, // shake on Z INTR_SHINTZ = 0x20, // shake on Z
INTR_SHINTY = 0x40, // shake on Y INTR_SHINTY = 0x40, // shake on Y
@ -96,7 +96,7 @@ namespace upm {
MODE_TON = 0x04, // determines mode with MODE_MODE MODE_TON = 0x04, // determines mode with MODE_MODE
MODE_AWE = 0x08, // auto-wake MODE_AWE = 0x08, // auto-wake
MODE_ASE = 0x10, // auto-sleep MODE_ASE = 0x10, // auto-sleep
MODE_SCPS = 0x20, // sleep count pre-scale MODE_SCPS = 0x20, // sleep count prescale
MODE_IPP = 0x40, // intr out push-pull/open drain MODE_IPP = 0x40, // intr out push-pull/open drain
MODE_IAH = 0x80 // intr active low/high MODE_IAH = 0x80 // intr active low/high
} MMA7660_MODE_T; } MMA7660_MODE_T;
@ -115,7 +115,7 @@ namespace upm {
LP_VERT_UP = 0x06 LP_VERT_UP = 0x06
} MMA7660_TILT_LP_T; } MMA7660_TILT_LP_T;
// sample rate (auto sleep) values // sample rate (auto-sleep) values
typedef enum { AUTOSLEEP_120 = 0x00, typedef enum { AUTOSLEEP_120 = 0x00,
AUTOSLEEP_64 = 0x01, AUTOSLEEP_64 = 0x01,
AUTOSLEEP_32 = 0x02, AUTOSLEEP_32 = 0x02,
@ -127,151 +127,151 @@ namespace upm {
} MMA7660_AUTOSLEEP_T; } MMA7660_AUTOSLEEP_T;
/** /**
* mma7660 constructor * MMA7660 constructor
* *
* @param bus i2c bus to use * @param bus I2C bus to use
* @param address the address for this sensor; default is 0x55 * @param address Address for this sensor; default is 0x55
*/ */
MMA7660(int bus, uint8_t address = MMA7660_DEFAULT_I2C_ADDR); MMA7660(int bus, uint8_t address = MMA7660_DEFAULT_I2C_ADDR);
/** /**
* MMA7660 Destructor * MMA7660 destructor
*/ */
~MMA7660(); ~MMA7660();
/** /**
* Write byte value into register * Writes a byte value into a register
* *
* @param reg register location to write into * @param reg Register location to write into
* @param byte byte to write * @param byte Byte to write
* @return true if successful * @return True if successful
*/ */
bool writeByte(uint8_t reg, uint8_t byte); bool writeByte(uint8_t reg, uint8_t byte);
/** /**
* Read byte value from register * Reads a byte value from a register
* *
* @param reg register location to read from * @param reg Register location to read from
* @return value at specified register * @return Value in a specified register
*/ */
uint8_t readByte(uint8_t reg); uint8_t readByte(uint8_t reg);
/** /**
* Read current value of conversion * Reads the current value of conversion
* *
* @param x returned x value * @param x Returned x value
* @param y returned y value * @param y Returned y value
* @param z returned z value * @param z Returned z value
*/ */
void getRawValues(int *x, int *y, int *z); void getRawValues(int *x, int *y, int *z);
/** /**
* Get the computed acceleration * Gets the computed acceleration
* *
* @param ax returned computed acceleration of X axis * @param ax Returned computed acceleration of the X-axis
* @param ay returned computed acceleration of Y axis * @param ay Returned computed acceleration of the Y-axis
* @param az returned computed acceleration of Z axis * @param az Returned computed acceleration of the Z-axis
*/ */
void getAcceleration(float *ax, float *ay, float *az); void getAcceleration(float *ax, float *ay, float *az);
/** /**
* Read an axis, verifying it's validity. The value passed must * Reads an axis, verifying its validity. The value passed must
* be one of REG_XOUT, REG_YOUT, or REG_ZOUT. * be one of REG_XOUT, REG_YOUT, or REG_ZOUT.
* *
* @param axis axis to read * @param axis Axis to read
* @return axis value * @return Axis value
*/ */
int getVerifiedAxis(MMA7660_REG_T axis); int getVerifiedAxis(MMA7660_REG_T axis);
/** /**
* Read the tilt register, verifying it's validity. * Reads the tilt register, verifying its validity
* *
* @return tilt value * @return Tilt value
*/ */
uint8_t getVerifiedTilt(); uint8_t getVerifiedTilt();
/** /**
* Put the device into active mode. In active mode, register * Puts the device in the active mode. In this mode, register
* write are not allowed. Place the device in Standby mode before * writes are not allowed. Place the device in the standby mode before
* attempting to write registers. * attempting to write registers.
* *
*/ */
void setModeActive(); void setModeActive();
/** /**
* Put the device into Standby (power saving) mode. Note, when in * Puts the device in the standby (power saving) mode. Note: when in
* standby mode, there will be no valid data in the registers. In * the standby mode, there is no valid data in the registers. In
* addition, the only way to write a register is to place the * addition, the only way to write a register is to put the
* device in standby mode. * device in the standby mode.
* *
*/ */
void setModeStandby(); void setModeStandby();
/** /**
* Read tilt BackFront bits * Reads tiltBackFront bits
* *
* The value returned will be one of the MMA7660_TILT_BF_T values * The value returned is one of the MMA7660_TILT_BF_T values
* *
* @return the bits corresponding to the BackFront tilt status * @return Bits corresponding to the BackFront tilt status
*/ */
uint8_t tiltBackFront(); uint8_t tiltBackFront();
/** /**
* Read tilt LandscapePortrait bits * Reads tiltLandscapePortrait bits
* *
* The value returned will be one of the MMA7660_TILT_LP_T values * The value returned is one of the MMA7660_TILT_LP_T values
* *
* @return the bits corresponding to the LandscapePortrait tilt status * @return Bits corresponding to the LandscapePortrait tilt status
*/ */
uint8_t tiltLandscapePortrait(); uint8_t tiltLandscapePortrait();
/** /**
* read the tilt Tap status * Reads the tiltTap status
* *
* @return true if a tap was detected * @return True if a tap is detected
*/ */
bool tiltTap(); bool tiltTap();
/** /**
* read the tilt Shake status * Reads the tiltShake status
* *
* @return true if a Shake was detected * @return True if a shake is detected
*/ */
bool tiltShake(); bool tiltShake();
/** /**
* Install an Interrupt Service Routine (ISR) to be called when * Installs an interrupt service routine (ISR) to be called when
* an interrupt occurs * an interrupt occurs
* *
* @param pin gpio pin to use as interrupt pin * @param pin GPIO pin to use as the interrupt pin
* @param fptr function pointer to function to be called on interrupt * @param fptr Pointer to a function to be called on interrupt
* @param arg pointer to an object that will be supplied as an * @param arg Pointer to an object to be supplied as an
* argument to the ISR. * argument to the ISR.
*/ */
void installISR(int pin, void (*isr)(void *), void *arg); void installISR(int pin, void (*isr)(void *), void *arg);
/** /**
* Uninstall the previously installed Interrupt Service Routine (ISR) * Uninstalls the previously installed ISR
* *
*/ */
void uninstallISR(); void uninstallISR();
/** /**
* Enable interrupt generation based on the passed interrupt bits. * Enables interrupt generation based on passed interrupt bits.
* The bits are a bit mask of the requested MMA7660_INTR_T values. * The bits are a bitmask of the requested MMA7660_INTR_T values.
* Note: The device must be in standby mode to set this register. * Note: the device must be in the standby mode to set this register.
* *
* @param ibits set the requested interrupt bits * @param ibits Sets the requested interrupt bits
* @return true if successful * @return True if successful
*/ */
bool setInterruptBits(uint8_t ibits); bool setInterruptBits(uint8_t ibits);
/** /**
* Set the sampling rate of the sensor. The value supplied must * Sets the sampling rate of the sensor. The value supplied must
* be one of the MMA7660_AUTOSLEEP_T values. * be one of the MMA7660_AUTOSLEEP_T values.
* *
* @param sr one of the MMA7660_AUTOSLEEP_T values * @param sr One of the MMA7660_AUTOSLEEP_T values
* @return true if successful * @return True if successful
*/ */
bool setSampleRate(MMA7660_AUTOSLEEP_T sr); bool setSampleRate(MMA7660_AUTOSLEEP_T sr);

View File

@ -56,7 +56,7 @@
namespace upm { namespace upm {
/** /**
* @brief MPL3115A2 atmospheric pressure library * @brief MPL3115A2 Atmospheric Pressure Sensor library
* @defgroup mpl3115a2 libupm-mpl3115a2 * @defgroup mpl3115a2 libupm-mpl3115a2
* @ingroup freescale i2c pressure * @ingroup freescale i2c pressure
*/ */
@ -69,12 +69,12 @@ namespace upm {
* @web http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MPL3115A2 * @web http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MPL3115A2
* @con i2c * @con i2c
* *
* @brief API for MPL3115A2 chip (Atmospheric Pressure Sensor) * @brief API for the MPL3115A2 Atmospheric Pressure Sensor
* *
* Freescale [MPL3115A2] * Freescale Semiconductor* [MPL3115A2]
* (http://cache.freescale.com/files/sensors/doc/data_sheet/MPL3115A2.pdf) * (http://cache.freescale.com/files/sensors/doc/data_sheet/MPL3115A2.pdf)
* is a high precision, ultra-low power consumption pressure sensor. It has a * is a high-precision, ultra-low power consumption pressure sensor. Its operating
* range of between 50 and 110 kPa. * range is 50-110 kPa.
* *
* @image html mpl3115a2.jpg * @image html mpl3115a2.jpg
* @snippet mpl3115a2.cxx Interesting * @snippet mpl3115a2.cxx Interesting
@ -84,92 +84,92 @@ class MPL3115A2 {
/** /**
* Instantiates an MPL3115A2 object * Instantiates an MPL3115A2 object
* *
* @param bus number of used bus * @param bus Number of the used bus
* @param devAddr address of used i2c device * @param devAddr Address of the used I2C device
* @param mode MPL3115A2 oversampling (6 = 64x) * @param mode MPL3115A2 oversampling (6 = 64x)
*/ */
MPL3115A2(int bus, int devAddr=MPL3115A2_I2C_ADDRESS, uint8_t mode=6); MPL3115A2(int bus, int devAddr=MPL3115A2_I2C_ADDRESS, uint8_t mode=6);
/** /**
* MPL3115A2 object destructor, basicaly it close i2c connection. * MPL3115A2 object destructor; basically, it closes the I2C connection.
*/ */
~MPL3115A2(); ~MPL3115A2();
/** /**
* Test the sensor and try to determine if operating by looking * Tests the sensor and tries to determine if the sensor is operating by looking
* for small variations in the value * for small variations in the value
*/ */
int testSensor(void); int testSensor(void);
/** /**
* Perform a soft RESET of the MPL3115A2 device to ensure * Performs a soft reset of the MPL3115A2 device to ensure
* it is in a known state. This function can be used to reset * it is in a known state. This function can be used to reset
* the min/max temperature and pressure values. * the min/max temperature and pressure values.
*/ */
int resetSensor(void); int resetSensor(void);
/** /**
* Dump out the i2c register block to stdout * Dumps out the I2C register block to stdout
*/ */
void dumpSensor(void); void dumpSensor(void);
/** /**
* Initiate a temp/pressure mesasurement and wait for function * Initiates a temperature/pressure mesasurement and waits for the function
* to complete. The temp and pressure registers can be read * to complete. Temperature and pressure registers can be read
* after this call. * after this call.
*/ */
int sampleData(void); int sampleData(void);
/** /**
* Read a pressure value from the mpl3115a2 [Pa * 100] * Reads the pressure value from MPL3115A2 [Pa * 100]
* *
* @param reg base address of pressure register * @param reg Base address of the pressure register
*/ */
int32_t getPressureReg(int reg); int32_t getPressureReg(int reg);
/** /**
* Read a temperature value from the mpl3115a2 [degC * 1000] * Reads the temperature value from MPL3115A2 [degC * 1000]
* *
* @param reg base address of temperature register * @param reg Base address of the temperature register
*/ */
int32_t getTempReg(int reg); int32_t getTempReg(int reg);
/** /**
* Read the current pressure value from the mpl3115a2 [Pa] * Reads the current pressure value from MPL3115A2 [Pa]
* *
* @param bSampleData Set non-zero to sample reading * @param bSampleData Sets non-zero to a sample reading
*/ */
float getPressure(int bSampleData = true); float getPressure(int bSampleData = true);
/** /**
* Read the current temperature value from the mpl3115a2 [degC] * Reads the current temperature value from MPL3115A2 [degC]
* *
* @param bSampleData Set non-zero to sample reading * @param bSampleData Sets non-zero to a sample reading
*/ */
float getTemperature(int bSampleData = true); float getTemperature(int bSampleData = true);
/** /**
* Read the current pressure and using a known altitude calculate * Reads the current pressure and, using a known altitude, calculates
* the sea level pressure value [Pa] * the sea level pressure value [Pa]
* This function should be preceeded by the sampleData() call * This function should be preceded by the sampleData() call
* *
* @param altitudeMeters Altitude in meters * @param altitudeMeters Altitude in meters
*/ */
float getSealevelPressure(float altitudeMeters = 0.0); float getSealevelPressure(float altitudeMeters = 0.0);
/** /**
* Read the current pressure and using a known sea level pressure * Reads the current pressure and, using a known sea level pressure,
* calculate the altitude value [m] * calculates the altitude value [m]
* This function should be preceeded by the sampleData() call * This function should be preceded by the sampleData() call
* *
* @param sealevelPressure Current sea level pressure * @param sealevelPressure Current sea level pressure
*/ */
float getAltitude (float sealevelPressure = 101325.0); float getAltitude (float sealevelPressure = 101325.0);
/** /**
* Set the oversampling setting (ranges from 0 to 7). The * Defines the oversampling setting (ranges from 0 to 7). The
* value represents 2^n samples (ranging from 1 to 128). The * value represents 2^n samples (ranging from 1 to 128). The
* time to calculate the sample is approximately (2^n * 4 + 2) mS * time to calculate a sample is approximately (2^n * 4 + 2) ms
* *
* @param oversampling New oversampling value * @param oversampling New oversampling value
*/ */
@ -181,60 +181,60 @@ class MPL3115A2 {
uint8_t getOversampling(void); uint8_t getOversampling(void);
/** /**
* Read the maximum measured temperature [degC] * Reads the maximum measured temperature [degC]
*/ */
float getTemperatureMax(void); float getTemperatureMax(void);
/** /**
* Read the minimum measured temperature [degC] * Reads the minimum measured temperature [degC]
*/ */
float getTemperatureMin(void); float getTemperatureMin(void);
/** /**
* Read the maximum measured pressure [Pa] * Reads the maximum measured pressure [Pa]
*/ */
float getPressureMax (void); float getPressureMax (void);
/** /**
* Read the minimum measured pressure [Pa] * Reads the minimum measured pressure [Pa]
*/ */
float getPressureMin (void); float getPressureMin (void);
/** /**
* Convert temperature from degC*1000 to degF*1000 * Converts temperature from degC*1000 to degF*1000
* *
* @param iTemp Temperature in degC * @param iTemp Temperature in degC
*/ */
float convertTempCtoF(float fTemp); float convertTempCtoF(float fTemp);
/** /**
* Convert pressure from Pa*100 to inHg*10000 * Converts pressure from Pa*100 to inHg*10000
* This is set for 15degC (Pa = 0.0002961 in Hg) * This is set for 15degC (Pa = 0.0002961 in Hg)
* TODO: Change function to add temp calibration * TODO: Change the function to add temperature calibration
* *
* @param iPressure Pressure in Pa * @param iPressure Pressure in Pa
*/ */
float convertPaToinHg(float fPressure); float convertPaToinHg(float fPressure);
/** /**
* Write to one byte to i2c register * Writes one byte to an I2C register
* *
* @param reg address of a register * @param reg Address of the register
* @param value byte to be written * @param value Byte to be written
*/ */
mraa_result_t i2cWriteReg (uint8_t reg, uint8_t value); mraa_result_t i2cWriteReg (uint8_t reg, uint8_t value);
/** /**
* Read two bytes from i2c registers * Reads two bytes from an I2C register
* *
* @param reg address of a register * @param reg Address of the register
*/ */
uint16_t i2cReadReg_16 (int reg); 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); uint8_t i2cReadReg_8 (int reg);

View File

@ -31,7 +31,7 @@
namespace upm { namespace upm {
/** /**
* @brief MPR121 touch sensor library * @brief MPR121 Touch Sensor library
* @defgroup mpr121 libupm-mpr121 * @defgroup mpr121 libupm-mpr121
* @ingroup seeed i2c touch tsk * @ingroup seeed i2c touch tsk
*/ */
@ -46,7 +46,7 @@ namespace upm {
* @con i2c * @con i2c
* @kit tsk * @kit tsk
* *
* @brief API for the MPR121 I2C touch sensor * @brief API for the MPR121 I2C Touch Sensor
* *
* UPM module for the MPR121 touch sensor * UPM module for the MPR121 touch sensor
* *
@ -56,60 +56,60 @@ namespace upm {
class MPR121 { class MPR121 {
public: public:
/** /**
* mpr121 touch sensor constructor * MPR121 constructor
* *
* @param bus i2c bus to use * @param bus I2C bus to use
*/ */
MPR121(int bus, uint8_t address = MPR121_DEFAULT_I2C_ADDR); MPR121(int bus, uint8_t address = MPR121_DEFAULT_I2C_ADDR);
/** /**
* MPR121 Destructor * MPR121 destructor
*/ */
~MPR121(); ~MPR121();
/** /**
* Setup a default configuration, based on Application Note 3944 * Sets up a default configuration, based on Application Note 3944
* (AN3944): * (AN3944):
* http://cache.freescale.com/files/sensors/doc/app_note/AN3944.pdf * http://cache.freescale.com/files/sensors/doc/app_note/AN3944.pdf
* *
* After configuration, the sensor will be left in the Run State. * After configuration, the sensor is left in the run state.
* *
* @return True if configuration succeeded * @return True if configuration is successful
*/ */
bool configAN3944(); bool configAN3944();
/** /**
* Read the button states into the m_buttonStates member variable. Also * Reads button states in the m_buttonStates member variable. Also,
* set the m_overCurrentFault variable if an over current is detected. * sets the m_overCurrentFault variable if overcurrent is detected.
*/ */
void readButtons(); void readButtons();
/** /**
* Write value(s) into registers * Writes value(s) into registers
* *
* @param reg register location to start writing into * @param reg Register location to start writing into
* @param buffer buffer for data storage * @param buffer Buffer for data storage
* @param len number of bytes to write * @param len Number of bytes to write
* @return mraa_result_t * @return mraa_result_t
*/ */
mraa_result_t writeBytes(uint8_t reg, uint8_t *buffer, unsigned int len); 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 reg Register location to start reading from
* @param buffer buffer for data storage * @param buffer Buffer for data storage
* @param len number of bytes to read * @param len Number of bytes to read
*/ */
void readBytes(uint8_t reg, uint8_t *buffer, unsigned int len); void readBytes(uint8_t reg, uint8_t *buffer, unsigned int len);
/** /**
* button states * Button states
*/ */
uint16_t m_buttonStates; uint16_t m_buttonStates;
/** /**
* Over current fault detected * Overcurrent detected
*/ */
bool m_overCurrentFault; bool m_overCurrentFault;

View File

@ -63,27 +63,27 @@ namespace upm {
/** /**
* MPU9150 constructor * MPU9150 constructor
* *
* @param bus i2c bus to use * @param bus I2C bus to use
* @param address the address for this device * @param address The address for this device
* @param magAddress the address of the connected magnetometer * @param magAddress The address of the connected magnetometer
*/ */
MPU9150 (int bus=MPU9150_I2C_BUS, int address=MPU9150_DEFAULT_I2C_ADDR, MPU9150 (int bus=MPU9150_I2C_BUS, int address=MPU9150_DEFAULT_I2C_ADDR,
int magAddress=AK8975_DEFAULT_I2C_ADDR); int magAddress=AK8975_DEFAULT_I2C_ADDR);
/** /**
* MPU9150 Destructor * MPU9150 destructor
*/ */
~MPU9150 (); ~MPU9150 ();
/** /**
* set up initial values and start operation * Set up initial values and start operation
* *
* @return true if successful * @return true if successful
*/ */
bool init(); bool init();
/** /**
* take a measurement and store the current sensor values * Take a measurement and store the current sensor values
* internally. Note, these user facing registers are only updated * internally. Note, these user facing registers are only updated
* from the internal device sensor values when the i2c serial * from the internal device sensor values when the i2c serial
* traffic is 'idle'. So, if you are reading the values too fast, * traffic is 'idle'. So, if you are reading the values too fast,
@ -97,12 +97,12 @@ namespace upm {
void update(); void update();
/** /**
* return the compensated values for the x, y, and z axes. The * Return the compensated values for the x, y, and z axes. The
* unit of measurement is in micro-teslas (uT). * unit of measurement is in micro-teslas (uT).
* *
* @param x pointer to returned X axis value * @param x Pointer to returned X axis value
* @param y pointer to returned Y axis value * @param y Pointer to returned Y axis value
* @param z pointer to returned Z axis value * @param z Pointer to returned Z axis value
*/ */
void getMagnetometer(float *x, float *y, float *z); void getMagnetometer(float *x, float *y, float *z);

View File

@ -29,7 +29,7 @@
namespace upm { namespace upm {
/** /**
* @brief MQ303A alcohol sensor library * @brief MQ303A Alcohol Sensor library
* @defgroup mq303a libupm-mq303a * @defgroup mq303a libupm-mq303a
* @ingroup seeed analog gpio gaseous tsk * @ingroup seeed analog gpio gaseous tsk
*/ */
@ -46,10 +46,10 @@ namespace upm {
* *
* @brief API for the MQ303A Alcohol Sensor * @brief API for the MQ303A Alcohol Sensor
* *
* UPM module for the MQ303A Alcohol Sensor. * UPM module for the MQ303A alcohol sensor.
* This sensor needs to be warmed up before stable results are * This sensor needs to be warmed up before stable results are
* obtained. The higher the value returned from value(), * obtained. The higher the value returned from value(),
* the higher the amount of alcohol that was detected. * the higher the amount of alcohol detected.
* *
* @image html mq303a.jpg * @image html mq303a.jpg
* @snippet mq303a.cxx Interesting * @snippet mq303a.cxx Interesting
@ -57,31 +57,31 @@ namespace upm {
class MQ303A { class MQ303A {
public: public:
/** /**
* MQ303A sensor constructor * MQ303A constructor
* *
* @param pin analog pin to use * @param pin Analog pin to use
* @param heaterPin digital pin mapped to analog pin to use * @param heaterPin Digital pin mapped to the analog pin to use
*/ */
MQ303A(int pin, int heaterPin); MQ303A(int pin, int heaterPin);
/** /**
* MQ303A Destructor * MQ303A destructor
*/ */
~MQ303A(); ~MQ303A();
/** /**
* Get the alcohol detected from the sensor. * Gets the alcohol reading from the sensor.
* The value read from the analog pin is inverted. * The value read from the analog pin is inverted.
* A higher returned value means a higher amount of alcohol was detected. * A higher returned value means a higher amount of alcohol detected.
* *
* @return the alcohol reading * @return Alcohol reading
*/ */
int value(); int value();
/** /**
* Enable the heater. * Enables the heater
* *
* @param enable if true, enable the heater else disable * @param enable Enables the heater if true; otherwise, disables it
*/ */
void heaterEnable(bool enable); void heaterEnable(bool enable);

View File

@ -38,7 +38,7 @@
namespace upm { namespace upm {
/** /**
* @brief MY9221 led bar library * @brief MY9221 LED Bar library
* @defgroup my9221 libupm-my9221 * @defgroup my9221 libupm-my9221
* @ingroup seeed display gpio eak * @ingroup seeed display gpio eak
*/ */
@ -53,7 +53,7 @@ namespace upm {
* @con gpio * @con gpio
* @kit eak * @kit eak
* *
* @brief API for MY9221 based LED bars * @brief API for MY9221-based LED Bars
* *
* This file defines the MY9221 interface for libmy9221 * This file defines the MY9221 interface for libmy9221
* *
@ -64,10 +64,10 @@ namespace upm {
class MY9221 { class MY9221 {
public: public:
/** /**
* Instanciates a MY9221 object * Instantiates an MY9221 object
* *
* @param di data pin * @param di Data pin
* @param dcki clock pin * @param dcki Clock pin
*/ */
MY9221 (uint8_t di, uint8_t dcki); MY9221 (uint8_t di, uint8_t dcki);
@ -77,15 +77,15 @@ class MY9221 {
~MY9221 (); ~MY9221 ();
/** /**
* Set the level bar * Sets the bar level
* *
* @param level selected level for the bar (1 - 10) * @param level Selected level for the bar (1 - 10)
* @param direction up or down, true is up and is the default * @param direction Up or down; up is true and default
*/ */
mraa_result_t setBarLevel (uint8_t level, bool direction=true); mraa_result_t setBarLevel (uint8_t level, bool direction=true);
/** /**
* Return name of the component * Returns the name of the component
*/ */
std::string name() std::string name()
{ {

View File

@ -151,7 +151,7 @@ typedef enum {
} power_t; } power_t;
/** /**
* @brief NRF24L01 transceiver library * @brief NRF24L01 Transceiver library
* @defgroup nrf24l01 libupm-nrf24l01 * @defgroup nrf24l01 libupm-nrf24l01
* @ingroup seeed sparkfun spi wifi * @ingroup seeed sparkfun spi wifi
*/ */
@ -164,9 +164,9 @@ typedef enum {
* @web http://www.seeedstudio.com/depot/nRF24L01Module-p-1394.html * @web http://www.seeedstudio.com/depot/nRF24L01Module-p-1394.html
* @con spi * @con spi
* *
* @brief API for NRF24L01 transceiver module * @brief API for the NRF24L01 Transceiver Module
* *
* This file defines the NRF24l01 interface for libnrf24l01 * This file defines the NRF24L01 interface for libnrf24l01
* *
* @image html nrf24l01.jpg * @image html nrf24l01.jpg
* @snippet nrf24l01-receiver.cxx Interesting * @snippet nrf24l01-receiver.cxx Interesting
@ -176,9 +176,9 @@ typedef enum {
class NRF24L01 { class NRF24L01 {
public: public:
/** /**
* Instanciates a NRF24l01 object * Instantiates an NRF24l01 object
* *
* @param cs chip select pin * @param cs Chip select pin
*/ */
NRF24L01 (uint8_t cs, uint8_t ce); NRF24L01 (uint8_t cs, uint8_t ce);
@ -188,7 +188,7 @@ class NRF24L01 {
~NRF24L01 (); ~NRF24L01 ();
/** /**
* Return name of the component * Returns the name of the component
*/ */
std::string name() std::string name()
{ {
@ -196,104 +196,104 @@ class NRF24L01 {
} }
/** /**
* Initialize needed Gpio pins and SPI interface * Initializes needed GPIO pins and SPI
* *
* @param chipSelect setting up the chip select pin * @param chipSelect Sets up the chip select pin
* @param chipEnable setting up the chip enable pin * @param chipEnable Sets up the chip enable pin
*/ */
void init (uint8_t chipSelect, uint8_t chipEnable); void init (uint8_t chipSelect, uint8_t chipEnable);
/** /**
* Configure NRF24l01 chip * Configures the NRF24L01 transceiver
*/ */
void configure (); void configure ();
/** /**
* Send the buffer data * Sends the buffer data
* *
* @param *value pointer to the buffer * @param *value Pointer to the buffer
*/ */
void send (uint8_t * value); void send (uint8_t * value);
/** /**
* Send the data located in inner bufer, user must fill the * Sends the data located in an inner bufer; the user must fill the
* m_txBuffer buffer * m_txBuffer buffer
*/ */
void send (); void send ();
/** /**
* Set recieving address of the device * Sets a receiving address of the device
* *
* @param addr 5 bytes addres * @param addr 5-byte address
*/ */
void setSourceAddress (uint8_t * addr); void setSourceAddress (uint8_t * addr);
/** /**
* Set recipient address. nrfSend method will send the data buffer * Sets a recipient address. The nrfSend method sends the data buffer
* to this address * to this address
* *
* @param addr 5 bytes addres * @param addr 5-byte address
*/ */
void setDestinationAddress (uint8_t * addr); void setDestinationAddress (uint8_t * addr);
/** /**
* Set broadcasting address. * Sets a broadcasting address
* *
* @param addr 5 bytes addres * @param addr 5-byte address
*/ */
void setBroadcastAddress (uint8_t * addr); void setBroadcastAddress (uint8_t * addr);
/** /**
* Set payload size. * Sets the payload size
* *
* @param load size of the payload (MAX 32) * @param load Size of the payload (MAX 32)
*/ */
void setPayload (uint8_t load); void setPayload (uint8_t load);
/** /**
* Check if data arrived * Checks if the data has arrived
*/ */
bool dataReady (); bool dataReady ();
/** /**
* Check if chip in sending mode * Checks if the transceiver is in the sending mode
*/ */
bool dataSending (); bool dataSending ();
/** /**
* Sink all arrived data into the provided buffer * Sinks all the arrived data into a provided buffer
* *
* @param load size of the payload (MAX 32) * @param load Size of the payload (MAX 32)
*/ */
void getData (uint8_t * data); void getData (uint8_t * data);
/** /**
* Check the chip state * Checks the transceiver state
*/ */
uint8_t getStatus (); uint8_t getStatus ();
/** /**
* Check if recieving stack is empty * Checks if the receive stack is empty
*/ */
bool rxFifoEmpty (); bool rxFifoEmpty ();
/** /**
* Power up reciever * Powers the receiver up
*/ */
void rxPowerUp (); void rxPowerUp ();
/** /**
* Flush reciver stack * Flushes the receive stack
*/ */
void rxFlushBuffer (); void rxFlushBuffer ();
/** /**
* Power up transmitter * Powers the transmitter up
*/ */
void txPowerUp (); void txPowerUp ();
/** /**
* Power down all * Powers everything down
*/ */
void powerDown (); void powerDown ();
@ -304,77 +304,77 @@ class NRF24L01 {
uint8_t setSpeedRate (speed_rate_t rate); uint8_t setSpeedRate (speed_rate_t rate);
/** /**
* Flush transmit stack * Flushes the transmit stack
*/ */
void txFlushBuffer (); void txFlushBuffer ();
/** /**
* Pulling method which listenning for arrived data, if data * Pulling the method listening for the arrived data,
* arrived dataRecievedHandler will be triggered * dataRecievedHandler is triggered if data arrives
*/ */
void pollListener (); void pollListener ();
/** /**
* Set chip enable pin HIGH * Sets the chip enable pin to HIGH
*/ */
mraa_result_t ceHigh (); mraa_result_t ceHigh ();
/** /**
* Set chip enable LOW * Sets the chip enable pin to LOW
*/ */
mraa_result_t ceLow (); mraa_result_t ceLow ();
/** /**
* Set chip select pin LOW * Sets the chip select pin to LOW
*/ */
mraa_result_t csOn (); mraa_result_t csOn ();
/** /**
* Set chip select pin HIGH * Sets the chip select pin to HIGH
*/ */
mraa_result_t csOff (); mraa_result_t csOff ();
/** /**
* Configure nRF24l01 module to behave as BLE * Configures the NRF24L01 transceiver to behave as a BLE
* (Bluetooth Low Energy) beaconing devcie. * (Bluetooth Low Energy) beaconing devcie.
*/ */
void setBeaconingMode (); void setBeaconingMode ();
/** /**
* Beaconing the provided message to BLE scanners. * Beacons the provided message to BLE scanners.
* *
* @param msg beacon the provated message (max length is 16 bytes) * @param msg Beacons the provided message (max length is 16 bytes)
*/ */
void sendBeaconingMsg (uint8_t * msg); void sendBeaconingMsg (uint8_t * msg);
uint8_t m_rxBuffer[MAX_BUFFER]; /**< Reciver buffer */ uint8_t m_rxBuffer[MAX_BUFFER]; /**< Receive buffer */
uint8_t m_txBuffer[MAX_BUFFER]; /**< Transmit buffer */ uint8_t m_txBuffer[MAX_BUFFER]; /**< Transmit buffer */
uint8_t m_bleBuffer [32]; /**< BLE buffer */ uint8_t m_bleBuffer [32]; /**< BLE buffer */
funcPtrVoidVoid dataRecievedHandler; /**< Data arrived handler */ funcPtrVoidVoid dataRecievedHandler; /**< Data arrived handler */
private: private:
/** /**
* Write bytes to the SPI device. * Writes bytes to an SPI device
*/ */
void writeBytes (uint8_t * dataout, uint8_t * datain, uint8_t len); void writeBytes (uint8_t * dataout, uint8_t * datain, uint8_t len);
/** /**
* Set register value on SPI device. [one byte] * Sets the register value on an SPI device [one byte]
*/ */
void setRegister (uint8_t reg, uint8_t value); void setRegister (uint8_t reg, uint8_t value);
/** /**
* Get register value from SPI device. [one byte] * Gets the register value from an SPI device [one byte]
*/ */
uint8_t getRegister (uint8_t reg); uint8_t getRegister (uint8_t reg);
/** /**
* Reads an array of bytes from the given start position in the nrf24l01 registers. * Reads an array of bytes from the given starting position in NRF24L01 registers
*/ */
void readRegister (uint8_t reg, uint8_t * value, uint8_t len); void readRegister (uint8_t reg, uint8_t * value, uint8_t len);
/** /**
* Writes an array of bytes into inte the nrf24l01 registers. * Writes an array of bytes into NRF24L01 registers
*/ */
void writeRegister (uint8_t reg, uint8_t * value, uint8_t len); void writeRegister (uint8_t reg, uint8_t * value, uint8_t len);
/** /**
* Send command to the nrf24l01. * Sends a command to NRF24L01
*/ */
void sendCommand (uint8_t cmd); void sendCommand (uint8_t cmd);

View File

@ -23,7 +23,7 @@
*/ */
/** /**
* @brief NRF8001 bluetooth low energy library * @brief NRF8001 Bluetooth Low Energy library
* @defgroup nrf8001 libupm-nrf8001 * @defgroup nrf8001 libupm-nrf8001
* @ingroup adafruit wifi analog gpio spi * @ingroup adafruit wifi analog gpio spi
*/ */
@ -36,12 +36,12 @@
* @web https://learn.adafruit.com/getting-started-with-the-nrf8001-bluefruit-le-breakout/introduction * @web https://learn.adafruit.com/getting-started-with-the-nrf8001-bluefruit-le-breakout/introduction
* @con spi gpio analog * @con spi gpio analog
* *
* @brief nrf8001 Bluetooth Low Energy library * @brief NRF8001 Bluetooth Low Energy library
* *
* These files define the NRF8001 interface for lib-nrf8001. Interaction * These files define the NRF8001 interface for lib-nrf8001. Interaction
* with this device is done through the ACI routines included with the library. * with this device is done through the ACI routines included with the library.
* You can use the nRF UART app in the Apple iOS app store and Google Play for * You can use the nRF UART app in Apple* App Store and Google* Play* on
* Android 4.3 for Samsung Galaxy S4 to interact with a microcontroller running * Samsung* Galaxy S*4 running Android* 4.3 to interact with a microcontroller running
* the 'hello world' example. * the 'hello world' example.
* *
* @image html nrf8001.jpg * @image html nrf8001.jpg

View File

@ -31,33 +31,33 @@
namespace upm { namespace upm {
/** /**
* @brief Wii Nunchuck library * @brief Wii Nunchuk library
* @defgroup nunchuck libupm-nunchuck * @defgroup nunchuck libupm-nunchuck
* @ingroup generic i2c accelerometer robok * @ingroup generic i2c accelerometer robok
*/ */
/** /**
* @library nunchuck * @library nunchuck
* @sensor nunchuck * @sensor nunchuck
* @comname Wii Nunchuck * @comname Wii Nunchuk
* @type accelerometer * @type accelerometer
* @man generic * @man generic
* @web http://wiibrew.org/wiki/Wiimote/Extension_Controllers * @web http://wiibrew.org/wiki/Wiimote/Extension_Controllers
* @con i2c * @con i2c
* @kit robok * @kit robok
* *
* @brief API for the Wii Nunchuck * @brief API for the Wii* Nunchuk controller
* *
* UPM module for the Wii Nunchuck. This module was tested with the * UPM module for the Wii Nunchuk controller. This module was tested with
* Wii Nunchuck connected to I2C via a Grove Wii Nunchuck adapter. * Wii Nunchuk connected to I2C via a Grove Wii Nunchuk adapter.
* *
* See http://wiibrew.org/wiki/Wiimote/Extension_Controllers and * See http://wiibrew.org/wiki/Wiimote/Extension_Controllers and
* http://wiibrew.org/wiki/Wiimote/Extension_Controllers/Nunchuck * http://wiibrew.org/wiki/Wiimote/Extension_Controllers/Nunchuck
* for more detailed information on the controller and it's protocol. * for more details on the controller and its protocol.
* *
* A warning for the Grove nunchuck adapter: It has 2 traces on one * A warning for the Grove Wii Nunchuk adapter: it has 2 traces on one
* side, and 3 traces on the other. Do not match these up with the * side, and 3 traces on the other. Do not match these up with the
* nunchuck connector's traces. The nunchuck connector 'groove' * Nunchuk connector's traces. The connector's 'Grove'
* should be on the same side as the grove interface socket on the * should be on the same side as the Grove interface socket on the
* adapter. * adapter.
* *
* @image html nunchuck.jpg * @image html nunchuck.jpg
@ -68,8 +68,8 @@ namespace upm {
/** /**
* NUNCHUCK constructor * NUNCHUCK constructor
* *
* @param bus i2c bus to use * @param bus I2C bus to use
* @param addr i2c address to use * @param addr I2C address to use
*/ */
NUNCHUCK(int bus, uint8_t addr=NUNCHUCK_I2C_ADDR); NUNCHUCK(int bus, uint8_t addr=NUNCHUCK_I2C_ADDR);
@ -79,34 +79,34 @@ namespace upm {
~NUNCHUCK(); ~NUNCHUCK();
/** /**
* Write value(s) into registers * Writes value(s) into registers
* *
* @param reg register location to start writing into * @param reg Register location to start writing into
* @param byte byte to write * @param byte Byte to write
* @return true if successful * @return True if successful
*/ */
bool writeByte(uint8_t reg, uint8_t byte); bool writeByte(uint8_t reg, uint8_t byte);
/** /**
* Read value(s) from registers * Reads value(s) from registers
* *
* @param reg register location to start reading from * @param reg Register location to start reading from
* @param buffer buffer for data storage * @param buffer Buffer for data storage
* @param len number of bytes to read * @param len Number of bytes to read
* @return number of bytes read * @return Number of bytes read
*/ */
uint8_t readBytes(uint8_t reg, uint8_t *buffer, unsigned int len); uint8_t readBytes(uint8_t reg, uint8_t *buffer, unsigned int len);
/** /**
* Initialize the controller. Here, we disable encryption after * Initializes the controller. Here, we disable encryption after
* delaying for a time to ensure the controller is ready. * delaying for a time to ensure the controller is ready.
* *
* @return true if initialized successfully * @return True if initialization is successful
*/ */
bool init(); bool init();
/** /**
* Read and update the current state of the controller. * Reads and updates the current state of the controller.
* *
*/ */
void update(); void update();

View File

@ -45,24 +45,24 @@ namespace upm {
* *
* @brief API for the OTP538U IR Temperature Sensor * @brief API for the OTP538U IR Temperature Sensor
* *
* UPM module for the OTP538U IR Temperature Sensor * UPM module for the OTP538U IR temperature sensor
* *
* This module was tested with the Grove IR non-contact temperature * This module was tested with the Grove IR non-contact temperature
* sensor. * sensor.
* *
* The sensor provides 2 analog outputs - one for the thermistor * The sensor provides 2 analog outputs: one for the thermistor
* that measures ambient temperature, and another for the thermopile * that measures the ambient temperature, and the other for the thermopile
* that measures object temperature. * that measures the object temperature.
* *
* Much of the code depends on analyzing the SeeedStudio examples * Much of the code depends on analyzing Seeed Studio* examples
* and circuit design. As a result, there are several 'magic' * and the circuit design. As a result, there are several 'magic'
* numbers that were derived from their circuit design. By default, * numbers derived from their circuit design. These values are used
* these values will be used. * by default.
* *
* The tables used came from the datasheets "538U VT * The tables used came from the "538U VT
* Table__20_200(v1.3).pdf" and "538RT_table.pdf". * Table__20_200(v1.3).pdf" and "538RT_table.pdf" datasheets.
* *
* These tables assume the object to be measured is 9cm (3.54 * These tables assume the object to be measured is 9 cm (3.54
* inches) from the sensor. * inches) from the sensor.
* *
* @image html otp538u.jpg * @image html otp538u.jpg
@ -71,71 +71,71 @@ namespace upm {
class OTP538U { class OTP538U {
public: public:
/** /**
* OTP538U sensor constructor * OTP538U constructor
* *
* @param pinA analog pin to use for Ambient temperature * @param pinA Analog pin to use for the ambient temperature
* @param pinO analog pin to use for Object temperature * @param pinO Analog pin to use for the object temperature
* @param aref analog reference voltage, default 5.0 * @param aref Analog reference voltage; default is 5.0 V
*/ */
OTP538U(int pinA, int pinO, float aref = 5.0); OTP538U(int pinA, int pinO, float aref = 5.0);
/** /**
* OTP538U Destructor * OTP538U destructor
*/ */
~OTP538U(); ~OTP538U();
/** /**
* Get the ambient temperature in C * Gets the ambient temperature in Celsius
* *
* @return the ambient temperature * @return Ambient temperature
*/ */
float ambientTemperature(); float ambientTemperature();
/** /**
* Get the object temperature in C * Gets the object temperature in Celsius
* *
* @return the object's temperature * @return Object temperature
*/ */
float objectTemperature(); float objectTemperature();
/** /**
* Set the offset voltage * Sets the offset voltage
* *
* The Seeedstudio wiki gives an example on calibrating the sensor * The Seeed Studio wiki gives an example of calibrating the sensor
* and calculating the offset voltage to apply. Currently, the * and calculating the offset voltage to apply. Currently, the
* default value is set, but you can use the function to set one * default value is set, but you can use the function to set one
* of your own. * of your own.
* *
* @param vOffset the desired offset voltage * @param vOffset Desired offset voltage
*/ */
void setVoltageOffset(float vOffset) { m_offsetVoltage = vOffset; }; void setVoltageOffset(float vOffset) { m_offsetVoltage = vOffset; };
/** /**
* Set the output resistance value * Sets the output resistance value
* *
* The Seeedstudio wiki example uses a value, 2000000 in one of * The Seeed Studio wiki example uses a value of 2,000,000 in one of
* the equations used to calculate a voltage. The value is the * the equations used to calculate voltage. The value is the
* resistance of a resistor they use in the output stage of their * resistance of a resistor they use in the output stage of their
* SIG2 output. This was 'decoded' by looking at the eagle files * SIG2 output. This was 'decoded' by looking at the EAGLE* files
* containing their schematics for this device. * containing their schematics for this device.
* *
* @param outResistance value of output resistor, default 2M Ohm. * @param outResistance Value of the output resistor; default is 2M Ohm
*/ */
void setOutputResistence(int outResistance) { void setOutputResistence(int outResistance) {
m_vResistance = outResistance; }; m_vResistance = outResistance; };
/** /**
* Set the voltage reference of the internal seedstudio voltage * Sets the reference voltage of the internal Seeed Studio voltage
* regulator on the sensor board. * regulator on the sensor board.
* *
* The Seeedstudio wiki example uses a value, 2.5 in one of the * The Seeed Studio wiki example uses a value of 2.5 in one of the
* equations used to calculate the resistance of the ambient * equations used to calculate the resistance of the ambient
* thermistor. The value is the voltage of an internal voltage * thermistor. The value is the voltage of an internal voltage
* regulator used in the sensor board. This was 'decoded' by * regulator used on the sensor board. This was 'decoded' by
* looking at the eagle files containing their schematics for this * looking at the EAGLE files containing their schematics for this
* device. * device.
* *
* @param vref internal sensor voltage reference, default 2.5 * @param vref Reference voltage of the internal sensor; default is 2.5 V
*/ */
void setVRef(float vref) { m_vref = vref; }; void setVRef(float vref) { m_vref = vref; };

View File

@ -22,9 +22,9 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
// This table was taken from the 538RT_table.pdf datasheet. It maps // This table was taken from the '538RT_table.pdf' datasheet. It maps
// resistance values to ambient temperatures starting at -20C and // resistance values to ambient temperatures starting at -20C and
// going to 200C in increments of 1C // going up to 200C in increments of 1C
static const int otp538u_rt_table_max = 121; static const int otp538u_rt_table_max = 121;

View File

@ -22,12 +22,12 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
// This table was taken from the 538U VT Table__20_200(v1.3).pdf // This table was taken from the '538U VT Table__20_200(v1.3).pdf'
// datasheet, but the 25C column has been removed for consistency. // datasheet, but the 25C column has been removed for consistency.
static const int otp538u_vt_table_max = 23; static const int otp538u_vt_table_max = 23;
// Thermister temperature (C) // Thermistor temperature (C)
// { -20 -10 0 10 20 30 40 50 60 70 80 90 100 } // { -20 -10 0 10 20 30 40 50 60 70 80 90 100 }
static float otp538u_vt_table[otp538u_vt_table_max][13] = { static float otp538u_vt_table[otp538u_vt_table_max][13] = {

View File

@ -39,7 +39,7 @@
namespace upm { namespace upm {
/** /**
* @brief PCA9685 PWM controller library * @brief PCA9685 PWM Controller library
* @defgroup pca9685 libupm-pca9685 * @defgroup pca9685 libupm-pca9685
* @ingroup adafruit i2c led motor * @ingroup adafruit i2c led motor
*/ */
@ -52,10 +52,10 @@ namespace upm {
* @web http://www.adafruit.com/products/815 * @web http://www.adafruit.com/products/815
* @con i2c * @con i2c
* *
* @brief API for the PCA9685 16 channel, 12 bit pwm LED controller * @brief API for the PCA9685 16-channel, 12-bit PWM LED Controller
* *
* This controller is also used on the Adafruit Motor Shield v2.3 * This controller is also used on the Adafruit* Motor Shield v2.3
* board to control up to 4 DC motors, 2 step motors and 2 servo * board to control up to 4 DC motors, 2 stepper motors, and 2 servo
* motors. * motors.
* *
* This module was tested with the Adafruit Motor Shield v2.3 * This module was tested with the Adafruit Motor Shield v2.3
@ -178,137 +178,136 @@ namespace upm {
} PCA9685_MODE2_T; } PCA9685_MODE2_T;
/** /**
* pca9685 constructor * PCA9685 constructor
* *
* @param bus i2c bus to use * @param bus I2C bus to use
* @param address the address for this device * @param address Address for this device
*/ */
PCA9685(int bus, uint8_t address = PCA9685_DEFAULT_I2C_ADDR); PCA9685(int bus, uint8_t address = PCA9685_DEFAULT_I2C_ADDR);
/** /**
* PCA9685 Destructor * PCA9685 destructor
*/ */
~PCA9685(); ~PCA9685();
/** /**
* Write byte value into register * Writes a byte value into a register
* *
* @param reg register location to write into * @param reg Register location to write into
* @param byte byte to write * @param byte Byte to write
* @return true if successful * @return True if successful
*/ */
bool writeByte(uint8_t reg, uint8_t byte); bool writeByte(uint8_t reg, uint8_t byte);
/** /**
* Write word value at register. Note, the device must have the * Writes a word value into a register. Note: the device must have the
* auto-increment bit set in the MODE1 register to work. * auto-increment bit set in the MODE1 register to work.
* *
* @param reg register location to write into * @param reg Register location to write into
* @param word word to write * @param word Word to write
* @return true if successful * @return True if successful
*/ */
bool writeWord(uint8_t reg, uint16_t word); bool writeWord(uint8_t reg, uint16_t word);
/** /**
* Read byte value from register * Reads a byte value from a register
* *
* @param reg register location to read from * @param reg Register location to read from
* @return value at specified register * @return Value in a specified register
*/ */
uint8_t readByte(uint8_t reg); uint8_t readByte(uint8_t reg);
/** /**
* Read word value from register. Note, the device must have the * Reads a word value from a register. Note: the device must have the
* auto-increment bit set in the MODE1 register to work. * auto-increment bit set in the MODE1 register to work.
* *
* @param reg register location to read from * @param reg Register location to read from
* @return value at specified register * @return Value in a specified register
*/ */
uint16_t readWord(uint8_t reg); uint16_t readWord(uint8_t reg);
/** /**
* Put the device into or out of Sleep mode. The device is always * Puts the device in or out of the sleep mode. The device is always
* in sleep mode upon power up. * in the sleep mode upon power-up.
* *
* @param sleep true to put into sleep mode, false to take out of * @param sleep True to put the device in the sleep mode, false to put out
* sleep mode. * @return True if successful
* @return true if successful
*/ */
bool setModeSleep(bool sleep); bool setModeSleep(bool sleep);
/** /**
* set or clear the FULL ON bit for a given LED * Sets or clears the FULL ON bit for a given LED
* *
* @param led led number, valid values: 0-15, PCA9685_ALL_LED * @param led LED number; valid values are 0-15, PCA9685_ALL_LED
* @param val true to set the bit, false to clear it * @param val True to set the bit, false to clear it
* @return true if successful * @return True if successful
*/ */
bool ledFullOn(uint8_t led, bool val); bool ledFullOn(uint8_t led, bool val);
/** /**
* set or clear the FULL OFF bit for a given LED. If the FULL ON * Sets or clears the FULL OFF bit for a given LED. If the FULL ON
* bit is also set, then FULL OFF has precendence. * bit is also set, FULL OFF has precedence.
* *
* @param led led number, valid values: 0-15, PCA9685_ALL_LED * @param led LED number; valid values are 0-15, PCA9685_ALL_LED
* @param val true to set the bit, false to clear it * @param val True to set the bit, false to clear it
* @return true if successful * @return True if successful
*/ */
bool ledFullOff(uint8_t led, bool val); bool ledFullOff(uint8_t led, bool val);
/** /**
* set the LED on time (0-4095). See the pca9685 datasheet for details. * Sets the 'LED on' time (0-4,095). See the PCA9685 datasheet for details.
* *
* @param led led number, valid values: 0-15, PCA9685_ALL_LED * @param led LED number; valid values are 0-15, PCA9685_ALL_LED
* @param time the 12 bit value at which point the LED will turn on * @param time 12-bit value at which point the LED turns on
* @return true if successful * @return True if successful
*/ */
bool ledOnTime(uint8_t led, uint16_t time); bool ledOnTime(uint8_t led, uint16_t time);
/** /**
* set the LED off time (0-4095). See the pca9685 datasheet for details. * Sets the 'LED off' time (0-4,095). See the PCA9685 datasheet for details.
* *
* @param led led number, valid values: 0-15, PCA9685_ALL_LED * @param led LED number; valid values are 0-15, PCA9685_ALL_LED
* @param time the 12 bit value at which point the LED will turn off * @param time 12-bit value at which point the LED turns off
* @return true if successful * @return True if successful
*/ */
bool ledOffTime(uint8_t led, uint16_t time); bool ledOffTime(uint8_t led, uint16_t time);
/** /**
* set the prescale value. See the pca9685 datasheet for * Sets the prescale value. See the PCA9685 datasheet for
* details. The prescale can only be set when the device is in * details. The prescale can only be set when the device is in
* sleep mode. * the sleep mode.
* *
* @param prescale the prescale value * @param prescale Prescale value
* @return true if successful * @return True if successful
*/ */
bool setPrescale(uint8_t prescale); bool setPrescale(uint8_t prescale);
/** /**
* set the prescale value based on a desired frequency in hz. The * Sets the prescale value based on a desired frequency in Hz. The
* prescale can only be set when the device is in sleep mode. * prescale can only be set when the device is in the sleep mode.
* *
* @param hz the desired frequency in hz * @param hz Desired frequency in Hz
* @param oscFreq the oscillator frequency, defaul 25Mhz * @param oscFreq Oscillator frequency; default is 25 MHz
* @return true if successful * @return True if successful
*/ */
bool setPrescaleFromHz(float hz, bool setPrescaleFromHz(float hz,
float oscFreq=PCA9685_INTERNAL_OSC); float oscFreq=PCA9685_INTERNAL_OSC);
/** /**
* enable or disable the RESTART capability of the controller * Enables or disables the restart capability of the controller
* *
* @param enabled true to enable restart, false to disable. * @param enabled True to enable, false to disable
* Default is enabled. * It is enabled by default.
*/ */
void enableRestart(bool enabled) { m_restartEnabled = enabled; }; void enableRestart(bool enabled) { m_restartEnabled = enabled; };
private: private:
/** /**
* Enable I2C register auto-increment. This needs to be enabled * Enables the I2C register auto-increment. This needs to be enabled
* for write/readWord() to work. The contructor enables this by * for write/readWord() to work. The contructor enables this by
* default. * default.
* *
* @param ai true to enable auto-increment of i2c regs, false otherwise * @param ai True to enable, false otherwise
*/ */
bool enableAutoIncrement(bool ai); bool enableAutoIncrement(bool ai);

View File

@ -37,7 +37,7 @@ typedef struct
} dustData; } dustData;
/** /**
* @brief PPD42NS dust sensor library * @brief PPD42NS Dust Sensor library
* @defgroup ppd42ns libupm-ppd42ns * @defgroup ppd42ns libupm-ppd42ns
* @ingroup seeed gpio other eak * @ingroup seeed gpio other eak
*/ */
@ -52,9 +52,9 @@ typedef struct
* @con gpio * @con gpio
* @kit eak * @kit eak
* *
* @brief API for the Dust Sensor * @brief API for the PPD42NS Dust Sensor
* *
* UPM module for the Dust Sensor * UPM module for the PPD42NS dust sensor
* *
* @image html ppd42ns.jpg * @image html ppd42ns.jpg
* @snippet ppd42ns.cxx Interesting * @snippet ppd42ns.cxx Interesting
@ -62,28 +62,28 @@ typedef struct
class PPD42NS { class PPD42NS {
public: public:
/** /**
* Dust Sensor Constructor * PPD42NS constructor
* *
* @param pin digital pin to use * @param pin Digital pin to use
*/ */
PPD42NS(int pin); PPD42NS(int pin);
/** /**
* Dust Sensor Destructor * PPD42NS destructor
*/ */
~PPD42NS(); ~PPD42NS();
/** /**
* Print dust concentration * Prints dust concentration
* *
* @return struct dustData contains data from dust sensor * @return struct dustData Contains data from the dust sensor
*/ */
dustData getData(); dustData getData();
private: private:
mraa_gpio_context m_gpio; mraa_gpio_context m_gpio;
/** /**
* Return the amount of time it takes a pin to go from HIGH to LOW or LOW to HIGH * Returns the amount of time it takes a pin to go from HIGH to LOW or from LOW to HIGH
* *
* @param highLowValue int do we measure from HIGH to LOW or LOW to HIGH. highLowValue is "from" value * @param highLowValue int Do we measure movements from HIGH to LOW or from LOW to HIGH? highLowValue is the "from" value
*/ */
double pulseIn_polyfill(bool highLowValue, double endTime); double pulseIn_polyfill(bool highLowValue, double endTime);
double m_timediff(timespec time1, timespec time2); double m_timediff(timespec time1, timespec time2);

View File

@ -40,7 +40,7 @@
#define FALSE LOW #define FALSE LOW
/** /**
* @brief pulsensor pulse sensor library * @brief Pulsensor Pulse Sensor library
* @defgroup pulsensor libupm-pulsensor * @defgroup pulsensor libupm-pulsensor
* @ingroup seeed analog medical * @ingroup seeed analog medical
*/ */
@ -53,9 +53,9 @@
* @web http://www.adafruit.com/products/1093 * @web http://www.adafruit.com/products/1093
* @con analog * @con analog
* *
* @brief C++ API for 3-wire pulse sensor * @brief C++ API for the 3-Wire Pulse Sensor
* *
* This is a library for the 3-wire pulse sensor sold by several manufacturers. * This is a library for a 3-wire pulse sensor sold by several manufacturers.
* Usually, you can identify the sensor based on the round breakout and the * Usually, you can identify the sensor based on the round breakout and the
* distinctive heart symbol. * distinctive heart symbol.
* *
@ -68,7 +68,7 @@
* @brief callback data * @brief callback data
*/ */
struct clbk_data { struct clbk_data {
int is_heart_beat; /**< heart beat check */ int is_heart_beat; /**< heartbeat check */
}; };
typedef void (* callback_handler) (clbk_data); typedef void (* callback_handler) (clbk_data);
@ -80,7 +80,7 @@ typedef void (* callback_handler) (clbk_data);
struct pulsensor_context { struct pulsensor_context {
pthread_t sample_thread; /**< Thread for the code sample */ pthread_t sample_thread; /**< Thread for the code sample */
uint32_t sample_counter; /**< Counter for the code sample */ uint32_t sample_counter; /**< Counter for the code sample */
uint32_t last_beat_time; /**< Last heart beat time */ uint32_t last_beat_time; /**< Last heartbeat time */
int threshold; /**< Threshold */ int threshold; /**< Threshold */
int ibi_rate[10]; /**< ibi rate */ int ibi_rate[10]; /**< ibi rate */
int ibi; /**< ibi */ int ibi; /**< ibi */
@ -90,8 +90,8 @@ struct pulsensor_context {
int apmlitude; /**< Amplitude */ int apmlitude; /**< Amplitude */
uint8_t qs; /**< qs */ uint8_t qs; /**< qs */
uint8_t is_pulse; /**< Is pulse check */ uint8_t is_pulse; /**< Is pulse check */
uint8_t first_beat; /**< First heart beat */ uint8_t first_beat; /**< First heartbeat */
uint8_t second_beat; /**< Second heart beat */ uint8_t second_beat; /**< Second heartbeat */
uint8_t pin; /**< Pin */ uint8_t pin; /**< Pin */
uint8_t ret; /**< Return value */ uint8_t ret; /**< Return value */
mraa_aio_context pin_ctx; /**< The pin context */ mraa_aio_context pin_ctx; /**< The pin context */

View File

@ -44,11 +44,11 @@ namespace upm {
* @con gpio * @con gpio
* @kit robok tsk * @kit robok tsk
* *
* @brief API for the RFR359F based Grove Distance Interrupter. * @brief API for the RFR359F-based Grove Distance Interrupter.
* *
* UPM module for the Grove Distance Interrupter. The sensitivity * UPM module for the Grove distance interrupter. The sensitivity
* can be adjusted with the potentiometer on the sensor module. It * can be adjusted with the potentiometer on the sensor module. It
* has a range of approximately 4 inches and a fast response time. * has a range of approximately 4 inches and a quick response time.
* *
* @image html rfr359f.jpg * @image html rfr359f.jpg
* @snippet rfr359f.cxx Interesting * @snippet rfr359f.cxx Interesting
@ -56,21 +56,21 @@ namespace upm {
class RFR359F { class RFR359F {
public: public:
/** /**
* Grove Distance Interrupter constructor * RFR359F constructor
* *
* @param pin digital pin to use * @param pin Digital pin to use
*/ */
RFR359F(int pin); RFR359F(int pin);
/** /**
* RFR359F Destructor * RFR359F destructor
*/ */
~RFR359F(); ~RFR359F();
/** /**
* Get the status of the pin, true means object detected * Gets the status of the pin; true means an object has been detected
* *
* @return true if the sensor detected an object * @return True if the sensor has detected an object
*/ */
bool objectDetected(); bool objectDetected();

View File

@ -33,7 +33,7 @@
namespace upm { namespace upm {
/** /**
* @brief Sparkfun RGB RingCoder * @brief SparkFun RGB RingCoder
* @defgroup rgbringcoder libupm-rgbringcoder * @defgroup rgbringcoder libupm-rgbringcoder
* @ingroup seeed gpio led * @ingroup seeed gpio led
*/ */
@ -41,19 +41,19 @@ namespace upm {
/** /**
* @library rgbringcoder * @library rgbringcoder
* @sensor rgbringcoder * @sensor rgbringcoder
* @comname Sparkfun RGB Ringcoder * @comname SparkFun RGB Ringcoder
* @type led * @type led
* @web https://www.sparkfun.com/products/11040 * @web https://www.sparkfun.com/products/11040
* @man sparkfun * @man sparkfun
* @con pwm gpio * @con pwm gpio
* *
* @brief API for the Sparkfun RGB Ringcoder * @brief API for the SparkFun* RGB RingCoder
* *
* The RGB RingCoder is a breakout board, a circular LED containing * RGB RingCoder is a breakout board, a circular LED containing
* 16 LEDs arranged in a ring, and a rotary encoder. The encoder * 16 LEDs arranged in a ring, and a rotary encoder. The encoder
* contains an RGB LED as well as a push button function. * contains an RGB LED as well as a push button function.
* *
* The device will require 11 pins, 3 of which must be PWM capable * The device requires 11 pins, 3 of which must be PWM-capable
* (for the RGB LEDs). * (for the RGB LEDs).
* *
* @image html rgbringcoder.jpg * @image html rgbringcoder.jpg
@ -66,62 +66,62 @@ namespace upm {
/** /**
* RGBRingCoder constructor * RGBRingCoder constructor
* *
* @param en enable gpio * @param en Enables GPIO
* @param latch latch gpio * @param latch Latch GPIO
* @param clear clear gpio * @param clear Clears GPIO
* @param clk clock gpio * @param clk Clock GPIO
* @param dat data out gpio * @param dat Data out GPIO
* @param sw push button switch gpio * @param sw Push button switch GPIO
* @param encA encoder A gpio * @param encA Encoder A GPIO
* @param encB encoder B gpio * @param encB Encoder B GPIO
* @param red RGB red led pwm * @param red RGB red LED PWM
* @param green RGB green led pwm * @param green RGB green LED PWM
* @param blue RGB blue led pwm * @param blue RGB blue LED PWM
*/ */
RGBRingCoder(int en, int latch, int clear, int clk, int dat, int sw, RGBRingCoder(int en, int latch, int clear, int clk, int dat, int sw,
int encA, int encB, int red, int green, int blue); int encA, int encB, int red, int green, int blue);
/** /**
* RGBRingCoder Destructor * RGBRingCoder destructor
*/ */
~RGBRingCoder(); ~RGBRingCoder();
/* /*
* set the state of the ring LEDs. This is a 16 bit value, where * Sets the state of the ring LEDs. This is a 16-bit value, where
* each bit corresponds to one of the ring LEDs. A 1 bit means * each bit corresponds to one of the ring LEDs. A 1 bit means
* that specific LED is on, and 0 bit means that specific LED is * that a specific LED is on, and a 0 bit means that a specific LED is
* off. * off.
* *
* @param bits the bits representing the state of each LED * @param bits Bits representing the state of each LED
*/ */
void setRingLEDS(uint16_t bits); void setRingLEDS(uint16_t bits);
/* /*
* return the state of the button * Returns the state of the button
* *
* @return true if the button is pressed, false otherwise * @return True if the button is pressed, false otherwise
*/ */
bool getButtonState(); bool getButtonState();
/* /*
* get the current rotary encoder counter value * Gets the current rotary encoder counter value
* *
* @return the current counter value * @return Current counter value
*/ */
int getEncoderPosition() { return m_counter; }; int getEncoderPosition() { return m_counter; };
/* /*
* set the encoder counter to 0 * Sets the encoder counter to 0
*/ */
void clearEncoderPosition() { m_counter = 0; }; void clearEncoderPosition() { m_counter = 0; };
/* /*
* set the intensity of the red, grenn, and blue LEDs. Values can * Sets the intensity of the red, green, and blue LEDs. Values can
* be between 0.0 and 1.0. Lower is brighter, higher is dimmer. * be between 0.0 and 1.0. Lower is brighter, higher is dimmer.
* *
* @param r the red value, valid values are between 0.0 and 1.0 * @param r Red value; valid values are 0.0-1.0
* @param g the green value, valid values are between 0.0 and 1.0 * @param g Green value; valid values are 0.0-1.0
* @param b the blue value, valid values are between 0.0 and 1.0 * @param b Blue value; valid values are 0.0-1.0
*/ */
void setRGBLED(float r, float g, float b); void setRGBLED(float r, float g, float b);

View File

@ -47,11 +47,11 @@ namespace upm {
* *
* @brief API for the Grove Rotary Encoder * @brief API for the Grove Rotary Encoder
* *
* UPM module for the Grove Rotary Encoder. A Rotary Encoder * UPM module for the Grove rotary encoder. This rotary encoder
* encodes a rotation signal into electronic pulses that can be used * encodes a rotation signal into electronic pulses that can be used
* to measure rotation and direction. It is useful in cases where a * to measure rotation and direction. It is useful in cases where a
* rotary knob is required, but using a potentiometer is not * rotary knob is required, but using a potentiometer is not
* desirable. A rotary encoder can turn a full 360 degrees+ * desirable. A rotary encoder can turn a full 360 degrees
* without a stop and does not place a resistive load on the * without a stop and does not place a resistive load on the
* circuit, as is the case with a potentiometer. * circuit, as is the case with a potentiometer.
* *
@ -66,32 +66,32 @@ namespace upm {
/** /**
* RotaryEncoder constructor * RotaryEncoder constructor
* *
* @param pinA digital pin to use for signal A * @param pinA Digital pin to use for signal A
* @param pinB digital pin to use for signal B * @param pinB Digital pin to use for signal B
*/ */
RotaryEncoder(int pinA, int pinB); RotaryEncoder(int pinA, int pinB);
/** /**
* RotaryEncoder Destructor * RotaryEncoder destructor
*/ */
~RotaryEncoder(); ~RotaryEncoder();
/** /**
* Reset the position to a given number, default is 0. * Resets the position to a given number; default is 0.
* *
* @param count integer to initialize the position to * @param count Integer to initialize the position to
*/ */
void initPosition(int count=0); void initPosition(int count=0);
/** /**
* Get the position value * Gets the position value
* *
*/ */
int position(); int position();
/** /**
* ISR for signal A * Interrupt service routine (ISR) for signal A
* *
* @param ctx user context for the ISR (*this pointer) * @param ctx User context for the ISR (*this pointer)
*/ */
static void signalAISR(void *ctx); static void signalAISR(void *ctx);

View File

@ -29,7 +29,7 @@
namespace upm { namespace upm {
/** /**
* @brief RPR220 IR reflective sensor library * @brief RPR220 IR Reflective Sensor library
* @defgroup rpr220 libupm-rpr220 * @defgroup rpr220 libupm-rpr220
* @ingroup seeed gpio light tsk hak * @ingroup seeed gpio light tsk hak
*/ */
@ -44,18 +44,18 @@ namespace upm {
* @con gpio * @con gpio
* @kit tsk hak * @kit tsk hak
* *
* @brief API for the RPR220 based Grove IR Reflective Sensor * @brief API for the RPR220-based Grove IR Reflective Sensor
* *
* UPM module for the Grove IR Reflective Sensor. The sensitivity * UPM module for the Grove IR reflective sensor. The sensitivity
* can be adjusted with the potentiometer on the sensor module. It * can be adjusted with the potentiometer on the sensor module. It
* has a range of approximately 15mm, and a fast response time. * has a range of approximately 15 mm, and a quick response time.
* *
* It detects high contrast dark areas on a light background. * It detects high-contrast dark areas on a light background.
* *
* This module allows the user to determine the current status * This module allows the user to determine the current status
* (black detected or not). Additionally, if desired, an Interrupt * (black detected or not). Additionally, if desired, an interrupt
* Service Routine (ISR) can be installed that will be called when * service routine (ISR) can be installed that is called when
* black is detected. Either method can be used, depending on your * black is detected. Either method can be used, depending on your
* use case. * use case.
* *
* @image html rpr220.jpg * @image html rpr220.jpg
@ -65,36 +65,36 @@ namespace upm {
class RPR220 { class RPR220 {
public: public:
/** /**
* Grove IR Reflective Sensor constructor * RPR220 constructor
* *
* @param pin digital pin to use * @param pin Digital pin to use
*/ */
RPR220(int pin); RPR220(int pin);
/** /**
* RPR220 Destructor * RPR220 destructor
*/ */
~RPR220(); ~RPR220();
/** /**
* Get the status of the pin, true means black detected * Gets the status of the pin; true means black has been detected
* *
* @return true if the sensor is detecting black * @return True if the sensor has detected black
*/ */
bool blackDetected(); bool blackDetected();
/** /**
* Install an Interrupt Service Routine (ISR) to be called when * Installs an ISR to be called when
* black is detected * black is detected
* *
* @param fptr function pointer to function to be called on interrupt * @param fptr Pointer to a function to be called on interrupt
* @param arg pointer to an object that will be supplied as an * @param arg Pointer to an object to be supplied as an
* arguement to the ISR. * argument to the ISR.
*/ */
void installISR(void (*isr)(void *), void *arg); void installISR(void (*isr)(void *), void *arg);
/** /**
* Uninstall the previously installed Interrupt Service Routine (ISR) * Uninstalls the previously installed ISR
* *
*/ */
void uninstallISR(); void uninstallISR();

View File

@ -39,11 +39,11 @@ namespace upm {
* @con pwm * @con pwm
* @kit gsk * @kit gsk
* *
* @brief API for ES08A servo component * @brief API for the ES08A Servo
* *
* This file defines the ES08A interface for ES08A servos. * This file defines the ES08A interface for ES08A servos.
* Like other servos, the ES08A servo has a shaft that can be controlled * Like other servos, the ES08A servo has a shaft that can be controlled
* by setting the desired angle. There are also routines for setting * by setting the desired angle. There are also routines for setting
* and getting the minimum and maximum pulse width as well as the * and getting the minimum and maximum pulse width as well as the
* maximum period. * maximum period.
* *
@ -55,12 +55,12 @@ namespace upm {
/** /**
* Instantiates an ES08A object * Instantiates an ES08A object
* *
* @param pin servo pin number * @param pin Servo pin number
*/ */
ES08A (int pin); ES08A (int pin);
/** /**
* ES08A object destructor. * ES08A object destructor
*/ */
~ES08A (); ~ES08A ();
}; };

View File

@ -40,7 +40,7 @@ namespace upm {
/** /**
* @brief Servo library * @brief Servo library
* *
* The base class Servo provides routines for setting the angle of the shaft * The base Servo class provides routines for setting the angle of the shaft
* as well as setting and getting the minimum and maximum pulse width and * as well as setting and getting the minimum and maximum pulse width and
* the maximum period. * the maximum period.
* *
@ -50,42 +50,42 @@ namespace upm {
class Servo { class Servo {
public: public:
/** /**
* Instantiates a servo object * Instantiates a Servo object
* *
* @param pin servo pin number * @param pin Servo pin number
*/ */
Servo (int pin); Servo (int pin);
/** /**
* Instantiates a servo object * Instantiates a Servo object
* *
* @param pin servo pin number * @param pin Servo pin number
* @param minPulseWidth minimum pulse width, in microseconds * @param minPulseWidth Minimum pulse width, in microseconds
* @param maxPulseWidth maximum pulse width, in microseconds * @param maxPulseWidth Maximum pulse width, in microseconds
*/ */
Servo (int pin, int minPulseWidth, int maxPulseWidth); Servo (int pin, int minPulseWidth, int maxPulseWidth);
/** /**
* Instantiates a servo object * Instantiates a Servo object
* *
* @param pin servo pin number * @param pin Servo pin number
* @param minPulseWidth minimum pulse width, in microseconds * @param minPulseWidth Minimum pulse width, in microseconds
* @param maxPulseWidth maximum pulse width, in microseconds * @param maxPulseWidth Maximum pulse width, in microseconds
* @param waitAndDisablePwm if 1, PWM will be enabled only during setAngle() execution * @param waitAndDisablePwm If 1, PWM is enabled only during the setAngle() execution
* for a period of 1 second, and then turned back off. If 0, PWM will remain on afterward. * for a period of 1 second, and then turned back off. If 0, PWM remains on afterward.
*/ */
Servo (int pin, int minPulseWidth, int maxPulseWidth, int waitAndDisablePwm); Servo (int pin, int minPulseWidth, int maxPulseWidth, int waitAndDisablePwm);
/** /**
* Servo object destructor. * Servo object destructor
*/ */
~Servo(); ~Servo();
/** /**
* Set the angle of the servo engine. * Sets the angle of the servo engine.
* *
* @param angle number between 0 and 180 * @param angle Number between 0 and 180
* @return 0 on success; non-zero otherwise * @return 0 if successful, non-zero otherwise
*/ */
mraa_result_t setAngle (int angle); mraa_result_t setAngle (int angle);
@ -95,9 +95,9 @@ class Servo {
mraa_result_t haltPwm (); mraa_result_t haltPwm ();
/** /**
* Return name of the component * Returns the name of the component
* *
* @return name of the component * @return Name of the component
*/ */
std::string name() std::string name()
{ {
@ -105,44 +105,44 @@ class Servo {
} }
/** /**
* Set minimum pulse width * Sets the minimum pulse width
* *
* @param width minimum HIGH signal width * @param width Minimum HIGH signal width
*/ */
void setMinPulseWidth (int width); void setMinPulseWidth (int width);
/** /**
* Set maximum pulse width * Sets the maximum pulse width
* *
* @param width maximum HIGH signal width * @param width Maximum HIGH signal width
*/ */
void setMaxPulseWidth (int width); void setMaxPulseWidth (int width);
/** /**
* Set maximum period width * Sets the maximum period width
* *
* @param period PWM period width * @param period PWM period width
*/ */
void setPeriod (int period); void setPeriod (int period);
/** /**
* Return minimum pulse width * Returns the minimum pulse width
* *
* @return minimum pulse width * @return Minimum pulse width
*/ */
int getMinPulseWidth (); int getMinPulseWidth ();
/** /**
* Return maximum pulse width * Returns the maximum pulse width
* *
* @return maximum pulse width * @return Maximum pulse width
*/ */
int getMaxPulseWidth (); int getMaxPulseWidth ();
/** /**
* Return maximum PWM period width * Returns the maximum PWM period width
* *
* @return maximum PWM period width * @return Maximum PWM period width
*/ */
int getPeriod (); int getPeriod ();

View File

@ -37,7 +37,7 @@
namespace upm { namespace upm {
/** /**
* @brief SI1145 UV light sensor library * @brief SI1145 UV Light Sensor library
* @defgroup si114x libupm-si114x * @defgroup si114x libupm-si114x
* @ingroup adafruit i2c light * @ingroup adafruit i2c light
*/ */
@ -45,23 +45,23 @@ namespace upm {
/** /**
* @library si114x * @library si114x
* @sensor si114x * @sensor si114x
* @comname SI1145 UV light sensor * @comname SI1145 UV Light Sensor
* @altname SI1146, SI1147 * @altname SI1146, SI1147
* @type light * @type light
* @man adafruit * @man adafruit
* @web https://www.adafruit.com/products/1777 * @web https://www.adafruit.com/products/1777
* @con i2c * @con i2c
* *
* @brief API for the SI1145 UV light sensor * @brief API for the SI1145 UV Light Sensor
* *
* This module was tested with the Adafruit UV Sensor * This module was tested with the Adafruit* UV Light Sensor
* *
* This device is also capable of measuring IR and visible ambient * This device is capable of measuring IR and visible ambient
* light as well. It also supports the ability to use externally * light as well. It also supports the ability to use externally
* attached LED's to perform proximity detection on 3 separate * attached LEDs to perform proximity detection on 3 separate
* channels. * channels.
* *
* This class currently only supports the retriving of the * Currently, this class only supports the retrieving of the
* calculated UV index measured by the device, but enough * calculated UV index measured by the device, but enough
* infrastructure is provided to make it easy to enhance this driver * infrastructure is provided to make it easy to enhance this driver
* in the future to support additional capabilities, including * in the future to support additional capabilities, including
@ -175,13 +175,13 @@ namespace upm {
CMD_ALS_AUTO = 0x0e, CMD_ALS_AUTO = 0x0e,
CMD_PSALS_AUTO = 0x0f, CMD_PSALS_AUTO = 0x0f,
CMD_PARAM_QUERY = 0x80, // or'd with PARAM_T value CMD_PARAM_QUERY = 0x80, // OR'd with PARAM_T value
CMD_PARAM_SET = 0xa0 // or'd with PARAM_T value CMD_PARAM_SET = 0xa0 // OR'd with PARAM_T value
} SI114X_CMD_T; } SI114X_CMD_T;
/** /**
* Channel List enable bits * Channel list enable bits
*/ */
typedef enum { CHLIST_EN_PS1 = 0x01, // proximity sense 1-3 typedef enum { CHLIST_EN_PS1 = 0x01, // proximity sense 1-3
CHLIST_EN_PS2 = 0x02, CHLIST_EN_PS2 = 0x02,
@ -218,95 +218,95 @@ namespace upm {
} SI114X_IRQEN_BITS_T; } SI114X_IRQEN_BITS_T;
/** /**
* si114x constructor * SI114X constructor
* *
* @param bus i2c bus to use * @param bus I2C bus to use
* @param address the address for this device * @param address Address for this device
*/ */
SI114X(int bus, uint8_t address = SI114X_DEFAULT_I2C_ADDR); SI114X(int bus, uint8_t address = SI114X_DEFAULT_I2C_ADDR);
/** /**
* SI114X Destructor * SI114X destructor
*/ */
~SI114X(); ~SI114X();
/** /**
* Write byte value into register * Writes a byte value into a register
* *
* @param reg register location to write into * @param reg Register location to write into
* @param byte byte to write * @param byte Byte to write
* @return true if successful * @return True if successful
*/ */
bool writeByte(uint8_t reg, uint8_t byte); bool writeByte(uint8_t reg, uint8_t byte);
/** /**
* Read byte value from register * Reads a byte value from a register
* *
* @param reg register location to read from * @param reg Register location to read from
* @return value at specified register * @return Value in a specified register
*/ */
uint8_t readByte(uint8_t reg); uint8_t readByte(uint8_t reg);
/** /**
* Read word value from register. * Reads a word value from a register
* *
* @param reg register location to read from * @param reg Register location to read from
* @return value at specified register * @return Value in a specified register
*/ */
uint16_t readWord(uint8_t reg); uint16_t readWord(uint8_t reg);
/** /**
* disable interrupts and auto measuring, issue a device reset, * Disables interrupts and auto-measuring, issues a device reset,
* and then set the hardware key. * and then sets the hardware key.
*/ */
void reset(); void reset();
/** /**
* set the UV calibration values. The constructor sets default * Sets UV calibration values. The constructor sets default
* values for you, so you only need this function if you need * values for you, so you only need this function if you need
* different values for your device and situation. If you set new * different values for your device and situation. If you set new
* values here, be sure to do so before calling initialize(). * values here, be sure to do so before calling initialize().
* *
* @param uvcoeff0 coefficient for REG_UCOEF0 * @param uvcoeff0 Coefficient for REG_UCOEF0
* @param uvcoeff1 coefficient for REG_UCOEF1 * @param uvcoeff1 Coefficient for REG_UCOEF1
* @param uvcoeff2 coefficient for REG_UCOEF2 * @param uvcoeff2 Coefficient for REG_UCOEF2
* @param uvcoeff3 coefficient for REG_UCOEF3 * @param uvcoeff3 Coefficient for REG_UCOEF3
* *
*/ */
void setUVCalibration(uint8_t uvcoeff0, uint8_t uvcoeff1, uint8_t uvcoeff2, void setUVCalibration(uint8_t uvcoeff0, uint8_t uvcoeff1, uint8_t uvcoeff2,
uint8_t uvcoeff3); uint8_t uvcoeff3);
/** /**
* write a value to parameter memory. * Writes a value to the parameter memory.
* *
* @param param the SI114X_PARAM_T register to write * @param param SI114X_PARAM_T register to write
* @param value the value to write * @param value Value to write
*/ */
void writeParam(SI114X_PARAM_T param, uint8_t value); void writeParam(SI114X_PARAM_T param, uint8_t value);
/** /**
* read a value from parameter memory * Reads a value from the parameter memory
* *
* @param param the SI114X_PARAM_T register to read * @param param SI114X_PARAM_T register to read
* @return the value * @return Value
*/ */
uint8_t readParam(SI114X_PARAM_T param); uint8_t readParam(SI114X_PARAM_T param);
/** /**
* Reset and initialize device, start auto sampling * Resets and initializes the device and starts auto-sampling
*/ */
void initialize(); void initialize();
/** /**
* update stored values. You should call this before calling * Updates stored values. You should call this before calling
* getUVIndex() * getUVIndex()
*/ */
void update(); void update();
/** /**
* Read the currently measured UV Index value * Reads the currently measured UV index value
* *
* @return UV Index value * @return UV index value
*/ */
float getUVIndex() { return m_uvIndex; }; float getUVIndex() { return m_uvIndex; };

View File

@ -41,7 +41,7 @@
namespace upm { namespace upm {
/** /**
* @brief SM130 RFID reader module sensor library * @brief SM130 RFID Reader Module library
* @defgroup sm130 libupm-sm130 * @defgroup sm130 libupm-sm130
* @ingroup sparkfun gpio rfid * @ingroup sparkfun gpio rfid
*/ */
@ -54,12 +54,12 @@ namespace upm {
* @web https://www.sparkfun.com/products/10126 * @web https://www.sparkfun.com/products/10126
* @con gpio * @con gpio
* *
* @brief API for SM130 RFID reader module * @brief API for the SM130 RFID Reader Module
* *
* This file defines the interface for sm130 RFID library * This file defines the SM130 interface for the sm130 RFID library
* *
* @image html sm130.jpg * @image html sm130.jpg
* <br><em>SM130 RFID Reader image provided by SparkFun under * <br><em>SM130 RFID Reader image provided by SparkFun* under
* <a href=https://creativecommons.org/licenses/by-nc-sa/3.0/> * <a href=https://creativecommons.org/licenses/by-nc-sa/3.0/>
* CC BY-NC-SA-3.0</a>.</em> * CC BY-NC-SA-3.0</a>.</em>
* *
@ -103,10 +103,10 @@ class SM130 {
static const uint8_t CMD_SLEEP = 0x96; static const uint8_t CMD_SLEEP = 0x96;
/** /**
* Instanciates a SM130 object * Instantiates an SM130 object
* *
* @param di data pin * @param di Data pin
* @param dcki clock pin * @param dcki Clock pin
*/ */
SM130 (int bus, int devAddr, int rst, int dready); SM130 (int bus, int devAddr, int rst, int dready);
@ -116,22 +116,22 @@ class SM130 {
~SM130 (); ~SM130 ();
/** /**
* Get the firmware version string. * Gets the firmware version string.
*/ */
const char* getFirmwareVersion (); const char* getFirmwareVersion ();
/** /**
* Checks for availability of a valid response packet. * Checks for availability of a valid response packet.
* *
* This function should always be called and return true prior to using results * This function should always be called and return true prior to using the results
* of a command. * of a command.
* *
* @returns true if a valid response packet is available * @returns True if a valid response packet is available
*/ */
uint8_t available (); uint8_t available ();
/** /**
* Returns the packet length, excluding checksum * Returns the packet length, excluding the checksum
*/ */
uint8_t getPacketLength () { return this->m_Data[0]; }; uint8_t getPacketLength () { return this->m_Data[0]; };
@ -141,7 +141,7 @@ class SM130 {
uint8_t getCommand () { return this->m_Data[1]; }; uint8_t getCommand () { return this->m_Data[1]; };
/** /**
* Return name of the component * Returns the name of the component
*/ */
std::string name() std::string name()
{ {

View File

@ -36,17 +36,17 @@ namespace upm {
/** /**
* @brief GFX helper class * @brief GFX helper class
* *
* This file used by the screen. * This file is used by the screen.
*/ */
class GFX { class GFX {
public: public:
/** /**
* Instanciates a GFX object * Instantiates a GFX object
* *
* @param width screen width * @param width Screen width
* @param height screen height * @param height Screen height
* @param screenBuffer pointer to screen buffer * @param screenBuffer Pointer to the screen buffer
* @param font pointer to font map * @param font Pointer to the font map
*/ */
GFX (int width, int height, uint8_t * screenBuffer, const unsigned char * font); GFX (int width, int height, uint8_t * screenBuffer, const unsigned char * font);
@ -56,147 +56,147 @@ class GFX {
~GFX (); ~GFX ();
/** /**
* Set the window address * Sets the window address
* *
* @param x0 first coordinate * @param x0 First coordinate
* @param y0 first coordinate * @param y0 First coordinate
* @param x1 second coordinate * @param x1 Second coordinate
* @param y1 second coordinate * @param y1 Second coordinate
*/ */
virtual void setAddrWindow (uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1) = 0; virtual void setAddrWindow (uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1) = 0;
/** /**
* Send pixel collor (RGB) to the chip. Must be implemented by * Sends a pixel color (RGB) to the chip. Must be implemented by the
* inherited class. * inherited class.
* *
* @param x axis on horizontal scale * @param x Axis on the horizontal scale
* @param y axis on vertical scale * @param y Axis on the vertical scale
* @param color rgb value * @param color RGB value
*/ */
virtual void drawPixel (int16_t x, int16_t y, uint16_t color) = 0; virtual void drawPixel (int16_t x, int16_t y, uint16_t color) = 0;
/** /**
* Copy the buffer to the chip via SPI interface. * Copies the buffer to the chip via the SPI.
*/ */
virtual void refresh () = 0; virtual void refresh () = 0;
/** /**
* *
* *
* @param x axis on horizontal scale * @param x Axis on the horizontal scale
* @param y axis on vertical scale * @param y Axis on the vertical scale
* @param data character to write * @param data Character to write
* @param color character's color * @param color Character color
* @param bg character's background color * @param bg Character background color
* @param size size of the font * @param size Size of the font
*/ */
void drawChar (int16_t x, int16_t y, uint8_t data, uint16_t color, uint16_t bg, uint8_t size); void drawChar (int16_t x, int16_t y, uint8_t data, uint16_t color, uint16_t bg, uint8_t size);
/** /**
* Print the message to the screen * Prints a message on the screen
* *
* @param msg message which will be printed * @param msg Message to print
*/ */
void print (std::string msg); void print (std::string msg);
/** /**
* Print the message to the screen * Prints a message on the screen
* *
* @param x axis on horizontal scale * @param x Axis on the horizontal scale
* @param y axis on vertical scale * @param y Axis on the vertical scale
* @param color pixel's color * @param color Pixel color
*/ */
mraa_result_t setPixel (int x, int y, uint16_t color); mraa_result_t setPixel (int x, int y, uint16_t color);
/** /**
* Fill screen with selected color * Fills the screen with a selected color
* *
* @param color selected's color * @param color Selected color
*/ */
void fillScreen (uint16_t color); void fillScreen (uint16_t color);
/** /**
* Fill rectangle with selected color * Fills a rectangle with a selected color
* *
* @param x axis on horizontal scale (top left corner) * @param x Axis on the horizontal scale (top-left corner)
* @param y axis on vertical scale (top left corner) * @param y Axis on the vertical scale (top-left corner)
* @param w distanse from x * @param w Distanse from x
* @param h distanse from y * @param h Distanse from y
* @param color selected color * @param color Selected color
*/ */
void fillRect (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color); void fillRect (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);
/** /**
* Draw line in vertical scale. * Draws a line on the vertical scale
* *
* @param x axis on horizontal scale * @param x Axis on the horizontal scale
* @param y axis on vertical scale * @param y Axis on the vertical scale
* @param h distanse from y * @param h Distanse from y
* @param color selected color * @param color Selected color
*/ */
void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color); void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
/** /**
* Draw line from coordinate C0 to coordinate C1 * Draws a line from coordinate C0 to coordinate C1
* *
* @param x0 first coordinate * @param x0 First coordinate
* @param y0 first coordinate * @param y0 First coordinate
* @param x1 second coordinate * @param x1 Second coordinate
* @param y1 second coordinate * @param y1 Second coordinate
* @param color selected color * @param color selected color
*/ */
void drawLine (int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color); void drawLine (int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color);
/** /**
* Draw a triangle * Draws a triangle
* *
* @param x0 first coordinate * @param x0 First coordinate
* @param y0 first coordinate * @param y0 First coordinate
* @param x1 second coordinate * @param x1 Second coordinate
* @param y1 second coordinate * @param y1 Second coordinate
* @param x2 third coordinate * @param x2 Third coordinate
* @param y2 third coordinate * @param y2 Third coordinate
* @param color selected color * @param color Selected color
*/ */
void drawTriangle (int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color); void drawTriangle (int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);
/** /**
* Draw a circle * Draws a circle
* *
* @param x center of circle on X scale * @param x Center of the circle on the horizontal scale
* @param y center of circle on Y scale * @param y Center of the circle on the vertical scale
* @param r radius of circle * @param r Radius of the circle
* @param color color of circle * @param color Color of the circle
*/ */
void drawCircle (int16_t x, int16_t y, int16_t r, uint16_t color); void drawCircle (int16_t x, int16_t y, int16_t r, uint16_t color);
/** /**
* Set cursor for text message * Sets the cursor for a text message
* *
* @param x axis on horizontal scale * @param x Axis on the horizontal scale
* @param y axis on vertical scale * @param y Axis on the vertical scale
*/ */
void setCursor (int16_t x, int16_t y); void setCursor (int16_t x, int16_t y);
/** /**
* Set text color for the message * Sets a text color for a message
* *
* @param textColor font color * @param textColor Font color
* @param textBGColor background color * @param textBGColor Background color
*/ */
void setTextColor (uint16_t textColor, uint16_t textBGColor); void setTextColor (uint16_t textColor, uint16_t textBGColor);
/** /**
* Set the size of the font * Sets the size of the font
* *
* @param size font size * @param size Font size
*/ */
void setTextSize (uint8_t size); void setTextSize (uint8_t size);
/** /**
* Wrap printed message. * Wraps a printed message
* *
* @param wrap true (0x1) or false (0x0) * @param wrap True (0x1) or false (0x0)
*/ */
void setTextWrap (uint8_t wrap); void setTextWrap (uint8_t wrap);

View File

@ -494,22 +494,22 @@ const unsigned char font[] = {
}; };
/** /**
* @brief ST7735 LCD display library * @brief ST7735 LCD library
* @defgroup st7735 libupm-st7735 * @defgroup st7735 libupm-st7735
* @ingroup adafruit spi display * @ingroup adafruit spi display
*/ */
/** /**
* @library st7735 * @library st7735
* @sensor st7735 * @sensor st7735
* @comname ST7735 LCD display * @comname ST7735 LCD
* @type display * @type display
* @man adafruit * @man adafruit
* @web http://www.adafruit.com/product/358 * @web http://www.adafruit.com/product/358
* @con spi * @con spi
* *
* @brief API for the st7735 lcd display library * @brief API for the ST7735 LCD
* *
* This file defines the interface for ST7735 display library * This file defines the interface for the ST7735 display library
* *
* @image html st7735.jpg * @image html st7735.jpg
* @snippet st7735.cxx Interesting * @snippet st7735.cxx Interesting
@ -517,12 +517,12 @@ const unsigned char font[] = {
class ST7735 : public GFX { class ST7735 : public GFX {
public: public:
/** /**
* Instantiates a ST7735 object * Instantiates an ST7735 object
* *
* @param csLCD LCD chip select pin * @param csLCD LCD chip select pin
* @param cSD SD card chip select pin * @param cSD SD card chip select pin
* @param rs data/command pin * @param rs Data/command pin
* @param rst reset pin * @param rst Reset pin
*/ */
ST7735 (uint8_t csLCD, uint8_t cSD, uint8_t rs, uint8_t rst); ST7735 (uint8_t csLCD, uint8_t cSD, uint8_t rs, uint8_t rst);
@ -532,7 +532,7 @@ class ST7735 : public GFX {
~ST7735 (); ~ST7735 ();
/** /**
* Return name of the component * Returns the name of the component
*/ */
std::string name() std::string name()
{ {
@ -540,88 +540,88 @@ class ST7735 : public GFX {
} }
/** /**
* Initialize the modules GPIOs * Initializes the module GPIOs
*/ */
void initModule (); void initModule ();
/** /**
* Configure the chip via SPI interface * Configures the chip via the SPI
*/ */
void configModule (); void configModule ();
/** /**
* Send command to SPI bus (rs must be LOW) * Sends a command to an SPI bus (rs must be LOW)
* *
* @param value command number * @param value Command number
*/ */
void write (uint8_t value); void write (uint8_t value);
/** /**
* Send data to SPI bus (rs must be HIGH) * Sends data to an SPI bus (rs must be HIGH)
* *
* @param value command number * @param value Command number
*/ */
void data (uint8_t value); void data (uint8_t value);
/** /**
* Execute set of commands and data * Executes a set of commands and data
* *
* @param addr pointer to start of the commands/data section * @param addr Pointer to the start of the commands/data section
*/ */
void executeCMDList (const uint8_t *addr); void executeCMDList (const uint8_t *addr);
/** /**
* Set the window size inside the screen where the pixels data * Sets the window size inside the screen where pixels data
* will be written. * is written.
* *
* @param x0 first coordinate * @param x0 First coordinate
* @param y0 first coordinate * @param y0 First coordinate
* @param x1 second coordinate * @param x1 Second coordinate
* @param y1 second coordinate * @param y1 Second coordinate
*/ */
void setAddrWindow (uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1); void setAddrWindow (uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1);
/** /**
* Send pixel collor (RGB) to the chip. * Sends a pixel color (RGB) to the chip.
* *
* @param x axis on horizontal scale * @param x Axis on the horizontal scale
* @param y axis on vertical scale * @param y Axis on the vertical scale
* @param color rgb (16bit) color (R[0-4], G[5-10], B[11-15]) * @param color RGB (16-bit) color (R[0-4], G[5-10], B[11-15])
*/ */
void drawPixel (int16_t x, int16_t y, uint16_t color); void drawPixel (int16_t x, int16_t y, uint16_t color);
/** /**
* Copy the buffer to the chip via SPI interface. * Copies the buffer to the chip via the SPI.
*/ */
void refresh (); void refresh ();
/** /**
* LCD chip select LOW. * LCD chip select is LOW
*/ */
mraa_result_t lcdCSOn (); mraa_result_t lcdCSOn ();
/** /**
* LCD chip select HIGH. * LCD chip select is HIGH
*/ */
mraa_result_t lcdCSOff (); mraa_result_t lcdCSOff ();
/** /**
* CD card chip select LOW. * CD card chip select is LOW
*/ */
mraa_result_t sdCSOn (); mraa_result_t sdCSOn ();
/** /**
* CD card select HIGH. * CD card select is HIGH
*/ */
mraa_result_t sdCSOff (); mraa_result_t sdCSOff ();
/** /**
* Data select HIGH. * Data select is HIGH
*/ */
mraa_result_t rsHIGH (); mraa_result_t rsHIGH ();
/** /**
* Data select LOW. * Data select is LOW
*/ */
mraa_result_t rsLOW (); mraa_result_t rsLOW ();

View File

@ -41,7 +41,7 @@
namespace upm { namespace upm {
/** /**
* @brief Stepper motor library * @brief Stepper Motor library
* @defgroup stepper libupm-stepper * @defgroup stepper libupm-stepper
* @ingroup seeed sparkfun pwm gpio motor * @ingroup seeed sparkfun pwm gpio motor
*/ */
@ -55,10 +55,10 @@ namespace upm {
* @web http://www.schmalzhaus.com/EasyDriver/index.html * @web http://www.schmalzhaus.com/EasyDriver/index.html
* @con pwm gpio * @con pwm gpio
* *
* @brief API for the Stepper motor library * @brief API for the Stepper Motor
* *
* This file defines the StepMotor interface. It is compatible with Stepper * This file defines the Stepper Motor interface. It is compatible with stepper
* Motor Drivers that use 2 pins to control the motor, like the EasyDriver * motor drivers that use 2 pins to control the motor, like an Easy Driver
* from Brian Schmalz. * from Brian Schmalz.
* *
* @image html stepmotor.jpg * @image html stepmotor.jpg
@ -69,34 +69,34 @@ class StepMotor {
/** /**
* Instantiates a StepMotor object * Instantiates a StepMotor object
* *
* @param dirPin direction GPIO pin * @param dirPin Direction GPIO pin
* @param stePin stepper pulse PWM pin * @param stePin Stepper pulse PWM pin
*/ */
StepMotor (int dirPin, int stePin); StepMotor (int dirPin, int stePin);
/** /**
* StepMotor object destructor. * StepMotor object destructor
*/ */
~StepMotor (); ~StepMotor ();
/** /**
* Set the speed of rotation * Sets the rotation speed
* *
* @param speed rotation speed * @param speed Rotation speed
*/ */
void setSpeed (int speed); void setSpeed (int speed);
/** /**
* Rotate motor forward * Rotates the motor forward
* *
* @param ticks number of ticks the motor will move * @param ticks Number of ticks the motor moves
*/ */
mraa_result_t stepForward (int ticks); mraa_result_t stepForward (int ticks);
/** /**
* Rotate motor backward * Rotates the motor backward
* *
* @param ticks number of ticks the motor will move * @param ticks Number of ticks the motor moves
*/ */
mraa_result_t stepBackwards (int ticks); mraa_result_t stepBackwards (int ticks);

View File

@ -29,7 +29,7 @@
namespace upm { namespace upm {
/** /**
* @brief SX6119 based FM receiver library * @brief SX6119-based FM Receiver library
* @defgroup sx6119 libupm-sx6119 * @defgroup sx6119 libupm-sx6119
* @ingroup seeed gpio sound * @ingroup seeed gpio sound
*/ */
@ -43,10 +43,10 @@ namespace upm {
* @man seeed * @man seeed
* @con gpio * @con gpio
* *
* @brief API support for the SX6119 based Grove FM Receiver * @brief API support for the SX6119-based Grove FM Receiver
* *
* This class implements support for the FM Receiver. There are * This class implements support for the SX6119 FM Receiver. There are
* two digital pins, one that toggles power on/off, and one that * two digital pins: one that toggles power on/off, and the other that
* does a seek to the next station. * does a seek to the next station.
* *
* @image html sx6119.jpg * @image html sx6119.jpg
@ -56,26 +56,26 @@ namespace upm {
public: public:
/** /**
* SX6119 module constructor * SX6119 constructor
* *
* @param powerPin the pin to use for recording * @param powerPin Pin to use for recording
* @param seekPin the pin to use to seek to the next station * @param seekPin Pin to use for seeking to the next station
*/ */
SX6119(int powerPin, int seekPin); SX6119(int powerPin, int seekPin);
/** /**
* SX6119 module Destructor * SX6119 destructor
*/ */
~SX6119(); ~SX6119();
/** /**
* Toggle the device power on or off * Toggles the device power on or off
* *
*/ */
void togglePower(); void togglePower();
/** /**
* Seek to the next station * Seeks to the next station
* *
*/ */
void seek(); void seek();

View File

@ -34,26 +34,26 @@
namespace upm { namespace upm {
/** /**
* @brief TA12-200 current transformer library * @brief TA12-200 Current Transformer library
* @defgroup ta12200 libupm-ta12200 * @defgroup ta12200 libupm-ta12200
* @ingroup seeed analog electric * @ingroup seeed analog electric
*/ */
/** /**
* @library ta12200 * @library ta12200
* @sensor ta12200 * @sensor ta12200
* @comname TA12-200 Current transformer * @comname TA12-200 Current Transformer
* @altname Grove Electricity Sensor * @altname Grove Electricity Sensor
* @type electric * @type electric
* @man seeed * @man seeed
* @web http://www.seeedstudio.com/wiki/Grove_-_Electricity_Sensor * @web http://www.seeedstudio.com/wiki/Grove_-_Electricity_Sensor
* @con analog * @con analog
* *
* @brief API for the TA12-200 current transformer * @brief API for the TA12-200 Current Transformer
* *
* UPM module for the TA12-200 current transformer, which is found, * UPM module for the TA12-200 current transformer found,
* for instance, in the Grove Electricity Sensor. * for instance, in the Grove Electricity Sensor.
* This module can measure AC current moving through a wire at up * This module can measure AC moving through a wire at up
* to 5A. * to 5 A.
* *
* @image html ta12200.jpg * @image html ta12200.jpg
* @snippet ta12200.cxx Interesting * @snippet ta12200.cxx Interesting
@ -61,45 +61,45 @@ namespace upm {
class TA12200 { class TA12200 {
public: public:
/** /**
* TA12200 sensor constructor * TA12200 constructor
* *
* @param pin analog pin to use * @param pin Analog pin to use
*/ */
TA12200(int pin); TA12200(int pin);
/** /**
* TA12200 Destructor * TA12200 destructor
*/ */
~TA12200(); ~TA12200();
/** /**
* Return the number of milliseconds elapsed since initClock() * Returns the number of milliseconds elapsed since initClock()
* was last called. * was last called.
* *
* @return elapsed milliseconds * @return Elapsed milliseconds
*/ */
uint32_t getMillis(); uint32_t getMillis();
/** /**
* Reset the Clock * Resets the clock
* *
*/ */
void initClock(); void initClock();
/** /**
* Get the conversion value from the sensor * Gets the conversion value from the sensor
* *
* @return the highest value obtained over 1 second of measuring * @return Highest value obtained over 1 second of measuring
*/ */
unsigned int highestValue(); unsigned int highestValue();
/** /**
* Compute the measured voltage * Computes the measured voltage
* *
* @param val value measured by highestValue() * @param val Value measured by highestValue()
* @param res ADC resolution * @param res ADC resolution
* *
* @return the measured current in milliamps * @return Measured current in mA
*/ */
float milliAmps(unsigned int val, int res=TA12200_ADC_RES); float milliAmps(unsigned int val, int res=TA12200_ADC_RES);

View File

@ -105,7 +105,7 @@ typedef struct {
} tcs3414sc_rgb_t; } tcs3414sc_rgb_t;
/** /**
* @brief TCS3414CS color sensor library * @brief TCS3414CS Color Sensor library
* @defgroup tcs3414cs libupm-tcs3414cs * @defgroup tcs3414cs libupm-tcs3414cs
* @ingroup seeed i2c color * @ingroup seeed i2c color
*/ */
@ -119,9 +119,9 @@ typedef struct {
* @web http://www.seeedstudio.com/wiki/Grove_-_I2C_Color_Sensor * @web http://www.seeedstudio.com/wiki/Grove_-_I2C_Color_Sensor
* @con i2c * @con i2c
* *
* @brief API for TCS3414CS chip (Color sensor) * @brief API for the TCS3414CS Color Sensor
* *
* This file defines the TCS3414CS interface for the color sensor * This file defines the TCS3414CS interface for the color sensor
* *
* @image html tcs3414cs.jpg * @image html tcs3414cs.jpg
* @snippet tcs3414cs.cxx Interesting * @snippet tcs3414cs.cxx Interesting
@ -129,31 +129,31 @@ typedef struct {
class TCS3414CS { class TCS3414CS {
public: public:
/** /**
* Instanciates a TCS3414CS object * Instantiates a TCS3414CS object
* *
* @param bus number of used bus * @param bus Number of the used bus
*/ */
TCS3414CS (); TCS3414CS ();
/** /**
* TCS3414CS object destructor, basicaly it close i2c connection. * TCS3414CS object destructor; basically, it closes the I2C connection.
*/ */
~TCS3414CS (); ~TCS3414CS ();
/** /**
* Get the RGB value from sensor. * Gets the RGB value from the sensor.
* *
* @param rgb color values * @param rgb Color values
*/ */
void readRGB (tcs3414sc_rgb_t * rgb); void readRGB (tcs3414sc_rgb_t * rgb);
/** /**
* Clear interrupts. * Clears interrupts.
*/ */
void clearInterrupt (); void clearInterrupt ();
/** /**
* Return name of the component * Returns the name of the component
*/ */
std::string name() std::string name()
{ {

View File

@ -45,7 +45,7 @@
namespace upm { namespace upm {
/** /**
* @brief TH02 temperature & humidity sensor library * @brief TH02 Temperature & Humidity Sensor library
* @defgroup th02 libupm-th02 * @defgroup th02 libupm-th02
* @ingroup seeed i2c temp * @ingroup seeed i2c temp
*/ */
@ -53,18 +53,18 @@ namespace upm {
* @library th02 * @library th02
* @sensor th02 * @sensor th02
* @comname TH02 Temperature & Humidity Sensor * @comname TH02 Temperature & Humidity Sensor
* @altname Grove Temperature & Humidity Sensor (High Accuracy & Mini) * @altname Grove Temperature & Humidity Sensor (High-Accuracy & Mini)
* @type temp * @type temp
* @man seeed * @man seeed
* @web http://www.seeedstudio.com/wiki/Grove_-_Tempture%26Humidity_Sensor_(High-Accuracy_%26Mini)_v1.0 * @web http://www.seeedstudio.com/wiki/Grove_-_Tempture%26Humidity_Sensor_(High-Accuracy_%26Mini)_v1.0
* @con i2c * @con i2c
* *
* @brief API for th02 temperature & humidity sensor library * @brief API for the TH02 Temperature & Humidity Sensor
* *
* This file defines the TH02 interface for libth02 * This file defines the TH02 interface for libth02
* *
* NOTE: For use on the Edison with the Arduino breakout board, the * Note: For use on Intel(R) Edison with an Arduino* breakout board, Intel
* Edison must be set to 3v rather than 5v. * Edison must be set to 3 V rather than 5 V.
* *
* @image html th02.jpg * @image html th02.jpg
* @snippet th02.cxx Interesting * @snippet th02.cxx Interesting
@ -72,32 +72,32 @@ namespace upm {
class TH02 { class TH02 {
public: public:
/** /**
* Instanciates a TH02 object * Instantiates a TH02 object
*/ */
TH02 (int bus=0, uint8_t addr=TH02_ADDR); TH02 (int bus=0, uint8_t addr=TH02_ADDR);
/** /**
* TH02 object destructor, basicaly it close i2c connection. * TH02 object destructor; basically, it closes the I2C connection.
*/ */
~TH02 (); ~TH02 ();
/** /**
* Get the temperature value from sensor. * Gets the temperature value from the sensor.
*/ */
float getTemperature (); float getTemperature ();
/** /**
* Get the humidity value from sensor. * Gets the humidity value from the sensor.
*/ */
float getHumidity (); float getHumidity ();
/** /**
* Get the sensor's status. * Gets the sensor status.
*/ */
bool getStatus (); bool getStatus ();
/** /**
* Return name of the component * Returns the name of the component
*/ */
std::string name() std::string name()
{ {

View File

@ -32,19 +32,19 @@
#include <mraa/gpio.h> #include <mraa/gpio.h>
// TM1637 specific register addresses for writing all digits at a time // TM1637-specific register addresses for writing all digits at a time
#define TM1637_ADDR 0x40 #define TM1637_ADDR 0x40
#define TM1637_REG 0xC0 #define TM1637_REG 0xC0
#define TM1637_CMD 0x88 #define TM1637_CMD 0x88
// Display specific values // Display-specific values
#define M_DISPLAY_DIGITS 4 #define M_DISPLAY_DIGITS 4
namespace upm namespace upm
{ {
/** /**
* @brief TM1637 7-segment display library * @brief TM1637 7-Segment Display library
* @defgroup tm1637 libupm-tm1637 * @defgroup tm1637 libupm-tm1637
* @ingroup seeed gpio display * @ingroup seeed gpio display
*/ */
@ -58,13 +58,13 @@ namespace upm
* @man seeed * @man seeed
* @con gpio * @con gpio
* *
* @brief API for TM1637 (7-segment display) * @brief API for the TM1637 7-Segment Display
* *
* The TM1637 is a display controller for LED based 7-segment displays. * TM1637 is a display controller for LED-based 7-segment displays.
* It can be used to address and write data to multiple display digits. This * It can be used to address and write data to multiple display digits. This
* driver is based on the Grove version of the TM1637 display which uses 4 * driver is based on the Grove version of the TM1637 display that uses 4
* digits thus making it ideal for clock displays, timers, counters or even * digits, thus making it ideal for clock displays, timers, counters, or even
* score display in a two player arcade game. * score displays in a two-player arcade game.
* *
* @image html tm1637.jpeg * @image html tm1637.jpeg
* @snippet tm1637.cxx Interesting * @snippet tm1637.cxx Interesting
@ -74,7 +74,7 @@ namespace upm
{ {
public: public:
/** /**
* Enum for memory mapped GPIO * Enum for the memory-mapped GPIO
*/ */
typedef enum { typedef enum {
NO = 0, NO = 0,
@ -83,10 +83,10 @@ namespace upm
/** /**
* TM1637 constructor * TM1637 constructor
* *
* @param clk_pin the clock pin the sensor is connected to * @param clk_pin Clock pin the sensor is connected to
* @param dio_pin the data pin the sensor is connected to * @param dio_pin Data pin the sensor is connected to
* @param bright initial brightness from 0 to 7 dark to bright (default 3) * @param bright Initial brightness, from 0 (dark) to 7 (bright) (default is 3)
* @param mmio fast memory mapped gpio writes, default is yes * @param mmio Fast memory-mapped GPIO writes; default is yes
*/ */
TM1637(int clk_pin, int dio_pin, int bright = 3, M_FAST_GPIO mmio = YES); TM1637(int clk_pin, int dio_pin, int bright = 3, M_FAST_GPIO mmio = YES);
/** /**
@ -94,44 +94,44 @@ namespace upm
*/ */
~TM1637(); ~TM1637();
/** /**
* Write digits to the display in 7 segment encoding * Writes digits to the display in a 7-segment encoding
* *
* @param digits an array of digits to send to the display * @param digits Array of digits to send to the display
* @return 0 if the write was successful, error code otherwise * @return 0 if successful, error code otherwise
*/ */
mraa_result_t write(uint8_t *digits); mraa_result_t write(uint8_t *digits);
/** /**
* Write digits to the display in 7 segment encoding * Writes digits to the display in a 7-segment encoding
* *
* @param d list of multiple arguments to send to the display * @param d List of multiple arguments to send to the display
* @return 0 if the write was successful, error code otherwise * @return 0 if successful, error code otherwise
*/ */
mraa_result_t write(int d, ...); mraa_result_t write(int d, ...);
/** /**
* Write a symbol (digit or letter) to the display at a specified index * Writes a symbol (digit or letter) to the display in a specified index
* *
* @param index 0-based index of the digit to change from the left * @param index 0-based index of the digit to change from the left
* @param symbol the digit or letter to display * @param symbol Digit or letter to display
* @return 0 if the write was successful, error code otherwise * @return 0 if successful, error code otherwise
*/ */
mraa_result_t writeAt(int index, char symbol); mraa_result_t writeAt(int index, char symbol);
/** /**
* Write all the digits or letters to the display as a string * Writes all the digits or letters to the display as a string
* *
* @param digits a string of symbols to display * @param digits String of symbols to display
* @return 0 if the write was successful, error code otherwise * @return 0 if successful, error code otherwise
*/ */
mraa_result_t write(std::string digits); mraa_result_t write(std::string digits);
/** /**
* Toggles the colon between digits on the display * Toggles the colon between digits on the display
* *
* @param value pass true to turn on the colon, false to turn it off * @param value True to turn the colon on, false to turn it off
*/ */
void setColon(bool value); void setColon(bool value);
/** /**
* Use to control the brightness of the display * Controls the brightness of the display
* *
* @param value between 0 and 7, darkest to brightest * @param value Brightness, from 0 (darkest) to 7 (brightest)
*/ */
void setBrightness(int value); void setBrightness(int value);

View File

@ -92,7 +92,7 @@ namespace upm {
#define LUX_M8C (0x0000) // 0.000 * 2^LUX_SCALE #define LUX_M8C (0x0000) // 0.000 * 2^LUX_SCALE
/** /**
* @brief TSL2561 digital light sensor library * @brief TSL2561 Digital Light Sensor library
* @defgroup tsl2561 libupm-tsl2561 * @defgroup tsl2561 libupm-tsl2561
* @ingroup seeed i2c light eak * @ingroup seeed i2c light eak
*/ */
@ -107,12 +107,10 @@ namespace upm {
* @con i2c * @con i2c
* @kit eak * @kit eak
* *
* @brief TSL2561 Digital Light Sensor library * @brief API for the TSL2561 Digital Light Sensor
* *
* The LIGHT-TO-DIGITAL CONVERTER [TAOS-TSL2561] * TSL2560 and TSL2561 are light-to-digital converters that transform
* (http://www.adafruit.com/datasheets/TSL2561.pdf) * light intensity to a digital signal output capable of a direct I2C (TSL2561) interface
* The TSL2560 and TSL2561 are light-to-digital converters that transform
* light intensity to a digital signal output capable of direct I2C (TSL2561)
* *
* @image html tsl2561.jpg * @image html tsl2561.jpg
* @snippet tsl2561.cxx Interesting * @snippet tsl2561.cxx Interesting
@ -120,42 +118,42 @@ namespace upm {
class TSL2561{ class TSL2561{
public: public:
/** /**
* Instanciates a TSL2561 object * Instantiates a TSL2561 object
* *
* @param bus number of used bus * @param bus Number of the used bus
* @param devAddr address of used i2c device * @param devAddr Address of the used I2C device
* @param gain the correct gain to use * @param gain Correct gain to use
* @param integration time to use * @param integration Time to use
*/ */
TSL2561(int bus=0, uint8_t devAddr=TSL2561_Address, uint8_t gain=GAIN_0X, uint8_t integrationTime=INTEGRATION_TIME1_101MS); TSL2561(int bus=0, uint8_t devAddr=TSL2561_Address, uint8_t gain=GAIN_0X, uint8_t integrationTime=INTEGRATION_TIME1_101MS);
/** /**
* GY65 object destructor to power down TSL2561 and close i2c connection. * GY65 object destructor; powers down TSL2561 and closes the I2C connection.
*/ */
~TSL2561(); ~TSL2561();
/** /**
* Get calculated lux reading from TSL2561 * Gets the calculated lux reading from TSL2561
* *
* @return the calculated lux value from the sensor * @return Calculated lux value from the sensor
*/ */
int getLux(); int getLux();
private: private:
/** /**
* Write to TSL2561 register * Writes to a TSL2561 register
* *
* @param reg addess to write * @param reg Addess to write
* @param value to write * @param Value to write
* @return mraa_result_t * @return mraa_result_t
*/ */
mraa_result_t i2cWriteReg(uint8_t reg, uint8_t value); mraa_result_t i2cWriteReg(uint8_t reg, uint8_t value);
/** /**
* Read from TSL2561 register * Reads from a TSL2561 register
* *
* @param reg addess to read * @param reg Addess to read
* @param data byte read from the register * @param data Byte read from the register
* @return mraa_result_t * @return mraa_result_t
*/ */
mraa_result_t i2cReadReg(uint8_t reg, uint8_t &data); mraa_result_t i2cReadReg(uint8_t reg, uint8_t &data);

View File

@ -28,13 +28,7 @@
namespace upm { namespace upm {
/** /**
* @brief TTP223 touch detector sensor library * @brief TTP223 Touch Detector Sensor library
*
* This touch sensor detects when a finger is near the metallic pad
* by a change in capacitance. It can replace a more traditional push
* button. The touch sensor can still function when placed under a
* non-metallic surface like glass or plastic.
*
* @defgroup ttp223 libupm-ttp223 * @defgroup ttp223 libupm-ttp223
* @ingroup seeed gpio touch * @ingroup seeed gpio touch
*/ */
@ -48,11 +42,11 @@ namespace upm {
* @web http://www.seeedstudio.com/depot/Grove-Touch-Sensor-p-747.html * @web http://www.seeedstudio.com/depot/Grove-Touch-Sensor-p-747.html
* @con gpio * @con gpio
* *
* @brief TTP223 Touch Detector sensor library * @brief API for the TTP223 Touch Sensor
* *
* This touch sensor detects when a finger is near the metallic pad * This touch sensor detects when a finger is near the metallic pad
* by a change in capacitance. It can replace a more traditional push * by the change in capacitance. It can replace a more traditional push
* button. The touch sensor can still function when placed under a * button. The touch sensor can still function when placed under a
* non-metallic surface like glass or plastic. * non-metallic surface like glass or plastic.
* *
* @image html ttp223.jpg * @image html ttp223.jpg
@ -61,9 +55,9 @@ namespace upm {
class TTP223 { class TTP223 {
public: public:
/** /**
* TTP223 touch sensor constructor * TTP223 constructor
* *
* @param pin GPIO pin where sensor is connected * @param pin GPIO pin where the sensor is connected
*/ */
TTP223(unsigned int pin); TTP223(unsigned int pin);
@ -73,23 +67,23 @@ class TTP223 {
~TTP223(); ~TTP223();
/** /**
* 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(); 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(); int value();
/** /**
* Returns whether or not the touch sensor is being touched * Determines whether the touch sensor is being touched
* *
* @return true if the touch sensor is being touched; false otherwise * @return True if touched, false otherwise
*/ */
bool isPressed(); bool isPressed();

View File

@ -44,7 +44,7 @@ const int UBLOX6_DEFAULT_UART = 0;
namespace upm { namespace upm {
/** /**
* @brief UBLOX6 & SIM28 GPS module library * @brief UBLOX6 & SIM28 GPS Module library
* @defgroup ublox6 libupm-ublox6 * @defgroup ublox6 libupm-ublox6
* @ingroup seeed uart gps tsk * @ingroup seeed uart gps tsk
*/ */
@ -52,17 +52,17 @@ namespace upm {
* @library ublox6 * @library ublox6
* @sensor ublox6 * @sensor ublox6
* @comname Grove GPS * @comname Grove GPS
* @altname U-BLOX6 SIM28 * @altname U-BLOX 6 SIM28
* @type gps * @type gps
* @man seeed * @man seeed
* @web http://www.seeedstudio.com/depot/Grove-GPS-p-959.html * @web http://www.seeedstudio.com/depot/Grove-GPS-p-959.html
* @con uart * @con uart
* @kit tsk * @kit tsk
* *
* @brief API for the U-BLOX 6 and SIM28 GPS modules * @brief API for the U-BLOX 6 and SIM28 GPS Modules
* *
* UPM support for the U-BLOX 6 GPS Module. It is also compatible with * UPM support for the U-BLOX 6 GPS module. It is also compatible with
* the SIM28 GPS Module. * the SIM28 GPS module.
* *
* @image html ublox6.jpg * @image html ublox6.jpg
* @snippet ublox6.cxx Interesting * @snippet ublox6.cxx Interesting
@ -70,51 +70,51 @@ namespace upm {
class Ublox6 { class Ublox6 {
public: public:
/** /**
* U-BLOX 6 GPS module constructor * Ublox6 object constructor
* *
* @param uart defualt uart to use (0 or 1) * @param uart Default UART to use (0 or 1)
*/ */
Ublox6(int uart); Ublox6(int uart);
/** /**
* U-BLOX 6 GPS module Destructor * Ublox6 object destructor
*/ */
~Ublox6(); ~Ublox6();
/** /**
* Check to see if there is data available for reading * Checks to see if there is data available for reading
* *
* @return true if there is data available to be read * @return True if there is data available for reading
*/ */
bool dataAvailable(); bool dataAvailable();
/** /**
* read any available data into a user-supplied buffer. Note, the * Reads any available data in a user-supplied buffer. Note: the
* call will block until data is available to be read. Use * call blocks until data is available to be read. Use
* dataAvailable() to determine whether there is data available * dataAvailable() to determine whether there is data available
* beforehand, to avoid blocking. * beforehand, to avoid blocking.
* *
* @param buffer the buffer to hold the data read * @param buffer Buffer to hold the data read
* @param len the length of the buffer * @param len Length of the buffer
* @return the number of bytes read * @return the Number of bytes read
*/ */
int readData(char *buffer, size_t len); 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 buffer Buffer to hold the data read
* @param len the length of the buffer * @param len Length of the buffer
* @return the number of bytes written * @return Number of bytes written
*/ */
int writeData(char *buffer, size_t len); int writeData(char *buffer, size_t len);
/** /**
* setup the proper tty i/o modes and the baudrate. The default * Sets up proper tty I/O modes and the baud rate. The default
* baud rate is 9600 (B9600). * baud rate is 9,600 (B9600).
* *
* @param baud the desired baud rate. * @param baud Desired baud rate
* @return true if successful * @return True if successful
*/ */
bool setupTty(speed_t baud=B9600); bool setupTty(speed_t baud=B9600);

View File

@ -32,7 +32,7 @@
namespace upm { namespace upm {
/** /**
* @brief ULN200XA stepper driver library * @brief ULN200XA Stepper Driver library
* @defgroup uln200xa libupm-uln200xa * @defgroup uln200xa libupm-uln200xa
* @ingroup seeed gpio motor * @ingroup seeed gpio motor
*/ */
@ -47,11 +47,11 @@ namespace upm {
* @web http://www.seeedstudio.com/depot/Gear-Stepper-Motor-with-Driver-p-1685.html?cPath=39_40 * @web http://www.seeedstudio.com/depot/Gear-Stepper-Motor-with-Driver-p-1685.html?cPath=39_40
* @con gpio * @con gpio
* *
* @brief UPM module for the ULN200XA Darlington Stepper driver * @brief UPM module for the ULN200XA Darlington Stepper Driver
* *
* This module was developed on a ULBN2003A Stepper Driver. It * This module was developed on a ULN2003A Stepper Driver. It
* should support the uln2001a, 2002a, 2003a, and 2004a devices, for * should also support the ULN2001A, ULN2002A, and ULN2004A devices, when
* use in driving a unipolar stepper motor, the 28BYJ-48. * using to drive the 28BYJ-48 unipolar stepper motor.
* *
* @image html uln200xa.jpg * @image html uln200xa.jpg
* Example driving a stepper motor * Example driving a stepper motor
@ -73,56 +73,56 @@ namespace upm {
/** /**
* ULN200XA constructor * ULN200XA constructor
* *
* @param stepsPerRev number of steps per full revolution * @param stepsPerRev Number of steps per full revolution
* @param i1 digital pin to use for stepper input 1 * @param i1 Digital pin to use for stepper input 1
* @param i2 digital pin to use for stepper input 2 * @param i2 Digital pin to use for stepper input 2
* @param i3 digital pin to use for stepper input 3 * @param i3 Digital pin to use for stepper input 3
* @param i4 digital pin to use for stepper input 4 * @param i4 Digital pin to use for stepper input 4
*/ */
ULN200XA(int stepsPerRev, int i1, int i2, int i3, int i4); ULN200XA(int stepsPerRev, int i1, int i2, int i3, int i4);
/** /**
* ULN200XA Destructor * ULN200XA destructor
*/ */
~ULN200XA(); ~ULN200XA();
/** /**
* Return the number of milliseconds elapsed since initClock() * Returns the number of milliseconds elapsed since initClock()
* was last called. * was last called.
* *
* @return elapsed milliseconds * @return Elapsed milliseconds
*/ */
uint32_t getMillis(); uint32_t getMillis();
/** /**
* Reset the Clock * Resets the clock
* *
*/ */
void initClock(); void initClock();
/** /**
* set the speed of the stepper in RPM (Rotation Per Minute * Sets the speed of the stepper motor in revolutions per minute (RPM)
* *
* @param speed speed to set the motor to in RPM's * @param speed Speed to set the motor to, in RPM
*/ */
void setSpeed(int speed); 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(ULN200XA_DIRECTION_T dir); void setDirection(ULN200XA_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); void stepperSteps(unsigned int steps);
/** /**
* release the stepper, by removing power * Releases the stepper motor by removing power
* *
*/ */
void release(); void release();
@ -142,13 +142,13 @@ namespace upm {
uint32_t m_stepDelay; uint32_t m_stepDelay;
/** /**
* step the motor one tick * Steps the stepper motor one tick
* *
*/ */
void stepperStep(); void stepperStep();
/** /**
* step direction - 1 = forward, -1 = backward * Defines the step direction: 1 = forward, -1 = backward
* *
*/ */
int m_stepDirection; int m_stepDirection;

View File

@ -27,7 +27,7 @@
namespace upm { namespace upm {
/** /**
* @brief Water Level switch library * @brief Water Level Switch Library
* @defgroup waterlevel libupm-waterlevel * @defgroup waterlevel libupm-waterlevel
* @ingroup seeed gpio liquid * @ingroup seeed gpio liquid
*/ */
@ -50,17 +50,17 @@ namespace upm {
class WaterLevel { class WaterLevel {
public: public:
/** /**
* Water Level Constructor * WaterLevel constructor
* *
* @param pin digital pin to use * @param pin Digital pin to use
*/ */
WaterLevel(int pin); WaterLevel(int pin);
/** /**
* Water Level Destructor * WaterLevel destructor
*/ */
~WaterLevel(); ~WaterLevel();
/** /**
* @return bool returns whether liquid has gone above sensor * @return bool Determines whether liquid has risen above the sensor
*/ */
bool isSubmerged(); bool isSubmerged();

View File

@ -63,9 +63,9 @@ namespace upm {
* @web http://www.seeedstudio.com/wiki/Grove_%E2%80%93_Serial_MP3_Player * @web http://www.seeedstudio.com/wiki/Grove_%E2%80%93_Serial_MP3_Player
* @con uart * @con uart
* *
* @brief API for the WT5001 Serial MP3 module * @brief API for the WT5001 Serial MP3 Module
* *
* UPM support for the WT5001 Serial MP3 Module. This was tested * UPM support for the WT5001 Serial MP3 module. This was tested
* specifically with the Grove Serial MP3 module. * specifically with the Grove Serial MP3 module.
* *
* @image html wt5001.jpg * @image html wt5001.jpg
@ -120,220 +120,220 @@ namespace upm {
} WT5001_PLAYSOURCE_T; } WT5001_PLAYSOURCE_T;
/** /**
* WT5001 Serial MP3 module constructor * WT5001 constructor
* *
* @param uart default uart to use (0 or 1) * @param uart Default UART to use (0 or 1)
*/ */
WT5001(int uart); WT5001(int uart);
/** /**
* WT5001 Serial MP3 module Destructor * WT5001 destructor
*/ */
~WT5001(); ~WT5001();
/** /**
* 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. * @param millis Number of milliseconds to wait; 0 means no waiting
* @return true if there is data available to be read * @return True if there is data available for reading
*/ */
bool dataAvailable(unsigned int millis); bool dataAvailable(unsigned int millis);
/** /**
* read any available data into a user-supplied buffer. Note, the * Reads any available data in a user-supplied buffer. Note: the
* call will block until data is available to be read. Use * call blocks until data is available to be read. Use
* dataAvailable() to determine whether there is data available * dataAvailable() to determine whether there is data available
* beforehand, to avoid blocking. * beforehand, to avoid blocking.
* *
* @param buffer the buffer to hold the data read * @param buffer Buffer to hold the data read
* @param len the length of the buffer * @param len Length of the buffer
* @return the number of bytes read * @return Number of bytes read
*/ */
int readData(char *buffer, size_t len); 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 buffer Buffer to hold the data read
* @param len the length of the buffer * @param len Length of the buffer
* @return the number of bytes written * @return Number of bytes written
*/ */
int writeData(char *buffer, size_t len); int writeData(char *buffer, size_t len);
/** /**
* setup the proper tty i/o modes and the baudrate. The default * Sets up proper tty I/O modes and the baud rate. The default
* baud rate is 9600 (B9600). * baud rate is 9,600 (B9600).
* *
* @param baud the desired baud rate. * @param baud Desired baud rate.
* @return true if successful * @return True if successful
*/ */
bool setupTty(speed_t baud=B9600); bool setupTty(speed_t baud=B9600);
/** /**
* Get a command response and return it's validity * Gets a command response and returns its validity
* *
* @param index opcode to verify * @param index Opcode to verify
* @return true if successful * @return True if successful
*/ */
bool checkResponse(WT5001_OPCODE_T opcode); bool checkResponse(WT5001_OPCODE_T opcode);
/** /**
* play a file, from a source * Plays a file from a source
* *
* @param psrc the play source (SD, UDISK, SPI) * @param psrc Play source (SD, UDISK, SPI)
* @param index file number to play * @param index File number to play
* @return true if successful * @return True if successful
*/ */
bool play(WT5001_PLAYSOURCE_T psrc, uint16_t index); bool play(WT5001_PLAYSOURCE_T psrc, uint16_t index);
/** /**
* stop playing * Stops playing
* *
* @return true if successful * @return True if successful
*/ */
bool stop(); bool stop();
/** /**
* pause playback, or resume playback if already paused * Pauses the playback or resumes it if already paused
* *
* @return true if successful * @return True if successful
*/ */
bool pause(); bool pause();
/** /**
* go to next track * Moves to the next track
* *
* @return true if successful * @return True if successful
*/ */
bool next(); bool next();
/** /**
* go to previous track * Moves to the previous track
* *
* @return true if successful * @return True if successful
*/ */
bool previous(); bool previous();
/** /**
* set the volume. Range is between 0-31. 0 means mute. * Sets the volume. Valid range is 0-31. 0 means mute.
* *
* @return true if successful * @return True if successful
*/ */
bool setVolume(uint8_t vol); bool setVolume(uint8_t vol);
/** /**
* queue a track to play next, when current song is finished * Queues a track to play next, when the current song is finished
* *
* @param index file number to queue * @param index File number to queue
* @return true if successful * @return True if successful
*/ */
bool queue(uint16_t index); bool queue(uint16_t index);
/** /**
* set the playback mode * Sets the playback mode
* *
* @param pm play mode to enable * @param pm Play mode to enable
* @return true if successful * @return True if successful
*/ */
bool setPlayMode(WT5001_PLAYMODE_T pm); bool setPlayMode(WT5001_PLAYMODE_T pm);
/** /**
* insert a track to play immediately, interrupting the current * Inserts a track to play immediately, interrupting the current
* track. When the inserted track is finished playing, the * track. When the inserted track is finished, the
* interrupted track will resume where it was interrupted. * interrupted track resumes where it was interrupted.
* *
* @param index file number to insert * @param index File number to insert
* @return true if successful * @return True if successful
*/ */
bool insert(uint16_t index); bool insert(uint16_t index);
/** /**
* set the date of the internal clock * Sets the date of the internal clock
* *
* @param year 4 digit year * @param year 4-digit year
* @param month the month * @param month Month
* @param day the day * @param day Day
* @return true if successful * @return True if successful
*/ */
bool setDate(uint16_t year, uint8_t month, uint8_t day); bool setDate(uint16_t year, uint8_t month, uint8_t day);
/** /**
* set the time of the internal clock * Sets the time of the internal clock
* *
* @param hour hour * @param hour Hour
* @param minute minute * @param minute Minute
* @param second second * @param second Second
* @return true if successful * @return True if successful
*/ */
bool setTime(uint8_t hour, uint8_t minute, uint8_t second); bool setTime(uint8_t hour, uint8_t minute, uint8_t second);
/** /**
* set the alarm * Sets the alarm
* *
* @param hour hour * @param hour Hour
* @param minute minute * @param minute Minute
* @param second second * @param second Second
* @return true if successful * @return True if successful
*/ */
bool setAlarm(uint8_t hour, uint8_t minute, uint8_t second); bool setAlarm(uint8_t hour, uint8_t minute, uint8_t second);
/** /**
* clear any alarm that has been set * Clears any alarm that has been set
* *
* @return true if successful * @return True if successful
*/ */
bool clearAlarm(); bool clearAlarm();
/** /**
* get the current volume * Gets the current volume
* *
* @param vol the returned volume * @param vol Volume
* @return true if successful * @return True if successful
*/ */
bool getVolume(uint8_t *vol); bool getVolume(uint8_t *vol);
/** /**
* get the current play state. 1 = playing, 2 = stopped, 3 = paused * Gets the current play state: 1 = playing, 2 = stopped, 3 = paused
* *
* @param ps the returned play state * @param ps Play state
* @return true if successful * @return True if successful
*/ */
bool getPlayState(uint8_t *ps); bool getPlayState(uint8_t *ps);
/** /**
* get the number of files present on the source device * Gets the number of files present on the source device
* *
* @param psrc the storage source * @param psrc Storage source
* @param numf the returned number of files * @param numf Number of files
* @return true if successful * @return True if successful
*/ */
bool getNumFiles(WT5001_PLAYSOURCE_T psrc, uint16_t *numf); bool getNumFiles(WT5001_PLAYSOURCE_T psrc, uint16_t *numf);
/** /**
* get the index of the current file * Gets the index of the current file
* *
* @param curf the index of the current file * @param curf Index of the current file
* @return true if successful * @return True if successful
*/ */
bool getCurrentFile(uint16_t *curf); bool getCurrentFile(uint16_t *curf);
/** /**
* get the device date * Gets the device date
* *
* @param year returned 4 digit year * @param year 4-digit year
* @param month returned month * @param month Month
* @param day returned day * @param day Day
* @return true if successful * @return True if successful
*/ */
bool getDate(uint16_t *year, uint8_t *month, uint8_t *day); bool getDate(uint16_t *year, uint8_t *month, uint8_t *day);
/** /**
* get the device time * Gets the device time
* *
* @param hour returned hour * @param hour Hour
* @param minute returned minute * @param minute Minute
* @param second returned second * @param second Second
* @return true if successful * @return True if successful
*/ */
bool getTime(uint8_t *hour, uint8_t *minute, uint8_t *second); bool getTime(uint8_t *hour, uint8_t *minute, uint8_t *second);

View File

@ -28,7 +28,7 @@
namespace upm { namespace upm {
/** /**
* @brief YG1006 flame sensor library * @brief YG1006 Flame Sensor library
* @defgroup yg1006 libupm-yg1006 * @defgroup yg1006 libupm-yg1006
* @ingroup seeed gpio light hak * @ingroup seeed gpio light hak
*/ */
@ -43,10 +43,10 @@ namespace upm {
* @con gpio * @con gpio
* @kit hak * @kit hak
* *
* @brief API for the YG1006 flame sensor * @brief API for the YG1006 Flame Sensor
* *
* UPM module for the YG1006 flame sensor. It detects flame or any * UPM module for the YG1006 flame sensor. It detects a flame or any
* other light in the 760nm - 1100nm wavelength range. * other light source in the 760-1,100 nm wavelength range.
* *
* @image html yg1006.jpg * @image html yg1006.jpg
* @snippet yg1006.cxx Interesting * @snippet yg1006.cxx Interesting
@ -54,19 +54,19 @@ namespace upm {
class YG1006 { class YG1006 {
public: public:
/** /**
* YG1006 digital flame sensor constructor * YG1006 constructor
* *
* @param pin digital pin to use * @param pin Digital pin to use
*/ */
YG1006(int pin); YG1006(int pin);
/** /**
* YG1006 Destructor * YG1006 destructor
*/ */
~YG1006(); ~YG1006();
/** /**
* Determine whether a flame has been detected * Determines whether a flame has been detected
* *
* @return True if a flame or other comparable light source is detected * @return True if a flame or another comparable light source has been detected
*/ */
bool flameDetected(); bool flameDetected();

View File

@ -59,7 +59,7 @@
namespace upm { namespace upm {
/** /**
* @brief ZFM-20 fingerprint sensor module library * @brief ZFM-20 Fingerprint Sensor Module library
* @defgroup zfm20 libupm-zfm20 * @defgroup zfm20 libupm-zfm20
* @ingroup seeed uart touch * @ingroup seeed uart touch
*/ */
@ -73,14 +73,14 @@ namespace upm {
* @man seeed * @man seeed
* @con uart * @con uart
* *
* @brief API for the ZFM-20 fingerprint sensor module * @brief API for the ZFM-20 Fingerprint Sensor Module
* *
* This class was tested on the Grove Fingerprint Sensor * This class was tested on the Grove Fingerprint Sensor
* Module. It can store up to 163 fingerprints. * Module. It can store up to 163 fingerprints.
* *
* It is connected via a UART at 57600 baud. * It is connected via a UART at 57,600 baud.
* *
* @image html zfm20.jpg * @image html zfm20.jpg
* This example demonstrates how to register and store a new fingerprint * This example demonstrates how to register and store a new fingerprint
* @snippet zfm20-register.cxx Interesting * @snippet zfm20-register.cxx Interesting
* This example demonstrates reading a fingerprint and locating it in the DB * This example demonstrates reading a fingerprint and locating it in the DB
@ -138,7 +138,7 @@ namespace upm {
ERR_INVALID_REG = 0x1a, ERR_INVALID_REG = 0x1a,
ERR_INVALID_ADDR = 0x20, ERR_INVALID_ADDR = 0x20,
ERR_NEEDS_PWD = 0x21, ERR_NEEDS_PWD = 0x21,
// end of module specific errors // end of module-specific errors
ERR_INTERNAL_ERR = 0xff // API internal error ERR_INTERNAL_ERR = 0xff // API internal error
} ZFM20_ERRORS_T; } ZFM20_ERRORS_T;
@ -150,215 +150,215 @@ namespace upm {
} ZFM20_PKTCODES_T; } ZFM20_PKTCODES_T;
/** /**
* ZFM20 module constructor * ZFM20 constructor
* *
* @param uart default uart to use (0 or 1) * @param uart Default UART to use (0 or 1)
*/ */
ZFM20(int uart); ZFM20(int uart);
/** /**
* ZFM20 module Destructor * ZFM20 destructor
*/ */
~ZFM20(); ~ZFM20();
/** /**
* 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. * @param millis Number of milliseconds to wait; 0 means no waiting
* @return true if there is data available to be read * @return true if there is data available for reading
*/ */
bool dataAvailable(unsigned int millis); bool dataAvailable(unsigned int millis);
/** /**
* read any available data into a user-supplied buffer. Note, the * Reads any available data in a user-supplied buffer. Note: the
* call will block until data is available to be read. Use * call blocks until data is available to be read. Use
* dataAvailable() to determine whether there is data available * dataAvailable() to determine whether there is data available
* beforehand, to avoid blocking. * beforehand, to avoid blocking.
* *
* @param buffer the buffer to hold the data read * @param buffer Buffer to hold the data read
* @param len the length of the buffer * @param len Length of the buffer
* @return the number of bytes read * @return Number of bytes read
*/ */
int readData(char *buffer, size_t len); 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 buffer Buffer to hold the data read
* @param len the length of the buffer * @param len Length of the buffer
* @return the number of bytes written * @return Number of bytes written
*/ */
int writeData(char *buffer, size_t len); int writeData(char *buffer, size_t len);
/** /**
* setup the proper tty i/o modes and the baudrate. The default * Sets up proper tty I/O modes and the baud rate. For this device,
* baud rate is 57600 (B57600) for this device. * the default baud rate is 57,600 (B57600).
* *
* @param baud the desired baud rate. * @param baud Desired baud rate.
* @return true if successful * @return True if successful
*/ */
bool setupTty(speed_t baud=B57600); bool setupTty(speed_t baud=B57600);
/** /**
* compose and write a command packet * Composes and writes a command packet
* *
* @param pkt the packet * @param pkt Packet
* @param len length of packet * @param len Length of packet
* @return the number of bytes written * @return Number of bytes written
*/ */
int writeCmdPacket(unsigned char *pkt, int len); int writeCmdPacket(unsigned char *pkt, int len);
/** /**
* verify the packet header and indicate it's validity * Verifies the packet header and indicates its validity
* *
* @param pkt the packet to check * @param pkt Packet to check
* @return true if valid checksum, false otherwise * @return True if the checksum is valid, false otherwise
*/ */
bool verifyPacket(unsigned char *pkt); bool verifyPacket(unsigned char *pkt);
/** /**
* Return the number of milliseconds elapsed since initClock() * Returns the number of milliseconds elapsed since initClock()
* was last called. * was last called
* *
* @return elapsed milliseconds * @return Elapsed milliseconds
*/ */
uint32_t getMillis(); uint32_t getMillis();
/** /**
* Reset the Clock * Resets the clock
* *
*/ */
void initClock(); void initClock();
/** /**
* set the address that should be used to access the module * Sets the address that should be used to access the module
* *
* @param addr the address to use * @param addr Address to use
*/ */
void setAddress(uint32_t addr) { m_address = addr; }; void setAddress(uint32_t addr) { m_address = addr; };
/** /**
* set the password that should be used to access the module * Sets the password that should be used to access the module
* *
* @param pw password to use * @param pw Password to use
*/ */
void setPassword(uint32_t pw) { m_password = pw; }; void setPassword(uint32_t pw) { m_password = pw; };
/** /**
* get the returned data from a request * Gets the returned data from a request
* *
* @param pkt the buffer to store the returned data into * @param pkt Buffer to store the returned data
* @param len the expected response length. pkt should be at least this * @param len Expected response length; pkt should be at least this
* big. * large
* @return true if successful * @return True if successful
*/ */
bool getResponse(unsigned char *pkt, int len); bool getResponse(unsigned char *pkt, int len);
/** /**
* verify and authenticate to the module. The password used is * Verifies and authenticates to the module. The password used is
* the one last set by setPassword(). * the last one set by setPassword().
* *
* @return true if successful * @return True if successful
*/ */
bool verifyPassword(); bool verifyPassword();
/** /**
* query the module for the number of stored templates * Queries the module for the number of stored templates
* (fingerprints). * (fingerprints).
* *
* @return the number of currently stored templates * @return Number of currently stored templates
*/ */
int getNumTemplates(); int getNumTemplates();
/** /**
* set a new password for the module. This passowrd will be * Sets a new password for the module. This passowrd is
* stored on the module, and will be required in order to access * stored in the module, and is required to access
* the module in the future. * the module in the future.
* *
* @param pwd the new password to set on the module * @param pwd New password to set on the module
* @return true if successful * @return True if successful
*/ */
bool setNewPassword(uint32_t pwd); bool setNewPassword(uint32_t pwd);
/** /**
* set a new address for the module. This address will be * Sets a new address for the module. This address is
* stored on the module, and will be required in order to access * stored in the module, and is required to access
* the module in the future. * the module in the future.
* *
* @param addr the new address to set on the module * @param addr New address to set on the module
* @return true if successful * @return True if successful
*/ */
bool setNewAddress(uint32_t addr); bool setNewAddress(uint32_t addr);
/** /**
* generate a new fingerprint image (scan a fingerprint) * Generates a new fingerprint image (scans a fingerprint)
* *
* @return one of the ZFM20_ERRORS_T values * @return One of the ZFM20_ERRORS_T values
*/ */
uint8_t generateImage(); uint8_t generateImage();
/** /**
* convert the image in the image buffer (generated by * Converts the image in the image buffer (generated by
* generateImage()) and store it in one of the two characteristics * generateImage()) and stores it in one of the two characteristics
* buffers, 1 or 2 * buffers, 1 or 2
* *
* @param slot the characteristics buffer to use. Must be 1 or 2. * @param slot Characteristics buffer to use; must be 1 or 2
* @return one of the ZFM20_ERRORS_T values * @return One of the ZFM20_ERRORS_T values
*/ */
uint8_t image2Tz(int slot); uint8_t image2Tz(int slot);
/** /**
* based on the two characteristics bufferes (1 & 2), create a * Based on the two characteristics buffers (1 & 2), creates a
* fingerprint model. Once a model has been successfully created, * fingerprint model. Once a model is successfully created,
* it can be stored in the module with storeModel(). * it can be stored in the module with storeModel().
* *
* @return one of the ZFM20_ERRORS_T values * @return One of the ZFM20_ERRORS_T values
*/ */
uint8_t createModel(); uint8_t createModel();
/** /**
* once a fingerprint model has been created, this method can be * Once a fingerprint model is created, this method can be
* used to store it (via one of the characteristics buffers) in a * used to store it (via one of the characteristics buffers) in a
* given location. * given location.
* *
* @param slot the characteristics buffer to store (1 or 2) * @param slot Characteristics buffer to store the model, 1 or 2
* @param id the location in which to store the model * @param id Location to store the model
* @return one of the ZFM20_ERRORS_T values * @return One of the ZFM20_ERRORS_T values
*/ */
uint8_t storeModel(int slot, uint16_t id); uint8_t storeModel(int slot, uint16_t id);
/** /**
* delete a stored model. * Deletes a stored model
* *
* @param id the location containing the model to delete * @param id Location containing the model to delete
* @return one of the ZFM20_ERRORS_T values * @return One of the ZFM20_ERRORS_T values
*/ */
uint8_t deleteModel(uint16_t id); uint8_t deleteModel(uint16_t id);
/** /**
* delete the model database * Deletes the model database (DB)
* *
* @return one of the ZFM20_ERRORS_T values * @return One of the ZFM20_ERRORS_T values
*/ */
uint8_t deleteDB(); uint8_t deleteDB();
/** /**
* search the fingerprint DB and return the id and score, if found * Searches the fingerprint DB and returns an ID and score, if found
* *
* *
* @param slot the slot containing a converted image to search for * @param slot Slot containing a converted image to search for
* @param id the returned id if found, 0 otherwise * @param id ID if found, 0 otherwise
* @param score the returned score if found, 0 otherwise * @param score Score if found, 0 otherwise
* @return one of the ZFM20_ERRORS_T values * @return One of the ZFM20_ERRORS_T values
*/ */
uint8_t search(int slot, uint16_t *id, uint16_t *score); uint8_t search(int slot, uint16_t *id, uint16_t *score);
/** /**
* compares the features in characteristic buffers 1 and 2 and * Compares the features in characteristics buffers 1 and 2 and
* returns a score if they match * returns a score if they match
* *
* @param score the returned score * @param score Score
* @return one of the ZFM20_ERRORS_T values * @return One of the ZFM20_ERRORS_T values
*/ */
uint8_t match(uint16_t *score); uint8_t match(uint16_t *score);