diff options
| -rw-r--r-- | doc/ex/Doxyfile_chm | 1 | ||||
| -rw-r--r-- | doc/ex/Doxyfile_html | 1 | ||||
| -rw-r--r-- | doc/ex/src/main.dox | 3 | ||||
| -rw-r--r-- | os/ex/Bosch/bmp085.c | 30 | ||||
| -rw-r--r-- | os/ex/Bosch/bmp085.h | 28 | ||||
| -rw-r--r-- | os/ex/dox/main.dox | 19 | 
6 files changed, 44 insertions, 38 deletions
| diff --git a/doc/ex/Doxyfile_chm b/doc/ex/Doxyfile_chm index e687474d0..0ad493e88 100644 --- a/doc/ex/Doxyfile_chm +++ b/doc/ex/Doxyfile_chm @@ -799,6 +799,7 @@ WARN_LOGFILE           =  INPUT                  = ./src \                           ../../os/ex/dox \ +                         ../../os/ex/Bosch \                           ../../os/ex/ST \                           ../../os/ex/Micron \                           ../../os/hal/lib/peripherals/sensors \ diff --git a/doc/ex/Doxyfile_html b/doc/ex/Doxyfile_html index 703b95400..7866d42bf 100644 --- a/doc/ex/Doxyfile_html +++ b/doc/ex/Doxyfile_html @@ -799,6 +799,7 @@ WARN_LOGFILE           =  INPUT                  = ./src \                           ../../os/ex/dox \ +                         ../../os/ex/Bosch \                           ../../os/ex/ST \                           ../../os/ex/Micron \                           ../../os/hal/lib/peripherals/sensors \ diff --git a/doc/ex/src/main.dox b/doc/ex/src/main.dox index fac2d62e7..b32dce1b8 100644 --- a/doc/ex/src/main.dox +++ b/doc/ex/src/main.dox @@ -21,6 +21,7 @@   * @mainpage Introduction
   * @author Giovanni Di Sirio (gdisirio@users.sourceforge.net).
   * @author Rocco Marco Guglielmi (guglielmir@playembedded.org).
 + * @author Theodore Ateba (tf.ateba@gmail.com).
   *
   * <h2>Features</h2>
   * - EXternal devices (EX) supporting numerous devices external to the MCU
 @@ -39,4 +40,6 @@   *    - @b LSM303DLHC: Ultra compact high performance e-compass;
   * - Currently Micron Technology supported devices are:
   *    - @b M25Q: Serial NOR Flash;
 + * - Currently Bosch supported devices are:
 + *    - @b BMP085: Digital pressure sensor;
   */
 diff --git a/os/ex/Bosch/bmp085.c b/os/ex/Bosch/bmp085.c index 82676dc4c..1d68e8bca 100644 --- a/os/ex/Bosch/bmp085.c +++ b/os/ex/Bosch/bmp085.c @@ -20,32 +20,29 @@  /**   * @file        bmp085.c - *   * @brief       BMP085 Digital pressure sensor interface module code.   * - * @author      Theodore Ateba, tf.ateba@gmail.com - * - * @date        19 July 2016 - * - * TODO:        Read the altitude with the sensor. - * + * @addtogroup BMP085 + * @ingroup EX_BOSCH   * @{   */ -/*==========================================================================*/ -/* Include files.                                                           */ -/*==========================================================================*/ - -/* ChibiOS HAL file. */  #include "hal.h" - -/* ChibiOS EX file. */  #include "bmp085.h"  /*==========================================================================*/  /* Driver local definitions.                                                */  /*==========================================================================*/ +#define BMP085_SAD                  0x77 + +#define BMP085_CR_P_VAL0            0x34 +#define BMP085_CR_P_VAL1            0x74 +#define BMP085_CR_P_VAL2            0xB4 +#define BMP085_CR_P_VAL3            0xF4 + +#define BMP085_CR_T_VAL             0x2E +  /*==========================================================================*/  /* Driver exported variables.                                               */  /*==========================================================================*/ @@ -176,6 +173,7 @@ static void calcul_t(int32_t ut, float *ctp) {   * @brief   Calcul the true pressure.   *   * @param[in]   up    uncompensated pressure + * @param[in]   oss   over sampling setting   * @param[out]  cpp   pointer of the compensated pressure   */  static void calcul_p(int32_t up, uint8_t oss, float *cpp) { @@ -290,7 +288,7 @@ static msg_t start_p_measurement(BMP085Driver *devp) {   *   * @return      msg     the operation status   */ -msg_t acquire_ut(BMP085Driver *devp, int32_t *utemp) { +static msg_t acquire_ut(BMP085Driver *devp, int32_t *utemp) {    uint8_t rxbuf[2];    msg_t msg; @@ -327,7 +325,7 @@ msg_t acquire_ut(BMP085Driver *devp, int32_t *utemp) {   *   * @return      msg     the operation status   */ -msg_t acquire_up(BMP085Driver *devp, int32_t *upress) { +static msg_t acquire_up(BMP085Driver *devp, int32_t *upress) {    uint8_t rxbuf[3];    uint8_t oss; diff --git a/os/ex/Bosch/bmp085.h b/os/ex/Bosch/bmp085.h index 9bfa5b99e..04233f534 100644 --- a/os/ex/Bosch/bmp085.h +++ b/os/ex/Bosch/bmp085.h @@ -20,13 +20,10 @@  /**   * @file    bmp085.h - *   * @brief   BMP085 Digital pressure sensor interface module header.   * - * @author  Theodore Ateba, tf.ateba@gmail.com - * - * @date    19 July 2016 - * + * @addtogroup BMP085 + * @ingroup EX_BOSCH   * @{   */ @@ -70,29 +67,20 @@   * @brief   BMP085 barometer subsystem characteristics.   * @{   */ -#define BMP085_BARO_NUMBER_OF_AXES  1U    /**< Number of axes.              */ +#define BMP085_BARO_NUMBER_OF_AXES  1U    /**< Number of axes               */ -#define BMP085_P_RES                0.01  /**< Press resolution.            */ - -#define BMP085_CR_P_VAL0            0x34  /**< Press control reg value 0.   */ -#define BMP085_CR_P_VAL1            0x74  /**< Press control reg value 1.   */ -#define BMP085_CR_P_VAL2            0xB4  /**< Press control reg value 2.   */ -#define BMP085_CR_P_VAL3            0xF4  /**< Press control reg value 3.   */ +#define BMP085_P_RES                0.01  /**< LSB/hP                       */  /** @} */  /**   * @brief   BMP085 thermometer subsystem characteristics.   * @{   */ -#define BMP085_THERMO_NUMBER_OF_AXES 1U  /**< Number of axis.               */ - -#define BMP085_T_RES                0.1   /**< Temp resolution.             */ +#define BMP085_THERMO_NUMBER_OF_AXES 1U  /**< Number of axes                */ -#define BMP085_CR_T_VAL             0x2E  /**< Temp control register value. */ +#define BMP085_T_RES                0.1   /**< LSB/C°                       */  /** @} */ -#define BMP085_SAD                  0x77  /**< Slave address.               */ -  /**   * @name  BMP085 Registers addresses.   * @{ @@ -151,7 +139,7 @@   * @note    The default is @p FALSE.   */  #if !defined(BMP085_BARO_USE_ADVANCED) || defined(__DOXYGEN__) -#define BMP085_BARO_USE_AVANCED             FALSE +#define BMP085_BARO_USE_ADVANCED            FALSE  #endif  /** @@ -160,7 +148,7 @@   * @note    The default is @p FALSE.   */  #if !defined(BMP085_THERMO_USE_ADVANCED) || defined(__DOXYGEN__) -#define BMP085_THERMO_USE_AVANCED           FALSE +#define BMP085_THERMO_USE_DAVANCED          FALSE  #endif  /** diff --git a/os/ex/dox/main.dox b/os/ex/dox/main.dox index dbb73d7b4..45b6b96cf 100644 --- a/os/ex/dox/main.dox +++ b/os/ex/dox/main.dox @@ -27,9 +27,17 @@   * @section ex_complex_drivers_architecture EX Complex Drivers Architecture
   * Each EX driver can be considered as a standalone Complex Device Driver. For 
   * ease of use these drivers are grouped by vendor:
 - * - Micron Technology Peripherals
 - * - STMicroelectronics Peripherals
 + * - Bosch Devices
 + * - Micron Technology Devices
 + * - STMicroelectronics Devices
   * .
 + *
 + * @section bosch_devices Bosch Devices
 + * This section contains all the drivers of devices produced by Bosch. 
 + * Devices currently supported are MEMS and are:
 + *   - @b BMP085: Digital pressure sensor;
 + * .
 + *
   * @section micron_devices Micron Technology Devices
   * This section contains all the drivers of devices produced by
   * Micron Technology. Devices currently supported are FLASH and are:
 @@ -50,6 +58,13 @@   * .
   */
 + /**
 + * @defgroup EX_BOSCH Bosch Devices
 + * @brief   Bosch Devices.
 + *
 + * @ingroup EX
 + */
 + 
  /**
   * @defgroup EX_MICRON Micron Technology Devices
   * @brief   Micron Technology Devices.
 | 
