Library for supporting the Nucleo Sensor Shield.

Dependents:   Nucleo_Sensors_Demo m2x-temp_ethernet_demo m2x-MEMS_ACKme_Wifi_demo m2x_MEMS_Ublox_Cellular_demo ... more

Fork of Nucleo_Sensor_Shield by Daniel Griffin

Warning: Deprecated!

Supported drivers and applications can be found at this link.

Committer:
dangriffin
Date:
Tue Dec 16 21:14:32 2014 +0000
Revision:
2:57888ec40e75
Parent:
0:0433918efb54
Additional checking of return code in pressure sensor driver.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dangriffin 0:0433918efb54 1 /**
dangriffin 0:0433918efb54 2 ******************************************************************************
dangriffin 0:0433918efb54 3 * @file x_cube_mems.h
dangriffin 0:0433918efb54 4 * @author AST / EST
dangriffin 0:0433918efb54 5 * @version V0.0.1
dangriffin 0:0433918efb54 6 * @date 01-December-2014
dangriffin 0:0433918efb54 7 * @brief Header file for class X_CUBE_MEMS representing an MEMS expansion board
dangriffin 0:0433918efb54 8 ******************************************************************************
dangriffin 0:0433918efb54 9 * @attention
dangriffin 0:0433918efb54 10 *
dangriffin 0:0433918efb54 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
dangriffin 0:0433918efb54 12 *
dangriffin 0:0433918efb54 13 * Redistribution and use in source and binary forms, with or without modification,
dangriffin 0:0433918efb54 14 * are permitted provided that the following conditions are met:
dangriffin 0:0433918efb54 15 * 1. Redistributions of source code must retain the above copyright notice,
dangriffin 0:0433918efb54 16 * this list of conditions and the following disclaimer.
dangriffin 0:0433918efb54 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
dangriffin 0:0433918efb54 18 * this list of conditions and the following disclaimer in the documentation
dangriffin 0:0433918efb54 19 * and/or other materials provided with the distribution.
dangriffin 0:0433918efb54 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
dangriffin 0:0433918efb54 21 * may be used to endorse or promote products derived from this software
dangriffin 0:0433918efb54 22 * without specific prior written permission.
dangriffin 0:0433918efb54 23 *
dangriffin 0:0433918efb54 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
dangriffin 0:0433918efb54 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
dangriffin 0:0433918efb54 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
dangriffin 0:0433918efb54 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
dangriffin 0:0433918efb54 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
dangriffin 0:0433918efb54 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
dangriffin 0:0433918efb54 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
dangriffin 0:0433918efb54 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
dangriffin 0:0433918efb54 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
dangriffin 0:0433918efb54 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dangriffin 0:0433918efb54 34 *
dangriffin 0:0433918efb54 35 ******************************************************************************
dangriffin 0:0433918efb54 36 */
dangriffin 0:0433918efb54 37
dangriffin 0:0433918efb54 38
dangriffin 0:0433918efb54 39 #ifndef __X_CUBE_MEMS_H
dangriffin 0:0433918efb54 40 #define __X_CUBE_MEMS_H
dangriffin 0:0433918efb54 41
dangriffin 0:0433918efb54 42 /* Includes ------------------------------------------------------------------*/
dangriffin 0:0433918efb54 43 #include "mbed.h"
dangriffin 0:0433918efb54 44
dangriffin 0:0433918efb54 45 #include "x_cube_mems_i2c.h"
dangriffin 0:0433918efb54 46 #include "Components/HTS221/hts221.h"
dangriffin 0:0433918efb54 47 #include "Components/LPS25H/lps25h.h"
dangriffin 0:0433918efb54 48 #include "Components/LIS3MDL/lis3mdl.h"
dangriffin 0:0433918efb54 49 #include "Components/LSM6DS0/lsm6ds0.h"
dangriffin 0:0433918efb54 50
dangriffin 0:0433918efb54 51 /* Classes -------------------------------------------------------------------*/
dangriffin 0:0433918efb54 52 /** Class X_CUBE_MEMS represents the MEMS Sensor expansion board X-NUCLEO-IKS01A1
dangriffin 0:0433918efb54 53 *
dangriffin 0:0433918efb54 54 * The expansion board has the following IPs:\n
dangriffin 0:0433918efb54 55 * - HTS221 Relative Humidity and Temperature Sensor
dangriffin 0:0433918efb54 56 * - LIS3MDL 3-Axis Magnetometer
dangriffin 0:0433918efb54 57 * - LPS25H MEMS Pressure Sensor
dangriffin 0:0433918efb54 58 * - LSM6DS0 3D Acceleromenter and 3D Gyroscope
dangriffin 0:0433918efb54 59 * *
dangriffin 0:0433918efb54 60 * @code
dangriffin 0:0433918efb54 61 * // MEMS Sensors expansion board singleton instance
dangriffin 0:0433918efb54 62 * static X_CUBE_MEMS *mems_expansion_board = X_CUBE_MEMS::Instance();
dangriffin 0:0433918efb54 63 * @endcode
dangriffin 0:0433918efb54 64 */
dangriffin 0:0433918efb54 65 class X_CUBE_MEMS
dangriffin 0:0433918efb54 66 {
dangriffin 0:0433918efb54 67 protected:
dangriffin 0:0433918efb54 68 X_CUBE_MEMS(void);
dangriffin 0:0433918efb54 69
dangriffin 0:0433918efb54 70 public:
dangriffin 0:0433918efb54 71 static X_CUBE_MEMS* Instance(void);
dangriffin 0:0433918efb54 72
dangriffin 0:0433918efb54 73 DevI2C dev_i2c;
dangriffin 0:0433918efb54 74 HTS221 hts221;
dangriffin 0:0433918efb54 75 LPS25H lps25h;
dangriffin 0:0433918efb54 76 LIS3MDL lis3mdl;
dangriffin 0:0433918efb54 77 LSM6DS0 lsm6ds0;
dangriffin 0:0433918efb54 78
dangriffin 0:0433918efb54 79 private:
dangriffin 0:0433918efb54 80 static X_CUBE_MEMS *_instance;
dangriffin 0:0433918efb54 81 };
dangriffin 0:0433918efb54 82
dangriffin 0:0433918efb54 83 #endif /* __X_CUBE_MEMS_H */