Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of ReferredCoursework2016 by
lsm6ds0.h
00001 /** 00002 ****************************************************************************** 00003 * @file lsm6ds0.h 00004 * @author MEMS Application Team 00005 * @version V1.3.0 00006 * @date 28-May-2015 00007 * @brief This file contains definitions for the lsm6ds0.c 00008 * firmware driver. 00009 ****************************************************************************** 00010 * @attention 00011 * 00012 * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> 00013 * 00014 * Redistribution and use in source and binary forms, with or without modification, 00015 * are permitted provided that the following conditions are met: 00016 * 1. Redistributions of source code must retain the above copyright notice, 00017 * this list of conditions and the following disclaimer. 00018 * 2. Redistributions in binary form must reproduce the above copyright notice, 00019 * this list of conditions and the following disclaimer in the documentation 00020 * and/or other materials provided with the distribution. 00021 * 3. Neither the name of STMicroelectronics nor the names of its contributors 00022 * may be used to endorse or promote products derived from this software 00023 * without specific prior written permission. 00024 * 00025 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00026 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00027 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00028 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 00029 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00030 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00031 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00032 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00033 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00034 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00035 * 00036 ****************************************************************************** 00037 */ 00038 00039 /* Define to prevent recursive inclusion -------------------------------------*/ 00040 #ifndef __LSM6DS0_H 00041 #define __LSM6DS0_H 00042 00043 #ifdef __cplusplus 00044 extern "C" { 00045 #endif 00046 00047 /* Includes ------------------------------------------------------------------*/ 00048 #include "imu_6axes.h" 00049 00050 /** @addtogroup BSP 00051 * @{ 00052 */ 00053 00054 /** @addtogroup Components 00055 * @{ 00056 */ 00057 00058 /** @addtogroup LSM6DS0 00059 * @{ 00060 */ 00061 00062 /** @defgroup LSM6DS0_Exported_Defines LSM6DS0_Exported_Defines 00063 * @{ 00064 */ 00065 #ifndef NULL 00066 #define NULL (void *) 0 00067 #endif 00068 00069 00070 /******************************************************************************/ 00071 /*********** START ACCELEROMETER AND GYROSCOPE REGISTER MAPPING **************/ 00072 /******************************************************************************/ 00073 00074 00075 /***************************************** COMMON REGISTERS ********************************************/ 00076 00077 /** 00078 * @brief Interrupt config register 00079 * \code 00080 * Read/write 00081 * Default value: 0x00 00082 * [7] INT_IG_G: Gyroscope interrupt enable on INT pin 00083 * [6] INT_IG_XL: Accelerometer interrupt generator on INT pin 00084 * [5] INT_FSS5: FSS5 interrupt enable on INT pin 00085 * [4] INT_OVR: Overrun interrupt on INT pin 00086 * [3] INT_FTH: Gyroscope interrupt enable on INT pin 00087 * [2] INT_BOOT: Accelerometer interrupt generator on INT pin 00088 * [1] INT_DRDY_G: FSS5 interrupt enable on INT pin 00089 * [0] INT_DRDY_XL: Overrun interrupt on INT pin 00090 * \endcode 00091 */ 00092 #define LSM6DS0_XG_INT_CTRL 0x0C 00093 00094 00095 /** 00096 * @brief Device identifier register. 00097 * \code 00098 * Read 00099 * Default value: 00100 * [7:0] This read-only register contains the device identifier 00101 * \endcode 00102 */ 00103 #define LSM6DS0_XG_WHO_AM_I_ADDR 0x0F 00104 00105 00106 /** 00107 * @brief Control Register 4 00108 * \code 00109 * Read/write 00110 * Default value: 0x38 00111 * [5] Zen_G: Gyroscope�s Z-axis output enable 00112 * [4] Yen_G: Gyroscope�s Y-axis output enable 00113 * [3] Xen_G: Gyroscope�s X-axis output enable 00114 * \endcode 00115 */ 00116 #define LSM6DS0_XG_CTRL_REG4 0x1E 00117 00118 00119 /** 00120 * @brief Control Register 10 00121 * \code 00122 * Read/write 00123 * Default value: 0x00 00124 * [2] ST_G: Gyro selftest disable (0) / enable (1) 00125 * [0] ST_XL: Accel selftest disable (0) / enable (1) 00126 * \endcode 00127 */ 00128 #define LSM6DS0_XG_CTRL_REG10 0x24 00129 00130 00131 /***************************************** GYROSCOPE REGISTERS ********************************************/ 00132 00133 /** 00134 * @brief Angular rate sensor Control Register 1 00135 * \code 00136 * Read/write 00137 * Default value: 0x00 00138 * [7:5] ODR_G2-0: Gyroscope output data rate selection 00139 * [4:3] FS_G1-0: Gyroscope full-scale selection 00140 * [2] This bit must be set to �0� for the correct operation of the device 00141 * [1:0] BW_G1-0: Gyroscope bandwidth selection 00142 * \endcode 00143 */ 00144 #define LSM6DS0_XG_CTRL_REG1_G 0x10 00145 00146 00147 /** 00148 * @brief Gyroscope data (LSB) 00149 * \code 00150 * Read 00151 * \endcode 00152 */ 00153 #define LSM6DS0_XG_OUT_X_L_G 0x18 00154 00155 00156 /** 00157 * @brief Gyroscope data (MSB) 00158 * \code 00159 * Read 00160 * \endcode 00161 */ 00162 #define LSM6DS0_XG_OUT_X_H_G 0x19 00163 00164 00165 /** 00166 * @brief Gyroscope data (LSB) 00167 * \code 00168 * Read 00169 * \endcode 00170 */ 00171 #define LSM6DS0_XG_OUT_Y_L_G 0x1A 00172 00173 00174 /** 00175 * @brief Gyroscope data (MSB) 00176 * \code 00177 * Read 00178 * \endcode 00179 */ 00180 #define LSM6DS0_XG_OUT_Y_H_G 0x1B 00181 00182 00183 /** 00184 * @brief Gyroscope data (LSB) 00185 * \code 00186 * Read 00187 * \endcode 00188 */ 00189 #define LSM6DS0_XG_OUT_Z_L_G 0x1C 00190 00191 00192 /** 00193 * @brief Gyroscope data (MSB) 00194 * \code 00195 * Read 00196 * \endcode 00197 */ 00198 #define LSM6DS0_XG_OUT_Z_H_G 0x1D 00199 00200 00201 00202 /*************************************** ACCELEROMETER REGISTERS *******************************************/ 00203 00204 /** 00205 * @brief Linear acceleration sensor Control Register 6 00206 * \code 00207 * Read/write 00208 * Default value: 0x00 00209 * [7:5] ODR_XL2-0: Accelerometer Output data rate and power mode selection 00210 * [4:3] FS1_XL-FS0_XL: Accelerometer full-scale selection 00211 * [2] BW_SCAL_ODR: Bandwidth selection 00212 * [1:0] BW_XL1-0: Anti-aliasing filter bandwidth selection 00213 * \endcode 00214 */ 00215 #define LSM6DS0_XG_CTRL_REG6_XL 0x20 00216 00217 00218 /** 00219 * @brief Linear acceleration sensor Control Register 5 00220 * \code 00221 * Read/write 00222 * Default value: 0x38 00223 * [7:6] DEC1-0: Decimation of acceleration data on OUT REG and FIFO 00224 * [5] Zen_XL: Accelerometer�s Z-axis output enable 00225 * [4] Yen_XL: Accelerometer�s Y-axis output enable 00226 * [3] Xen_XL: Accelerometer�s X-axis output enable 00227 * [2:0] These bits must be set to �0� for the correct operation of the device 00228 * \endcode 00229 */ 00230 #define LSM6DS0_XG_CTRL_REG5_XL 0x1F 00231 00232 00233 /** 00234 * @brief Accelerometer data (LSB) 00235 * \code 00236 * Read 00237 * \endcode 00238 */ 00239 #define LSM6DS0_XG_OUT_X_L_XL 0x28 00240 00241 00242 /** 00243 * @brief Accelerometer data (MSB) 00244 * \code 00245 * Read 00246 * \endcode 00247 */ 00248 #define LSM6DS0_XG_OUT_X_H_XL 0x29 00249 00250 00251 /** 00252 * @brief Accelerometer data (LSB) 00253 * \code 00254 * Read 00255 * \endcode 00256 */ 00257 #define LSM6DS0_XG_OUT_Y_L_XL 0x2A 00258 00259 00260 /** 00261 * @brief Accelerometer data (MSB) 00262 * \code 00263 * Read 00264 * \endcode 00265 */ 00266 #define LSM6DS0_XG_OUT_Y_H_XL 0x2B 00267 00268 00269 /** 00270 * @brief Accelerometer data (LSB) 00271 * \code 00272 * Read 00273 * \endcode 00274 */ 00275 #define LSM6DS0_XG_OUT_Z_L_XL 0x2C 00276 00277 00278 /** 00279 * @brief Accelerometer data (MSB) 00280 * \code 00281 * Read 00282 * \endcode 00283 */ 00284 #define LSM6DS0_XG_OUT_Z_H_XL 0x2D 00285 00286 /******************************************************************************/ 00287 /************* END ACCELEROMETER AND GYROSCOPE REGISTER MAPPING **************/ 00288 /******************************************************************************/ 00289 00290 /** 00291 * @brief Multiple Byte. Mask for enabling multiple byte read/write command. 00292 */ 00293 #define LSM6DS0_I2C_MULTIPLEBYTE_CMD ((uint8_t)0x80) 00294 00295 /** 00296 * @brief Device Address 00297 */ 00298 #define LSM6DS0_ADDRESS_LOW 0xD4 // SAD[0] = 0 00299 #define LSM6DS0_ADDRESS_HIGH 0xD6 // SAD[0] = 1 00300 #define LSM6DS0_XG_MEMS_ADDRESS LSM6DS0_ADDRESS_HIGH // SAD[0] = 1 00301 00302 /** 00303 * @brief Device Identifier. Default value of the WHO_AM_I register. 00304 */ 00305 #define I_AM_LSM6DS0_XG ((uint8_t)0x68) 00306 00307 00308 00309 /************************************** GYROSCOPE REGISTERS VALUE *******************************************/ 00310 00311 00312 /** @defgroup LSM6DS0_XG_Gyroscope_Output_Data_Rate_Selection_CTRL_REG1_G LSM6DS0_XG_Gyroscope_Output_Data_Rate_Selection_CTRL_REG1_G 00313 * @{ 00314 */ 00315 #define LSM6DS0_G_ODR_PD ((uint8_t)0x00) /*!< Output Data Rate: Power-down*/ 00316 #define LSM6DS0_G_ODR_14_9HZ ((uint8_t)0x20) /*!< Output Data Rate: 14.9 Hz, cutoff 5Hz */ 00317 #define LSM6DS0_G_ODR_59_5HZ ((uint8_t)0x40) /*!< Output Data Rate: 59.5 Hz, cutoff 19Hz */ 00318 #define LSM6DS0_G_ODR_119HZ ((uint8_t)0x60) /*!< Output Data Rate: 119 Hz, cutoff 38Hz*/ 00319 #define LSM6DS0_G_ODR_238HZ ((uint8_t)0x80) /*!< Output Data Rate: 238 Hz, cutoff 76Hz*/ 00320 #define LSM6DS0_G_ODR_476HZ ((uint8_t)0xA0) /*!< Output Data Rate: 476 Hz, cutoff 100Hz*/ 00321 #define LSM6DS0_G_ODR_952HZ ((uint8_t)0xC0) /*!< Output Data Rate: 952 Hz, cutoff 100Hz*/ 00322 00323 #define LSM6DS0_G_ODR_MASK ((uint8_t)0xE0) 00324 /** 00325 * @} 00326 */ 00327 00328 00329 /** @defgroup LSM6DS0_XG_Gyroscope_Bandwidth_Selection_CTRL_REG1_G LSM6DS0_XG_Gyroscope_Bandwidth_Selection_CTRL_REG1_G 00330 * @{ 00331 */ 00332 #define LSM6DS0_G_BW_00 ((uint8_t)0x00) /*!< Bandwidth selection: - cutoff = n.a. when ODR = Power-down 00333 - cutoff = n.a. when ODR = 14.9 00334 - cutoff = 16 when ODR = 59.5 00335 - cutoff = 14 when ODR = 119 00336 - cutoff = 14 when ODR = 238 00337 - cutoff = 21 when ODR = 476 00338 - cutoff = 33 when ODR = 952 */ 00339 #define LSM6DS0_G_BW_01 ((uint8_t)0x01) /*!< Bandwidth selection: - cutoff = n.a. when ODR = Power-down 00340 - cutoff = n.a. when ODR = 14.9 00341 - cutoff = 16 when ODR = 59.5 00342 - cutoff = 31 when ODR = 119 00343 - cutoff = 29 when ODR = 238 00344 - cutoff = 28 when ODR = 476 00345 - cutoff = 40 when ODR = 952 */ 00346 #define LSM6DS0_G_BW_10 ((uint8_t)0x02) /*!< Bandwidth selection: - cutoff = n.a. when ODR = Power-down 00347 - cutoff = n.a. when ODR = 14.9 00348 - cutoff = 16 when ODR = 59.5 00349 - cutoff = 31 when ODR = 119 00350 - cutoff = 63 when ODR = 238 00351 - cutoff = 57 when ODR = 476 00352 - cutoff = 58 when ODR = 952 */ 00353 #define LSM6DS0_G_BW_11 ((uint8_t)0x03) /*!< Bandwidth selection: - cutoff = n.a. when ODR = Power-down 00354 - cutoff = n.a. when ODR = 14.9 00355 - cutoff = 16 when ODR = 59.5 00356 - cutoff = 31 when ODR = 119 00357 - cutoff = 78 when ODR = 238 00358 - cutoff = 100 when ODR = 476 00359 - cutoff = 100 when ODR = 952 */ 00360 00361 #define LSM6DS0_G_BW_MASK ((uint8_t)0x03) 00362 /** 00363 * @} 00364 */ 00365 00366 /** @defgroup LSM6DS0_XG_Gyroscope_Full_Scale_Selection_CTRL_REG1_G LSM6DS0_XG_Gyroscope_Full_Scale_Selection_CTRL_REG1_G 00367 * @{ 00368 */ 00369 #define LSM6DS0_G_FS_245 ((uint8_t)0x00) /*!< Full scale: 245 dps*/ 00370 #define LSM6DS0_G_FS_500 ((uint8_t)0x08) /*!< Full scale: 500 dps */ 00371 #define LSM6DS0_G_FS_2000 ((uint8_t)0x18) /*!< Full scale: 2000 dps */ 00372 00373 #define LSM6DS0_G_FS_MASK ((uint8_t)0x18) 00374 /** 00375 * @} 00376 */ 00377 00378 /** @defgroup LSM6DS0_XG_Gyroscope_Z_Axis_Output_Enable_Selection_CTRL_REG4 LSM6DS0_XG_Gyroscope_Z_Axis_Output_Enable_Selection_CTRL_REG4 00379 * @{ 00380 */ 00381 #define LSM6DS0_G_ZEN_DISABLE ((uint8_t)0x00) /*!< Gyroscope�s Z-axis output enable: disable */ 00382 #define LSM6DS0_G_ZEN_ENABLE ((uint8_t)0x20) /*!< Gyroscope�s Z-axis output enable: enable */ 00383 00384 #define LSM6DS0_G_ZEN_MASK ((uint8_t)0x20) 00385 /** 00386 * @} 00387 */ 00388 00389 /** @defgroup LSM6DS0_XG_Gyroscope_Y_Axis_Output_Enable_Selection_CTRL_REG4 LSM6DS0_XG_Gyroscope_Y_Axis_Output_Enable_Selection_CTRL_REG4 00390 * @{ 00391 */ 00392 #define LSM6DS0_G_YEN_DISABLE ((uint8_t)0x00) /*!< Gyroscope�s Y-axis output enable: disable */ 00393 #define LSM6DS0_G_YEN_ENABLE ((uint8_t)0x10) /*!< Gyroscope�s Y-axis output enable: enable */ 00394 00395 #define LSM6DS0_G_YEN_MASK ((uint8_t)0x10) 00396 /** 00397 * @} 00398 */ 00399 00400 /** @defgroup LSM6DS0_XG_Gyroscope_X_Axis_Output_Enable_Selection_CTRL_REG4 LSM6DS0_XG_Gyroscope_X_Axis_Output_Enable_Selection_CTRL_REG4 00401 * @{ 00402 */ 00403 #define LSM6DS0_G_XEN_DISABLE ((uint8_t)0x00) /*!< Gyroscope�s X-axis output enable: disable */ 00404 #define LSM6DS0_G_XEN_ENABLE ((uint8_t)0x08) /*!< Gyroscope�s X-axis output enable: enable */ 00405 00406 #define LSM6DS0_G_XEN_MASK ((uint8_t)0x08) 00407 /** 00408 * @} 00409 */ 00410 00411 /** @defgroup LSM6DS0_XG_Gyroscope_Selftest_Enable_Selection_CTRL_REG10 LSM6DS0_XG_Gyroscope_Selftest_Enable_Selection_CTRL_REG10 00412 * @{ 00413 */ 00414 #define LSM6DS0_G_ST_DISABLE ((uint8_t)0x00) /*!< Gyro selftest disable */ 00415 #define LSM6DS0_G_ST_ENABLE ((uint8_t)0x04) /*!< Gyro selftest enable */ 00416 00417 #define LSM6DS0_G_ST_MASK ((uint8_t)0x04) 00418 /** 00419 * @} 00420 */ 00421 00422 00423 /************************************ ACCELEROMETER REGISTERS VALUE *****************************************/ 00424 00425 /** @defgroup LSM6DS0_XG_Accelerometer_Output_Data_Rate_Selection_CTRL_REG6_XL LSM6DS0_XG_Accelerometer_Output_Data_Rate_Selection_CTRL_REG6_XL 00426 * @{ 00427 */ 00428 #define LSM6DS0_XL_ODR_PD ((uint8_t)0x00) /*!< Output Data Rate: Power-down*/ 00429 #define LSM6DS0_XL_ODR_10HZ ((uint8_t)0x20) /*!< Output Data Rate: 10 Hz*/ 00430 #define LSM6DS0_XL_ODR_50HZ ((uint8_t)0x40) /*!< Output Data Rate: 50 Hz */ 00431 #define LSM6DS0_XL_ODR_119HZ ((uint8_t)0x60) /*!< Output Data Rate: 119 Hz */ 00432 #define LSM6DS0_XL_ODR_238HZ ((uint8_t)0x80) /*!< Output Data Rate: 238 Hz */ 00433 #define LSM6DS0_XL_ODR_476HZ ((uint8_t)0xA0) /*!< Output Data Rate: 476 Hz */ 00434 #define LSM6DS0_XL_ODR_952HZ ((uint8_t)0xC0) /*!< Output Data Rate: 952 Hz */ 00435 00436 #define LSM6DS0_XL_ODR_MASK ((uint8_t)0xE0) 00437 /** 00438 * @} 00439 */ 00440 00441 /** @defgroup LSM6DS0_XG_Accelerometer_Full_Scale_Selection_CTRL_REG6_XL LSM6DS0_XG_Accelerometer_Full_Scale_Selection_CTRL_REG6_XL 00442 * @{ 00443 */ 00444 #define LSM6DS0_XL_FS_2G ((uint8_t)0x00) /*!< Full scale: +- 2g */ 00445 #define LSM6DS0_XL_FS_4G ((uint8_t)0x10) /*!< Full scale: +- 4g */ 00446 #define LSM6DS0_XL_FS_8G ((uint8_t)0x18) /*!< Full scale: +- 8g */ 00447 #define LSM6DS0_XL_FS_16G ((uint8_t)0x08) /*!< Full scale: +- 16g */ 00448 00449 #define LSM6DS0_XL_FS_MASK ((uint8_t)0x18) 00450 /** 00451 * @} 00452 */ 00453 00454 /** @defgroup LSM6DS0_XG_Accelerometer_Bandwidth_Selection_CTRL_REG6_XL LSM6DS0_XG_Accelerometer_Bandwidth_Selection_CTRL_REG6_XL 00455 * @{ 00456 */ 00457 #define LSM6DS0_XL_BW_SCAL_ODR ((uint8_t)0x00) /*!< Bandwidth selection: determined by ODR: 00458 - BW = 408Hz when ODR = 952Hz, 50Hz, 10Hz 00459 - BW = 211Hz when ODR = 476Hz 00460 - BW = 105Hz when ODR = 238Hz 00461 - BW = 50Hz when ODR = 119Hz */ 00462 #define LSM6DS0_XL_BW_SCAL_BW ((uint8_t)0x04) /*!< Bandwidth selection: selected according to Anti aliasing filter bandwidth */ 00463 00464 #define LSM6DS0_XL_BW_SCAL_MASK ((uint8_t)0x04) 00465 /** 00466 * @} 00467 */ 00468 00469 00470 /** @defgroup LSM6DS0_XG_Accelerometer_Anti_Aliasing_Filter_Bandwidth_Selection_CTRL_REG6_XL LSM6DS0_XG_Accelerometer_Anti_Aliasing_Filter_Bandwidth_Selection_CTRL_REG6_XL 00471 * @{ 00472 */ 00473 #define LSM6DS0_XL_BW_408HZ ((uint8_t)0x00) /*!< Anti-aliasing filter bandwidht: 408 Hz */ 00474 #define LSM6DS0_XL_BW_211HZ ((uint8_t)0x01) /*!< Anti-aliasing filter bandwidht: 211 Hz */ 00475 #define LSM6DS0_XL_BW_105HZ ((uint8_t)0x02) /*!< Anti-aliasing filter bandwidht: 105 Hz */ 00476 #define LSM6DS0_XL_BW_50HZ ((uint8_t)0x03) /*!< Anti-aliasing filter bandwidht: 50 Hz */ 00477 00478 #define LSM6DS0_XL_BW_MASK ((uint8_t)0x03) 00479 /** 00480 * @} 00481 */ 00482 00483 /** @defgroup LSM6DS0_XG_Accelerometer_Decimation_Acceleration_Data_Selection_CTRL_REG5_XL LSM6DS0_XG_Accelerometer_Decimation_Acceleration_Data_Selection_CTRL_REG5_XL 00484 * @{ 00485 */ 00486 #define LSM6DS0_XL_DEC_NO ((uint8_t)0x00) /*!< Decimation of acceleration data: no decimation */ 00487 #define LSM6DS0_XL_DEC_EVERY_2S ((uint8_t)0x40) /*!< Decimation of acceleration data: update every 2 samples */ 00488 #define LSM6DS0_XL_DEC_EVERY_4S ((uint8_t)0x80) /*!< Decimation of acceleration data: update every 4 samples */ 00489 #define LSM6DS0_XL_DEC_EVERY_8S ((uint8_t)0xC0) /*!< Decimation of acceleration data: update every 8 samples */ 00490 00491 #define LSM6DS0_XL_DEC_MASK ((uint8_t)0xC0) 00492 /** 00493 * @} 00494 */ 00495 00496 00497 /** @defgroup LSM6DS0_XG_Accelerometer_Z_Axis_Output_Enable_Selection_CTRL_REG5_XL LSM6DS0_XG_Accelerometer_Z_Axis_Output_Enable_Selection_CTRL_REG5_XL 00498 * @{ 00499 */ 00500 #define LSM6DS0_XL_ZEN_DISABLE ((uint8_t)0x00) /*!< Accelerometer�s Z-axis output enable: disable */ 00501 #define LSM6DS0_XL_ZEN_ENABLE ((uint8_t)0x20) /*!< Accelerometer�s Z-axis output enable: enable */ 00502 00503 #define LSM6DS0_XL_ZEN_MASK ((uint8_t)0x20) 00504 /** 00505 * @} 00506 */ 00507 00508 /** @defgroup LSM6DS0_XG_Accelerometer_Y_Axis_Output_Enable_Selection_CTRL_REG5_XL LSM6DS0_XG_Accelerometer_Y_Axis_Output_Enable_Selection_CTRL_REG5_XL 00509 * @{ 00510 */ 00511 #define LSM6DS0_XL_YEN_DISABLE ((uint8_t)0x00) /*!< Accelerometer�s Y-axis output enable: disable */ 00512 #define LSM6DS0_XL_YEN_ENABLE ((uint8_t)0x10) /*!< Accelerometer�s Y-axis output enable: enable */ 00513 00514 #define LSM6DS0_XL_YEN_MASK ((uint8_t)0x10) 00515 /** 00516 * @} 00517 */ 00518 00519 00520 /** @defgroup LSM6DS0_XG_Accelerometer_X_Axis_Output_Enable_Selection_CTRL_REG5_XL LSM6DS0_XG_Accelerometer_X_Axis_Output_Enable_Selection_CTRL_REG5_XL 00521 * @{ 00522 */ 00523 #define LSM6DS0_XL_XEN_DISABLE ((uint8_t)0x00) /*!< Accelerometer�s X-axis output enable: disable */ 00524 #define LSM6DS0_XL_XEN_ENABLE ((uint8_t)0x08) /*!< Accelerometer�s X-axis output enable: enable */ 00525 00526 #define LSM6DS0_XL_XEN_MASK ((uint8_t)0x08) 00527 00528 /** 00529 * @} 00530 */ 00531 00532 00533 /** @defgroup LSM6DS0_XG_Accelerometer_Selftest_Enable_Selection_CTRL_REG10 LSM6DS0_XG_Accelerometer_Selftest_Enable_Selection_CTRL_REG10 00534 * @{ 00535 */ 00536 #define LSM6DS0_XL_ST_DISABLE ((uint8_t)0x00) /*!< Accel selftest disable */ 00537 #define LSM6DS0_XL_ST_ENABLE ((uint8_t)0x01) /*!< Accel selftest enable */ 00538 00539 #define LSM6DS0_XL_ST_MASK ((uint8_t)0x01) 00540 00541 /** 00542 * @} 00543 */ 00544 00545 /** 00546 * @} 00547 */ 00548 00549 00550 /** @defgroup LSM6DS0_Imported_Functions LSM6DS0_Imported_Functions 00551 * @{ 00552 */ 00553 00554 /* Six axes sensor IO functions */ 00555 extern IMU_6AXES_StatusTypeDef LSM6DS0_IO_Init(void); 00556 extern IMU_6AXES_StatusTypeDef LSM6DS0_IO_Write(uint8_t* pBuffer, uint8_t DeviceAddr, uint8_t RegisterAddr, 00557 uint16_t NumByteToWrite); 00558 extern IMU_6AXES_StatusTypeDef LSM6DS0_IO_Read(uint8_t* pBuffer, uint8_t DeviceAddr, uint8_t RegisterAddr, 00559 uint16_t NumByteToRead); 00560 extern void LSM6DS0_IO_ITConfig( void ); 00561 00562 /** 00563 * @} 00564 */ 00565 00566 /* ------------------------------------------------------- */ 00567 /* Here you should declare the internal struct of */ 00568 /* extended features of LIS3MDL. See the example of */ 00569 /* LSM6DS3 in lsm6ds3.h */ 00570 /* ------------------------------------------------------- */ 00571 00572 /** @addtogroup LSM6DS0_Exported_Variables LSM6DS0_Exported_Variables 00573 * @{ 00574 */ 00575 00576 /* Six axes sensor driver structure */ 00577 extern IMU_6AXES_DrvTypeDef LSM6DS0Drv; 00578 extern IMU_6AXES_DrvExtTypeDef LSM6DS0Drv_ext; 00579 00580 /** 00581 * @} 00582 */ 00583 00584 /** 00585 * @} 00586 */ 00587 00588 /** 00589 * @} 00590 */ 00591 00592 /** 00593 * @} 00594 */ 00595 00596 #ifdef __cplusplus 00597 } 00598 #endif 00599 00600 #endif /* __LSM6DS0_H */ 00601 00602 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Generated on Sat Jul 16 2022 05:47:21 by
