Version of the IKS01A1 library for this coursework
Dependencies: X_NUCLEO_COMMON
Fork of X_NUCLEO_IKS01A1 by
Components/lsm6ds0/lsm6ds0.h@89:c55aa4c1187f, 2017-08-01 (annotated)
- Committer:
- noutram
- Date:
- Tue Aug 01 23:46:04 2017 +0000
- Revision:
- 89:c55aa4c1187f
- Parent:
- 24:92cc9c6e4b2b
updated for 2017
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Wolfgang Betz |
7:a2bb3d5e12e9 | 1 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 2 | ****************************************************************************** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 3 | * @file lsm6ds0.h |
Wolfgang Betz |
7:a2bb3d5e12e9 | 4 | * @author MEMS Application Team |
Wolfgang Betz |
24:92cc9c6e4b2b | 5 | * @version V1.3.0 |
Wolfgang Betz |
24:92cc9c6e4b2b | 6 | * @date 28-May-2015 |
Wolfgang Betz |
24:92cc9c6e4b2b | 7 | * @brief This file contains definitions for the lsm6ds0.c |
Wolfgang Betz |
7:a2bb3d5e12e9 | 8 | * firmware driver. |
Wolfgang Betz |
7:a2bb3d5e12e9 | 9 | ****************************************************************************** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 10 | * @attention |
Wolfgang Betz |
7:a2bb3d5e12e9 | 11 | * |
Wolfgang Betz |
7:a2bb3d5e12e9 | 12 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
Wolfgang Betz |
7:a2bb3d5e12e9 | 13 | * |
Wolfgang Betz |
7:a2bb3d5e12e9 | 14 | * Redistribution and use in source and binary forms, with or without modification, |
Wolfgang Betz |
7:a2bb3d5e12e9 | 15 | * are permitted provided that the following conditions are met: |
Wolfgang Betz |
7:a2bb3d5e12e9 | 16 | * 1. Redistributions of source code must retain the above copyright notice, |
Wolfgang Betz |
7:a2bb3d5e12e9 | 17 | * this list of conditions and the following disclaimer. |
Wolfgang Betz |
7:a2bb3d5e12e9 | 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
Wolfgang Betz |
7:a2bb3d5e12e9 | 19 | * this list of conditions and the following disclaimer in the documentation |
Wolfgang Betz |
7:a2bb3d5e12e9 | 20 | * and/or other materials provided with the distribution. |
Wolfgang Betz |
7:a2bb3d5e12e9 | 21 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
Wolfgang Betz |
7:a2bb3d5e12e9 | 22 | * may be used to endorse or promote products derived from this software |
Wolfgang Betz |
7:a2bb3d5e12e9 | 23 | * without specific prior written permission. |
Wolfgang Betz |
7:a2bb3d5e12e9 | 24 | * |
Wolfgang Betz |
7:a2bb3d5e12e9 | 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
Wolfgang Betz |
7:a2bb3d5e12e9 | 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
Wolfgang Betz |
7:a2bb3d5e12e9 | 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
Wolfgang Betz |
7:a2bb3d5e12e9 | 28 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
Wolfgang Betz |
7:a2bb3d5e12e9 | 29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
Wolfgang Betz |
7:a2bb3d5e12e9 | 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
Wolfgang Betz |
7:a2bb3d5e12e9 | 31 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
Wolfgang Betz |
7:a2bb3d5e12e9 | 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
Wolfgang Betz |
7:a2bb3d5e12e9 | 33 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
Wolfgang Betz |
7:a2bb3d5e12e9 | 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Wolfgang Betz |
7:a2bb3d5e12e9 | 35 | * |
Wolfgang Betz |
7:a2bb3d5e12e9 | 36 | ****************************************************************************** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 37 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 38 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 39 | /* Define to prevent recursive inclusion -------------------------------------*/ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 40 | #ifndef __LSM6DS0_H |
Wolfgang Betz |
7:a2bb3d5e12e9 | 41 | #define __LSM6DS0_H |
Wolfgang Betz |
7:a2bb3d5e12e9 | 42 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 43 | #ifdef __cplusplus |
Wolfgang Betz |
7:a2bb3d5e12e9 | 44 | extern "C" { |
Wolfgang Betz |
7:a2bb3d5e12e9 | 45 | #endif |
Wolfgang Betz |
7:a2bb3d5e12e9 | 46 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 47 | /* Includes ------------------------------------------------------------------*/ |
Wolfgang Betz |
24:92cc9c6e4b2b | 48 | #include "imu_6axes.h" |
Wolfgang Betz |
7:a2bb3d5e12e9 | 49 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 50 | /** @addtogroup BSP |
Wolfgang Betz |
7:a2bb3d5e12e9 | 51 | * @{ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 52 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 53 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 54 | /** @addtogroup Components |
Wolfgang Betz |
7:a2bb3d5e12e9 | 55 | * @{ |
Wolfgang Betz |
24:92cc9c6e4b2b | 56 | */ |
Wolfgang Betz |
24:92cc9c6e4b2b | 57 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 58 | /** @addtogroup LSM6DS0 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 59 | * @{ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 60 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 61 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 62 | /** @defgroup LSM6DS0_Exported_Defines LSM6DS0_Exported_Defines |
Wolfgang Betz |
7:a2bb3d5e12e9 | 63 | * @{ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 64 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 65 | #ifndef NULL |
Wolfgang Betz |
24:92cc9c6e4b2b | 66 | #define NULL (void *) 0 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 67 | #endif |
Wolfgang Betz |
7:a2bb3d5e12e9 | 68 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 69 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 70 | /******************************************************************************/ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 71 | /*********** START ACCELEROMETER AND GYROSCOPE REGISTER MAPPING **************/ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 72 | /******************************************************************************/ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 73 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 74 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 75 | /***************************************** COMMON REGISTERS ********************************************/ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 76 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 77 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 78 | * @brief Interrupt config register |
Wolfgang Betz |
7:a2bb3d5e12e9 | 79 | * \code |
Wolfgang Betz |
7:a2bb3d5e12e9 | 80 | * Read/write |
Wolfgang Betz |
7:a2bb3d5e12e9 | 81 | * Default value: 0x00 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 82 | * [7] INT_IG_G: Gyroscope interrupt enable on INT pin |
Wolfgang Betz |
7:a2bb3d5e12e9 | 83 | * [6] INT_IG_XL: Accelerometer interrupt generator on INT pin |
Wolfgang Betz |
7:a2bb3d5e12e9 | 84 | * [5] INT_FSS5: FSS5 interrupt enable on INT pin |
Wolfgang Betz |
7:a2bb3d5e12e9 | 85 | * [4] INT_OVR: Overrun interrupt on INT pin |
Wolfgang Betz |
7:a2bb3d5e12e9 | 86 | * [3] INT_FTH: Gyroscope interrupt enable on INT pin |
Wolfgang Betz |
7:a2bb3d5e12e9 | 87 | * [2] INT_BOOT: Accelerometer interrupt generator on INT pin |
Wolfgang Betz |
7:a2bb3d5e12e9 | 88 | * [1] INT_DRDY_G: FSS5 interrupt enable on INT pin |
Wolfgang Betz |
7:a2bb3d5e12e9 | 89 | * [0] INT_DRDY_XL: Overrun interrupt on INT pin |
Wolfgang Betz |
7:a2bb3d5e12e9 | 90 | * \endcode |
Wolfgang Betz |
7:a2bb3d5e12e9 | 91 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 92 | #define LSM6DS0_XG_INT_CTRL 0x0C |
Wolfgang Betz |
7:a2bb3d5e12e9 | 93 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 94 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 95 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 96 | * @brief Device identifier register. |
Wolfgang Betz |
7:a2bb3d5e12e9 | 97 | * \code |
Wolfgang Betz |
7:a2bb3d5e12e9 | 98 | * Read |
Wolfgang Betz |
7:a2bb3d5e12e9 | 99 | * Default value: |
Wolfgang Betz |
7:a2bb3d5e12e9 | 100 | * [7:0] This read-only register contains the device identifier |
Wolfgang Betz |
7:a2bb3d5e12e9 | 101 | * \endcode |
Wolfgang Betz |
7:a2bb3d5e12e9 | 102 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 103 | #define LSM6DS0_XG_WHO_AM_I_ADDR 0x0F |
Wolfgang Betz |
7:a2bb3d5e12e9 | 104 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 105 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 106 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 107 | * @brief Control Register 4 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 108 | * \code |
Wolfgang Betz |
7:a2bb3d5e12e9 | 109 | * Read/write |
Wolfgang Betz |
7:a2bb3d5e12e9 | 110 | * Default value: 0x38 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 111 | * [5] Zen_G: Gyroscope�s Z-axis output enable |
Wolfgang Betz |
7:a2bb3d5e12e9 | 112 | * [4] Yen_G: Gyroscope�s Y-axis output enable |
Wolfgang Betz |
7:a2bb3d5e12e9 | 113 | * [3] Xen_G: Gyroscope�s X-axis output enable |
Wolfgang Betz |
7:a2bb3d5e12e9 | 114 | * \endcode |
Wolfgang Betz |
7:a2bb3d5e12e9 | 115 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 116 | #define LSM6DS0_XG_CTRL_REG4 0x1E |
Wolfgang Betz |
7:a2bb3d5e12e9 | 117 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 118 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 119 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 120 | * @brief Control Register 10 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 121 | * \code |
Wolfgang Betz |
7:a2bb3d5e12e9 | 122 | * Read/write |
Wolfgang Betz |
7:a2bb3d5e12e9 | 123 | * Default value: 0x00 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 124 | * [2] ST_G: Gyro selftest disable (0) / enable (1) |
Wolfgang Betz |
7:a2bb3d5e12e9 | 125 | * [0] ST_XL: Accel selftest disable (0) / enable (1) |
Wolfgang Betz |
7:a2bb3d5e12e9 | 126 | * \endcode |
Wolfgang Betz |
7:a2bb3d5e12e9 | 127 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 128 | #define LSM6DS0_XG_CTRL_REG10 0x24 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 129 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 130 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 131 | /***************************************** GYROSCOPE REGISTERS ********************************************/ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 132 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 133 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 134 | * @brief Angular rate sensor Control Register 1 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 135 | * \code |
Wolfgang Betz |
7:a2bb3d5e12e9 | 136 | * Read/write |
Wolfgang Betz |
7:a2bb3d5e12e9 | 137 | * Default value: 0x00 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 138 | * [7:5] ODR_G2-0: Gyroscope output data rate selection |
Wolfgang Betz |
7:a2bb3d5e12e9 | 139 | * [4:3] FS_G1-0: Gyroscope full-scale selection |
Wolfgang Betz |
7:a2bb3d5e12e9 | 140 | * [2] This bit must be set to �0� for the correct operation of the device |
Wolfgang Betz |
7:a2bb3d5e12e9 | 141 | * [1:0] BW_G1-0: Gyroscope bandwidth selection |
Wolfgang Betz |
7:a2bb3d5e12e9 | 142 | * \endcode |
Wolfgang Betz |
7:a2bb3d5e12e9 | 143 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 144 | #define LSM6DS0_XG_CTRL_REG1_G 0x10 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 145 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 146 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 147 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 148 | * @brief Gyroscope data (LSB) |
Wolfgang Betz |
7:a2bb3d5e12e9 | 149 | * \code |
Wolfgang Betz |
7:a2bb3d5e12e9 | 150 | * Read |
Wolfgang Betz |
7:a2bb3d5e12e9 | 151 | * \endcode |
Wolfgang Betz |
7:a2bb3d5e12e9 | 152 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 153 | #define LSM6DS0_XG_OUT_X_L_G 0x18 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 154 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 155 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 156 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 157 | * @brief Gyroscope data (MSB) |
Wolfgang Betz |
7:a2bb3d5e12e9 | 158 | * \code |
Wolfgang Betz |
7:a2bb3d5e12e9 | 159 | * Read |
Wolfgang Betz |
7:a2bb3d5e12e9 | 160 | * \endcode |
Wolfgang Betz |
7:a2bb3d5e12e9 | 161 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 162 | #define LSM6DS0_XG_OUT_X_H_G 0x19 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 163 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 164 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 165 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 166 | * @brief Gyroscope data (LSB) |
Wolfgang Betz |
7:a2bb3d5e12e9 | 167 | * \code |
Wolfgang Betz |
7:a2bb3d5e12e9 | 168 | * Read |
Wolfgang Betz |
7:a2bb3d5e12e9 | 169 | * \endcode |
Wolfgang Betz |
7:a2bb3d5e12e9 | 170 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 171 | #define LSM6DS0_XG_OUT_Y_L_G 0x1A |
Wolfgang Betz |
7:a2bb3d5e12e9 | 172 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 173 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 174 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 175 | * @brief Gyroscope data (MSB) |
Wolfgang Betz |
7:a2bb3d5e12e9 | 176 | * \code |
Wolfgang Betz |
7:a2bb3d5e12e9 | 177 | * Read |
Wolfgang Betz |
7:a2bb3d5e12e9 | 178 | * \endcode |
Wolfgang Betz |
7:a2bb3d5e12e9 | 179 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 180 | #define LSM6DS0_XG_OUT_Y_H_G 0x1B |
Wolfgang Betz |
7:a2bb3d5e12e9 | 181 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 182 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 183 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 184 | * @brief Gyroscope data (LSB) |
Wolfgang Betz |
7:a2bb3d5e12e9 | 185 | * \code |
Wolfgang Betz |
7:a2bb3d5e12e9 | 186 | * Read |
Wolfgang Betz |
7:a2bb3d5e12e9 | 187 | * \endcode |
Wolfgang Betz |
7:a2bb3d5e12e9 | 188 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 189 | #define LSM6DS0_XG_OUT_Z_L_G 0x1C |
Wolfgang Betz |
7:a2bb3d5e12e9 | 190 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 191 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 192 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 193 | * @brief Gyroscope data (MSB) |
Wolfgang Betz |
7:a2bb3d5e12e9 | 194 | * \code |
Wolfgang Betz |
7:a2bb3d5e12e9 | 195 | * Read |
Wolfgang Betz |
7:a2bb3d5e12e9 | 196 | * \endcode |
Wolfgang Betz |
7:a2bb3d5e12e9 | 197 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 198 | #define LSM6DS0_XG_OUT_Z_H_G 0x1D |
Wolfgang Betz |
7:a2bb3d5e12e9 | 199 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 200 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 201 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 202 | /*************************************** ACCELEROMETER REGISTERS *******************************************/ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 203 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 204 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 205 | * @brief Linear acceleration sensor Control Register 6 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 206 | * \code |
Wolfgang Betz |
7:a2bb3d5e12e9 | 207 | * Read/write |
Wolfgang Betz |
7:a2bb3d5e12e9 | 208 | * Default value: 0x00 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 209 | * [7:5] ODR_XL2-0: Accelerometer Output data rate and power mode selection |
Wolfgang Betz |
7:a2bb3d5e12e9 | 210 | * [4:3] FS1_XL-FS0_XL: Accelerometer full-scale selection |
Wolfgang Betz |
7:a2bb3d5e12e9 | 211 | * [2] BW_SCAL_ODR: Bandwidth selection |
Wolfgang Betz |
7:a2bb3d5e12e9 | 212 | * [1:0] BW_XL1-0: Anti-aliasing filter bandwidth selection |
Wolfgang Betz |
7:a2bb3d5e12e9 | 213 | * \endcode |
Wolfgang Betz |
7:a2bb3d5e12e9 | 214 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 215 | #define LSM6DS0_XG_CTRL_REG6_XL 0x20 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 216 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 217 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 218 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 219 | * @brief Linear acceleration sensor Control Register 5 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 220 | * \code |
Wolfgang Betz |
7:a2bb3d5e12e9 | 221 | * Read/write |
Wolfgang Betz |
7:a2bb3d5e12e9 | 222 | * Default value: 0x38 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 223 | * [7:6] DEC1-0: Decimation of acceleration data on OUT REG and FIFO |
Wolfgang Betz |
7:a2bb3d5e12e9 | 224 | * [5] Zen_XL: Accelerometer�s Z-axis output enable |
Wolfgang Betz |
7:a2bb3d5e12e9 | 225 | * [4] Yen_XL: Accelerometer�s Y-axis output enable |
Wolfgang Betz |
7:a2bb3d5e12e9 | 226 | * [3] Xen_XL: Accelerometer�s X-axis output enable |
Wolfgang Betz |
7:a2bb3d5e12e9 | 227 | * [2:0] These bits must be set to �0� for the correct operation of the device |
Wolfgang Betz |
7:a2bb3d5e12e9 | 228 | * \endcode |
Wolfgang Betz |
7:a2bb3d5e12e9 | 229 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 230 | #define LSM6DS0_XG_CTRL_REG5_XL 0x1F |
Wolfgang Betz |
7:a2bb3d5e12e9 | 231 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 232 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 233 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 234 | * @brief Accelerometer data (LSB) |
Wolfgang Betz |
7:a2bb3d5e12e9 | 235 | * \code |
Wolfgang Betz |
7:a2bb3d5e12e9 | 236 | * Read |
Wolfgang Betz |
7:a2bb3d5e12e9 | 237 | * \endcode |
Wolfgang Betz |
7:a2bb3d5e12e9 | 238 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 239 | #define LSM6DS0_XG_OUT_X_L_XL 0x28 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 240 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 241 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 242 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 243 | * @brief Accelerometer data (MSB) |
Wolfgang Betz |
7:a2bb3d5e12e9 | 244 | * \code |
Wolfgang Betz |
7:a2bb3d5e12e9 | 245 | * Read |
Wolfgang Betz |
7:a2bb3d5e12e9 | 246 | * \endcode |
Wolfgang Betz |
7:a2bb3d5e12e9 | 247 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 248 | #define LSM6DS0_XG_OUT_X_H_XL 0x29 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 249 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 250 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 251 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 252 | * @brief Accelerometer data (LSB) |
Wolfgang Betz |
7:a2bb3d5e12e9 | 253 | * \code |
Wolfgang Betz |
7:a2bb3d5e12e9 | 254 | * Read |
Wolfgang Betz |
7:a2bb3d5e12e9 | 255 | * \endcode |
Wolfgang Betz |
7:a2bb3d5e12e9 | 256 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 257 | #define LSM6DS0_XG_OUT_Y_L_XL 0x2A |
Wolfgang Betz |
7:a2bb3d5e12e9 | 258 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 259 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 260 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 261 | * @brief Accelerometer data (MSB) |
Wolfgang Betz |
7:a2bb3d5e12e9 | 262 | * \code |
Wolfgang Betz |
7:a2bb3d5e12e9 | 263 | * Read |
Wolfgang Betz |
7:a2bb3d5e12e9 | 264 | * \endcode |
Wolfgang Betz |
7:a2bb3d5e12e9 | 265 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 266 | #define LSM6DS0_XG_OUT_Y_H_XL 0x2B |
Wolfgang Betz |
7:a2bb3d5e12e9 | 267 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 268 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 269 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 270 | * @brief Accelerometer data (LSB) |
Wolfgang Betz |
7:a2bb3d5e12e9 | 271 | * \code |
Wolfgang Betz |
7:a2bb3d5e12e9 | 272 | * Read |
Wolfgang Betz |
7:a2bb3d5e12e9 | 273 | * \endcode |
Wolfgang Betz |
7:a2bb3d5e12e9 | 274 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 275 | #define LSM6DS0_XG_OUT_Z_L_XL 0x2C |
Wolfgang Betz |
7:a2bb3d5e12e9 | 276 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 277 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 278 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 279 | * @brief Accelerometer data (MSB) |
Wolfgang Betz |
7:a2bb3d5e12e9 | 280 | * \code |
Wolfgang Betz |
7:a2bb3d5e12e9 | 281 | * Read |
Wolfgang Betz |
7:a2bb3d5e12e9 | 282 | * \endcode |
Wolfgang Betz |
7:a2bb3d5e12e9 | 283 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 284 | #define LSM6DS0_XG_OUT_Z_H_XL 0x2D |
Wolfgang Betz |
7:a2bb3d5e12e9 | 285 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 286 | /******************************************************************************/ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 287 | /************* END ACCELEROMETER AND GYROSCOPE REGISTER MAPPING **************/ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 288 | /******************************************************************************/ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 289 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 290 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 291 | * @brief Multiple Byte. Mask for enabling multiple byte read/write command. |
Wolfgang Betz |
24:92cc9c6e4b2b | 292 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 293 | #define LSM6DS0_I2C_MULTIPLEBYTE_CMD ((uint8_t)0x80) |
Wolfgang Betz |
7:a2bb3d5e12e9 | 294 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 295 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 296 | * @brief Device Address |
Wolfgang Betz |
7:a2bb3d5e12e9 | 297 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 298 | #define LSM6DS0_ADDRESS_LOW 0xD4 // SAD[0] = 0 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 299 | #define LSM6DS0_ADDRESS_HIGH 0xD6 // SAD[0] = 1 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 300 | #define LSM6DS0_XG_MEMS_ADDRESS LSM6DS0_ADDRESS_HIGH // SAD[0] = 1 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 301 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 302 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 303 | * @brief Device Identifier. Default value of the WHO_AM_I register. |
Wolfgang Betz |
7:a2bb3d5e12e9 | 304 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 305 | #define I_AM_LSM6DS0_XG ((uint8_t)0x68) |
Wolfgang Betz |
7:a2bb3d5e12e9 | 306 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 307 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 308 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 309 | /************************************** GYROSCOPE REGISTERS VALUE *******************************************/ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 310 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 311 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 312 | /** @defgroup LSM6DS0_XG_Gyroscope_Output_Data_Rate_Selection_CTRL_REG1_G LSM6DS0_XG_Gyroscope_Output_Data_Rate_Selection_CTRL_REG1_G |
Wolfgang Betz |
7:a2bb3d5e12e9 | 313 | * @{ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 314 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 315 | #define LSM6DS0_G_ODR_PD ((uint8_t)0x00) /*!< Output Data Rate: Power-down*/ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 316 | #define LSM6DS0_G_ODR_14_9HZ ((uint8_t)0x20) /*!< Output Data Rate: 14.9 Hz, cutoff 5Hz */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 317 | #define LSM6DS0_G_ODR_59_5HZ ((uint8_t)0x40) /*!< Output Data Rate: 59.5 Hz, cutoff 19Hz */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 318 | #define LSM6DS0_G_ODR_119HZ ((uint8_t)0x60) /*!< Output Data Rate: 119 Hz, cutoff 38Hz*/ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 319 | #define LSM6DS0_G_ODR_238HZ ((uint8_t)0x80) /*!< Output Data Rate: 238 Hz, cutoff 76Hz*/ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 320 | #define LSM6DS0_G_ODR_476HZ ((uint8_t)0xA0) /*!< Output Data Rate: 476 Hz, cutoff 100Hz*/ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 321 | #define LSM6DS0_G_ODR_952HZ ((uint8_t)0xC0) /*!< Output Data Rate: 952 Hz, cutoff 100Hz*/ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 322 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 323 | #define LSM6DS0_G_ODR_MASK ((uint8_t)0xE0) |
Wolfgang Betz |
7:a2bb3d5e12e9 | 324 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 325 | * @} |
Wolfgang Betz |
7:a2bb3d5e12e9 | 326 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 327 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 328 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 329 | /** @defgroup LSM6DS0_XG_Gyroscope_Bandwidth_Selection_CTRL_REG1_G LSM6DS0_XG_Gyroscope_Bandwidth_Selection_CTRL_REG1_G |
Wolfgang Betz |
7:a2bb3d5e12e9 | 330 | * @{ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 331 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 332 | #define LSM6DS0_G_BW_00 ((uint8_t)0x00) /*!< Bandwidth selection: - cutoff = n.a. when ODR = Power-down |
Wolfgang Betz |
7:a2bb3d5e12e9 | 333 | - cutoff = n.a. when ODR = 14.9 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 334 | - cutoff = 16 when ODR = 59.5 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 335 | - cutoff = 14 when ODR = 119 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 336 | - cutoff = 14 when ODR = 238 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 337 | - cutoff = 21 when ODR = 476 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 338 | - cutoff = 33 when ODR = 952 */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 339 | #define LSM6DS0_G_BW_01 ((uint8_t)0x01) /*!< Bandwidth selection: - cutoff = n.a. when ODR = Power-down |
Wolfgang Betz |
7:a2bb3d5e12e9 | 340 | - cutoff = n.a. when ODR = 14.9 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 341 | - cutoff = 16 when ODR = 59.5 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 342 | - cutoff = 31 when ODR = 119 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 343 | - cutoff = 29 when ODR = 238 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 344 | - cutoff = 28 when ODR = 476 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 345 | - cutoff = 40 when ODR = 952 */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 346 | #define LSM6DS0_G_BW_10 ((uint8_t)0x02) /*!< Bandwidth selection: - cutoff = n.a. when ODR = Power-down |
Wolfgang Betz |
7:a2bb3d5e12e9 | 347 | - cutoff = n.a. when ODR = 14.9 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 348 | - cutoff = 16 when ODR = 59.5 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 349 | - cutoff = 31 when ODR = 119 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 350 | - cutoff = 63 when ODR = 238 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 351 | - cutoff = 57 when ODR = 476 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 352 | - cutoff = 58 when ODR = 952 */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 353 | #define LSM6DS0_G_BW_11 ((uint8_t)0x03) /*!< Bandwidth selection: - cutoff = n.a. when ODR = Power-down |
Wolfgang Betz |
7:a2bb3d5e12e9 | 354 | - cutoff = n.a. when ODR = 14.9 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 355 | - cutoff = 16 when ODR = 59.5 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 356 | - cutoff = 31 when ODR = 119 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 357 | - cutoff = 78 when ODR = 238 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 358 | - cutoff = 100 when ODR = 476 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 359 | - cutoff = 100 when ODR = 952 */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 360 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 361 | #define LSM6DS0_G_BW_MASK ((uint8_t)0x03) |
Wolfgang Betz |
7:a2bb3d5e12e9 | 362 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 363 | * @} |
Wolfgang Betz |
7:a2bb3d5e12e9 | 364 | */ |
Wolfgang Betz |
24:92cc9c6e4b2b | 365 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 366 | /** @defgroup LSM6DS0_XG_Gyroscope_Full_Scale_Selection_CTRL_REG1_G LSM6DS0_XG_Gyroscope_Full_Scale_Selection_CTRL_REG1_G |
Wolfgang Betz |
7:a2bb3d5e12e9 | 367 | * @{ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 368 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 369 | #define LSM6DS0_G_FS_245 ((uint8_t)0x00) /*!< Full scale: 245 dps*/ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 370 | #define LSM6DS0_G_FS_500 ((uint8_t)0x08) /*!< Full scale: 500 dps */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 371 | #define LSM6DS0_G_FS_2000 ((uint8_t)0x18) /*!< Full scale: 2000 dps */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 372 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 373 | #define LSM6DS0_G_FS_MASK ((uint8_t)0x18) |
Wolfgang Betz |
7:a2bb3d5e12e9 | 374 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 375 | * @} |
Wolfgang Betz |
7:a2bb3d5e12e9 | 376 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 377 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 378 | /** @defgroup LSM6DS0_XG_Gyroscope_Z_Axis_Output_Enable_Selection_CTRL_REG4 LSM6DS0_XG_Gyroscope_Z_Axis_Output_Enable_Selection_CTRL_REG4 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 379 | * @{ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 380 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 381 | #define LSM6DS0_G_ZEN_DISABLE ((uint8_t)0x00) /*!< Gyroscope�s Z-axis output enable: disable */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 382 | #define LSM6DS0_G_ZEN_ENABLE ((uint8_t)0x20) /*!< Gyroscope�s Z-axis output enable: enable */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 383 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 384 | #define LSM6DS0_G_ZEN_MASK ((uint8_t)0x20) |
Wolfgang Betz |
7:a2bb3d5e12e9 | 385 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 386 | * @} |
Wolfgang Betz |
7:a2bb3d5e12e9 | 387 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 388 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 389 | /** @defgroup LSM6DS0_XG_Gyroscope_Y_Axis_Output_Enable_Selection_CTRL_REG4 LSM6DS0_XG_Gyroscope_Y_Axis_Output_Enable_Selection_CTRL_REG4 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 390 | * @{ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 391 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 392 | #define LSM6DS0_G_YEN_DISABLE ((uint8_t)0x00) /*!< Gyroscope�s Y-axis output enable: disable */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 393 | #define LSM6DS0_G_YEN_ENABLE ((uint8_t)0x10) /*!< Gyroscope�s Y-axis output enable: enable */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 394 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 395 | #define LSM6DS0_G_YEN_MASK ((uint8_t)0x10) |
Wolfgang Betz |
7:a2bb3d5e12e9 | 396 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 397 | * @} |
Wolfgang Betz |
7:a2bb3d5e12e9 | 398 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 399 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 400 | /** @defgroup LSM6DS0_XG_Gyroscope_X_Axis_Output_Enable_Selection_CTRL_REG4 LSM6DS0_XG_Gyroscope_X_Axis_Output_Enable_Selection_CTRL_REG4 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 401 | * @{ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 402 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 403 | #define LSM6DS0_G_XEN_DISABLE ((uint8_t)0x00) /*!< Gyroscope�s X-axis output enable: disable */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 404 | #define LSM6DS0_G_XEN_ENABLE ((uint8_t)0x08) /*!< Gyroscope�s X-axis output enable: enable */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 405 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 406 | #define LSM6DS0_G_XEN_MASK ((uint8_t)0x08) |
Wolfgang Betz |
7:a2bb3d5e12e9 | 407 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 408 | * @} |
Wolfgang Betz |
7:a2bb3d5e12e9 | 409 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 410 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 411 | /** @defgroup LSM6DS0_XG_Gyroscope_Selftest_Enable_Selection_CTRL_REG10 LSM6DS0_XG_Gyroscope_Selftest_Enable_Selection_CTRL_REG10 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 412 | * @{ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 413 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 414 | #define LSM6DS0_G_ST_DISABLE ((uint8_t)0x00) /*!< Gyro selftest disable */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 415 | #define LSM6DS0_G_ST_ENABLE ((uint8_t)0x04) /*!< Gyro selftest enable */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 416 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 417 | #define LSM6DS0_G_ST_MASK ((uint8_t)0x04) |
Wolfgang Betz |
7:a2bb3d5e12e9 | 418 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 419 | * @} |
Wolfgang Betz |
7:a2bb3d5e12e9 | 420 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 421 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 422 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 423 | /************************************ ACCELEROMETER REGISTERS VALUE *****************************************/ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 424 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 425 | /** @defgroup LSM6DS0_XG_Accelerometer_Output_Data_Rate_Selection_CTRL_REG6_XL LSM6DS0_XG_Accelerometer_Output_Data_Rate_Selection_CTRL_REG6_XL |
Wolfgang Betz |
7:a2bb3d5e12e9 | 426 | * @{ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 427 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 428 | #define LSM6DS0_XL_ODR_PD ((uint8_t)0x00) /*!< Output Data Rate: Power-down*/ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 429 | #define LSM6DS0_XL_ODR_10HZ ((uint8_t)0x20) /*!< Output Data Rate: 10 Hz*/ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 430 | #define LSM6DS0_XL_ODR_50HZ ((uint8_t)0x40) /*!< Output Data Rate: 50 Hz */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 431 | #define LSM6DS0_XL_ODR_119HZ ((uint8_t)0x60) /*!< Output Data Rate: 119 Hz */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 432 | #define LSM6DS0_XL_ODR_238HZ ((uint8_t)0x80) /*!< Output Data Rate: 238 Hz */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 433 | #define LSM6DS0_XL_ODR_476HZ ((uint8_t)0xA0) /*!< Output Data Rate: 476 Hz */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 434 | #define LSM6DS0_XL_ODR_952HZ ((uint8_t)0xC0) /*!< Output Data Rate: 952 Hz */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 435 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 436 | #define LSM6DS0_XL_ODR_MASK ((uint8_t)0xE0) |
Wolfgang Betz |
7:a2bb3d5e12e9 | 437 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 438 | * @} |
Wolfgang Betz |
7:a2bb3d5e12e9 | 439 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 440 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 441 | /** @defgroup LSM6DS0_XG_Accelerometer_Full_Scale_Selection_CTRL_REG6_XL LSM6DS0_XG_Accelerometer_Full_Scale_Selection_CTRL_REG6_XL |
Wolfgang Betz |
7:a2bb3d5e12e9 | 442 | * @{ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 443 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 444 | #define LSM6DS0_XL_FS_2G ((uint8_t)0x00) /*!< Full scale: +- 2g */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 445 | #define LSM6DS0_XL_FS_4G ((uint8_t)0x10) /*!< Full scale: +- 4g */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 446 | #define LSM6DS0_XL_FS_8G ((uint8_t)0x18) /*!< Full scale: +- 8g */ |
Wolfgang Betz |
24:92cc9c6e4b2b | 447 | #define LSM6DS0_XL_FS_16G ((uint8_t)0x08) /*!< Full scale: +- 16g */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 448 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 449 | #define LSM6DS0_XL_FS_MASK ((uint8_t)0x18) |
Wolfgang Betz |
7:a2bb3d5e12e9 | 450 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 451 | * @} |
Wolfgang Betz |
7:a2bb3d5e12e9 | 452 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 453 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 454 | /** @defgroup LSM6DS0_XG_Accelerometer_Bandwidth_Selection_CTRL_REG6_XL LSM6DS0_XG_Accelerometer_Bandwidth_Selection_CTRL_REG6_XL |
Wolfgang Betz |
7:a2bb3d5e12e9 | 455 | * @{ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 456 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 457 | #define LSM6DS0_XL_BW_SCAL_ODR ((uint8_t)0x00) /*!< Bandwidth selection: determined by ODR: |
Wolfgang Betz |
7:a2bb3d5e12e9 | 458 | - BW = 408Hz when ODR = 952Hz, 50Hz, 10Hz |
Wolfgang Betz |
7:a2bb3d5e12e9 | 459 | - BW = 211Hz when ODR = 476Hz |
Wolfgang Betz |
7:a2bb3d5e12e9 | 460 | - BW = 105Hz when ODR = 238Hz |
Wolfgang Betz |
7:a2bb3d5e12e9 | 461 | - BW = 50Hz when ODR = 119Hz */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 462 | #define LSM6DS0_XL_BW_SCAL_BW ((uint8_t)0x04) /*!< Bandwidth selection: selected according to Anti aliasing filter bandwidth */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 463 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 464 | #define LSM6DS0_XL_BW_SCAL_MASK ((uint8_t)0x04) |
Wolfgang Betz |
7:a2bb3d5e12e9 | 465 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 466 | * @} |
Wolfgang Betz |
7:a2bb3d5e12e9 | 467 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 468 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 469 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 470 | /** @defgroup LSM6DS0_XG_Accelerometer_Anti_Aliasing_Filter_Bandwidth_Selection_CTRL_REG6_XL LSM6DS0_XG_Accelerometer_Anti_Aliasing_Filter_Bandwidth_Selection_CTRL_REG6_XL |
Wolfgang Betz |
7:a2bb3d5e12e9 | 471 | * @{ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 472 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 473 | #define LSM6DS0_XL_BW_408HZ ((uint8_t)0x00) /*!< Anti-aliasing filter bandwidht: 408 Hz */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 474 | #define LSM6DS0_XL_BW_211HZ ((uint8_t)0x01) /*!< Anti-aliasing filter bandwidht: 211 Hz */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 475 | #define LSM6DS0_XL_BW_105HZ ((uint8_t)0x02) /*!< Anti-aliasing filter bandwidht: 105 Hz */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 476 | #define LSM6DS0_XL_BW_50HZ ((uint8_t)0x03) /*!< Anti-aliasing filter bandwidht: 50 Hz */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 477 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 478 | #define LSM6DS0_XL_BW_MASK ((uint8_t)0x03) |
Wolfgang Betz |
7:a2bb3d5e12e9 | 479 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 480 | * @} |
Wolfgang Betz |
7:a2bb3d5e12e9 | 481 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 482 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 483 | /** @defgroup LSM6DS0_XG_Accelerometer_Decimation_Acceleration_Data_Selection_CTRL_REG5_XL LSM6DS0_XG_Accelerometer_Decimation_Acceleration_Data_Selection_CTRL_REG5_XL |
Wolfgang Betz |
7:a2bb3d5e12e9 | 484 | * @{ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 485 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 486 | #define LSM6DS0_XL_DEC_NO ((uint8_t)0x00) /*!< Decimation of acceleration data: no decimation */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 487 | #define LSM6DS0_XL_DEC_EVERY_2S ((uint8_t)0x40) /*!< Decimation of acceleration data: update every 2 samples */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 488 | #define LSM6DS0_XL_DEC_EVERY_4S ((uint8_t)0x80) /*!< Decimation of acceleration data: update every 4 samples */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 489 | #define LSM6DS0_XL_DEC_EVERY_8S ((uint8_t)0xC0) /*!< Decimation of acceleration data: update every 8 samples */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 490 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 491 | #define LSM6DS0_XL_DEC_MASK ((uint8_t)0xC0) |
Wolfgang Betz |
7:a2bb3d5e12e9 | 492 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 493 | * @} |
Wolfgang Betz |
7:a2bb3d5e12e9 | 494 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 495 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 496 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 497 | /** @defgroup LSM6DS0_XG_Accelerometer_Z_Axis_Output_Enable_Selection_CTRL_REG5_XL LSM6DS0_XG_Accelerometer_Z_Axis_Output_Enable_Selection_CTRL_REG5_XL |
Wolfgang Betz |
7:a2bb3d5e12e9 | 498 | * @{ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 499 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 500 | #define LSM6DS0_XL_ZEN_DISABLE ((uint8_t)0x00) /*!< Accelerometer�s Z-axis output enable: disable */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 501 | #define LSM6DS0_XL_ZEN_ENABLE ((uint8_t)0x20) /*!< Accelerometer�s Z-axis output enable: enable */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 502 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 503 | #define LSM6DS0_XL_ZEN_MASK ((uint8_t)0x20) |
Wolfgang Betz |
7:a2bb3d5e12e9 | 504 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 505 | * @} |
Wolfgang Betz |
7:a2bb3d5e12e9 | 506 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 507 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 508 | /** @defgroup LSM6DS0_XG_Accelerometer_Y_Axis_Output_Enable_Selection_CTRL_REG5_XL LSM6DS0_XG_Accelerometer_Y_Axis_Output_Enable_Selection_CTRL_REG5_XL |
Wolfgang Betz |
7:a2bb3d5e12e9 | 509 | * @{ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 510 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 511 | #define LSM6DS0_XL_YEN_DISABLE ((uint8_t)0x00) /*!< Accelerometer�s Y-axis output enable: disable */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 512 | #define LSM6DS0_XL_YEN_ENABLE ((uint8_t)0x10) /*!< Accelerometer�s Y-axis output enable: enable */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 513 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 514 | #define LSM6DS0_XL_YEN_MASK ((uint8_t)0x10) |
Wolfgang Betz |
7:a2bb3d5e12e9 | 515 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 516 | * @} |
Wolfgang Betz |
7:a2bb3d5e12e9 | 517 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 518 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 519 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 520 | /** @defgroup LSM6DS0_XG_Accelerometer_X_Axis_Output_Enable_Selection_CTRL_REG5_XL LSM6DS0_XG_Accelerometer_X_Axis_Output_Enable_Selection_CTRL_REG5_XL |
Wolfgang Betz |
7:a2bb3d5e12e9 | 521 | * @{ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 522 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 523 | #define LSM6DS0_XL_XEN_DISABLE ((uint8_t)0x00) /*!< Accelerometer�s X-axis output enable: disable */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 524 | #define LSM6DS0_XL_XEN_ENABLE ((uint8_t)0x08) /*!< Accelerometer�s X-axis output enable: enable */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 525 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 526 | #define LSM6DS0_XL_XEN_MASK ((uint8_t)0x08) |
Wolfgang Betz |
7:a2bb3d5e12e9 | 527 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 528 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 529 | * @} |
Wolfgang Betz |
7:a2bb3d5e12e9 | 530 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 531 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 532 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 533 | /** @defgroup LSM6DS0_XG_Accelerometer_Selftest_Enable_Selection_CTRL_REG10 LSM6DS0_XG_Accelerometer_Selftest_Enable_Selection_CTRL_REG10 |
Wolfgang Betz |
7:a2bb3d5e12e9 | 534 | * @{ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 535 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 536 | #define LSM6DS0_XL_ST_DISABLE ((uint8_t)0x00) /*!< Accel selftest disable */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 537 | #define LSM6DS0_XL_ST_ENABLE ((uint8_t)0x01) /*!< Accel selftest enable */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 538 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 539 | #define LSM6DS0_XL_ST_MASK ((uint8_t)0x01) |
Wolfgang Betz |
7:a2bb3d5e12e9 | 540 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 541 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 542 | * @} |
Wolfgang Betz |
7:a2bb3d5e12e9 | 543 | */ |
Wolfgang Betz |
24:92cc9c6e4b2b | 544 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 545 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 546 | * @} |
Wolfgang Betz |
7:a2bb3d5e12e9 | 547 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 548 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 549 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 550 | /** @defgroup LSM6DS0_Imported_Functions LSM6DS0_Imported_Functions |
Wolfgang Betz |
7:a2bb3d5e12e9 | 551 | * @{ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 552 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 553 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 554 | /* Six axes sensor IO functions */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 555 | extern IMU_6AXES_StatusTypeDef LSM6DS0_IO_Init(void); |
Wolfgang Betz |
24:92cc9c6e4b2b | 556 | extern IMU_6AXES_StatusTypeDef LSM6DS0_IO_Write(uint8_t* pBuffer, uint8_t DeviceAddr, uint8_t RegisterAddr, |
Wolfgang Betz |
24:92cc9c6e4b2b | 557 | uint16_t NumByteToWrite); |
Wolfgang Betz |
24:92cc9c6e4b2b | 558 | extern IMU_6AXES_StatusTypeDef LSM6DS0_IO_Read(uint8_t* pBuffer, uint8_t DeviceAddr, uint8_t RegisterAddr, |
Wolfgang Betz |
24:92cc9c6e4b2b | 559 | uint16_t NumByteToRead); |
Wolfgang Betz |
7:a2bb3d5e12e9 | 560 | extern void LSM6DS0_IO_ITConfig( void ); |
Wolfgang Betz |
7:a2bb3d5e12e9 | 561 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 562 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 563 | * @} |
Wolfgang Betz |
7:a2bb3d5e12e9 | 564 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 565 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 566 | /* ------------------------------------------------------- */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 567 | /* Here you should declare the internal struct of */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 568 | /* extended features of LIS3MDL. See the example of */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 569 | /* LSM6DS3 in lsm6ds3.h */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 570 | /* ------------------------------------------------------- */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 571 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 572 | /** @addtogroup LSM6DS0_Exported_Variables LSM6DS0_Exported_Variables |
Wolfgang Betz |
7:a2bb3d5e12e9 | 573 | * @{ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 574 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 575 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 576 | /* Six axes sensor driver structure */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 577 | extern IMU_6AXES_DrvTypeDef LSM6DS0Drv; |
Wolfgang Betz |
7:a2bb3d5e12e9 | 578 | extern IMU_6AXES_DrvExtTypeDef LSM6DS0Drv_ext; |
Wolfgang Betz |
7:a2bb3d5e12e9 | 579 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 580 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 581 | * @} |
Wolfgang Betz |
7:a2bb3d5e12e9 | 582 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 583 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 584 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 585 | * @} |
Wolfgang Betz |
7:a2bb3d5e12e9 | 586 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 587 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 588 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 589 | * @} |
Wolfgang Betz |
7:a2bb3d5e12e9 | 590 | */ |
Wolfgang Betz |
24:92cc9c6e4b2b | 591 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 592 | /** |
Wolfgang Betz |
7:a2bb3d5e12e9 | 593 | * @} |
Wolfgang Betz |
7:a2bb3d5e12e9 | 594 | */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 595 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 596 | #ifdef __cplusplus |
Wolfgang Betz |
7:a2bb3d5e12e9 | 597 | } |
Wolfgang Betz |
7:a2bb3d5e12e9 | 598 | #endif |
Wolfgang Betz |
7:a2bb3d5e12e9 | 599 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 600 | #endif /* __LSM6DS0_H */ |
Wolfgang Betz |
7:a2bb3d5e12e9 | 601 | |
Wolfgang Betz |
7:a2bb3d5e12e9 | 602 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |