| ISF 2.2 rev 5 Intelligent Sensing Framework for Kinetis with Processor Expert

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

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 */
29 } fxas21002_DataBuffer_t;
30
31
32 /**
33 * @brief FXAS21002 internal return codes.
34 */
35 typedef int32 fxas21002_Status_t;
36
37 /**
38 * @brief Enumeration for the FXAS21002 internal error codes.
39 */
40 enum fxas21002_Error_tag {
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.*/
55 } fxas21002_Power_t;
56 /**
57 * @brief Enumeration for the FXAS21002 driver internal states.
58 */
59 typedef enum fxas21002_InternalState_tag {
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. */
64 } fxas21002_InternalState_t;
65
66 typedef enum fxas21002_Range_tag {
67 FXAS21002_RANGE_2000DPS = 0,
68 FXAS21002_RANGE_1000DPS = 1,
69 FXAS21002_RANGE_500DPS = 2,
70 FXAS21002_RANGE_MAX = FXAS21002_RANGE_2000DPS,
71 } fxas21002_Range_t;
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. */
79 }fxas21002_ODR_Table_t;
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. */
87 }fxas21000_ODR_Table_t;
88
89 /**
90 * @brief the structure defines the configuration table.
91 */
92 typedef struct fxas21002_ConfigTable_tag{
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. */
96 }fxas21002_ConfigTable_t;
97
98
99
100 /*! @brief Supported sensor and data types for MMA8652 */
101 extern isf_SensorTypes_t fxas21002_SupportedSensorTypes[];
102 extern isf_SensorDataTypes_t fxas21002_SupportedDataTypes[];
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 */
117 isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_Initialize( isf_SensorHandle_t *pSensorHandle);
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 */
134 isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_ValidateSettings(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSubSettings);
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 */
151 isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_Configure(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings);
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 */
166 isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_StartData(isf_SensorHandle_t *pSensorHandle );
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 */
181 isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_EndData(isf_SensorHandle_t *pSensorHandle );
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 */
196 isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_Calibrate(isf_SensorHandle_t *pSensorHandle, void *pCalData );
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 */
211 isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_Shutdown(isf_SensorHandle_t *pSensorHandle );
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 */
241 isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_Convert
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
253 extern isf_SensorTypes_t fxas21002_SupportedSensorTypes[];
254 extern isf_SensorDataTypes_t fxas21002_SupportedDataTypes[];
255 #endif
256 /* ifndef FSL_FXAS21002_I2CSPI_3D_GYRO_H_ */
257 /*!
258 ** @}
259 */
fxas21002_DataBuffer_t::temperature
uint8 temperature
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:28
FXAS21002_ERROR_WRITE
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:46
FXAS21002_STATE_UNINTIALIZED
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:60
fsl_fxas21002_i2cspi_3D_gyro_Calibrate
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 ...
Definition: fsl_fxas21002_i2cspi_3D_gyro.c:564
fxas21002_ConfigTable_tag::startAddress
uint8 startAddress
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:94
uint8
unsigned char uint8
Definition: isf_types.h:76
fxas21000_ODR_Table_tag
the structure defines the ODR table between Hybrid and normal mode of FXAS21000 operation.
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:84
fsl_fxas21002_i2cspi_3D_gyro_EndData
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. ...
Definition: fsl_fxas21002_i2cspi_3D_gyro.c:498
fsl_fxas21002_i2cspi_3D_gyro_Convert
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.
Definition: fsl_fxas21002_i2cspi_3D_gyro.c:727
isf_dsa_adapter.h
fxas21002_Status_t
int32 fxas21002_Status_t
FXAS21002 internal return codes.
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:35
FXAS21002_RANGE_MAX
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:70
fxas21002_DataBuffer_t
This structure defines the dummy DSA data buffer format.
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:25
FXAS21002_RANGE_1000DPS
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:68
FXAS21002_RANGE_2000DPS
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:67
fxas21002_ConfigTable_tag
the structure defines the configuration table.
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:92
isf_SensorHandle_st
This defines the DSA sensor device handle structure used to invoke the adapter access functions...
Definition: isf_dsa_adapter.h:107
fsl_fxas21002_i2cspi_3D_gyro_Configure
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.
Definition: fsl_fxas21002_i2cspi_3D_gyro.c:306
fxas21000_ODR_Table_tag::configVal
uint8 configVal
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:86
fxas21002_Error_tag
fxas21002_Error_tag
Enumeration for the FXAS21002 internal error codes.
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:40
fxas21002_ConfigTable_tag::memberVariable
void * memberVariable
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:93
isf_SensorTypes_t
isf_SensorTypes_t
Definition: isf_sensor_types.h:14
fxas21002_DataBuffer_t::timeStamp
uint32 timeStamp
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:26
fxas21002_Range_t
enum fxas21002_Range_tag fxas21002_Range_t
fxas21002_ConfigTable_tag::size
uint8 size
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:95
fxas21002_InternalState_t
enum fxas21002_InternalState_tag fxas21002_InternalState_t
Enumeration for the FXAS21002 driver internal states.
fxas21002_Range_tag
fxas21002_Range_tag
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:66
FXAS21002_ERROR_BURSTWRITE
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:43
fsl_fxas21002_i2cspi_3D_gyro_StartData
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.
Definition: fsl_fxas21002_i2cspi_3D_gyro.c:436
FXAS21002_ERROR_WHOAMI
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:41
FXAS21002_STATE_INITIALIZED
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:61
isf_dsa_status_t
int32 isf_dsa_status_t
This is the Sensor Manager API return type definition.
Definition: isf_dsa_adapter.h:21
int16
signed short int int16
Definition: isf_types.h:73
fxas21002_InternalState_tag
fxas21002_InternalState_tag
Enumeration for the FXAS21002 driver internal states.
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:59
fxas21002_SupportedDataTypes
isf_SensorDataTypes_t fxas21002_SupportedDataTypes[]
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:254
isf_dsa_result_types_t
enum isf_dsa_result_enums isf_dsa_result_types_t
fxas21002_ODR_Table_tag::configVal
uint8 configVal
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:78
fxas21002_ConfigTable_t
struct fxas21002_ConfigTable_tag fxas21002_ConfigTable_t
the structure defines the configuration table.
FXAS21002_POWER_STANDBY
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:53
fsl_fxas21002_i2cspi_3D_gyro_ValidateSettings
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...
Definition: fsl_fxas21002_i2cspi_3D_gyro.c:267
isf_SensorDataTypes_t
isf_SensorDataTypes_t
Definition: isf_sensor_types.h:61
FXAS21002_POWER_ACTIVE
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:54
isf.h
Main ISF header file. Contains code common to all ISF components.
fxas21002_SupportedSensorTypes
isf_SensorTypes_t fxas21002_SupportedSensorTypes[]
Supported sensor and data types for MMA8652.
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:253
int32
signed long int int32
Definition: isf_types.h:74
fxas21000_ODR_Table_tag::periodNormalMode
uint32 periodNormalMode
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:85
fsl_fxas21002_i2cspi_3D_gyro_Shutdown
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 .
Definition: fsl_fxas21002_i2cspi_3D_gyro.c:581
fsl_fxas21002_i2cspi_3D_gyro_PeriodicCallback
void fsl_fxas21002_i2cspi_3D_gyro_PeriodicCallback(void *pSensorHandle)
The callback function for the Bus Manager(BM).
Definition: fsl_fxas21002_i2cspi_3D_gyro.c:611
fxas21002_ODR_Table_tag::periodNormalMode
uint32 periodNormalMode
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:77
fsl_fxas21002_i2cspi_3D_gyro_Initialize
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.
Definition: fsl_fxas21002_i2cspi_3D_gyro.c:181
isf_dsa_SensorSettings_st
This defines the DSA sensor configuration parameter structure configuring the sensor settings by a su...
Definition: isf_dsa_adapter.h:79
FXAS21002_STATE_STARTED
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:63
FXAS21002_ERROR_WAITFORACTIVE
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:42
fxas21002_Power_t
enum fxas21002_Power_tag fxas21002_Power_t
Enumeration for the FXAS21002 power modes.
fxas21002_ODR_Table_t
struct fxas21002_ODR_Table_tag fxas21002_ODR_Table_t
the structure defines the ODR table between Hybrid and normal mode of FXAS21002 operation.
FXAS21002_RANGE_500DPS
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:69
fxas21002_Power_tag
fxas21002_Power_tag
Enumeration for the FXAS21002 power modes.
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:52
FXAS21002_ERROR_READ
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:47
uint32
unsigned long int uint32
Definition: isf_types.h:78
FXAS21002_ERROR_SETPOWER
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:45
isf_sm_types.h
The isf_sm_types.h contains the collection of type definitions used in the Sensor Manager Interface a...
FXAS21002_STATE_CONFIGURED
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:62
FXAS21002_ERROR_CONFIG
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:44
fxas21002_ODR_Table_tag
the structure defines the ODR table between Hybrid and normal mode of FXAS21002 operation.
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:76
fxas21000_ODR_Table_t
struct fxas21000_ODR_Table_tag fxas21000_ODR_Table_t
the structure defines the ODR table between Hybrid and normal mode of FXAS21000 operation.
- © Freescale Semiconductor, Inc. 2016. All Rights Reserved.