From 9db2d57de32b4b15a71d31985f41bc03a0a41458 Mon Sep 17 00:00:00 2001 From: VadimPopov Date: Fri, 7 Aug 2015 20:33:46 +0300 Subject: [PATCH] docs: header files for sensors starting with [a] reviewed. Signed-off-by: Mihai Tudor Panu --- src/a110x/a110x.h | 18 ++-- src/ad8232/ad8232.h | 30 +++--- src/adafruitms1438/adafruitms1438.h | 84 +++++++-------- src/adafruitss/adafruitss.h | 32 +++--- src/adc121c021/adc121c021.h | 152 ++++++++++++++-------------- src/adis16448/adis16448.h | 88 ++++++++++------ src/adxl335/adxl335.h | 53 +++++----- src/adxl345/adxl345.h | 33 +++--- src/am2315/am2315.h | 75 +++++++------- src/apds9002/apds9002.h | 16 +-- src/at42qt1070/at42qt1070.h | 106 +++++++++---------- 11 files changed, 359 insertions(+), 328 deletions(-) diff --git a/src/a110x/a110x.h b/src/a110x/a110x.h index b8833e80..d18b811d 100644 --- a/src/a110x/a110x.h +++ b/src/a110x/a110x.h @@ -63,32 +63,32 @@ namespace upm { /** * A110x digital sensor constructor * - * @param pin digital pin to use + * @param pin Digital pin to use */ A110X(int pin); /** - * A110X Destructor + * A110X destructor */ ~A110X(); /** - * Determine whether a magnetic field of south polarity has been detected + * Determines whether a magnetic field of south polarity has been detected * * @return True if magnetic field detected */ bool magnetDetected(); /** - * Install an Interrupt Service Routine (ISR) to be called when - * the appropriate magnetic field is detected. + * Installs an interrupt service routine (ISR) to be called when + * the appropriate magnetic field is detected * - * @param fptr function pointer to function to be called on interrupt - * @param arg pointer to an object that will be supplied as an - * arguement to the ISR. + * @param fptr Pointer to a function to be called on interrupt + * @param arg Pointer to an object to be supplied as an + * argument to the ISR. */ void installISR(void (*isr)(void *), void *arg); /** - * Uninstall the previously installed Interrupt Service Routine (ISR) + * Uninstalls the previously installed ISR * */ void uninstallISR(); diff --git a/src/ad8232/ad8232.h b/src/ad8232/ad8232.h index ff1502cd..df796eda 100644 --- a/src/ad8232/ad8232.h +++ b/src/ad8232/ad8232.h @@ -34,7 +34,7 @@ namespace upm { /** - * @brief AD8232 heart rate monitor library + * @brief AD8232 Heart Rate Monitor library * @defgroup ad8232 libupm-ad8232 * @ingroup sparkfun gpio medical */ @@ -50,17 +50,17 @@ namespace upm { * * @brief UPM module for the AD8232 Heart Rate Monitor * - * Note, this sensor must be driven at 3.3v only. + * Note: this sensor must be driven at 3.3v only. * - * This module will simply spit out the ADC values reported by the - * sensor, with the intent being to send that data somewhere (via - * serial or network port) to another piece of software running on a - * computer that will plot the data for you, like an EKG. + * This module simply spits out the ADC values reported by the sensor, with + * the intent to send that data, via serial or network port, somewhere to + * another piece of software running on a computer that plots the data for + * you, like an EKG. * - * Processing (https://www.processing.org/), is a piece of software - * that should work, using information from the Sparkfun website. + * Processing (https://www.processing.org/) is software + * that should work, using information from the SparkFun website. * - * This example just dumps the raw data. + * This example just dumps the raw data: * * @image html ad8232.jpg *
AD8232 Heart Rate Monitor image provided by SparkFun under @@ -76,20 +76,20 @@ namespace upm { /** * AD8232 constructor * - * @param loPlus digital pin to use for LO+ - * @param loMinus digital pin to use LO- - * @param output analog pin to use for reading the data + * @param loPlus Digital pin to use for LO+ + * @param loMinus Digital pin to use for LO- + * @param output Analog pin to read the data */ AD8232(int loPlus, int loMinus, int output, float aref=AD8232_DEFAULT_AREF); /** - * AD8232 Destructor + * AD8232 destructor */ ~AD8232(); /** - * return the current ADC value for the device output pin. If an - * LO (Leads Off) event is detected, 0 will be returned. + * Returns the current ADC value for the device output pin. If an + * LO (leads off) event is detected, 0 is returned. * * @return ADC value */ diff --git a/src/adafruitms1438/adafruitms1438.h b/src/adafruitms1438/adafruitms1438.h index c5cf5d74..7f28a52e 100644 --- a/src/adafruitms1438/adafruitms1438.h +++ b/src/adafruitms1438/adafruitms1438.h @@ -52,16 +52,16 @@ namespace upm { * @web http://www.adafruit.com/products/1438 * @con i2c * - * @brief API for the ADAFRUITMS1438 motor shield + * @brief API for the AdafruitMS1438 Motor Shield * * This class implements support for the stepper and DC motors that * can be connected to this Motor Shield. - * NOTE: The two servo connections are not actually controlled by - * the pca9685 controller (or this class), rather they are connected - * directly to digital PWM pins 9 and 10 on the arduino breakout. + * Note: the two servo connections are not controlled by the PCA9685 + * controller (or this class). They are connected directly to digital + * PWM pins 9 and 10 on the Arduino breakout board. * * @image html adafruitms1438.jpg - * An example using a DC motor conected to M3 + * An example using a DC motor connected to M3 * @snippet adafruitms1438.cxx Interesting * An example using a stepper motor connected to M1 & M2 * @snippet adafruitms1438-stepper.cxx Interesting @@ -89,7 +89,7 @@ namespace upm { } DCMOTORS_T; /** - * Enum to specify a Stepper motor + * Enum to specify a stepper motor */ typedef enum { STEPMOTOR_M12 = 0, @@ -99,62 +99,62 @@ namespace upm { /** * AdafruitMS1438 constructor * - * @param bus i2c bus to use - * @param address the address for this sensor + * @param bus I2C bus to use + * @param address Address for this sensor */ AdafruitMS1438(int bus, uint8_t address = ADAFRUITMS1438_DEFAULT_I2C_ADDR); /** - * AdafruitMS1438 Destructor + * AdafruitMS1438 destructor */ ~AdafruitMS1438(); /** - * Return the number of milliseconds elapsed since initClock(...) + * Returns the number of milliseconds elapsed since initClock(...) * was last called. * - * @return elapsed milliseconds + * @return Elapsed milliseconds */ uint32_t getMillis(STEPMOTORS_T motor); /** - * Reset the Clock + * Resets the clock * */ void initClock(STEPMOTORS_T motor); /** - * Set the PWM period. Note this applies to all PWM channels. + * Sets the PWM period. Note: this applies to all PWM channels. * - * @param hz set the PWM period + * @param hz Sets the PWM period */ void setPWMPeriod(float hz); /** - * enable PWM output for a motor + * Enables PWM output for a motor * - * @param motor the DC motor to enable + * @param motor DC motor to enable */ void enableMotor(DCMOTORS_T motor); /** - * disable PWM output for a motor + * Disables PWM output for a motor * - * @param motor the DC motor to disable + * @param motor DC motor to disable */ void disableMotor(DCMOTORS_T motor); /** - * enable output for a stepper motor + * Enables output for a stepper motor * - * @param motor the stepper motor to enable + * @param motor Stepper motor to enable */ void enableStepper(STEPMOTORS_T motor); /** - * disable output for a stepper motor + * Disable output for a stepper motor * - * @param motor the stepper motor to disable + * @param motor Stepper motor to disable */ void disableStepper(STEPMOTORS_T motor); @@ -168,57 +168,57 @@ namespace upm { void setMotorSpeed(DCMOTORS_T motor, int speed); /** - * set the speed of a stepper in revolution per minute (RPM) + * Sets the speed of a stepper in revolutions per minute (RPM) * - * @param motor the DC motor to configure - * @param speed speed to set the motor to + * @param motor DC motor to configure + * @param speed Speed to set the motor to */ void setStepperSpeed(STEPMOTORS_T motor, int speed); /** - * set the direction of a DC motor, clockwise or counter clockwise + * Sets the direction of a DC motor, clockwise or counterclockwise * - * @param motor the DC motor to configure - * @param dir direction to set the motor to + * @param motor DC motor to configure + * @param dir Direction to set the motor in */ void setMotorDirection(DCMOTORS_T motor, DIRECTION_T dir); /** - * set the direction of a stepper motor, clockwise or counter clockwise + * Sets the direction of a stepper motor, clockwise or counterclockwise * - * @param motor the stepper motor to configure - * @param dir direction to set the motor to + * @param motor Stepper motor to configure + * @param dir Direction to set the motor in */ void setStepperDirection(STEPMOTORS_T motor, DIRECTION_T dir); /** - * set a stepper motor configuration + * Sets a stepper motor configuration * - * @param motor the stepper motor to configure - * @param stepsPerRev the number of step to complete a full revolution + * @param motor Stepper motor to configure + * @param stepsPerRev Number of steps to complete a full revolution */ void stepConfig(STEPMOTORS_T motor, unsigned int stepsPerRev); /** - * step a stepper motor a specified number of steps + * Steps a stepper motor a specified number of steps * - * @param motor the stepper motor to step - * @param steps number of steps to move the stepper motor + * @param motor Stepper motor to step + * @param steps Number of steps to move the stepper motor */ void stepperSteps(STEPMOTORS_T motor, unsigned int steps); private: - // SWIG will generate warning for these 'nested structs', however - // those can be ignored as these structs are never exposed. + // SWIG will generate a warning for these 'nested structs'; however, + // it can be ignored as these structs are never exposed. - // struct to hold mappings of the dc motors + // struct to hold mappings of DC motors typedef struct { int pwm; int in1; int in2; } DC_PINMAP_T; - // struct to hold mappings of the stepper motors + // struct to hold mappings of stepper motors typedef struct { int pwmA; int in1A; @@ -228,7 +228,7 @@ namespace upm { int in2B; } STEPPER_PINMAP_T; - // struct to hold some information about each stepper + // struct to hold information about each stepper typedef struct { int stepsPerRev; // steps per revolution int currentStep; // current step number diff --git a/src/adafruitss/adafruitss.h b/src/adafruitss/adafruitss.h index 88ec8c73..e9dbb75c 100644 --- a/src/adafruitss/adafruitss.h +++ b/src/adafruitss/adafruitss.h @@ -55,7 +55,7 @@ namespace upm { /** - * @brief Adafruit PCA9685 based servo controller library + * @brief Adafruit PCA9685-based Servo Shield library * @defgroup adafruitss libupm-adafruitss * @ingroup adafruit i2c servos */ @@ -69,13 +69,12 @@ namespace upm { * @web http://www.adafruit.com/product/1411 * @con i2c * + * @brief API for the Adafruit Servo Shield * - * @brief API for Adafruit Servo Shield - * - * UPM library for the PCA9685 based Adafruit 16-channel servo shield. When 3 - * or more GWS servos attached results unpredictable. Adafruit do recommend a - * capacitor be installed on the board which should alleviate the issue. - * Sizing depends on servos and count. + * UPM library for the PCA9685-based Adafruit 16-channel servo shield. If 3 + * or more GWS servos are attached, results could be unpredictable. Adafruit + * Industries recommend installing a capacitor on the board, which should + * alleviate the issue. Sizing depends on servos and their number. * * @image html adafruitss.jpg * @snippet adafruitss.cxx Interesting @@ -84,25 +83,26 @@ namespace upm { class adafruitss { public: /** - * Creates a adafruitss object + * Creates an adafruitss object * - * @param bus number of used i2c bus - * @param i2c_address address of servo controller on i2c bus + * @param bus Number of the used I2C bus + * @param i2c_address Address of the servo shield on the I2C bus */ adafruitss(int bus, int i2c_address); int update(void); /** - * Sets the frequency for your servos + * Sets the frequency of the servos * - * @param freq the frequency at which the servos operate + * @param freq Frequency at which the servos operate */ void setPWMFreq(float freq); /** - * Moves the one of the servos to the specified angle + * Moves one of the servos to a specified angle * - * @param port port of the servo on the controller (servo number) - * @param servo_type can be 0 = standard 1ms to 2ms, 1 = extended 0.6ms to 2.4ms, or 2 = extended 0.8ms to 2.2ms - * @param degrees angle to set the servo to + * @param port Port of the servo on the shield (servo number) + * @param servo_type Can be 0 = standard (1ms to 2ms), 1 = extended + * (0.6ms to 2.4ms), or 2 = extended (0.8ms to 2.2ms) + * @param degrees Angle to set the servo to */ void servo(uint8_t port, uint8_t servo_type, float degrees); diff --git a/src/adc121c021/adc121c021.h b/src/adc121c021/adc121c021.h index 3f201e51..8a2519db 100644 --- a/src/adc121c021/adc121c021.h +++ b/src/adc121c021/adc121c021.h @@ -49,14 +49,14 @@ namespace upm { /** - * @brief ADC121C021 I2C analog digital converter library + * @brief ADC121C021 I2C Analog-to-Digital Converter library * @defgroup adc121c021 libupm-adc121c021 * @ingroup seeed i2c electric */ /** - * valid cycle times for automatic conversion mode + * Valid cycle times for the automatic conversion mode */ typedef enum { ADC121C021_CYCLE_NONE = 0, // disabled @@ -72,18 +72,18 @@ namespace upm { /** * @library adc121c021 * @sensor adc121c021 - * @comname ADC121C021 Analog Digital Converter + * @comname ADC121C021 Analog-to-Digital Converter * @altname Grove I2C ADC * @type electric * @man seeed * @web http://www.seeedstudio.com/depot/Grove-I2C-ADC-p-1580.html * @con i2c * - * @brief API for the ADC121C021 I2C ADC + * @brief API for the ADC121C021 I2C Analog-to-Digital Converter * - * UPM module for the ADC121C021 12 bit Analog to Digital (ADC) converter. - * By providing a constant reference voltage, this sensor helps - * to increase the accuracy of a value collected from an analog sensor. + * UPM module for the ADC121C021 12-bit analog-to-digital converter (ADC). + * By constantly providing a reference voltage, this sensor helps + * increase the accuracy of a value collected from an analog sensor. * * @image html adc121c021.jpg * @snippet adc121c021.cxx Interesting @@ -91,208 +91,212 @@ namespace upm { class ADC121C021 { public: /** - * adc121c021 ADC constructor + * ADC121C021 ADC constructor * - * @param bus i2c bus to use - * @param address the address for this sensor; default is 0x55 - * @param vref reference voltage for this sensor; default is 3.0 + * @param bus I2C bus to use + * @param address Address for this sensor; default is 0x55 + * @param vref Reference voltage for this sensor; default is 3.0v */ ADC121C021(int bus, uint8_t address = ADC121C021_DEFAULT_I2C_ADDR, float vref = ADC121C021_DEFAULT_VREF); /** - * ADC121C021 Destructor + * ADC121C021 destructor */ ~ADC121C021(); /** - * Write byte value into register + * Writes a byte value into the register * - * @param reg register location to write into - * @param byte byte to write + * @param reg Register location to write into + * @param byte Byte to write * @return 0 (MRAA_SUCCESS) if successful; non-zero otherwise */ mraa_result_t writeByte(uint8_t reg, uint8_t byte); /** - * Write word value into register + * Writes a word value into the register * - * @param reg register location to write into - * @param word word to write + * @param reg Register location to write into + * @param word Word to write * @return 0 (MRAA_SUCCESS) if successful; non-zero otherwise */ mraa_result_t writeWord(uint8_t reg, uint16_t word); /** - * Read byte value from register + * Reads the byte value from the register * - * @param reg register location to read from - * @return value at specified register + * @param reg Register location to read from + * @return Value in the specified register */ uint8_t readByte(uint8_t reg); /** - * Read word value from register + * Reads the word value from the register * - * @param reg register location to read from - * @return value at specified register + * @param reg Register location to read from + * @return Value in the specified register */ uint16_t readWord(uint8_t reg); /** - * Read current value of conversion + * Reads the current value of conversion * - * @return current conversion value + * @return Current value of conversion */ uint16_t value(); /** - * Convert a supplied value to voltage based on set VREF + * Converts a supplied value to voltage based on the set vref * - * @param val value of conversion (from value()) - * @return conversion value in volts + * @param val Value of conversion (from value()) + * @return Value of conversion in volts */ float valueToVolts(uint16_t val); /** - * Read current status of the alert flag. If the flag is set, the - * lower or upper alert indicators will be set as appropriate, and + * Reads the current status of the alert flag. If the flag is set, the + * low or high alert indicators are set as appropriate, and * you can access these values with alertLowTriggered() or * alertHighTriggered(). * - * @return true if the alert flag is set + * @return True if the alert flag is set */ bool getAlertStatus(); /** - * Return the current value of m_alertLow. You must call + * Returns the current value of m_alertLow. You must call * getAlertStatus() to update this value. * - * @return current alert low status + * @return Current status of the alert low flag */ bool alertLowTriggered() { return m_alertLow; }; /** - * Return the current value of m_alertHigh. You must call + * Returns the current value of m_alertHigh. You must call * getAlertStatus() to update this value. * - * @return current alert high status + * @return Current status of the alert high flag */ bool alertHighTriggered() { return m_alertHigh; }; /** - * Clear the alert low and high flags. This will also clear the + * Clears the alert low and alert high flags. This also clears the * last stored alert values. */ void clearAlertStatus(); /** - * Enable or disable the Alert Flag functionality. If enabled, - * then when the measured value exceeds the low or high limits - * configured, the alert flag will be set. Use getAlertStatus() + * Enables or disables the alert flag functionality. If enabled, + * when the measured value exceeds the low or high limits + * configured, the alert flag is set. Use getAlertStatus() * to access these values. * - * @param enable if true, enables Alert Flag; otherwise, disables Alert Flag + * @param enable If true, enables the alert flag; otherwise, disables the + * alert flag */ void enableAlertFlag(bool enable); /** - * Enable or disable the Alert Pin functionality. + * Enables or disables the alert pin functionality. * - * @param enable if true, enables Alert Pin; otherwise, disables Alert Pin + * @param enable If true, enables the alert pin; otherwise, disables the + * alert pin */ void enableAlertPin(bool enable); /** - * Enable or disable the Alert Hold functionality. When Alert - * Hold is enabled, the alert status remains until manually - * cleared via clearAlertStatus(). Otherwise, the alert will self - * clear when the value moves into the defined limits if alerts + * Enables or disables the alert hold functionality. When the alert + * hold is enabled, the alert status remains until manually + * cleared via clearAlertStatus(). Otherwise, the alert self-clears + * when the value moves into the defined limits if alerts * are enabled via enableAlertFlag(). * - * @param enable if true, enables Alert Hold; otherwise, disables Alert Hold + * @param enable If true, enables the alert hold; otherwise, disables the + * alert hold */ void enableAlertHold(bool enable); /** - * If the Alert Pin fnctionality is enabled, define the active - * polarity of the pin in an alert condition. Enabling this sets - * the pin to active high in an alert condition, otherwise an + * If the alert pin is enabled, defines the active + * polarity of the pin in an alert condition. Enabling this sets + * the pin to active high in an alert condition; otherwise, * active low is used. * - * @param enable if true, Alert Pin is active high, else active low + * @param enable If true, the alert pin is active high; otherwise, active + * low */ void enableAlertPinPolarityHigh(bool enable); /** - * Enable or disable Automatic Conversion mode. When enabled, the - * ADC will sample and update the conversion value independently. - * This is disabled by default, and a conversion is only done by + * Enables or disables the automatic conversion mode. When enabled, the + * ADC samples and updates the conversion value independently. + * It is disabled by default, so conversion is only done by * calling value(). * - * @param cycleTime set the Cycle Time for automatic conversion + * @param cycleTime Sets the cycle time for automatic conversion */ void setAutomaticConversion(ADC121C021_CYCLE_TIME_T cycleTime); /** - * Set the Alert Low Limit. If Alerts are enabled and the - * measured conversion value is lower than this, an alert will be + * Sets the alert low limit. If alerts are enabled and the + * measured conversion value is lower than the low limit, an alert is * triggered. * - * @param limit the Low Alert Limit + * @param limit Alert low limit * @return 0 (MRAA_SUCCESS) if successful; non-zero otherwise */ mraa_result_t setAlertLowLimit(uint16_t limit); /** - * Set the Alert High Limit. If Alerts are enabled and the - * measured conversion value is higher than this, an alert will be + * Sets the alert high limit. If alerts are enabled and the + * measured conversion value is higher than the high limit, an alert is * triggered. * - * @param limit the High Alert Limit + * @param limit Alert high limit * @return 0 (MRAA_SUCCESS) if successful; non-zero otherwise */ mraa_result_t setAlertHighLimit(uint16_t limit); /** - * Set the Hysteresis value. If a high or low alert condition is + * Sets the hysteresis value. If a high or low alert condition is * triggered, the conversion result must move within the high or * low limit by more than this value to clear the alert condition. - * If the Alert Hold bit is set, then the alert will not self - * clear regardless of this value. + * If the alert hold is set, the alert doesn't self-clear + * regardless of this value. * - * @param limit Hysteresis Limit + * @param limit Hysteresis limit * @return 0 (MRAA_SUCCESS) if successful; non-zero otherwise */ mraa_result_t setHysteresis(uint16_t limit); /** - * Return the Highest Conversion value sampled so far. This value - * is only updated by the converter when automatic conversion mode + * Returns the highest conversion value recorded so far. This value + * is only updated by the converter when the automatic conversion mode * is enabled. * - * @return the highest conversion value recorded + * @return Highest conversion value */ uint16_t getHighestConversion(); /** - * Return the Lowest Conversion value sampled so far. This value - * is only updated by the converter when automatic conversion mode + * Returns the lowest conversion value recorded so far. This value + * is only updated by the converter when the automatic conversion mode * is enabled. * - * @return the lowest conversion value recorded + * @return Lowest conversion value */ uint16_t getLowestConversion(); /** - * Clear the Highest Conversion value sampled so far. + * Clears the highest conversion value recorded so far. * * @return 0 (MRAA_SUCCESS) if successful; non-zero otherwise */ mraa_result_t clearHighestConversion(); /** - * Clear the Lowest Conversion value sampled so far. + * Clears the lowest conversion value recorded so far. * * @return 0 (MRAA_SUCCESS) if successful; non-zero otherwise */ diff --git a/src/adis16448/adis16448.h b/src/adis16448/adis16448.h index b787f5eb..0159e488 100644 --- a/src/adis16448/adis16448.h +++ b/src/adis16448/adis16448.h @@ -11,7 +11,7 @@ // // This library runs on an Intel Edison and uses mraa to acquire data // from an ADIS16448. This data is then scaled and printed onto the terminal. -// +// // This software has been tested to connect to an ADIS16448 through a level shifter // such as the TI TXB0104. The SPI lines (DIN, DOUT, SCLK, /CS) are all wired through // the level shifter and the ADIS16448 is also being powered by the Intel Edison. @@ -84,11 +84,11 @@ namespace upm { /** - * @brief ADIS16448 accelerometer library + * @brief ADIS16448 Accelerometer library * @defgroup adis16448 libupm-adis16448 * @ingroup generic spi accelerometer */ - + /** * @library adis16448 * @sensor adis16448 @@ -98,54 +98,76 @@ namespace upm { * @web http://www.analog.com/en/products/sensors/isensor-mems-inertial-measurement-units/adis16448.html * @con spi * - * @brief API for Analog Devices ADIS16448 + * @brief API for the Analog Devices ADIS16448 Accelerometer * - * This is an industrial grade accelerometer by Analog Devices. + * This is an industrial-grade accelerometer by Analog Devices. * * @snippet adis16448.cxx Interesting */ - class ADIS16448{ + class ADIS16448{ - public: + public: - // Constructor with configurable HW Reset - ADIS16448(int bus, int rst); + /** + * Constructor with configurable HW Reset + */ + ADIS16448(int bus, int rst); - //Destructor - ~ADIS16448(); + /** + * Destructor + */ + ~ADIS16448(); - //Performs hardware reset by sending the specified pin low for 2 seconds - void resetDUT(); + /** + * Performs hardware reset by sending the specified pin low for 2 seconds + */ + void resetDUT(); - //Sets SPI frequency, mode, and bits/word - void configSPI(); + /** + * Sets SPI frequency, mode, and bits/word + */ + void configSPI(); - //Read specified register and return data - int16_t regRead(uint8_t regAddr); + /** + * Reads a specified register and returns data + */ + int16_t regRead(uint8_t regAddr); - //Write to specified register - void regWrite(uint8_t regAddr, uint16_t regData); + /** + * Writes to a specified register + */ + void regWrite(uint8_t regAddr, uint16_t regData); - //Scale accelerometer data - float accelScale(int16_t sensorData); + /** + * Scales accelerometer data + */ + float accelScale(int16_t sensorData); - //Scale gyro data - float gyroScale(int16_t sensorData); + /** + * Scales gyro data + */ + float gyroScale(int16_t sensorData); - //Scale temperature data - float tempScale(int16_t sensorData); + /** + * Scales temperature data + */ + float tempScale(int16_t sensorData); - //Scale pressure data - float pressureScale(int16_t sensorData); + /** + * Scales pressure data + */ + float pressureScale(int16_t sensorData); - //Scale magnetometer data - float magnetometerScale(int16_t sensorData); + /** + * Scales magnetometer data + */ + float magnetometerScale(int16_t sensorData); - private: + private: - mraa_spi_context _spi; - mraa_gpio_context _rst; + mraa_spi_context _spi; + mraa_gpio_context _rst; - }; + }; } diff --git a/src/adxl335/adxl335.h b/src/adxl335/adxl335.h index 982f288f..8cef1a85 100644 --- a/src/adxl335/adxl335.h +++ b/src/adxl335/adxl335.h @@ -35,7 +35,7 @@ namespace upm { /** - * @brief ADXL335 accelerometer library + * @brief ADXL335 Accelerometer library * @defgroup adxl335 libupm-adxl335 * @ingroup seeed analog accelerometer */ @@ -49,11 +49,11 @@ namespace upm { * @man seeed * @con analog * - * @brief API for the ADXL335 3-axis Analog Accelerometer + * @brief API for the ADXL335 3-Axis Analog Accelerometer * - * UPM module for the ADXL335 3-axis analog accelerometer. This - * was tested on a Grove 3-axis Analog Accelerometer. It uses 3 - * analog pins, one each for X, Y, and Z axis. + * UPM module for the ADXL335 3-axis analog accelerometer. This + * was tested on a Grove 3-axis Analog Accelerometer. It uses 3 + * analog pins, one for each axis: X, Y, and Z. * * @image html adxl335.jpg * @snippet adxl335.cxx Interesting @@ -63,61 +63,60 @@ namespace upm { /** * ADXL335 constructor * - * @param pinX analog pin to use for axis X - * @param pinY analog pin to use for axis Y - * @param pinZ analog pin to use for axis Z - * @param aref analog voltage reference, default 5.0 + * @param pinX Analog pin to use for X-axis + * @param pinY Analog pin to use for Y-axis + * @param pinZ Analog pin to use for Z-axis + * @param aref Analog reference voltage; default is 5.0v */ ADXL335(int pinX, int pinY, int pinZ, float aref=ADXL335_DEFAULT_AREF); /** - * ADXL335 Destructor + * ADXL335 destructor */ ~ADXL335(); /** - * Set the "zero" value of the X axis, determined through calibration + * Sets the "zero" value of the X-axis, determined through calibration * - * @param zeroX The "zero" value of the X axis + * @param zeroX "Zero" value of the X-axis */ void setZeroX(float zeroX) { m_zeroX = zeroX; }; /** - * Set the "zero" value of the Y axis, determined through calibration + * Sets the "zero" value of the Y-axis, determined through calibration * - * @param zeroX The "zero" value of the Y axis + * @param zeroY "Zero" value of the Y-axis */ void setZeroY(float zeroY) { m_zeroY = zeroY; }; /** - * Set the "zero" value of the Z axis, determined through calibration + * Sets the "zero" value of the Z-axis, determined through calibration * - * @param zeroX The "zero" value of the Z axis + * @param zeroZ "Zero" value of the Z-axis */ void setZeroZ(float zeroZ) { m_zeroZ = zeroZ; }; /** - * Get the analog values for the 3 axes + * Gets the analog values for the 3 axes * - * @param xVal pointer to returned X value - * @param yVal pointer to returned Y value - * @param zVal pointer to returned Z value + * @param xVal Pointer to the returned X-axis value + * @param yVal Pointer to the returned Y-axis value + * @param zVal Pointer to the returned Z-axis value */ void values(int *xVal, int *yVal, int *zVal); /** - * Get the acceleration along all 3 axes + * Gets the acceleration along all 3 axes * - * @param xAccel pointer to returned X value - * @param yAccel pointer to returned Y value - * @param zAccel pointer to returned Z value + * @param xAccel Pointer to returned X-axis value + * @param yAccel Pointer to returned Y-axis value + * @param zAccel Pointer to returned Z-axis value */ void acceleration(float *xAccel, float *yAccel, float *zAccel); /** - * While the sensor is still, measure the X, Y, and Z values and - * use those values as our zero values. - * + * While the sensor is still, measures the X-axis, Y-axis, and Z-axis + * values and uses those values as the zero values. */ void calibrate(); diff --git a/src/adxl345/adxl345.h b/src/adxl345/adxl345.h index f239a9d1..656ea4e1 100644 --- a/src/adxl345/adxl345.h +++ b/src/adxl345/adxl345.h @@ -1,4 +1,4 @@ -/* +/* * Author: Mihai Tudor Panu * Copyright (c) 2014 Intel Corporation. * @@ -30,7 +30,7 @@ namespace upm { /** - * @brief ADXL345 accelerometer library + * @brief ADXL345 Accelerometer library * @defgroup adxl345 libupm-adxl345 * @ingroup seeed i2c accelerometer */ @@ -44,13 +44,14 @@ namespace upm { * @man seeed * @con i2c * - * @brief API for Adxl345 (3-axis digital accelerometer) + * @brief API for the ADXL345 3-Axis Digital Accelerometer * - * The Adxl345 is a 3-axis digital accelerometer. + * ADXL345 is a 3-axis digital accelerometer. * (http://www.seeedstudio.com/wiki/images/2/2c/ADXL345_datasheet.pdf) - * The sensor has configurable resolutions for measuring ±2g, ±4g, ±8g or ±16g. - * Note that the sensor it is incompatible and will not be detected on the I2C bus - * by the Intel Edison using the Arduino breakout board at 5V (3V3 will work fine). + * The sensor has configurable resolutions to measure ±2g, ±4g, ±8g, or ±16g. + * Note: the sensor is incompatible with and not detected on the I2C bus + * by the Intel(R) Edison using an Arduino breakout board at 5V (3V works + * fine). * * @image html adxl345.jpeg * @snippet adxl345.cxx Interesting @@ -58,14 +59,14 @@ namespace upm { class Adxl345 { public: /** - * Creates an Adxl345 object + * Creates an ADXL345 object * - * @param bus number of used i2c bus + * @param bus Number of the used I2C bus */ Adxl345(int bus); /** - * Adxl345 object destructor + * ADXL345 object destructor */ ~Adxl345(); @@ -77,23 +78,25 @@ public: float* getAcceleration(); /** - * Returns a pointer to an int[3] that contains the raw register values for X, Y and Z + * Returns a pointer to an int[3] that contains the raw register values + * for X, Y, and Z * * @return int* to an int[3] */ int16_t* getRawValues(); /** - * Returns the scale the accelerometer is currently set up to: 2, 4, 8 or 16 + * Returns the scale the accelerometer is currently set up to: 2, 4, 8, + * or 16 * - * @return uint with current scale value + * @return uint with the current scale value */ uint8_t getScale(); /** - * Updates the acceleration values from i2c bus + * Updates the acceleration values from the I2C bus * - * @return 0 for success + * @return 0 if successful */ mraa_result_t update(); private: diff --git a/src/am2315/am2315.h b/src/am2315/am2315.h index 5be6e5ed..8e440d94 100644 --- a/src/am2315/am2315.h +++ b/src/am2315/am2315.h @@ -50,7 +50,7 @@ namespace upm { /** - * @brief AM2315 temperature & humidity sensor library + * @brief AM2315 Temperature & Humidity Sensor library * @defgroup am2315 libupm-am2315 * @ingroup adafruit i2c temp */ @@ -64,15 +64,15 @@ namespace upm { * @web http://www.adafruit.com/products/1293 * @con i2c * - * @brief API for AM2315 chip (Temperature & Humidity Sensor) + * @brief API for the AM2315 Temperature & Humidity Sensor * - * Measurement Specialties [AM2315] + * AM2315 by Measurement Specialties * (http://www.aosong.com/asp_bin/Products/en/AM2315.pdf) * is a digital humidity sensor with temperature output. - * RH will report between 0 and 100% and temperature range is + * RH reports between 0 and 100%, and the temperature range is * -40 to +125 degC. - * The sampling period of this sensor is 2 seconds. Reads occurring - * more often than that will return cached data. + * The sampling period of this sensor is 2 seconds. Reads occurring + * more often than that return cached data. * * @image html am2315.jpeg * @snippet am2315.cxx Interesting @@ -80,94 +80,97 @@ namespace upm { class AM2315 { public: /** - * Instanciates a AM2315 object + * Instantiates an AM2315 object * - * @param bus number of used bus - * @param devAddr address of used i2c device + * @param bus Number of the used bus + * @param devAddr Address of the used I2C device * @param mode AM2315 oversampling */ AM2315 (int bus, int devAddr=AM2315_I2C_ADDRESS); /** - * AM2315 object destructor, basicaly it close i2c connection. + * AM2315 object destructor; basicaly, it closes the I2C connection. */ ~AM2315 (); /** - * Get the current measured humidity [RH] - * Data is updated every 2 seconds - accesses more often than - * that will return cached data + * Gets the current measured humidity [RH] + * + * Data is updated every 2 seconds - accesses occurring more often than + * that return cached data */ float getHumidity(void); /** - * Get the humidity cell temperature [degC] - * Data is updated every 2 seconds - accesses more often than - * that will return cached data + * Gets the humidity cell temperature [degC] + * + * Data is updated every 2 seconds - accesses occurring more often than + * that return cached data */ float getTemperature(void); /** - * Get the humidity cell temperature [degF] - * Data is updated every 2 seconds - accesses more often than - * that will return cached data + * Gets the humidity cell temperature [degF] + * + * Data is updated every 2 seconds - accesses occurring more often than + * that return cached data */ float getTemperatureF(void); /** * Function intended to test the device and verify it - * is correctly operating. + * is operating correctly. * */ int testSensor(void); /** - * Write four byte (32b) register + * Writes a four-byte (32b) register * - * Note: These access routines are not the normal accesses to an i2c - * device. The AM2315 contains a microcontroller that manages the - * actual readings. These handlers then make requests over i2c using - * a protocol defined by the AM2315. + * Note: these access routines are not the normal accesses to an I2C + * device. AM2315 contains a microcontroller that manages the + * actual readings. These handlers then make requests over I2C using + * a protocol defined by AM2315. * - * @param reg address of a register + * @param reg Address of the register * @param ival 32b value */ int i2cWriteReg_32(int reg, uint32_t ival); /** - * Write two byte (16b) register + * Writes a two-byte (16b) register * - * @param reg address of a register + * @param reg Address of the register * @param ival 16b value */ int i2cWriteReg_16(int reg, uint16_t ival); /** - * Write one byte (8b) register + * Writes a one-byte (8b) register * - * @param reg address of a register + * @param reg Address of the register * @param ival 8b value */ int i2cWriteReg_8(int reg, uint8_t ival); /** - * Read four bytes register + * Reads a four-byte register * - * @param reg address of a register + * @param reg Address of the register */ uint32_t i2cReadReg_32 (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); /** - * 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); diff --git a/src/apds9002/apds9002.h b/src/apds9002/apds9002.h index 1fa7f736..0c3a3d5e 100644 --- a/src/apds9002/apds9002.h +++ b/src/apds9002/apds9002.h @@ -28,7 +28,7 @@ namespace upm { /** - * @brief APDS-9002 luminance sensor library + * @brief APDS-9002 Luminance Sensor library * @defgroup apds9002 libupm-apds9002 * @ingroup seeed analog light */ @@ -42,10 +42,10 @@ namespace upm { * @man seeed * @con analog * - * @brief UPM module for the Grove Luminance Sensor + * @brief UPM module for the APDS-9002 Luminance Sensor * * This sensor transforms luminous intensity to output analog values. - * It uses the APDS-9002 ambient light sensor. + * It uses an APDS-9002 ambient light sensor. * * @image html apds9002.jpg * @snippet apds9002.cxx Interesting @@ -54,19 +54,19 @@ namespace upm { class APDS9002 { public: /** - * Grove luminance sensor constructor + * APDS-9002 luminance sensor constructor * - * @param pin analog pin to use + * @param pin Analog pin to use */ APDS9002(int pin); /** - * APDS9002 Destructor + * APDS9002 destructor */ ~APDS9002(); /** - * Get the luminance value from the sensor + * Gets the luminance value from the sensor * - * @return the luminance reading + * @return Luminance value */ int value(); diff --git a/src/at42qt1070/at42qt1070.h b/src/at42qt1070/at42qt1070.h index ef457d3f..826e0903 100644 --- a/src/at42qt1070/at42qt1070.h +++ b/src/at42qt1070/at42qt1070.h @@ -35,7 +35,7 @@ namespace upm { /** - * @brief Atmel AT42QT1070 QTouch sensor library + * @brief Atmel AT42QT1070 QTouch* Sensor library * @defgroup at42qt1070 libupm-at42qt1070 * @ingroup seeed i2c touch */ @@ -49,12 +49,12 @@ namespace upm * @man seeed * @con i2c * - * @brief API for the Atmel AT42QT1070 QTouch sensor + * @brief API for the Atmel AT42QT1070 QTouch Sensor * * This class implements support for the Atmel AT42QT1070 QTouch * sensor, which supports 7 capacitive buttons. * - * It was developed using the Grove Q Touch Sensor board. + * It was developed using a Grove-Q Touch Sensor board. * * @image html at42qt1070.jpg * @snippet at42qt1070.cxx Interesting @@ -143,122 +143,122 @@ class AT42QT1070 /** * AT42QT1070 constructor * - * @param bus i2c bus to use - * @param address the address for this sensor + * @param bus I2C bus to use + * @param address Address for this sensor */ AT42QT1070(int bus, uint8_t address = AT42QT1070_DEFAULT_I2C_ADDR); /** - * AT42QT1070 Destructor + * AT42QT1070 destructor */ ~AT42QT1070(); /** - * Write byte value into register + * Writes a byte value into the register * - * @param reg register location to write into - * @param byte byte to write - * @return true if successful + * @param reg Register location to write into + * @param byte Byte to write + * @return True if successful */ bool writeByte(uint8_t reg, uint8_t byte); /** - * Write word value at register. Note, the device must have the + * Writes a word value into the register. Note: the device must have the * auto-increment bit set in the MODE1 register to work. * - * @param reg register location to write into - * @param word word to write - * @return true if successful + * @param reg Register location to write into + * @param word Word to write + * @return True if successful */ bool writeWord(uint8_t reg, uint16_t word); /** - * Read byte value from register + * Read a byte value from the register * - * @param reg register location to read from - * @return value at specified register + * @param reg Register location to read from + * @return Value in the specified register */ uint8_t readByte(uint8_t reg); /** - * Read word value from register. Note, the device must have the + * Read a word value from the register. Note: the device must have the * auto-increment bit set in the MODE1 register to work. * - * @param reg register location to read from - * @return value at specified register + * @param reg Register location to read from + * @return Value in the specified register */ uint16_t readWord(uint8_t reg); /** - * Read the Chip ID register on the sensor + * Reads the Chip ID register on the sensor * - * @return the value of the Chip ID register + * @return Value of the Chip ID register */ uint8_t readChipID(void); /** - * Read the current touch status and detection state + * Reads the current touch status and detection state * - * @return key status bits for all keys (0-6) + * @return Key status bits for all keys (0-6) */ void updateState(); /** - * Read the current low-power mode setting + * Reads the current low-power mode setting * - * @return return low-power mode setting from sensor + * @return Low-power mode setting from the sensor */ uint8_t getLPMode(void); /** - * Change the low-pomer mode setting on the sensor + * Changes the low-pomer mode setting on the sensor * - * @param mode desired new mode - * @return new setting on sensor + * @param mode dDsired new mode + * @return New setting on the sensor */ uint8_t setLPMode(uint8_t mode); /** - * Read the current averaging factor setting for a key + * Reads the current averaging factor setting for a key * - * @param key the key being read - * @return the averaging factor + * @param key Key being read + * @return Averaging factor */ uint8_t getAVE(uint8_t key); /** - * Change the averaging factor setting for a key + * Changes the averaging factor setting for a key * - * @param key the key being changed - * @param ave the new averaging factor - * @return the new averaging factor as read from the device + * @param key Key being changed + * @param ave New averaging factor + * @return New averaging factor as read from the device */ uint8_t setAVE(uint8_t key, uint8_t ave); /** - * Read the AKS group a key is part of + * Reads the AKS group of which a key is part * - * @param key the key (0-6) being queried - * @return AKS group the key is part of + * @param key Key (0-6) being queried + * @return AKS group of which the key is part */ uint8_t getAKSGroup(uint8_t key); /** - * Change the AKS group that a key is part of + * Changes the AKS group of which a key is part * - * @param key the key (0-6) being changed - * @param group the new group for the key - * @return return the new value on the sensor + * @param key Key (0-6) being changed + * @param group New group for the key + * @return New value on the sensor */ uint8_t setAKSGroup(uint8_t key, uint8_t group); /** - * return the overflow indicator + * Returns the overflow indicator * - * @return true if overflow indicated + * @return True if overflow is indicated */ bool isOverflowed() @@ -267,9 +267,9 @@ class AT42QT1070 }; /** - * return the calibrating indicator + * Returns the calibrating indicator * - * @return true if calibration is in progress + * @return True if calibration is in progress */ bool isCalibrating() @@ -278,23 +278,23 @@ class AT42QT1070 }; /** - * Issue a reset command + * Issues a reset command * - * @return true if reset successful + * @return True if successful */ bool reset(); /** - * Issue a calibrate command + * Issues a calibrate command * - * @return true if calibrate successful + * @return True if successful */ bool calibrate(); /** - * Get the current button states + * Gets the current button states * - * @returns the button states + * @returns Button states */ uint8_t getButtons()