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
imu_6axes.h
00001 /** 00002 ****************************************************************************** 00003 * @file imu_6axes.h 00004 * @author MEMS Application Team 00005 * @version V1.2.0 00006 * @date 28-January-2015 00007 * @brief This header file contains the functions prototypes for the 00008 * accelerometer and gyroscope 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 00040 /* Define to prevent recursive inclusion -------------------------------------*/ 00041 #ifndef __IMU_6AXES_H 00042 #define __IMU_6AXES_H 00043 00044 #ifdef __cplusplus 00045 extern "C" { 00046 #endif 00047 00048 /* Includes ------------------------------------------------------------------*/ 00049 #include <stdint.h> 00050 00051 /** @addtogroup BSP 00052 * @{ 00053 */ 00054 00055 /** @addtogroup Components 00056 * @{ 00057 */ 00058 00059 /** @addtogroup IMU_6AXES 00060 * @{ 00061 */ 00062 00063 /** @defgroup IMU_6AXES_Exported_Types 00064 * @{ 00065 */ 00066 00067 /** 00068 * @brief IMU_6AXES init structure definition 00069 */ 00070 typedef struct 00071 { 00072 float G_OutputDataRate; 00073 float G_FullScale; 00074 uint8_t G_X_Axis; 00075 uint8_t G_Y_Axis; 00076 uint8_t G_Z_Axis; 00077 float X_OutputDataRate; 00078 float X_FullScale; 00079 uint8_t X_X_Axis; 00080 uint8_t X_Y_Axis; 00081 uint8_t X_Z_Axis; 00082 } IMU_6AXES_InitTypeDef; 00083 00084 /** 00085 * @brief IMU_6AXES status enumerator definition 00086 */ 00087 typedef enum 00088 { 00089 IMU_6AXES_OK = 0, 00090 IMU_6AXES_ERROR = 1, 00091 IMU_6AXES_TIMEOUT = 2, 00092 IMU_6AXES_NOT_IMPLEMENTED = 3 00093 } IMU_6AXES_StatusTypeDef; 00094 00095 /** 00096 * @brief IMU_6AXES component id enumerator definition 00097 */ 00098 typedef enum 00099 { 00100 IMU_6AXES_NONE_COMPONENT = 0, 00101 IMU_6AXES_LSM6DS0_COMPONENT = 1, 00102 IMU_6AXES_LSM6DS3_DIL24_COMPONENT = 2 00103 } IMU_6AXES_ComponentTypeDef; 00104 00105 /** 00106 * @brief IMU_6AXES driver extended structure definition 00107 */ 00108 typedef struct 00109 { 00110 IMU_6AXES_ComponentTypeDef 00111 id; /* This id must be unique for each component belonging to this class that wants to extend common class */ 00112 void *pData; /* This pointer is specific for each component */ 00113 } IMU_6AXES_DrvExtTypeDef; 00114 00115 /** 00116 * @brief IMU_6AXES driver structure definition 00117 */ 00118 typedef struct 00119 { 00120 IMU_6AXES_StatusTypeDef (*Init)(IMU_6AXES_InitTypeDef *); 00121 IMU_6AXES_StatusTypeDef (*Read_XG_ID)(uint8_t *); 00122 IMU_6AXES_StatusTypeDef (*Get_X_Axes)(int32_t *); 00123 IMU_6AXES_StatusTypeDef (*Get_X_AxesRaw)(int16_t *); 00124 IMU_6AXES_StatusTypeDef (*Get_G_Axes)(int32_t *); 00125 IMU_6AXES_StatusTypeDef (*Get_G_AxesRaw)(int16_t *); 00126 IMU_6AXES_StatusTypeDef (*Get_X_ODR) (float *); 00127 IMU_6AXES_StatusTypeDef (*Set_X_ODR) (float); 00128 IMU_6AXES_StatusTypeDef (*Get_X_Sensitivity) (float *); 00129 IMU_6AXES_StatusTypeDef (*Get_X_FS) (float *); 00130 IMU_6AXES_StatusTypeDef (*Set_X_FS) (float); 00131 IMU_6AXES_StatusTypeDef (*Get_G_ODR) (float *); 00132 IMU_6AXES_StatusTypeDef (*Set_G_ODR) (float); 00133 IMU_6AXES_StatusTypeDef (*Get_G_Sensitivity) (float *); 00134 IMU_6AXES_StatusTypeDef (*Get_G_FS) (float *); 00135 IMU_6AXES_StatusTypeDef (*Set_G_FS) (float); 00136 IMU_6AXES_DrvExtTypeDef *extData; 00137 } IMU_6AXES_DrvTypeDef; 00138 00139 /** 00140 * @} 00141 */ 00142 00143 /** 00144 * @} 00145 */ 00146 00147 /** 00148 * @} 00149 */ 00150 00151 /** 00152 * @} 00153 */ 00154 00155 #ifdef __cplusplus 00156 } 00157 #endif 00158 00159 #endif /* __IMU_6AXES_H */ 00160 00161 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Generated on Sat Jul 16 2022 05:47:21 by
