ISF  2.2 rev 5
Intelligent Sensing Framework for Kinetis with Processor Expert
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) 2015, 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 "isf.h"
16 #include "isf_sm_types.h"
17 #include "isf_dsa_adapter.h"
18 
19 /*! @brief Define the WHO_AM_I register values for both possible sensor variations. */
20 #define FXAS21002_WHO_AM_I_VALUE_PRE_RELEASE 0xD6
21 #define FXAS21002_WHO_AM_I_VALUE_RELEASE 0xD7
22 #define FXAS21000_WHO_AM_I_VALUE 0xD1
23 
24 /*! @brief This structure defines the dummy DSA data buffer format.*/
25 typedef struct {
26  uint32 timeStamp; /*!< The time stamp for the data packet.*/
27  int16 gyro[3]; /*!< The gyronetometer data */
28  uint8 temperature; /*!< The device temperature measured in celsius scale */
30 
31 
32 /**
33  * @brief FXAS21002 internal return codes.
34  */
36 
37 /**
38  * @brief Enumeration for the FXAS21002 internal error codes.
39  */
41  FXAS21002_ERROR_WHOAMI = 1, /*!< Error occurred while reading ::FXAS21002_WHO_AM_I or the value was incorrect. */
42  FXAS21002_ERROR_WAITFORACTIVE, /*!< Error occurred while attempting to put device into active mode. */
43  FXAS21002_ERROR_BURSTWRITE, /*!< Error occurred while attempting to write a block of memory to the device. */
44  FXAS21002_ERROR_CONFIG, /*!< Error occurred while attempting to configure the device. */
45  FXAS21002_ERROR_SETPOWER, /*!< Error occurred while attempting to set the power mode of the device. */
46  FXAS21002_ERROR_WRITE, /*!< Error occurred while attempting to write the registers directly. */
47  FXAS21002_ERROR_READ, /*!< Error occurred while attempting to read the registers directly. */
48 };
49 /**
50  * @brief Enumeration for the FXAS21002 power modes.
51  */
52 typedef enum fxas21002_Power_tag {
53  FXAS21002_POWER_STANDBY = 0, /*!< Device in Standby mode. Less power consumption during the mode.*/
54  FXAS21002_POWER_ACTIVE = 1, /*!< Device in active mode.*/
56 /**
57  * @brief Enumeration for the FXAS21002 driver internal states.
58  */
60  FXAS21002_STATE_UNINTIALIZED, /*!< initial state of the device.*/
61  FXAS21002_STATE_INITIALIZED, /*!< FXAS21002_WHO_AM_I has been verified. */
62  FXAS21002_STATE_CONFIGURED, /*!< Device has been reset and configured. */
63  FXAS21002_STATE_STARTED, /*!< Device is in active mode and measuring data. */
65 
66 typedef enum fxas21002_Range_tag {
72 
73 /**
74  * @brief the structure defines the ODR table between Hybrid and normal mode of FXAS21002 operation.
75  */
76 typedef struct fxas21002_ODR_Table_tag{
77  uint32 periodNormalMode; /*!< Normal Mode ODR value in millisecond. */
78  uint8 configVal; /*!< configuration value correspond to given ODR in millisecond. */
80 
81 /**
82  * @brief the structure defines the ODR table between Hybrid and normal mode of FXAS21000 operation.
83  */
84 typedef struct fxas21000_ODR_Table_tag{
85  uint32 periodNormalMode; /*!< Normal Mode ODR value in millisecond. */
86  uint8 configVal; /*!< configuration value correspond to given ODR in millisecond. */
88 
89 /**
90  * @brief the structure defines the configuration table.
91  */
93  void *memberVariable; /*!< reference to the member variable. */
94  uint8 startAddress; /*!< start address to the member variable. */
95  uint8 size; /*!< size of the memeber to be configured. */
97 
98 
99 
100 /*! @brief Supported sensor and data types for MMA8652 */
103 
104 /*
105 ** ===================================================================
106 ** Method : fsl_fxas21002_i2cspi_3D_gyro_Initialize (component ISFDSA)
107 ** @brief
108 **
109 ** Parameters :
110 ** NAME - DESCRIPTION
111 ** @param
112 ** void* pSensorHandle -
113 ** @return
114 ** int32_t -
115 ** ===================================================================
116 */
118 
119 /*
120 ** ===================================================================
121 ** Method : fsl_fxas21002_i2cspi_3D_gyro_ValidateSettings (component ISFDSA)
122 ** @brief
123 **
124 ** Parameters :
125 ** NAME - DESCRIPTION
126 ** @param
127 ** void* pSensorHandle -
128 ** @param
129 ** void* pSettings -
130 ** @return
131 ** int32_t -
132 ** ===================================================================
133 */
135 
136 /*
137 ** ===================================================================
138 ** Method : fsl_fxas21002_i2cspi_3D_gyro_Configure (component ISFDSA)
139 ** @brief
140 **
141 ** Parameters :
142 ** NAME - DESCRIPTION
143 ** @param
144 ** void* pSensorHandle -
145 ** @param
146 ** void* pConfigSettings -
147 ** @return
148 ** int32_t -
149 ** ===================================================================
150 */
152 
153 /*
154 ** ===================================================================
155 ** Method : fsl_fxas21002_i2cspi_3D_gyro_StartData (component ISFDSA)
156 ** @brief
157 **
158 ** Parameters :
159 ** NAME - DESCRIPTION
160 ** @param
161 ** void* pSensorHandle -
162 ** @return
163 ** int32_t -
164 ** ===================================================================
165 */
167 
168 /*
169 ** ===================================================================
170 ** Method : fsl_fxas21002_i2cspi_3D_gyro_EndData (component ISFDSA)
171 ** @brief
172 **
173 ** Parameters :
174 ** NAME - DESCRIPTION
175 ** @param
176 ** void* pSensorHandle -
177 ** @return
178 ** int32_t -
179 ** ===================================================================
180 */
182 
183 /*
184 ** ===================================================================
185 ** Method : fsl_fxas21002_i2cspi_3D_gyro_Calibrate (component ISFDSA)
186 ** @brief
187 **
188 ** Parameters :
189 ** NAME - DESCRIPTION
190 ** @param
191 ** void* pSensorHandle -
192 ** @return
193 ** int32_t -
194 ** ===================================================================
195 */
197 
198 /*
199 ** ===================================================================
200 ** Method : fsl_fxas21002_i2cspi_3D_gyro_Shutdown (component ISFDSA)
201 ** @brief
202 **
203 ** Parameters :
204 ** NAME - DESCRIPTION
205 ** @param
206 ** void* pSensorHandle -
207 ** @return
208 ** int32_t -
209 ** ===================================================================
210 */
212 
213 /*
214 ** ===================================================================
215 ** Method : fsl_fxas21002_i2cspi_3D_gyro_PeriodicCallback (component ISFDSA)
216 ** @brief
217 **
218 ** Parameters :
219 ** NAME - DESCRIPTION
220 ** @param
221 ** void* pSensorHandle -
222 ** @return
223 ** void -
224 ** ===================================================================
225 */
226 void fsl_fxas21002_i2cspi_3D_gyro_PeriodicCallback(void *pSensorHandle);
227 
228 /*
229 ** ===================================================================
230 ** Method : fsl_fxas21002_i2cspi_3D_gyro_Convert (component ISFDSA)
231 ** @brief
232 **
233 ** Parameters :
234 ** NAME - DESCRIPTION
235 ** @param
236 ** void* pSensorHandle -
237 ** @return
238 ** void -
239 ** ===================================================================
240 */
242 (
243  volatile isf_SensorHandle_t *pSensorHandle,
244  isf_SensorDataTypes_t convertToType,
245  isf_dsa_result_types_t resultType,
246  void *pNativeSample,
247  void *pConvertedSample,
248  int32 *numBytes
249 );
250 
251 /* END fsl_fxas21002_i2cspi_3D_gyro. */
252 
255 #endif
256 /* ifndef FSL_FXAS21002_I2CSPI_3D_GYRO_H_ */
257 /*!
258 ** @}
259 */
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
Definition: isf_types.h:76
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.
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.
signed short int int16
Definition: isf_types.h:73
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
Main ISF header file. Contains code common to all ISF components.
isf_SensorTypes_t fxas21002_SupportedSensorTypes[]
Supported sensor and data types for MMA8652.
signed long int int32
Definition: isf_types.h:74
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.
unsigned long int uint32
Definition: isf_types.h:78
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.