ISF  2.1
Intelligent Sensing Framework for Kinetis with Processor Expert
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
fsl_fxas21002_i2cspi_3D_gyro.h
Go to the documentation of this file.
1 /**
2  * @file fsl_fxas21002_i2cspi_3D_gyro.h
3  * @brief The \b fsl_fxas21002_i2cspi_3D_gyro.h file contains the definitions and functions supporting the FXAS21002 Sensor Adapter
4 
5  * @copyright Copyright (c) 2014, Freescale Semiconductor, Inc.
6  * @version 01.00
7  * @addtogroup fsl_fxas21002_i2cspi_3D_gyro_module fsl_fxas21002_i2cspi_3D_gyro module documentation
8  * @{
9 */
10 
11 #ifndef FSL_FXAS21002_I2CSPI_3D_GYRO_H_
12 #define FSL_FXAS21002_I2CSPI_3D_GYRO_H_
13 
14 /* Include shared modules, which are used for whole project */
15 #include "PE_Types.h"
16 #include "PE_Error.h"
17 #include "PE_Const.h"
18 #include "IO_Map.h"
19 /* Include inherited components */
20 
21 #include "Cpu.h"
22 
23 #include "isf_sm_types.h"
24 #include "isf_dsa_adapter.h"
25 
26 /*! @brief Define the WHO_AM_I register values for both possible sensor variations. */
27 #define FXAS21002_WHO_AM_I_VALUE 0xD6
28 #define FXAS21000_WHO_AM_I_VALUE 0xD1
29 
30 /*! @brief This structure defines the dummy DSA data buffer format.*/
31 typedef struct {
32  uint32 timeStamp; /*!< The time stamp for the data packet.*/
33  int16 gyro[3]; /*!< The gyronetometer data */
34  uint8 addr; /*!< The device "address" can uniquely identify the sensor */
36 
37 
38 /**
39  * @brief FXAS21002 internal return codes.
40  */
42 
43 /**
44  * @brief Enumeration for the FXAS21002 internal error codes.
45  */
47  FXAS21002_ERROR_WHOAMI = 1, /*!< Error occurred while reading ::FXAS21002_WHO_AM_I or the value was incorrect. */
48  FXAS21002_ERROR_WAITFORACTIVE, /*!< Error occurred while attempting to put device into active mode. */
49  FXAS21002_ERROR_BURSTWRITE, /*!< Error occurred while attempting to write a block of memory to the device. */
50  FXAS21002_ERROR_CONFIG, /*!< Error occurred while attempting to configure the device. */
51  FXAS21002_ERROR_SETPOWER, /*!< Error occurred while attempting to set the power mode of the device. */
52  FXAS21002_ERROR_WRITE, /*!< Error occurred while attempting to write the registers directly. */
53  FXAS21002_ERROR_READ, /*!< Error occurred while attempting to read the registers directly. */
54 };
55 /**
56  * @brief Enumeration for the FXAS21002 power modes.
57  */
58 typedef enum fxas21002_Power_tag {
59  FXAS21002_POWER_STANDBY = 0, /*!< Device in Standby mode. Less power consumption during the mode.*/
60  FXAS21002_POWER_ACTIVE = 1, /*!< Device in active mode.*/
62 /**
63  * @brief Enumeration for the FXAS21002 driver internal states.
64  */
66  FXAS21002_STATE_UNINTIALIZED, /*!< initial state of the device.*/
67  FXAS21002_STATE_INITIALIZED, /*!< FXAS21002_WHO_AM_I has been verified. */
68  FXAS21002_STATE_CONFIGURED, /*!< Device has been reset and configured. */
69  FXAS21002_STATE_STARTED, /*!< Device is in active mode and measuring data. */
71 
72 typedef enum fxas21002_Range_tag {
78 
79 /**
80  * @brief the structure defines the ODR table between Hybrid and normal mode of FXAS21002 operation.
81  */
82 typedef struct fxas21002_ODR_Table_tag{
83  uint32 periodNormalMode; /*!< Normal Mode ODR value in millisecond. */
84  uint8 configVal; /*!< configuration value correspond to given ODR in millisecond. */
86 
87 /**
88  * @brief the structure defines the ODR table between Hybrid and normal mode of FXAS21000 operation.
89  */
90 typedef struct fxas21000_ODR_Table_tag{
91  uint32 periodNormalMode; /*!< Normal Mode ODR value in millisecond. */
92  uint8 configVal; /*!< configuration value correspond to given ODR in millisecond. */
94 
95 /**
96  * @brief the structure defines the configuration table.
97  */
99  void *memberVariable; /*!< reference to the member variable. */
100  uint8 startAddress; /*!< start address to the member variable. */
101  uint8 size; /*!< size of the memeber to be configured. */
103 
104 
105 
106 /*! @brief Supported sensor and data types for MMA8652 */
109 
110 /*
111 ** ===================================================================
112 ** Method : fsl_fxas21002_i2cspi_3D_gyro_Initialize (component ISFDSA)
113 ** @brief
114 **
115 ** Parameters :
116 ** NAME - DESCRIPTION
117 ** @param
118 ** void* pSensorHandle -
119 ** @return
120 ** int32_t -
121 ** ===================================================================
122 */
124 
125 /*
126 ** ===================================================================
127 ** Method : fsl_fxas21002_i2cspi_3D_gyro_ValidateSettings (component ISFDSA)
128 ** @brief
129 **
130 ** Parameters :
131 ** NAME - DESCRIPTION
132 ** @param
133 ** void* pSensorHandle -
134 ** @param
135 ** void* pSettings -
136 ** @return
137 ** int32_t -
138 ** ===================================================================
139 */
141 
142 /*
143 ** ===================================================================
144 ** Method : fsl_fxas21002_i2cspi_3D_gyro_Configure (component ISFDSA)
145 ** @brief
146 **
147 ** Parameters :
148 ** NAME - DESCRIPTION
149 ** @param
150 ** void* pSensorHandle -
151 ** @param
152 ** void* pConfigSettings -
153 ** @return
154 ** int32_t -
155 ** ===================================================================
156 */
158 
159 /*
160 ** ===================================================================
161 ** Method : fsl_fxas21002_i2cspi_3D_gyro_StartData (component ISFDSA)
162 ** @brief
163 **
164 ** Parameters :
165 ** NAME - DESCRIPTION
166 ** @param
167 ** void* pSensorHandle -
168 ** @return
169 ** int32_t -
170 ** ===================================================================
171 */
173 
174 /*
175 ** ===================================================================
176 ** Method : fsl_fxas21002_i2cspi_3D_gyro_EndData (component ISFDSA)
177 ** @brief
178 **
179 ** Parameters :
180 ** NAME - DESCRIPTION
181 ** @param
182 ** void* pSensorHandle -
183 ** @return
184 ** int32_t -
185 ** ===================================================================
186 */
188 
189 /*
190 ** ===================================================================
191 ** Method : fsl_fxas21002_i2cspi_3D_gyro_Calibrate (component ISFDSA)
192 ** @brief
193 **
194 ** Parameters :
195 ** NAME - DESCRIPTION
196 ** @param
197 ** void* pSensorHandle -
198 ** @return
199 ** int32_t -
200 ** ===================================================================
201 */
203 
204 /*
205 ** ===================================================================
206 ** Method : fsl_fxas21002_i2cspi_3D_gyro_Shutdown (component ISFDSA)
207 ** @brief
208 **
209 ** Parameters :
210 ** NAME - DESCRIPTION
211 ** @param
212 ** void* pSensorHandle -
213 ** @return
214 ** int32_t -
215 ** ===================================================================
216 */
218 
219 /*
220 ** ===================================================================
221 ** Method : fsl_fxas21002_i2cspi_3D_gyro_PeriodicCallback (component ISFDSA)
222 ** @brief
223 **
224 ** Parameters :
225 ** NAME - DESCRIPTION
226 ** @param
227 ** void* pSensorHandle -
228 ** @return
229 ** void -
230 ** ===================================================================
231 */
232 void fsl_fxas21002_i2cspi_3D_gyro_PeriodicCallback(void *pSensorHandle);
233 
234 /*
235 ** ===================================================================
236 ** Method : fsl_fxas21002_i2cspi_3D_gyro_Convert (component ISFDSA)
237 ** @brief
238 **
239 ** Parameters :
240 ** NAME - DESCRIPTION
241 ** @param
242 ** void* pSensorHandle -
243 ** @return
244 ** void -
245 ** ===================================================================
246 */
248 (
249  volatile isf_SensorHandle_t *pSensorHandle,
250  isf_SensorDataTypes_t convertToType,
251  isf_dsa_result_types_t resultType,
252  void *pNativeSample,
253  void *pConvertedSample,
254  int32 *numBytes
255 );
256 
257 /* END fsl_fxas21002_i2cspi_3D_gyro. */
258 
261 #endif
262 /* ifndef FSL_FXAS21002_I2CSPI_3D_GYRO_H_ */
263 /*!
264 ** @}
265 */
isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_Calibrate(isf_SensorHandle_t *pSensorHandle, void *pCalData)
This is the concrete implementation of the FXAS21002 sensor adapter for calibration ...
unsigned char uint8
This defines uint8 as unsigned char.
Definition: isf_types.h:18
the structure defines the ODR table between Hybrid and normal mode of FXAS21000 operation.
isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_EndData(isf_SensorHandle_t *pSensorHandle)
This is the concrete implementation of the FXAS21002 sensor adapter for End Data. ...
isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_Convert(volatile isf_SensorHandle_t *pSensorHandle, isf_SensorDataTypes_t convertToType, isf_dsa_result_types_t resultType, void *pNativeSample, void *pConvertedSample, int32 *numBytes)
This function coverts the raw sample data to the desired output type.
int32 fxas21002_Status_t
FXAS21002 internal return codes.
This structure defines the dummy DSA data buffer format.
the structure defines the configuration table.
This defines the DSA sensor device handle structure used to invoke the adapter access functions...
isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_Configure(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
This is the concrete implementation of the FXAS21002 sensor adapter for configuration.
fxas21002_Error_tag
Enumeration for the FXAS21002 internal error codes.
unsigned long uint32
This defines uint32 as unsigned long.
Definition: isf_types.h:36
isf_SensorTypes_t
enum fxas21002_Range_tag fxas21002_Range_t
enum fxas21002_InternalState_tag fxas21002_InternalState_t
Enumeration for the FXAS21002 driver internal states.
isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_StartData(isf_SensorHandle_t *pSensorHandle)
This is the concrete implementation of the FXAS21002 sensor adapter for start Data.
int32 isf_dsa_status_t
This is the Sensor Manager API return type definition.
fxas21002_InternalState_tag
Enumeration for the FXAS21002 driver internal states.
isf_SensorDataTypes_t fxas21002_SupportedDataTypes[]
enum isf_dsa_result_enums isf_dsa_result_types_t
struct fxas21002_ConfigTable_tag fxas21002_ConfigTable_t
the structure defines the configuration table.
isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_ValidateSettings(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSubSettings)
This is the concrete implementation of the FXAS21002 sensor adapter for validating current settings...
isf_SensorDataTypes_t
long int32
This defines int32 as long.
Definition: isf_types.h:32
isf_SensorTypes_t fxas21002_SupportedSensorTypes[]
Supported sensor and data types for MMA8652.
short int16
This defines int16 as short.
Definition: isf_types.h:23
isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_Shutdown(isf_SensorHandle_t *pSensorHandle)
This is the concrete implementation of the FXAS21002 sensor adapter for shutdown .
void fsl_fxas21002_i2cspi_3D_gyro_PeriodicCallback(void *pSensorHandle)
The callback function for the Bus Manager(BM).
isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_Initialize(isf_SensorHandle_t *pSensorHandle)
This is the concrete implementation of the FXAS21002 sensor adapter initialization.
This defines the DSA sensor configuration parameter structure configuring the sensor settings by a su...
enum fxas21002_Power_tag fxas21002_Power_t
Enumeration for the FXAS21002 power modes.
struct fxas21002_ODR_Table_tag fxas21002_ODR_Table_t
the structure defines the ODR table between Hybrid and normal mode of FXAS21002 operation.
fxas21002_Power_tag
Enumeration for the FXAS21002 power modes.
The isf_sm_types.h contains the collection of type definitions used in the Sensor Manager Interface a...
the structure defines the ODR table between Hybrid and normal mode of FXAS21002 operation.
struct fxas21000_ODR_Table_tag fxas21000_ODR_Table_t
the structure defines the ODR table between Hybrid and normal mode of FXAS21000 operation.