| 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_fusion_virt_3D_orient.h
Go to the documentation of this file.
1 /* ###################################################################
2 ** THIS COMPONENT MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
3 ** Filename : fsl_fusion_virt_3D_orient.h
4 ** CDE edition : Standard
5 ** Project : Round2_KL25Z_PEX_Project
6 ** Processor : MKL25Z128VLK4
7 ** Component : ISFDSA
8 ** Version : Component 01.000, Driver 01.00, CPU db: 3.00.000
9 ** Compiler : GNU C Compiler
10 ** Date/Time : 2014-09-17, 09:31, # CodeGen: 0
11 ** Abstract :
12 **
13 ** Settings :
14 ** Contents :
15 ** PeriodicCallback -
16 ** Calibrate -
17 ** EndData -
18 ** StartData -
19 ** Configure -
20 ** ValidateSettings -
21 ** Initialize -
22 **
23 ** (c) Copyright <company/user-name>, 2014
24 http://www.<company>.com
25 mail: info@<company>.com
26 ** ###################################################################*/
27 /*!
28 ** @file fsl_fusion_virt_3D_orient.h
29 ** @version 01.00
30 ** @brief
31 **
32 */
33 /*!
34 ** @addtogroup fsl_fusion_virt_3D_orient_module fsl_fusion_virt_3D_orient module documentation
35 ** @{
36 */
37
38 #ifndef __fsl_fusion_virt_3D_orient_H
39 #define __fsl_fusion_virt_3D_orient_H
40
41 /* MODULE fsl_fusion_virt_3D_orient. */
42
43 /* Include shared modules, which are used for whole project */
44 #include "PE_Types.h"
45 #include "PE_Error.h"
46 #include "PE_Const.h"
47 #include "IO_Map.h"
48 /* Include inherited components */
49
50 #include "Cpu.h"
51 #include "fusion_config.h"
52 #include "fusion_types.h"
53 #include "fusion_exec.h"
54 #include "isf_sm_types.h"
55 #include "isf_sensor_base_types.h"
56 #include "isf_dsa_adapter.h"
57 #include "magnetic.h"
58
59 #ifdef USE_ACCELEROMETER
60 # include "isf_accelerometer_types.h"
61 #endif
62 #ifdef USE_GYROMETER
63 # include "isf_gyrometer_types.h"
64 #endif
65 #ifdef USE_MAGNETOMETER
66 # include "isf_magnetometer_types.h"
67 #endif
68 #ifdef USE_PRESSURE_SENSOR
69 # include "isf_altitude_types.h"
70 #endif
71
72 typedef struct {
73
74
75 #ifdef USE_PRESSURE_SENSOR
76 isf_Meters1D_float_t pressureData;
77 #endif
78 #ifdef USE_ACCELEROMETER
79 isf_Acceleration3D_Float_t accelData;
80 #endif
81 #ifdef USE_MAGNETOMETER
82 isf_MagneticFieldStrength3D_float_t magData;
83 #endif
84 #ifdef USE_GYROMETER
85 isf_AngularVelocity3D__float_t gyroData;
86 #endif
87
88 // start: elements common to all motion state vectors
89 isf_timestamp_t timestamp; // from the most recent sensor sample
90
91 // Euler angles
92 float fPhi; // roll (deg)
93 float fThe; // pitch (deg)
94 float fPsi; // yaw (deg)
95 float fRho; // compass (deg)
96 float fChi; // tilt from vertical (deg)
97 float fDelta; // inclination angle (deg)
98 // orientation matrix, quaternion and rotation vector
99 float fRmatrix[3][3]; // a posteriori orientation matrix
100 struct fquaternion fq; // a posteriori orientation quaternion
101 float fRVec[3]; // rotation vector
102 // angular velocity
103 float fOmega[3]; // angular velocity (deg/s)
104 // end: elements common to all motion state vectors
105 float faSe[3]; // linear acceleration (g, sensor frame)
106 float fHp; // Altitude (m)
107 float fTp; // Temperature (deg C)
108 // error and offset values
109 float fb[3]; // gyro offset (deg/s)
110 float fThErr[3]; // orientation error (deg)
111 float fbErr[3]; // gyro offset error (deg/s)
112 } fsl_orientation_DataBuffer_t;
113
114 typedef struct {
115 fusion_algorithmConfig_t algorithmConfig;
116 #ifdef USE_ACCELEROMETER
117 uint8 accelerometerSensorId; /* Index into the gSensorList array for the accel to use */
118 #endif
119 #ifdef USE_MAGNETOMETER
120 uint8 magnetometerSensorId; /* Index into the gSensorList array for the mag to use */
121 #endif
122 #ifdef USE_GYROMETER
123 uint8 gyroSensorId; /* Index into the gSensorList array for the gyro to use */
124 #endif
125 #ifdef USE_PRESSURE_SENSOR
126 uint8 pressureSensorId; /* Index into the gSensorList array for the pressure sensor to use */
127 #endif
128 uint8 lowPassFilterEnabled; /* Flag indicating whether the Euler Angle values should be filtered or not */
129 quaternion_type algorithmToUse; /* specifies which algorithm to take the orientation data from */
130 } fsl_fusion_Sensor_Specific_Settings_t;
131
132 typedef struct {
133
134 LWEVENT_STRUCT sensorLWEvent; /* lightweight event for sensor notifications. */
135 LWEVENT_STRUCT MagCalEventStruct; /* lightweight event for MagCal task */
136 LWSEM_STRUCT deviceSemaphore; /*!< Task synchronization mechanism for this data structure. */
137 isf_timestamp_t timestamp; // from the most recent sensor sample
138 #ifdef USE_ACCELEROMETER
139 isf_SensorHandle_t accelHandle;
140 #endif
141 #ifdef USE_MAGNETOMETER
142 isf_SensorHandle_t magHandle;
143 #endif
144 #ifdef USE_GYROMETER
145 isf_SensorHandle_t gyroHandle;
146 #endif
147 #ifdef USE_PRESSURE_SENSOR
148 isf_SensorHandle_t pressureHandle;
149 #endif
150
151 #ifdef USE_ACCELEROMETER
152 isf_fifo_t accelFifo;
153 #endif
154 #ifdef USE_MAGNETOMETER
155 isf_fifo_t magFifo;
156 #endif
157 #ifdef USE_GYROMETER
158 isf_fifo_t gyroFifo;
159 #endif
160 #ifdef USE_PRESSURE_SENSOR
161 isf_fifo_t pressureFifo;
162 #endif
163 int32 sensorDataReady;
164 fusion_state_t fusionState;
165
166 } fsl_fusion_DeviceDescriptor_t;
167
168
169 /*! @brief Supported sensor and data types for MMA8652 */
170 extern isf_SensorTypes_t fsl_fusion_SupportedSensorTypes[];
171 extern isf_SensorDataTypes_t fsl_fusion_SupportedDataTypes[];
172
173 /*
174 ** ===================================================================
175 ** Method : fsl_fusion_virt_3D_orient_Initialize (component ISFDSA)
176 ** @brief
177 **
178 ** Parameters :
179 ** NAME - DESCRIPTION
180 ** @param
181 ** void* pSensorHandle -
182 ** @return
183 ** int32_t -
184 ** ===================================================================
185 */
186 isf_dsa_status_t fsl_fusion_virt_3D_orient_Initialize( isf_SensorHandle_t *pSensorHandle);
187
188 /*
189 ** ===================================================================
190 ** Method : fsl_fusion_virt_3D_orient_ValidateSettings (component ISFDSA)
191 ** @brief
192 **
193 ** Parameters :
194 ** NAME - DESCRIPTION
195 ** @param
196 ** void* pSensorHandle -
197 ** @param
198 ** void* pSettings -
199 ** @return
200 ** int32_t -
201 ** ===================================================================
202 */
203 isf_dsa_status_t fsl_fusion_virt_3D_orient_ValidateSettings(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSubSettings);
204
205 /*
206 ** ===================================================================
207 ** Method : fsl_fusion_virt_3D_orient_Configure (component ISFDSA)
208 ** @brief
209 **
210 ** Parameters :
211 ** NAME - DESCRIPTION
212 ** @param
213 ** void* pSensorHandle -
214 ** @param
215 ** void* pConfigSettings -
216 ** @return
217 ** int32_t -
218 ** ===================================================================
219 */
220 isf_dsa_status_t fsl_fusion_virt_3D_orient_Configure(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings);
221
222 /*
223 ** ===================================================================
224 ** Method : fsl_fusion_virt_3D_orient_StartData (component ISFDSA)
225 ** @brief
226 **
227 ** Parameters :
228 ** NAME - DESCRIPTION
229 ** @param
230 ** void* pSensorHandle -
231 ** @return
232 ** int32_t -
233 ** ===================================================================
234 */
235 isf_dsa_status_t fsl_fusion_virt_3D_orient_StartData(isf_SensorHandle_t *pSensorHandle );
236
237 /*
238 ** ===================================================================
239 ** Method : fsl_fusion_virt_3D_orient_EndData (component ISFDSA)
240 ** @brief
241 **
242 ** Parameters :
243 ** NAME - DESCRIPTION
244 ** @param
245 ** void* pSensorHandle -
246 ** @return
247 ** int32_t -
248 ** ===================================================================
249 */
250 isf_dsa_status_t fsl_fusion_virt_3D_orient_EndData(isf_SensorHandle_t *pSensorHandle );
251
252 /*
253 ** ===================================================================
254 ** Method : fsl_fusion_virt_3D_orient_Calibrate (component ISFDSA)
255 ** @brief
256 **
257 ** Parameters :
258 ** NAME - DESCRIPTION
259 ** @param
260 ** void* pSensorHandle -
261 ** @return
262 ** int32_t -
263 ** ===================================================================
264 */
265 isf_dsa_status_t fsl_fusion_virt_3D_orient_Calibrate(isf_SensorHandle_t *pSensorHandle, void *pCalData );
266
267 /*
268 ** ===================================================================
269 ** Method : fsl_fusion_virt_3D_orient_Shutdown (component ISFDSA)
270 ** @brief
271 **
272 ** Parameters :
273 ** NAME - DESCRIPTION
274 ** @param
275 ** void* pSensorHandle -
276 ** @return
277 ** int32_t -
278 ** ===================================================================
279 */
280 isf_dsa_status_t fsl_fusion_virt_3D_orient_Shutdown(isf_SensorHandle_t *pSensorHandle );
281
282 /*
283 ** ===================================================================
284 ** Method : fsl_fusion_virt_3D_orient_PeriodicCallback (component ISFDSA)
285 ** @brief
286 **
287 ** Parameters :
288 ** NAME - DESCRIPTION
289 ** @param
290 ** void* pSensorHandle -
291 ** @return
292 ** void -
293 ** ===================================================================
294 */
295 void fsl_fusion_virt_3D_orient_PeriodicCallback(void *pSensorHandle);
296
297 /*
298 ** ===================================================================
299 ** Method : fsl_fusion_virt_3D_orient_Convert (component ISFDSA)
300 ** @brief
301 **
302 ** Parameters :
303 ** NAME - DESCRIPTION
304 ** @param
305 ** void* pSensorHandle -
306 ** @return
307 ** void -
308 ** ===================================================================
309 */
310 isf_dsa_status_t fsl_fusion_virt_3D_orient_Convert
311 (
312 volatile isf_SensorHandle_t *pSensorHandle,
313 isf_SensorDataTypes_t convertToType, isf_dsa_result_types_t resultType,
314 void *pNativeSample,
315 void *pConvertedSample,
316 int32 *numBytes
317 );
318
319 /*
320 ** ===================================================================
321 ** Method : fsl_MagCal_task
322 ** @brief : Top level executive for the MagCal task
323 **
324 ** Parameters :
325 ** NAME - DESCRIPTION
326 ** @param
327 ** uint32_t task_init_data
328 ** @return
329 ** void -
330 ** ===================================================================
331 */
332 void fsl_MagCal_task(uint32_t task_init_data);
333 /*
334 ** ===================================================================
335 ** Method : fsl_fusion_task
336 ** @brief : Top level executive for the fusion task
337 **
338 ** Parameters :
339 ** NAME - DESCRIPTION
340 ** @param
341 ** uint32_t task_init_data -
342 ** @return
343 ** void -
344 ** ===================================================================
345 */
346 void fsl_fusion_task(uint32_t task_init_data);
347
348 /* END fsl_fusion_virt_3D_orient. */
349
350 #endif
351 /* ifndef __fsl_fusion_virt_3D_orient_H */
352 /*!
353 ** @}
354 */
355 /*
356 ** ###################################################################
357 **
358 ** This file was created by Processor Expert 10.3 [05.09]
359 ** for the Freescale Kinetis series of microcontrollers.
360 **
361 ** ###################################################################
362 */
fsl_fusion_virt_3D_orient_Initialize
isf_dsa_status_t fsl_fusion_virt_3D_orient_Initialize(isf_SensorHandle_t *pSensorHandle)
This is the concrete implementation of the orientation sensor adapter initialization.
Definition: fsl_fusion_virt_3D_orient.c:126
uint8
unsigned char uint8
This defines uint8 as unsigned char.
Definition: isf_types.h:18
fsl_fusion_Sensor_Specific_Settings_t
Definition: fsl_fusion_virt_3D_orient.h:114
isf_dsa_adapter.h
fsl_orientation_DataBuffer_t::fChi
float fChi
Definition: fsl_fusion_virt_3D_orient.h:96
isf_MagneticFieldStrength3D_float_t
Standard fixed type for three axis accelerometers.
Definition: isf_magnetometer_types.h:62
isf_magnetometer_types.h
The isf_magnetometer_types.h file contains the ISF data type definitions for use with the ISF generic...
fsl_orientation_DataBuffer_t::fHp
float fHp
Definition: fsl_fusion_virt_3D_orient.h:106
fsl_fusion_SupportedDataTypes
isf_SensorDataTypes_t fsl_fusion_SupportedDataTypes[]
Definition: fsl_fusion_virt_3D_orient.c:86
fsl_fusion_virt_3D_orient_Configure
isf_dsa_status_t fsl_fusion_virt_3D_orient_Configure(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
This is the concrete implementation of the fusion sensor adapter configuration function.
Definition: fsl_fusion_virt_3D_orient.c:308
fsl_fusion_Sensor_Specific_Settings_t::algorithmToUse
quaternion_type algorithmToUse
Definition: fsl_fusion_virt_3D_orient.h:129
fsl_MagCal_task
void fsl_MagCal_task(uint32_t task_init_data)
Definition: fsl_fusion_virt_3D_orient.c:1114
fsl_orientation_DataBuffer_t
Definition: fsl_fusion_virt_3D_orient.h:72
fsl_fusion_SupportedSensorTypes
isf_SensorTypes_t fsl_fusion_SupportedSensorTypes[]
Supported sensor and data types for MMA8652.
Definition: fsl_fusion_virt_3D_orient.c:85
fsl_fusion_DeviceDescriptor_t::timestamp
isf_timestamp_t timestamp
Definition: fsl_fusion_virt_3D_orient.h:137
fsl_orientation_DataBuffer_t::fPsi
float fPsi
Definition: fsl_fusion_virt_3D_orient.h:94
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_fusion_DeviceDescriptor_t
Definition: fsl_fusion_virt_3D_orient.h:132
fusion_exec.h
fsl_fusion_DeviceDescriptor_t::sensorDataReady
int32 sensorDataReady
Definition: fsl_fusion_virt_3D_orient.h:163
fsl_fusion_DeviceDescriptor_t::fusionState
fusion_state_t fusionState
Definition: fsl_fusion_virt_3D_orient.h:164
fsl_fusion_virt_3D_orient_Shutdown
isf_dsa_status_t fsl_fusion_virt_3D_orient_Shutdown(isf_SensorHandle_t *pSensorHandle)
This is the concrete implementation of the orientation sensor adapter for shutdown ...
Definition: fsl_fusion_virt_3D_orient.c:731
isf_SensorTypes_t
isf_SensorTypes_t
Definition: isf_sensor_types.h:14
fquaternion
Definition: fusion_types.h:27
quaternion_type
enum quaternion quaternion_type
fsl_orientation_DataBuffer_t::fPhi
float fPhi
Definition: fsl_fusion_virt_3D_orient.h:92
fsl_orientation_DataBuffer_t::fDelta
float fDelta
Definition: fsl_fusion_virt_3D_orient.h:97
fsl_fusion_virt_3D_orient_EndData
isf_dsa_status_t fsl_fusion_virt_3D_orient_EndData(isf_SensorHandle_t *pSensorHandle)
This is the concrete implementation of the orientation sensor adapter for End Data.
Definition: fsl_fusion_virt_3D_orient.c:621
isf_dsa_status_t
int32 isf_dsa_status_t
This is the Sensor Manager API return type definition.
Definition: isf_dsa_adapter.h:23
isf_sensor_base_types.h
The isf_sensor_base_types.h file contains declarations for the general base types used in the isf sen...
isf_gyrometer_types.h
The isf_gyrometer_types.h file contains the ISF data type definitions for use with the ISF generic gy...
isf_AngularVelocity3D__float_t
Standard fixed type for three axis accelerometers.
Definition: isf_gyrometer_types.h:59
fsl_orientation_DataBuffer_t::fTp
float fTp
Definition: fsl_fusion_virt_3D_orient.h:107
isf_dsa_result_types_t
enum isf_dsa_result_enums isf_dsa_result_types_t
fsl_orientation_DataBuffer_t::fThe
float fThe
Definition: fsl_fusion_virt_3D_orient.h:93
fsl_fusion_DeviceDescriptor_t::sensorLWEvent
LWEVENT_STRUCT sensorLWEvent
Definition: fsl_fusion_virt_3D_orient.h:134
magnetic.h
fusion_config.h
The fusion_config.h file contains additional static configuration for the Sensor Fusion based Virtual...
fsl_fusion_Sensor_Specific_Settings_t::algorithmConfig
fusion_algorithmConfig_t algorithmConfig
Definition: fsl_fusion_virt_3D_orient.h:115
fusion_types.h
isf_SensorDataTypes_t
isf_SensorDataTypes_t
Definition: isf_sensor_types.h:61
isf_altitude_types.h
The isf_altitude_types.h file contains the ISF data type definitions for use with the ISF generic alt...
fsl_orientation_DataBuffer_t::fRho
float fRho
Definition: fsl_fusion_virt_3D_orient.h:95
isf_timestamp_t
uint32 isf_timestamp_t
Standard timestamp.
Definition: isf_sensor_base_types.h:15
isf_fifo_t
Definition: isf_fifo.h:18
int32
long int32
This defines int32 as long.
Definition: isf_types.h:32
fusion_state_t
Definition: fusion_exec.h:36
fsl_fusion_virt_3D_orient_ValidateSettings
isf_dsa_status_t fsl_fusion_virt_3D_orient_ValidateSettings(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSubSettings)
This is the concrete implementation of the orientation sensor adapter for validating current settings...
Definition: fsl_fusion_virt_3D_orient.c:245
fsl_fusion_virt_3D_orient_PeriodicCallback
void fsl_fusion_virt_3D_orient_PeriodicCallback(void *pSensorHandle)
The orientation sensor adapter's periodic processing function.
Definition: fsl_fusion_virt_3D_orient.c:775
isf_Acceleration3D_Float_t
Standard float type for three axis accelerometers.
Definition: isf_accelerometer_types.h:61
fsl_fusion_virt_3D_orient_StartData
isf_dsa_status_t fsl_fusion_virt_3D_orient_StartData(isf_SensorHandle_t *pSensorHandle)
This is the concrete implementation of the orientation sensor adapter for start Data.
Definition: fsl_fusion_virt_3D_orient.c:528
fsl_fusion_task
void fsl_fusion_task(uint32_t task_init_data)
Definition: fsl_fusion_virt_3D_orient.c:1056
isf_Meters1D_float_t
Standard floating point type for single axis altitude sensor.
Definition: isf_altitude_types.h:36
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
fsl_orientation_DataBuffer_t::timestamp
isf_timestamp_t timestamp
Definition: fsl_fusion_virt_3D_orient.h:89
fsl_fusion_Sensor_Specific_Settings_t::lowPassFilterEnabled
uint8 lowPassFilterEnabled
Definition: fsl_fusion_virt_3D_orient.h:128
fsl_fusion_virt_3D_orient_Convert
isf_dsa_status_t fsl_fusion_virt_3D_orient_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_fusion_virt_3D_orient.c:1144
fsl_fusion_DeviceDescriptor_t::deviceSemaphore
LWSEM_STRUCT deviceSemaphore
Definition: fsl_fusion_virt_3D_orient.h:136
fsl_fusion_DeviceDescriptor_t::MagCalEventStruct
LWEVENT_STRUCT MagCalEventStruct
Definition: fsl_fusion_virt_3D_orient.h:135
isf_sm_types.h
The isf_sm_types.h contains the collection of type definitions used in the Sensor Manager Interface a...
isf_accelerometer_types.h
The isf_accelerometer_types.h file contains the ISF data type definitions for use with the ISF generi...
fusion_algorithmConfig_t
Definition: fusion_types.h:258
fsl_fusion_virt_3D_orient_Calibrate
isf_dsa_status_t fsl_fusion_virt_3D_orient_Calibrate(isf_SensorHandle_t *pSensorHandle, void *pCalData)
This is the concrete implementation of the orientation sensor adapter for calibration ...
Definition: fsl_fusion_virt_3D_orient.c:714
- © Freescale Semiconductor, Inc. 2015. All Rights Reserved.