Contains the BSP driver for the B-L475E-IOT01 board.
Dependents: mbed-os-example-ble-Thermometer DISCO_L475VG_IOT01-Telegram-BOT DISCO_L475VG_IOT01-sche_cheveux DISCO_L475VG_IOT01-QSPI_FLASH_FILE_SYSTEM ... more
https://os.mbed.com/platforms/ST-Discovery-L475E-IOT01A/
Drivers/BSP/Components/lsm6dsl/lsm6dsl.h@7:bfe8272ced90, 2019-09-24 (annotated)
- Committer:
- jeromecoutant
- Date:
- Tue Sep 24 15:30:09 2019 +0200
- Revision:
- 7:bfe8272ced90
- Parent:
- 4:137bb367ba50
Update BSP files with STM32Cube L4 V1.14.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bcostm | 4:137bb367ba50 | 1 | /** |
bcostm | 4:137bb367ba50 | 2 | ****************************************************************************** |
bcostm | 4:137bb367ba50 | 3 | * @file lsm6dsl.h |
bcostm | 4:137bb367ba50 | 4 | * @author MCD Application Team |
bcostm | 4:137bb367ba50 | 5 | * @brief LSM6DSL header driver file |
bcostm | 4:137bb367ba50 | 6 | ****************************************************************************** |
bcostm | 4:137bb367ba50 | 7 | * @attention |
bcostm | 4:137bb367ba50 | 8 | * |
jeromecoutant | 7:bfe8272ced90 | 9 | * <h2><center>© Copyright (c) 2017 STMicroelectronics. |
jeromecoutant | 7:bfe8272ced90 | 10 | * All rights reserved.</center></h2> |
bcostm | 4:137bb367ba50 | 11 | * |
jeromecoutant | 7:bfe8272ced90 | 12 | * This software component is licensed by ST under BSD 3-Clause license, |
jeromecoutant | 7:bfe8272ced90 | 13 | * the "License"; You may not use this file except in compliance with the |
jeromecoutant | 7:bfe8272ced90 | 14 | * License. You may obtain a copy of the License at: |
jeromecoutant | 7:bfe8272ced90 | 15 | * opensource.org/licenses/BSD-3-Clause |
bcostm | 4:137bb367ba50 | 16 | * |
bcostm | 4:137bb367ba50 | 17 | ****************************************************************************** |
bcostm | 4:137bb367ba50 | 18 | */ |
bcostm | 4:137bb367ba50 | 19 | |
bcostm | 4:137bb367ba50 | 20 | /* Define to prevent recursive inclusion -------------------------------------*/ |
bcostm | 4:137bb367ba50 | 21 | #ifndef __LSM6DSL__H |
bcostm | 4:137bb367ba50 | 22 | #define __LSM6DSL__H |
bcostm | 4:137bb367ba50 | 23 | |
bcostm | 4:137bb367ba50 | 24 | #ifdef __cplusplus |
bcostm | 4:137bb367ba50 | 25 | extern "C" { |
bcostm | 4:137bb367ba50 | 26 | #endif |
bcostm | 4:137bb367ba50 | 27 | |
bcostm | 4:137bb367ba50 | 28 | /* Includes ------------------------------------------------------------------*/ |
bcostm | 4:137bb367ba50 | 29 | #include "../Common/accelero.h" |
bcostm | 4:137bb367ba50 | 30 | #include "../Common/gyro.h" |
bcostm | 4:137bb367ba50 | 31 | |
bcostm | 4:137bb367ba50 | 32 | /** @addtogroup BSP |
bcostm | 4:137bb367ba50 | 33 | * @{ |
bcostm | 4:137bb367ba50 | 34 | */ |
bcostm | 4:137bb367ba50 | 35 | |
bcostm | 4:137bb367ba50 | 36 | /** @addtogroup Component |
bcostm | 4:137bb367ba50 | 37 | * @{ |
bcostm | 4:137bb367ba50 | 38 | */ |
bcostm | 4:137bb367ba50 | 39 | |
bcostm | 4:137bb367ba50 | 40 | /** @addtogroup LSM6DSL |
bcostm | 4:137bb367ba50 | 41 | * @{ |
bcostm | 4:137bb367ba50 | 42 | */ |
bcostm | 4:137bb367ba50 | 43 | |
bcostm | 4:137bb367ba50 | 44 | /** @defgroup LSM6DSL_Exported_Constants LSM6DSL Exported Constants |
bcostm | 4:137bb367ba50 | 45 | * @{ |
bcostm | 4:137bb367ba50 | 46 | */ |
bcostm | 4:137bb367ba50 | 47 | /************** I2C Address *****************/ |
bcostm | 4:137bb367ba50 | 48 | |
bcostm | 4:137bb367ba50 | 49 | #define LSM6DSL_ACC_GYRO_I2C_ADDRESS_LOW 0xD4 // SAD[0] = 0 |
bcostm | 4:137bb367ba50 | 50 | #define LSM6DSL_ACC_GYRO_I2C_ADDRESS_HIGH 0xD6 // SAD[0] = 1 |
bcostm | 4:137bb367ba50 | 51 | |
bcostm | 4:137bb367ba50 | 52 | /************** Who am I *******************/ |
bcostm | 4:137bb367ba50 | 53 | |
bcostm | 4:137bb367ba50 | 54 | #define LSM6DSL_ACC_GYRO_WHO_AM_I 0x6A |
bcostm | 4:137bb367ba50 | 55 | |
bcostm | 4:137bb367ba50 | 56 | /************** Device Register *******************/ |
bcostm | 4:137bb367ba50 | 57 | |
bcostm | 4:137bb367ba50 | 58 | #define LSM6DSL_ACC_GYRO_FUNC_CFG_ACCESS 0x01 |
bcostm | 4:137bb367ba50 | 59 | |
bcostm | 4:137bb367ba50 | 60 | #define LSM6DSL_ACC_GYRO_SENSOR_SYNC_TIME 0x04 |
bcostm | 4:137bb367ba50 | 61 | #define LSM6DSL_ACC_GYRO_SENSOR_RES_RATIO 0x05 |
bcostm | 4:137bb367ba50 | 62 | |
bcostm | 4:137bb367ba50 | 63 | #define LSM6DSL_ACC_GYRO_FIFO_CTRL1 0x06 |
bcostm | 4:137bb367ba50 | 64 | #define LSM6DSL_ACC_GYRO_FIFO_CTRL2 0x07 |
bcostm | 4:137bb367ba50 | 65 | #define LSM6DSL_ACC_GYRO_FIFO_CTRL3 0x08 |
bcostm | 4:137bb367ba50 | 66 | #define LSM6DSL_ACC_GYRO_FIFO_CTRL4 0x09 |
bcostm | 4:137bb367ba50 | 67 | #define LSM6DSL_ACC_GYRO_FIFO_CTRL5 0x0A |
bcostm | 4:137bb367ba50 | 68 | |
bcostm | 4:137bb367ba50 | 69 | #define LSM6DSL_ACC_GYRO_DRDY_PULSE_CFG_G 0x0B |
bcostm | 4:137bb367ba50 | 70 | #define LSM6DSL_ACC_GYRO_INT1_CTRL 0x0D |
bcostm | 4:137bb367ba50 | 71 | #define LSM6DSL_ACC_GYRO_INT2_CTRL 0x0E |
bcostm | 4:137bb367ba50 | 72 | #define LSM6DSL_ACC_GYRO_WHO_AM_I_REG 0x0F |
bcostm | 4:137bb367ba50 | 73 | #define LSM6DSL_ACC_GYRO_CTRL1_XL 0x10 |
bcostm | 4:137bb367ba50 | 74 | #define LSM6DSL_ACC_GYRO_CTRL2_G 0x11 |
bcostm | 4:137bb367ba50 | 75 | #define LSM6DSL_ACC_GYRO_CTRL3_C 0x12 |
bcostm | 4:137bb367ba50 | 76 | #define LSM6DSL_ACC_GYRO_CTRL4_C 0x13 |
bcostm | 4:137bb367ba50 | 77 | #define LSM6DSL_ACC_GYRO_CTRL5_C 0x14 |
bcostm | 4:137bb367ba50 | 78 | #define LSM6DSL_ACC_GYRO_CTRL6_C 0x15 |
bcostm | 4:137bb367ba50 | 79 | #define LSM6DSL_ACC_GYRO_CTRL7_G 0x16 |
bcostm | 4:137bb367ba50 | 80 | #define LSM6DSL_ACC_GYRO_CTRL8_XL 0x17 |
bcostm | 4:137bb367ba50 | 81 | #define LSM6DSL_ACC_GYRO_CTRL9_XL 0x18 |
bcostm | 4:137bb367ba50 | 82 | #define LSM6DSL_ACC_GYRO_CTRL10_C 0x19 |
bcostm | 4:137bb367ba50 | 83 | |
bcostm | 4:137bb367ba50 | 84 | #define LSM6DSL_ACC_GYRO_MASTER_CONFIG 0x1A |
bcostm | 4:137bb367ba50 | 85 | #define LSM6DSL_ACC_GYRO_WAKE_UP_SRC 0x1B |
bcostm | 4:137bb367ba50 | 86 | #define LSM6DSL_ACC_GYRO_TAP_SRC 0x1C |
bcostm | 4:137bb367ba50 | 87 | #define LSM6DSL_ACC_GYRO_D6D_SRC 0x1D |
bcostm | 4:137bb367ba50 | 88 | #define LSM6DSL_ACC_GYRO_STATUS_REG 0x1E |
bcostm | 4:137bb367ba50 | 89 | |
bcostm | 4:137bb367ba50 | 90 | #define LSM6DSL_ACC_GYRO_OUT_TEMP_L 0x20 |
bcostm | 4:137bb367ba50 | 91 | #define LSM6DSL_ACC_GYRO_OUT_TEMP_H 0x21 |
bcostm | 4:137bb367ba50 | 92 | #define LSM6DSL_ACC_GYRO_OUTX_L_G 0x22 |
bcostm | 4:137bb367ba50 | 93 | #define LSM6DSL_ACC_GYRO_OUTX_H_G 0x23 |
bcostm | 4:137bb367ba50 | 94 | #define LSM6DSL_ACC_GYRO_OUTY_L_G 0x24 |
bcostm | 4:137bb367ba50 | 95 | #define LSM6DSL_ACC_GYRO_OUTY_H_G 0x25 |
bcostm | 4:137bb367ba50 | 96 | #define LSM6DSL_ACC_GYRO_OUTZ_L_G 0x26 |
bcostm | 4:137bb367ba50 | 97 | #define LSM6DSL_ACC_GYRO_OUTZ_H_G 0x27 |
bcostm | 4:137bb367ba50 | 98 | #define LSM6DSL_ACC_GYRO_OUTX_L_XL 0x28 |
bcostm | 4:137bb367ba50 | 99 | #define LSM6DSL_ACC_GYRO_OUTX_H_XL 0x29 |
bcostm | 4:137bb367ba50 | 100 | #define LSM6DSL_ACC_GYRO_OUTY_L_XL 0x2A |
bcostm | 4:137bb367ba50 | 101 | #define LSM6DSL_ACC_GYRO_OUTY_H_XL 0x2B |
bcostm | 4:137bb367ba50 | 102 | #define LSM6DSL_ACC_GYRO_OUTZ_L_XL 0x2C |
bcostm | 4:137bb367ba50 | 103 | #define LSM6DSL_ACC_GYRO_OUTZ_H_XL 0x2D |
bcostm | 4:137bb367ba50 | 104 | #define LSM6DSL_ACC_GYRO_SENSORHUB1_REG 0x2E |
bcostm | 4:137bb367ba50 | 105 | #define LSM6DSL_ACC_GYRO_SENSORHUB2_REG 0x2F |
bcostm | 4:137bb367ba50 | 106 | #define LSM6DSL_ACC_GYRO_SENSORHUB3_REG 0x30 |
bcostm | 4:137bb367ba50 | 107 | #define LSM6DSL_ACC_GYRO_SENSORHUB4_REG 0x31 |
bcostm | 4:137bb367ba50 | 108 | #define LSM6DSL_ACC_GYRO_SENSORHUB5_REG 0x32 |
bcostm | 4:137bb367ba50 | 109 | #define LSM6DSL_ACC_GYRO_SENSORHUB6_REG 0x33 |
bcostm | 4:137bb367ba50 | 110 | #define LSM6DSL_ACC_GYRO_SENSORHUB7_REG 0x34 |
bcostm | 4:137bb367ba50 | 111 | #define LSM6DSL_ACC_GYRO_SENSORHUB8_REG 0x35 |
bcostm | 4:137bb367ba50 | 112 | #define LSM6DSL_ACC_GYRO_SENSORHUB9_REG 0x36 |
bcostm | 4:137bb367ba50 | 113 | #define LSM6DSL_ACC_GYRO_SENSORHUB10_REG 0x37 |
bcostm | 4:137bb367ba50 | 114 | #define LSM6DSL_ACC_GYRO_SENSORHUB11_REG 0x38 |
bcostm | 4:137bb367ba50 | 115 | #define LSM6DSL_ACC_GYRO_SENSORHUB12_REG 0x39 |
bcostm | 4:137bb367ba50 | 116 | #define LSM6DSL_ACC_GYRO_FIFO_STATUS1 0x3A |
bcostm | 4:137bb367ba50 | 117 | #define LSM6DSL_ACC_GYRO_FIFO_STATUS2 0x3B |
bcostm | 4:137bb367ba50 | 118 | #define LSM6DSL_ACC_GYRO_FIFO_STATUS3 0x3C |
bcostm | 4:137bb367ba50 | 119 | #define LSM6DSL_ACC_GYRO_FIFO_STATUS4 0x3D |
bcostm | 4:137bb367ba50 | 120 | #define LSM6DSL_ACC_GYRO_FIFO_DATA_OUT_L 0x3E |
bcostm | 4:137bb367ba50 | 121 | #define LSM6DSL_ACC_GYRO_FIFO_DATA_OUT_H 0x3F |
bcostm | 4:137bb367ba50 | 122 | #define LSM6DSL_ACC_GYRO_TIMESTAMP0_REG 0x40 |
bcostm | 4:137bb367ba50 | 123 | #define LSM6DSL_ACC_GYRO_TIMESTAMP1_REG 0x41 |
bcostm | 4:137bb367ba50 | 124 | #define LSM6DSL_ACC_GYRO_TIMESTAMP2_REG 0x42 |
bcostm | 4:137bb367ba50 | 125 | |
bcostm | 4:137bb367ba50 | 126 | #define LSM6DSL_ACC_GYRO_TIMESTAMP_L 0x49 |
bcostm | 4:137bb367ba50 | 127 | #define LSM6DSL_ACC_GYRO_TIMESTAMP_H 0x4A |
bcostm | 4:137bb367ba50 | 128 | |
bcostm | 4:137bb367ba50 | 129 | #define LSM6DSL_ACC_GYRO_STEP_COUNTER_L 0x4B |
bcostm | 4:137bb367ba50 | 130 | #define LSM6DSL_ACC_GYRO_STEP_COUNTER_H 0x4C |
bcostm | 4:137bb367ba50 | 131 | |
bcostm | 4:137bb367ba50 | 132 | #define LSM6DSL_ACC_GYRO_SENSORHUB13_REG 0x4D |
bcostm | 4:137bb367ba50 | 133 | #define LSM6DSL_ACC_GYRO_SENSORHUB14_REG 0x4E |
bcostm | 4:137bb367ba50 | 134 | #define LSM6DSL_ACC_GYRO_SENSORHUB15_REG 0x4F |
bcostm | 4:137bb367ba50 | 135 | #define LSM6DSL_ACC_GYRO_SENSORHUB16_REG 0x50 |
bcostm | 4:137bb367ba50 | 136 | #define LSM6DSL_ACC_GYRO_SENSORHUB17_REG 0x51 |
bcostm | 4:137bb367ba50 | 137 | #define LSM6DSL_ACC_GYRO_SENSORHUB18_REG 0x52 |
bcostm | 4:137bb367ba50 | 138 | |
bcostm | 4:137bb367ba50 | 139 | #define LSM6DSL_ACC_GYRO_FUNC_SRC 0x53 |
bcostm | 4:137bb367ba50 | 140 | #define LSM6DSL_ACC_GYRO_TAP_CFG1 0x58 |
bcostm | 4:137bb367ba50 | 141 | #define LSM6DSL_ACC_GYRO_TAP_THS_6D 0x59 |
bcostm | 4:137bb367ba50 | 142 | #define LSM6DSL_ACC_GYRO_INT_DUR2 0x5A |
bcostm | 4:137bb367ba50 | 143 | #define LSM6DSL_ACC_GYRO_WAKE_UP_THS 0x5B |
bcostm | 4:137bb367ba50 | 144 | #define LSM6DSL_ACC_GYRO_WAKE_UP_DUR 0x5C |
bcostm | 4:137bb367ba50 | 145 | #define LSM6DSL_ACC_GYRO_FREE_FALL 0x5D |
bcostm | 4:137bb367ba50 | 146 | #define LSM6DSL_ACC_GYRO_MD1_CFG 0x5E |
bcostm | 4:137bb367ba50 | 147 | #define LSM6DSL_ACC_GYRO_MD2_CFG 0x5F |
bcostm | 4:137bb367ba50 | 148 | |
bcostm | 4:137bb367ba50 | 149 | #define LSM6DSL_ACC_GYRO_OUT_MAG_RAW_X_L 0x66 |
bcostm | 4:137bb367ba50 | 150 | #define LSM6DSL_ACC_GYRO_OUT_MAG_RAW_X_H 0x67 |
bcostm | 4:137bb367ba50 | 151 | #define LSM6DSL_ACC_GYRO_OUT_MAG_RAW_Y_L 0x68 |
bcostm | 4:137bb367ba50 | 152 | #define LSM6DSL_ACC_GYRO_OUT_MAG_RAW_Y_H 0x69 |
bcostm | 4:137bb367ba50 | 153 | #define LSM6DSL_ACC_GYRO_OUT_MAG_RAW_Z_L 0x6A |
bcostm | 4:137bb367ba50 | 154 | #define LSM6DSL_ACC_GYRO_OUT_MAG_RAW_Z_H 0x6B |
bcostm | 4:137bb367ba50 | 155 | |
bcostm | 4:137bb367ba50 | 156 | #define LSM6DSL_ACC_GYRO_X_OFS_USR 0x73 |
bcostm | 4:137bb367ba50 | 157 | #define LSM6DSL_ACC_GYRO_Y_OFS_USR 0x74 |
bcostm | 4:137bb367ba50 | 158 | #define LSM6DSL_ACC_GYRO_Z_OFS_USR 0x75 |
bcostm | 4:137bb367ba50 | 159 | |
bcostm | 4:137bb367ba50 | 160 | /************** Embedded functions register mapping *******************/ |
bcostm | 4:137bb367ba50 | 161 | #define LSM6DSL_ACC_GYRO_SLV0_ADD 0x02 |
bcostm | 4:137bb367ba50 | 162 | #define LSM6DSL_ACC_GYRO_SLV0_SUBADD 0x03 |
bcostm | 4:137bb367ba50 | 163 | #define LSM6DSL_ACC_GYRO_SLAVE0_CONFIG 0x04 |
bcostm | 4:137bb367ba50 | 164 | #define LSM6DSL_ACC_GYRO_SLV1_ADD 0x05 |
bcostm | 4:137bb367ba50 | 165 | #define LSM6DSL_ACC_GYRO_SLV1_SUBADD 0x06 |
bcostm | 4:137bb367ba50 | 166 | #define LSM6DSL_ACC_GYRO_SLAVE1_CONFIG 0x07 |
bcostm | 4:137bb367ba50 | 167 | #define LSM6DSL_ACC_GYRO_SLV2_ADD 0x08 |
bcostm | 4:137bb367ba50 | 168 | #define LSM6DSL_ACC_GYRO_SLV2_SUBADD 0x09 |
bcostm | 4:137bb367ba50 | 169 | #define LSM6DSL_ACC_GYRO_SLAVE2_CONFIG 0x0A |
bcostm | 4:137bb367ba50 | 170 | #define LSM6DSL_ACC_GYRO_SLV3_ADD 0x0B |
bcostm | 4:137bb367ba50 | 171 | #define LSM6DSL_ACC_GYRO_SLV3_SUBADD 0x0C |
bcostm | 4:137bb367ba50 | 172 | #define LSM6DSL_ACC_GYRO_SLAVE3_CONFIG 0x0D |
bcostm | 4:137bb367ba50 | 173 | #define LSM6DSL_ACC_GYRO_DATAWRITE_SRC_MODE_SUB_SLV0 0x0E |
bcostm | 4:137bb367ba50 | 174 | #define LSM6DSL_ACC_GYRO_CONFIG_PEDO_THS_MIN 0x0F |
bcostm | 4:137bb367ba50 | 175 | |
bcostm | 4:137bb367ba50 | 176 | #define LSM6DSL_ACC_GYRO_SM_STEP_THS 0x13 |
bcostm | 4:137bb367ba50 | 177 | #define LSM6DSL_ACC_GYRO_PEDO_DEB_REG 0x14 |
bcostm | 4:137bb367ba50 | 178 | #define LSM6DSL_ACC_GYRO_STEP_COUNT_DELTA 0x15 |
bcostm | 4:137bb367ba50 | 179 | |
bcostm | 4:137bb367ba50 | 180 | #define LSM6DSL_ACC_GYRO_MAG_SI_XX 0x24 |
bcostm | 4:137bb367ba50 | 181 | #define LSM6DSL_ACC_GYRO_MAG_SI_XY 0x25 |
bcostm | 4:137bb367ba50 | 182 | #define LSM6DSL_ACC_GYRO_MAG_SI_XZ 0x26 |
bcostm | 4:137bb367ba50 | 183 | #define LSM6DSL_ACC_GYRO_MAG_SI_YX 0x27 |
bcostm | 4:137bb367ba50 | 184 | #define LSM6DSL_ACC_GYRO_MAG_SI_YY 0x28 |
bcostm | 4:137bb367ba50 | 185 | #define LSM6DSL_ACC_GYRO_MAG_SI_YZ 0x29 |
bcostm | 4:137bb367ba50 | 186 | #define LSM6DSL_ACC_GYRO_MAG_SI_ZX 0x2A |
bcostm | 4:137bb367ba50 | 187 | #define LSM6DSL_ACC_GYRO_MAG_SI_ZY 0x2B |
bcostm | 4:137bb367ba50 | 188 | #define LSM6DSL_ACC_GYRO_MAG_SI_ZZ 0x2C |
bcostm | 4:137bb367ba50 | 189 | #define LSM6DSL_ACC_GYRO_MAG_OFFX_L 0x2D |
bcostm | 4:137bb367ba50 | 190 | #define LSM6DSL_ACC_GYRO_MAG_OFFX_H 0x2E |
bcostm | 4:137bb367ba50 | 191 | #define LSM6DSL_ACC_GYRO_MAG_OFFY_L 0x2F |
bcostm | 4:137bb367ba50 | 192 | #define LSM6DSL_ACC_GYRO_MAG_OFFY_H 0x30 |
bcostm | 4:137bb367ba50 | 193 | #define LSM6DSL_ACC_GYRO_MAG_OFFZ_L 0x31 |
bcostm | 4:137bb367ba50 | 194 | #define LSM6DSL_ACC_GYRO_MAG_OFFZ_H 0x32 |
bcostm | 4:137bb367ba50 | 195 | |
bcostm | 4:137bb367ba50 | 196 | /* Accelero Full_ScaleSelection */ |
bcostm | 4:137bb367ba50 | 197 | #define LSM6DSL_ACC_FULLSCALE_2G ((uint8_t)0x00) /*!< ±2 g */ |
bcostm | 4:137bb367ba50 | 198 | #define LSM6DSL_ACC_FULLSCALE_4G ((uint8_t)0x08) /*!< ±4 g */ |
bcostm | 4:137bb367ba50 | 199 | #define LSM6DSL_ACC_FULLSCALE_8G ((uint8_t)0x0C) /*!< ±8 g */ |
bcostm | 4:137bb367ba50 | 200 | #define LSM6DSL_ACC_FULLSCALE_16G ((uint8_t)0x04) /*!< ±16 g */ |
bcostm | 4:137bb367ba50 | 201 | |
bcostm | 4:137bb367ba50 | 202 | /* Accelero Full Scale Sensitivity */ |
bcostm | 4:137bb367ba50 | 203 | #define LSM6DSL_ACC_SENSITIVITY_2G ((float)0.061f) /*!< accelerometer sensitivity with 2 g full scale [mgauss/LSB] */ |
bcostm | 4:137bb367ba50 | 204 | #define LSM6DSL_ACC_SENSITIVITY_4G ((float)0.122f) /*!< accelerometer sensitivity with 4 g full scale [mgauss/LSB] */ |
bcostm | 4:137bb367ba50 | 205 | #define LSM6DSL_ACC_SENSITIVITY_8G ((float)0.244f) /*!< accelerometer sensitivity with 8 g full scale [mgauss/LSB] */ |
bcostm | 4:137bb367ba50 | 206 | #define LSM6DSL_ACC_SENSITIVITY_16G ((float)0.488f) /*!< accelerometer sensitivity with 12 g full scale [mgauss/LSB] */ |
bcostm | 4:137bb367ba50 | 207 | |
bcostm | 4:137bb367ba50 | 208 | /* Accelero Power Mode selection */ |
bcostm | 4:137bb367ba50 | 209 | #define LSM6DSL_ACC_GYRO_LP_XL_DISABLED ((uint8_t)0x00) /* LP disabled*/ |
bcostm | 4:137bb367ba50 | 210 | #define LSM6DSL_ACC_GYRO_LP_XL_ENABLED ((uint8_t)0x10) /* LP enabled*/ |
bcostm | 4:137bb367ba50 | 211 | |
bcostm | 4:137bb367ba50 | 212 | /* Output Data Rate */ |
bcostm | 4:137bb367ba50 | 213 | #define LSM6DSL_ODR_BITPOSITION ((uint8_t)0xF0) /*!< Output Data Rate bit position */ |
bcostm | 4:137bb367ba50 | 214 | #define LSM6DSL_ODR_POWER_DOWN ((uint8_t)0x00) /* Power Down mode */ |
bcostm | 4:137bb367ba50 | 215 | #define LSM6DSL_ODR_13Hz ((uint8_t)0x10) /* Low Power mode */ |
bcostm | 4:137bb367ba50 | 216 | #define LSM6DSL_ODR_26Hz ((uint8_t)0x20) /* Low Power mode */ |
bcostm | 4:137bb367ba50 | 217 | #define LSM6DSL_ODR_52Hz ((uint8_t)0x30) /* Low Power mode */ |
bcostm | 4:137bb367ba50 | 218 | #define LSM6DSL_ODR_104Hz ((uint8_t)0x40) /* Normal mode */ |
bcostm | 4:137bb367ba50 | 219 | #define LSM6DSL_ODR_208Hz ((uint8_t)0x50) /* Normal mode */ |
bcostm | 4:137bb367ba50 | 220 | #define LSM6DSL_ODR_416Hz ((uint8_t)0x60) /* High Performance mode */ |
bcostm | 4:137bb367ba50 | 221 | #define LSM6DSL_ODR_833Hz ((uint8_t)0x70) /* High Performance mode */ |
bcostm | 4:137bb367ba50 | 222 | #define LSM6DSL_ODR_1660Hz ((uint8_t)0x80) /* High Performance mode */ |
bcostm | 4:137bb367ba50 | 223 | #define LSM6DSL_ODR_3330Hz ((uint8_t)0x90) /* High Performance mode */ |
bcostm | 4:137bb367ba50 | 224 | #define LSM6DSL_ODR_6660Hz ((uint8_t)0xA0) /* High Performance mode */ |
bcostm | 4:137bb367ba50 | 225 | |
bcostm | 4:137bb367ba50 | 226 | /* Gyro Full Scale Selection */ |
bcostm | 4:137bb367ba50 | 227 | #define LSM6DSL_GYRO_FS_245 ((uint8_t)0x00) |
bcostm | 4:137bb367ba50 | 228 | #define LSM6DSL_GYRO_FS_500 ((uint8_t)0x04) |
bcostm | 4:137bb367ba50 | 229 | #define LSM6DSL_GYRO_FS_1000 ((uint8_t)0x08) |
bcostm | 4:137bb367ba50 | 230 | #define LSM6DSL_GYRO_FS_2000 ((uint8_t)0x0C) |
bcostm | 4:137bb367ba50 | 231 | |
bcostm | 4:137bb367ba50 | 232 | /* Gyro Full Scale Sensitivity */ |
bcostm | 4:137bb367ba50 | 233 | #define LSM6DSL_GYRO_SENSITIVITY_245DPS ((float)8.750f) /**< Sensitivity value for 245 dps full scale [mdps/LSB] */ |
bcostm | 4:137bb367ba50 | 234 | #define LSM6DSL_GYRO_SENSITIVITY_500DPS ((float)17.50f) /**< Sensitivity value for 500 dps full scale [mdps/LSB] */ |
bcostm | 4:137bb367ba50 | 235 | #define LSM6DSL_GYRO_SENSITIVITY_1000DPS ((float)35.00f) /**< Sensitivity value for 1000 dps full scale [mdps/LSB] */ |
bcostm | 4:137bb367ba50 | 236 | #define LSM6DSL_GYRO_SENSITIVITY_2000DPS ((float)70.00f) /**< Sensitivity value for 2000 dps full scale [mdps/LSB] */ |
bcostm | 4:137bb367ba50 | 237 | |
bcostm | 4:137bb367ba50 | 238 | /* Gyro Power Mode selection */ |
bcostm | 4:137bb367ba50 | 239 | #define LSM6DSL_ACC_GYRO_LP_G_DISABLED ((uint8_t)0x00) /* LP disabled*/ |
bcostm | 4:137bb367ba50 | 240 | #define LSM6DSL_ACC_GYRO_LP_G_ENABLED ((uint8_t)0x80) /* LP enabled*/ |
bcostm | 4:137bb367ba50 | 241 | |
bcostm | 4:137bb367ba50 | 242 | /* Block Data Update */ |
bcostm | 4:137bb367ba50 | 243 | #define LSM6DSL_BDU_CONTINUOS ((uint8_t)0x00) |
bcostm | 4:137bb367ba50 | 244 | #define LSM6DSL_BDU_BLOCK_UPDATE ((uint8_t)0x40) |
bcostm | 4:137bb367ba50 | 245 | |
bcostm | 4:137bb367ba50 | 246 | /* Auto-increment */ |
bcostm | 4:137bb367ba50 | 247 | #define LSM6DSL_ACC_GYRO_IF_INC_DISABLED ((uint8_t)0x00) |
bcostm | 4:137bb367ba50 | 248 | #define LSM6DSL_ACC_GYRO_IF_INC_ENABLED ((uint8_t)0x04) |
bcostm | 4:137bb367ba50 | 249 | |
bcostm | 4:137bb367ba50 | 250 | /** |
bcostm | 4:137bb367ba50 | 251 | * @} |
bcostm | 4:137bb367ba50 | 252 | */ |
bcostm | 4:137bb367ba50 | 253 | |
bcostm | 4:137bb367ba50 | 254 | /** @defgroup LSM6DSL_AccExported_Functions ACCELEROMETER Exported functions |
bcostm | 4:137bb367ba50 | 255 | * @{ |
bcostm | 4:137bb367ba50 | 256 | */ |
bcostm | 4:137bb367ba50 | 257 | void LSM6DSL_AccInit(uint16_t InitStruct); |
bcostm | 4:137bb367ba50 | 258 | void LSM6DSL_AccDeInit(void); |
bcostm | 4:137bb367ba50 | 259 | uint8_t LSM6DSL_AccReadID(void); |
bcostm | 4:137bb367ba50 | 260 | void LSM6DSL_AccLowPower(uint16_t status); |
bcostm | 4:137bb367ba50 | 261 | void LSM6DSL_AccReadXYZ(int16_t* pData); |
bcostm | 4:137bb367ba50 | 262 | /** |
bcostm | 4:137bb367ba50 | 263 | * @} |
bcostm | 4:137bb367ba50 | 264 | */ |
bcostm | 4:137bb367ba50 | 265 | |
bcostm | 4:137bb367ba50 | 266 | /** @defgroup LSM6DSL_AccImported_Globals ACCELEROMETER Imported Globals |
bcostm | 4:137bb367ba50 | 267 | * @{ |
bcostm | 4:137bb367ba50 | 268 | */ |
bcostm | 4:137bb367ba50 | 269 | extern ACCELERO_DrvTypeDef Lsm6dslAccDrv; |
bcostm | 4:137bb367ba50 | 270 | /** |
bcostm | 4:137bb367ba50 | 271 | * @} |
bcostm | 4:137bb367ba50 | 272 | */ |
bcostm | 4:137bb367ba50 | 273 | |
bcostm | 4:137bb367ba50 | 274 | /** @defgroup LSM6DSL_GyroExported_Functions GYROSCOPE Exported functions |
bcostm | 4:137bb367ba50 | 275 | * @{ |
bcostm | 4:137bb367ba50 | 276 | */ |
bcostm | 4:137bb367ba50 | 277 | /* Sensor Configuration Functions */ |
bcostm | 4:137bb367ba50 | 278 | void LSM6DSL_GyroInit(uint16_t InitStruct); |
bcostm | 4:137bb367ba50 | 279 | void LSM6DSL_GyroDeInit(void); |
bcostm | 4:137bb367ba50 | 280 | uint8_t LSM6DSL_GyroReadID(void); |
bcostm | 4:137bb367ba50 | 281 | void LSM6DSL_GyroLowPower(uint16_t status); |
bcostm | 4:137bb367ba50 | 282 | void LSM6DSL_GyroReadXYZAngRate(float *pfData); |
bcostm | 4:137bb367ba50 | 283 | /** |
bcostm | 4:137bb367ba50 | 284 | * @} |
bcostm | 4:137bb367ba50 | 285 | */ |
bcostm | 4:137bb367ba50 | 286 | |
bcostm | 4:137bb367ba50 | 287 | /** @defgroup LSM6DSL_GyroImported_Globals GYROSCOPE Imported Globals |
bcostm | 4:137bb367ba50 | 288 | * @{ |
bcostm | 4:137bb367ba50 | 289 | */ |
bcostm | 4:137bb367ba50 | 290 | /* Gyroscope driver structure */ |
bcostm | 4:137bb367ba50 | 291 | extern GYRO_DrvTypeDef Lsm6dslGyroDrv; |
bcostm | 4:137bb367ba50 | 292 | |
bcostm | 4:137bb367ba50 | 293 | /** |
bcostm | 4:137bb367ba50 | 294 | * @} |
bcostm | 4:137bb367ba50 | 295 | */ |
bcostm | 4:137bb367ba50 | 296 | |
bcostm | 4:137bb367ba50 | 297 | /** @defgroup LSM6DSL_Imported_Functions LSM6DSL Imported Functions |
bcostm | 4:137bb367ba50 | 298 | * @{ |
bcostm | 4:137bb367ba50 | 299 | */ |
bcostm | 4:137bb367ba50 | 300 | /* IO functions */ |
bcostm | 4:137bb367ba50 | 301 | extern void SENSOR_IO_Init(void); |
bcostm | 4:137bb367ba50 | 302 | extern void SENSOR_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value); |
bcostm | 4:137bb367ba50 | 303 | extern uint8_t SENSOR_IO_Read(uint8_t Addr, uint8_t Reg); |
bcostm | 4:137bb367ba50 | 304 | extern uint16_t SENSOR_IO_ReadMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length); |
bcostm | 4:137bb367ba50 | 305 | extern void SENSOR_IO_WriteMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length); |
bcostm | 4:137bb367ba50 | 306 | /** |
bcostm | 4:137bb367ba50 | 307 | * @} |
bcostm | 4:137bb367ba50 | 308 | */ |
bcostm | 4:137bb367ba50 | 309 | |
bcostm | 4:137bb367ba50 | 310 | #ifdef __cplusplus |
bcostm | 4:137bb367ba50 | 311 | } |
bcostm | 4:137bb367ba50 | 312 | #endif |
bcostm | 4:137bb367ba50 | 313 | |
bcostm | 4:137bb367ba50 | 314 | #endif /* __LSM6DSL__H */ |
bcostm | 4:137bb367ba50 | 315 | |
bcostm | 4:137bb367ba50 | 316 | /** |
bcostm | 4:137bb367ba50 | 317 | * @} |
bcostm | 4:137bb367ba50 | 318 | */ |
bcostm | 4:137bb367ba50 | 319 | |
bcostm | 4:137bb367ba50 | 320 | /** |
bcostm | 4:137bb367ba50 | 321 | * @} |
bcostm | 4:137bb367ba50 | 322 | */ |
bcostm | 4:137bb367ba50 | 323 | |
bcostm | 4:137bb367ba50 | 324 | /** |
bcostm | 4:137bb367ba50 | 325 | * @} |
bcostm | 4:137bb367ba50 | 326 | */ |
bcostm | 4:137bb367ba50 | 327 | |
bcostm | 4:137bb367ba50 | 328 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |