Version of the IKS01A1 library for this coursework
Dependencies: X_NUCLEO_COMMON
Fork of X_NUCLEO_IKS01A1 by
Components/Common/imu_6axes.h@24:92cc9c6e4b2b, 2015-06-03 (annotated)
- Committer:
- Wolfgang Betz
- Date:
- Wed Jun 03 14:57:57 2015 +0200
- Revision:
- 24:92cc9c6e4b2b
- Parent:
- 5:8bab0f419849
Upgrade to match X-CUBE-MEMS1/trunk, revision #402
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Wolfgang Betz |
5:8bab0f419849 | 1 | /** |
Wolfgang Betz |
5:8bab0f419849 | 2 | ****************************************************************************** |
Wolfgang Betz |
5:8bab0f419849 | 3 | * @file imu_6axes.h |
Wolfgang Betz |
5:8bab0f419849 | 4 | * @author MEMS Application Team |
Wolfgang Betz |
5:8bab0f419849 | 5 | * @version V1.2.0 |
Wolfgang Betz |
5:8bab0f419849 | 6 | * @date 28-January-2015 |
Wolfgang Betz |
24:92cc9c6e4b2b | 7 | * @brief This header file contains the functions prototypes for the |
Wolfgang Betz |
5:8bab0f419849 | 8 | * accelerometer and gyroscope driver. |
Wolfgang Betz |
5:8bab0f419849 | 9 | ****************************************************************************** |
Wolfgang Betz |
5:8bab0f419849 | 10 | * @attention |
Wolfgang Betz |
5:8bab0f419849 | 11 | * |
Wolfgang Betz |
5:8bab0f419849 | 12 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
Wolfgang Betz |
5:8bab0f419849 | 13 | * |
Wolfgang Betz |
5:8bab0f419849 | 14 | * Redistribution and use in source and binary forms, with or without modification, |
Wolfgang Betz |
5:8bab0f419849 | 15 | * are permitted provided that the following conditions are met: |
Wolfgang Betz |
5:8bab0f419849 | 16 | * 1. Redistributions of source code must retain the above copyright notice, |
Wolfgang Betz |
5:8bab0f419849 | 17 | * this list of conditions and the following disclaimer. |
Wolfgang Betz |
5:8bab0f419849 | 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
Wolfgang Betz |
5:8bab0f419849 | 19 | * this list of conditions and the following disclaimer in the documentation |
Wolfgang Betz |
5:8bab0f419849 | 20 | * and/or other materials provided with the distribution. |
Wolfgang Betz |
5:8bab0f419849 | 21 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
Wolfgang Betz |
5:8bab0f419849 | 22 | * may be used to endorse or promote products derived from this software |
Wolfgang Betz |
5:8bab0f419849 | 23 | * without specific prior written permission. |
Wolfgang Betz |
5:8bab0f419849 | 24 | * |
Wolfgang Betz |
5:8bab0f419849 | 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
Wolfgang Betz |
5:8bab0f419849 | 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
Wolfgang Betz |
5:8bab0f419849 | 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
Wolfgang Betz |
5:8bab0f419849 | 28 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
Wolfgang Betz |
5:8bab0f419849 | 29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
Wolfgang Betz |
5:8bab0f419849 | 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
Wolfgang Betz |
5:8bab0f419849 | 31 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
Wolfgang Betz |
5:8bab0f419849 | 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
Wolfgang Betz |
5:8bab0f419849 | 33 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
Wolfgang Betz |
5:8bab0f419849 | 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Wolfgang Betz |
5:8bab0f419849 | 35 | * |
Wolfgang Betz |
5:8bab0f419849 | 36 | ****************************************************************************** |
Wolfgang Betz |
5:8bab0f419849 | 37 | */ |
Wolfgang Betz |
5:8bab0f419849 | 38 | |
Wolfgang Betz |
5:8bab0f419849 | 39 | |
Wolfgang Betz |
5:8bab0f419849 | 40 | /* Define to prevent recursive inclusion -------------------------------------*/ |
Wolfgang Betz |
5:8bab0f419849 | 41 | #ifndef __IMU_6AXES_H |
Wolfgang Betz |
5:8bab0f419849 | 42 | #define __IMU_6AXES_H |
Wolfgang Betz |
5:8bab0f419849 | 43 | |
Wolfgang Betz |
5:8bab0f419849 | 44 | #ifdef __cplusplus |
Wolfgang Betz |
5:8bab0f419849 | 45 | extern "C" { |
Wolfgang Betz |
5:8bab0f419849 | 46 | #endif |
Wolfgang Betz |
5:8bab0f419849 | 47 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 48 | /* Includes ------------------------------------------------------------------*/ |
Wolfgang Betz |
24:92cc9c6e4b2b | 49 | #include <stdint.h> |
Wolfgang Betz |
5:8bab0f419849 | 50 | |
Wolfgang Betz |
5:8bab0f419849 | 51 | /** @addtogroup BSP |
Wolfgang Betz |
5:8bab0f419849 | 52 | * @{ |
Wolfgang Betz |
5:8bab0f419849 | 53 | */ |
Wolfgang Betz |
5:8bab0f419849 | 54 | |
Wolfgang Betz |
5:8bab0f419849 | 55 | /** @addtogroup Components |
Wolfgang Betz |
5:8bab0f419849 | 56 | * @{ |
Wolfgang Betz |
5:8bab0f419849 | 57 | */ |
Wolfgang Betz |
24:92cc9c6e4b2b | 58 | |
Wolfgang Betz |
5:8bab0f419849 | 59 | /** @addtogroup IMU_6AXES |
Wolfgang Betz |
5:8bab0f419849 | 60 | * @{ |
Wolfgang Betz |
5:8bab0f419849 | 61 | */ |
Wolfgang Betz |
5:8bab0f419849 | 62 | |
Wolfgang Betz |
5:8bab0f419849 | 63 | /** @defgroup IMU_6AXES_Exported_Types |
Wolfgang Betz |
5:8bab0f419849 | 64 | * @{ |
Wolfgang Betz |
5:8bab0f419849 | 65 | */ |
Wolfgang Betz |
24:92cc9c6e4b2b | 66 | |
Wolfgang Betz |
5:8bab0f419849 | 67 | /** |
Wolfgang Betz |
5:8bab0f419849 | 68 | * @brief IMU_6AXES init structure definition |
Wolfgang Betz |
5:8bab0f419849 | 69 | */ |
Wolfgang Betz |
5:8bab0f419849 | 70 | typedef struct |
Wolfgang Betz |
5:8bab0f419849 | 71 | { |
Wolfgang Betz |
24:92cc9c6e4b2b | 72 | float G_OutputDataRate; |
Wolfgang Betz |
24:92cc9c6e4b2b | 73 | float G_FullScale; |
Wolfgang Betz |
24:92cc9c6e4b2b | 74 | uint8_t G_X_Axis; |
Wolfgang Betz |
24:92cc9c6e4b2b | 75 | uint8_t G_Y_Axis; |
Wolfgang Betz |
24:92cc9c6e4b2b | 76 | uint8_t G_Z_Axis; |
Wolfgang Betz |
24:92cc9c6e4b2b | 77 | float X_OutputDataRate; |
Wolfgang Betz |
24:92cc9c6e4b2b | 78 | float X_FullScale; |
Wolfgang Betz |
24:92cc9c6e4b2b | 79 | uint8_t X_X_Axis; |
Wolfgang Betz |
24:92cc9c6e4b2b | 80 | uint8_t X_Y_Axis; |
Wolfgang Betz |
24:92cc9c6e4b2b | 81 | uint8_t X_Z_Axis; |
Wolfgang Betz |
24:92cc9c6e4b2b | 82 | } IMU_6AXES_InitTypeDef; |
Wolfgang Betz |
5:8bab0f419849 | 83 | |
Wolfgang Betz |
5:8bab0f419849 | 84 | /** |
Wolfgang Betz |
5:8bab0f419849 | 85 | * @brief IMU_6AXES status enumerator definition |
Wolfgang Betz |
5:8bab0f419849 | 86 | */ |
Wolfgang Betz |
24:92cc9c6e4b2b | 87 | typedef enum |
Wolfgang Betz |
24:92cc9c6e4b2b | 88 | { |
Wolfgang Betz |
24:92cc9c6e4b2b | 89 | IMU_6AXES_OK = 0, |
Wolfgang Betz |
24:92cc9c6e4b2b | 90 | IMU_6AXES_ERROR = 1, |
Wolfgang Betz |
24:92cc9c6e4b2b | 91 | IMU_6AXES_TIMEOUT = 2, |
Wolfgang Betz |
24:92cc9c6e4b2b | 92 | IMU_6AXES_NOT_IMPLEMENTED = 3 |
Wolfgang Betz |
5:8bab0f419849 | 93 | } IMU_6AXES_StatusTypeDef; |
Wolfgang Betz |
5:8bab0f419849 | 94 | |
Wolfgang Betz |
5:8bab0f419849 | 95 | /** |
Wolfgang Betz |
5:8bab0f419849 | 96 | * @brief IMU_6AXES component id enumerator definition |
Wolfgang Betz |
5:8bab0f419849 | 97 | */ |
Wolfgang Betz |
24:92cc9c6e4b2b | 98 | typedef enum |
Wolfgang Betz |
24:92cc9c6e4b2b | 99 | { |
Wolfgang Betz |
24:92cc9c6e4b2b | 100 | IMU_6AXES_NONE_COMPONENT = 0, |
Wolfgang Betz |
24:92cc9c6e4b2b | 101 | IMU_6AXES_LSM6DS0_COMPONENT = 1, |
Wolfgang Betz |
24:92cc9c6e4b2b | 102 | IMU_6AXES_LSM6DS3_DIL24_COMPONENT = 2 |
Wolfgang Betz |
5:8bab0f419849 | 103 | } IMU_6AXES_ComponentTypeDef; |
Wolfgang Betz |
5:8bab0f419849 | 104 | |
Wolfgang Betz |
5:8bab0f419849 | 105 | /** |
Wolfgang Betz |
5:8bab0f419849 | 106 | * @brief IMU_6AXES driver extended structure definition |
Wolfgang Betz |
5:8bab0f419849 | 107 | */ |
Wolfgang Betz |
24:92cc9c6e4b2b | 108 | typedef struct |
Wolfgang Betz |
24:92cc9c6e4b2b | 109 | { |
Wolfgang Betz |
24:92cc9c6e4b2b | 110 | IMU_6AXES_ComponentTypeDef |
Wolfgang Betz |
24:92cc9c6e4b2b | 111 | id; /* This id must be unique for each component belonging to this class that wants to extend common class */ |
Wolfgang Betz |
24:92cc9c6e4b2b | 112 | void *pData; /* This pointer is specific for each component */ |
Wolfgang Betz |
24:92cc9c6e4b2b | 113 | } IMU_6AXES_DrvExtTypeDef; |
Wolfgang Betz |
5:8bab0f419849 | 114 | |
Wolfgang Betz |
5:8bab0f419849 | 115 | /** |
Wolfgang Betz |
5:8bab0f419849 | 116 | * @brief IMU_6AXES driver structure definition |
Wolfgang Betz |
5:8bab0f419849 | 117 | */ |
Wolfgang Betz |
24:92cc9c6e4b2b | 118 | typedef struct |
Wolfgang Betz |
24:92cc9c6e4b2b | 119 | { |
Wolfgang Betz |
24:92cc9c6e4b2b | 120 | IMU_6AXES_StatusTypeDef (*Init)(IMU_6AXES_InitTypeDef *); |
Wolfgang Betz |
24:92cc9c6e4b2b | 121 | IMU_6AXES_StatusTypeDef (*Read_XG_ID)(uint8_t *); |
Wolfgang Betz |
24:92cc9c6e4b2b | 122 | IMU_6AXES_StatusTypeDef (*Get_X_Axes)(int32_t *); |
Wolfgang Betz |
24:92cc9c6e4b2b | 123 | IMU_6AXES_StatusTypeDef (*Get_X_AxesRaw)(int16_t *); |
Wolfgang Betz |
24:92cc9c6e4b2b | 124 | IMU_6AXES_StatusTypeDef (*Get_G_Axes)(int32_t *); |
Wolfgang Betz |
24:92cc9c6e4b2b | 125 | IMU_6AXES_StatusTypeDef (*Get_G_AxesRaw)(int16_t *); |
Wolfgang Betz |
24:92cc9c6e4b2b | 126 | IMU_6AXES_StatusTypeDef (*Get_X_ODR) (float *); |
Wolfgang Betz |
24:92cc9c6e4b2b | 127 | IMU_6AXES_StatusTypeDef (*Set_X_ODR) (float); |
Wolfgang Betz |
24:92cc9c6e4b2b | 128 | IMU_6AXES_StatusTypeDef (*Get_X_Sensitivity) (float *); |
Wolfgang Betz |
24:92cc9c6e4b2b | 129 | IMU_6AXES_StatusTypeDef (*Get_X_FS) (float *); |
Wolfgang Betz |
24:92cc9c6e4b2b | 130 | IMU_6AXES_StatusTypeDef (*Set_X_FS) (float); |
Wolfgang Betz |
24:92cc9c6e4b2b | 131 | IMU_6AXES_StatusTypeDef (*Get_G_ODR) (float *); |
Wolfgang Betz |
24:92cc9c6e4b2b | 132 | IMU_6AXES_StatusTypeDef (*Set_G_ODR) (float); |
Wolfgang Betz |
24:92cc9c6e4b2b | 133 | IMU_6AXES_StatusTypeDef (*Get_G_Sensitivity) (float *); |
Wolfgang Betz |
24:92cc9c6e4b2b | 134 | IMU_6AXES_StatusTypeDef (*Get_G_FS) (float *); |
Wolfgang Betz |
24:92cc9c6e4b2b | 135 | IMU_6AXES_StatusTypeDef (*Set_G_FS) (float); |
Wolfgang Betz |
24:92cc9c6e4b2b | 136 | IMU_6AXES_DrvExtTypeDef *extData; |
Wolfgang Betz |
24:92cc9c6e4b2b | 137 | } IMU_6AXES_DrvTypeDef; |
Wolfgang Betz |
5:8bab0f419849 | 138 | |
Wolfgang Betz |
5:8bab0f419849 | 139 | /** |
Wolfgang Betz |
5:8bab0f419849 | 140 | * @} |
Wolfgang Betz |
5:8bab0f419849 | 141 | */ |
Wolfgang Betz |
5:8bab0f419849 | 142 | |
Wolfgang Betz |
5:8bab0f419849 | 143 | /** |
Wolfgang Betz |
5:8bab0f419849 | 144 | * @} |
Wolfgang Betz |
5:8bab0f419849 | 145 | */ |
Wolfgang Betz |
5:8bab0f419849 | 146 | |
Wolfgang Betz |
5:8bab0f419849 | 147 | /** |
Wolfgang Betz |
5:8bab0f419849 | 148 | * @} |
Wolfgang Betz |
5:8bab0f419849 | 149 | */ |
Wolfgang Betz |
5:8bab0f419849 | 150 | |
Wolfgang Betz |
5:8bab0f419849 | 151 | /** |
Wolfgang Betz |
5:8bab0f419849 | 152 | * @} |
Wolfgang Betz |
5:8bab0f419849 | 153 | */ |
Wolfgang Betz |
5:8bab0f419849 | 154 | |
Wolfgang Betz |
5:8bab0f419849 | 155 | #ifdef __cplusplus |
Wolfgang Betz |
5:8bab0f419849 | 156 | } |
Wolfgang Betz |
5:8bab0f419849 | 157 | #endif |
Wolfgang Betz |
5:8bab0f419849 | 158 | |
Wolfgang Betz |
5:8bab0f419849 | 159 | #endif /* __IMU_6AXES_H */ |
Wolfgang Betz |
5:8bab0f419849 | 160 | |
Wolfgang Betz |
24:92cc9c6e4b2b | 161 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |