class IMU nucleo
Dependents: Coupe-Robotique-FIP-Main
Fork of IMU_FIP by
Components/LSM6DS0/lsm6ds0.h@0:528e23a13fb7, 2015-04-09 (annotated)
- Committer:
- quentin9696
- Date:
- Thu Apr 09 17:08:14 2015 +0000
- Revision:
- 0:528e23a13fb7
bug pointeur :(
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
quentin9696 | 0:528e23a13fb7 | 1 | /** |
quentin9696 | 0:528e23a13fb7 | 2 | ****************************************************************************** |
quentin9696 | 0:528e23a13fb7 | 3 | * @file x_cube_mems_lsm6ds0.h |
quentin9696 | 0:528e23a13fb7 | 4 | * @author AST / EST |
quentin9696 | 0:528e23a13fb7 | 5 | * @version V0.0.1 |
quentin9696 | 0:528e23a13fb7 | 6 | * @date 9-December-2014 |
quentin9696 | 0:528e23a13fb7 | 7 | * @brief Header file for component LSM6DS0 |
quentin9696 | 0:528e23a13fb7 | 8 | ****************************************************************************** |
quentin9696 | 0:528e23a13fb7 | 9 | * @attention |
quentin9696 | 0:528e23a13fb7 | 10 | * |
quentin9696 | 0:528e23a13fb7 | 11 | * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> |
quentin9696 | 0:528e23a13fb7 | 12 | * |
quentin9696 | 0:528e23a13fb7 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
quentin9696 | 0:528e23a13fb7 | 14 | * are permitted provided that the following conditions are met: |
quentin9696 | 0:528e23a13fb7 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
quentin9696 | 0:528e23a13fb7 | 16 | * this list of conditions and the following disclaimer. |
quentin9696 | 0:528e23a13fb7 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
quentin9696 | 0:528e23a13fb7 | 18 | * this list of conditions and the following disclaimer in the documentation |
quentin9696 | 0:528e23a13fb7 | 19 | * and/or other materials provided with the distribution. |
quentin9696 | 0:528e23a13fb7 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
quentin9696 | 0:528e23a13fb7 | 21 | * may be used to endorse or promote products derived from this software |
quentin9696 | 0:528e23a13fb7 | 22 | * without specific prior written permission. |
quentin9696 | 0:528e23a13fb7 | 23 | * |
quentin9696 | 0:528e23a13fb7 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
quentin9696 | 0:528e23a13fb7 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
quentin9696 | 0:528e23a13fb7 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
quentin9696 | 0:528e23a13fb7 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
quentin9696 | 0:528e23a13fb7 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
quentin9696 | 0:528e23a13fb7 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
quentin9696 | 0:528e23a13fb7 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
quentin9696 | 0:528e23a13fb7 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
quentin9696 | 0:528e23a13fb7 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
quentin9696 | 0:528e23a13fb7 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
quentin9696 | 0:528e23a13fb7 | 34 | * |
quentin9696 | 0:528e23a13fb7 | 35 | ****************************************************************************** |
quentin9696 | 0:528e23a13fb7 | 36 | */ |
quentin9696 | 0:528e23a13fb7 | 37 | |
quentin9696 | 0:528e23a13fb7 | 38 | #ifndef __X_CUBE_MEMS_LSM6DS0_H |
quentin9696 | 0:528e23a13fb7 | 39 | #define __X_CUBE_MEMS_LSM6DS0_H |
quentin9696 | 0:528e23a13fb7 | 40 | |
quentin9696 | 0:528e23a13fb7 | 41 | /* Includes ------------------------------------------------------------------*/ |
quentin9696 | 0:528e23a13fb7 | 42 | #include "mbed.h" |
quentin9696 | 0:528e23a13fb7 | 43 | #include "x_cube_mems_i2c.h" |
quentin9696 | 0:528e23a13fb7 | 44 | |
quentin9696 | 0:528e23a13fb7 | 45 | |
quentin9696 | 0:528e23a13fb7 | 46 | /* Classes -------------------------------------------------------------------*/ |
quentin9696 | 0:528e23a13fb7 | 47 | /** Class representing a HTS221 sensor component |
quentin9696 | 0:528e23a13fb7 | 48 | */ |
quentin9696 | 0:528e23a13fb7 | 49 | class LSM6DS0 |
quentin9696 | 0:528e23a13fb7 | 50 | { |
quentin9696 | 0:528e23a13fb7 | 51 | public: |
quentin9696 | 0:528e23a13fb7 | 52 | /** Constructor |
quentin9696 | 0:528e23a13fb7 | 53 | * @param |
quentin9696 | 0:528e23a13fb7 | 54 | */ |
quentin9696 | 0:528e23a13fb7 | 55 | LSM6DS0(DevI2C &i2c) : dev_i2c(i2c) { |
quentin9696 | 0:528e23a13fb7 | 56 | LSM6DS0Initialized = 0; |
quentin9696 | 0:528e23a13fb7 | 57 | Init(); |
quentin9696 | 0:528e23a13fb7 | 58 | }; |
quentin9696 | 0:528e23a13fb7 | 59 | |
quentin9696 | 0:528e23a13fb7 | 60 | void Gyro_GetAxes(AxesRaw_TypeDef *pData); |
quentin9696 | 0:528e23a13fb7 | 61 | void Gyro_GetAxesRaw(int16_t *pData); |
quentin9696 | 0:528e23a13fb7 | 62 | void Acc_GetAxes(AxesRaw_TypeDef *pData); |
quentin9696 | 0:528e23a13fb7 | 63 | void Acc_GetAxesRaw(int16_t *pData); |
quentin9696 | 0:528e23a13fb7 | 64 | void Init(/*HUM_TEMP_InitTypeDef *HTS221_Init*/); |
quentin9696 | 0:528e23a13fb7 | 65 | uint8_t ReadID(void); |
quentin9696 | 0:528e23a13fb7 | 66 | void RebootCmd(void); |
quentin9696 | 0:528e23a13fb7 | 67 | //int Power_OFF(void); |
quentin9696 | 0:528e23a13fb7 | 68 | //int Power_ON(void); |
quentin9696 | 0:528e23a13fb7 | 69 | //int LIS3MDL_Calibration(); |
quentin9696 | 0:528e23a13fb7 | 70 | private: |
quentin9696 | 0:528e23a13fb7 | 71 | |
quentin9696 | 0:528e23a13fb7 | 72 | uint8_t isInitialized(void) |
quentin9696 | 0:528e23a13fb7 | 73 | { |
quentin9696 | 0:528e23a13fb7 | 74 | return LSM6DS0Initialized; |
quentin9696 | 0:528e23a13fb7 | 75 | } |
quentin9696 | 0:528e23a13fb7 | 76 | |
quentin9696 | 0:528e23a13fb7 | 77 | DevI2C &dev_i2c; |
quentin9696 | 0:528e23a13fb7 | 78 | uint8_t LSM6DS0Initialized; |
quentin9696 | 0:528e23a13fb7 | 79 | }; |
quentin9696 | 0:528e23a13fb7 | 80 | |
quentin9696 | 0:528e23a13fb7 | 81 | #endif // __X_CUBE_MEMS_LSM6DS0_H |
quentin9696 | 0:528e23a13fb7 | 82 |