| ISF 2.1 Intelligent Sensing Framework for Kinetis with Processor Expert

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

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 */
35 } fxas21002_DataBuffer_t;
36
37
38 /**
39 * @brief FXAS21002 internal return codes.
40 */
41 typedef int32 fxas21002_Status_t;
42
43 /**
44 * @brief Enumeration for the FXAS21002 internal error codes.
45 */
46 enum fxas21002_Error_tag {
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.*/
61 } fxas21002_Power_t;
62 /**
63 * @brief Enumeration for the FXAS21002 driver internal states.
64 */
65 typedef enum fxas21002_InternalState_tag {
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. */
70 } fxas21002_InternalState_t;
71
72 typedef enum fxas21002_Range_tag {
73 FXAS21002_RANGE_2000DPS = 0,
74 FXAS21002_RANGE_1000DPS = 1,
75 FXAS21002_RANGE_500DPS = 2,
76 FXAS21002_RANGE_MAX = FXAS21002_RANGE_2000DPS,
77 } fxas21002_Range_t;
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. */
85 }fxas21002_ODR_Table_t;
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. */
93 }fxas21000_ODR_Table_t;
94
95 /**
96 * @brief the structure defines the configuration table.
97 */
98 typedef struct fxas21002_ConfigTable_tag{
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. */
102 }fxas21002_ConfigTable_t;
103
104
105
106 /*! @brief Supported sensor and data types for MMA8652 */
107 extern isf_SensorTypes_t fxas21002_SupportedSensorTypes[];
108 extern isf_SensorDataTypes_t fxas21002_SupportedDataTypes[];
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 */
123 isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_Initialize( isf_SensorHandle_t *pSensorHandle);
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 */
140 isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_ValidateSettings(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSubSettings);
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 */
157 isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_Configure(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings);
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 */
172 isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_StartData(isf_SensorHandle_t *pSensorHandle );
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 */
187 isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_EndData(isf_SensorHandle_t *pSensorHandle );
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 */
202 isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_Calibrate(isf_SensorHandle_t *pSensorHandle, void *pCalData );
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 */
217 isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_Shutdown(isf_SensorHandle_t *pSensorHandle );
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 */
247 isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_Convert
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
259 extern isf_SensorTypes_t fxas21002_SupportedSensorTypes[];
260 extern isf_SensorDataTypes_t fxas21002_SupportedDataTypes[];
261 #endif
262 /* ifndef FSL_FXAS21002_I2CSPI_3D_GYRO_H_ */
263 /*!
264 ** @}
265 */
FXAS21002_ERROR_WRITE
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:52
FXAS21002_STATE_UNINTIALIZED
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:66
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:538
fxas21002_ConfigTable_tag::startAddress
uint8 startAddress
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:100
uint8
unsigned char uint8
This defines uint8 as unsigned char.
Definition: isf_types.h:18
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:90
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:474
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:693
isf_dsa_adapter.h
fxas21002_Status_t
int32 fxas21002_Status_t
FXAS21002 internal return codes.
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:41
FXAS21002_RANGE_MAX
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:76
fxas21002_DataBuffer_t
This structure defines the dummy DSA data buffer format.
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:31
FXAS21002_RANGE_1000DPS
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:74
FXAS21002_RANGE_2000DPS
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:73
fxas21002_ConfigTable_tag
the structure defines the configuration table.
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:98
fxas21002_DataBuffer_t::addr
uint8 addr
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:34
isf_SensorHandle_st
This defines the DSA sensor device handle structure used to invoke the adapter access functions...
Definition: isf_dsa_adapter.h:109
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:285
fxas21000_ODR_Table_tag::configVal
uint8 configVal
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:92
fxas21002_Error_tag
fxas21002_Error_tag
Enumeration for the FXAS21002 internal error codes.
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:46
uint32
unsigned long uint32
This defines uint32 as unsigned long.
Definition: isf_types.h:36
fxas21002_ConfigTable_tag::memberVariable
void * memberVariable
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:99
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:32
fxas21002_Range_t
enum fxas21002_Range_tag fxas21002_Range_t
fxas21002_ConfigTable_tag::size
uint8 size
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:101
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:72
FXAS21002_ERROR_BURSTWRITE
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:49
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:414
FXAS21002_ERROR_WHOAMI
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:47
FXAS21002_STATE_INITIALIZED
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:67
isf_dsa_status_t
int32 isf_dsa_status_t
This is the Sensor Manager API return type definition.
Definition: isf_dsa_adapter.h:23
fxas21002_InternalState_tag
fxas21002_InternalState_tag
Enumeration for the FXAS21002 driver internal states.
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:65
fxas21002_SupportedDataTypes
isf_SensorDataTypes_t fxas21002_SupportedDataTypes[]
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:260
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:84
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:59
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:246
isf_SensorDataTypes_t
isf_SensorDataTypes_t
Definition: isf_sensor_types.h:61
FXAS21002_POWER_ACTIVE
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:60
int32
long int32
This defines int32 as long.
Definition: isf_types.h:32
fxas21002_SupportedSensorTypes
isf_SensorTypes_t fxas21002_SupportedSensorTypes[]
Supported sensor and data types for MMA8652.
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:259
int16
short int16
This defines int16 as short.
Definition: isf_types.h:23
fxas21000_ODR_Table_tag::periodNormalMode
uint32 periodNormalMode
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:91
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:555
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:585
fxas21002_ODR_Table_tag::periodNormalMode
uint32 periodNormalMode
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:83
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:157
isf_dsa_SensorSettings_st
This defines the DSA sensor configuration parameter structure configuring the sensor settings by a su...
Definition: isf_dsa_adapter.h:81
FXAS21002_STATE_STARTED
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:69
FXAS21002_ERROR_WAITFORACTIVE
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:48
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:75
fxas21002_Power_tag
fxas21002_Power_tag
Enumeration for the FXAS21002 power modes.
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:58
FXAS21002_ERROR_READ
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:53
FXAS21002_ERROR_SETPOWER
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:51
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:68
FXAS21002_ERROR_CONFIG
Definition: fsl_fxas21002_i2cspi_3D_gyro.h:50
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:82
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. 2015. All Rights Reserved.