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:
Sat Dec 13 01:09:48 2014 +0000
Revision:
0:0433918efb54
Create Nucleo sensor shield library.

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_lps25.h
dangriffin 0:0433918efb54 4 * @author AST / EST
dangriffin 0:0433918efb54 5 * @version V0.0.1
dangriffin 0:0433918efb54 6 * @date 1-December-2014
dangriffin 0:0433918efb54 7 * @brief Header file for component LPS25H
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 #ifndef __X_CUBE_MEMS_LPS25H_H
dangriffin 0:0433918efb54 39 #define __X_CUBE_MEMS_LPS25H_H
dangriffin 0:0433918efb54 40
dangriffin 0:0433918efb54 41 /* Includes ------------------------------------------------------------------*/
dangriffin 0:0433918efb54 42 #include "mbed.h"
dangriffin 0:0433918efb54 43 #include "x_cube_mems_i2c.h"
dangriffin 0:0433918efb54 44
dangriffin 0:0433918efb54 45 /* Classes -------------------------------------------------------------------*/
dangriffin 0:0433918efb54 46 /** Class representing a LPS25H sensor component
dangriffin 0:0433918efb54 47 */
dangriffin 0:0433918efb54 48 class LPS25H
dangriffin 0:0433918efb54 49 {
dangriffin 0:0433918efb54 50 public:
dangriffin 0:0433918efb54 51 /** Constructor
dangriffin 0:0433918efb54 52 * @param
dangriffin 0:0433918efb54 53 */
dangriffin 0:0433918efb54 54 LPS25H(DevI2C &i2c) : dev_i2c(i2c) {
dangriffin 0:0433918efb54 55 Lps25hInitialized = 0;
dangriffin 0:0433918efb54 56 Init();
dangriffin 0:0433918efb54 57 };
dangriffin 0:0433918efb54 58
dangriffin 0:0433918efb54 59 void GetPressure(float* pfData);
dangriffin 0:0433918efb54 60 void ReadRawPressure(uint32_t *raw_press);
dangriffin 0:0433918efb54 61 void Init();
dangriffin 0:0433918efb54 62 uint8_t ReadID(void);
dangriffin 0:0433918efb54 63 void RebootCmd(void);
dangriffin 0:0433918efb54 64 int Power_OFF(void);
dangriffin 0:0433918efb54 65 int Power_ON(void);
dangriffin 0:0433918efb54 66 int LPS25H_Calibration();
dangriffin 0:0433918efb54 67 private:
dangriffin 0:0433918efb54 68
dangriffin 0:0433918efb54 69 uint8_t isInitialized(void)
dangriffin 0:0433918efb54 70 {
dangriffin 0:0433918efb54 71 return Lps25hInitialized;
dangriffin 0:0433918efb54 72 }
dangriffin 0:0433918efb54 73
dangriffin 0:0433918efb54 74 DevI2C &dev_i2c;
dangriffin 0:0433918efb54 75 uint8_t Lps25hInitialized;
dangriffin 0:0433918efb54 76 };
dangriffin 0:0433918efb54 77
dangriffin 0:0433918efb54 78 #endif // __X_CUBE_MEMS_LPS25H_H
dangriffin 0:0433918efb54 79