ISF  2.1
Intelligent Sensing Framework for Kinetis with Processor Expert
 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
80 #endif
81 #ifdef USE_MAGNETOMETER
83 #endif
84 #ifdef USE_GYROMETER
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)
113 
114 typedef struct {
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 */
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
165 
167 
168 
169 /*! @brief Supported sensor and data types for MMA8652 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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.
unsigned char uint8
This defines uint8 as unsigned char.
Definition: isf_types.h:18
Standard fixed type for three axis accelerometers.
The isf_magnetometer_types.h file contains the ISF data type definitions for use with the ISF generic...
isf_SensorDataTypes_t fsl_fusion_SupportedDataTypes[]
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.
void fsl_MagCal_task(uint32_t task_init_data)
isf_SensorTypes_t fsl_fusion_SupportedSensorTypes[]
Supported sensor and data types for MMA8652.
This defines the DSA sensor device handle structure used to invoke the adapter access functions...
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 ...
isf_SensorTypes_t
enum quaternion quaternion_type
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.
int32 isf_dsa_status_t
This is the Sensor Manager API return type definition.
The isf_sensor_base_types.h file contains declarations for the general base types used in the isf sen...
The isf_gyrometer_types.h file contains the ISF data type definitions for use with the ISF generic gy...
Standard fixed type for three axis accelerometers.
enum isf_dsa_result_enums isf_dsa_result_types_t
The fusion_config.h file contains additional static configuration for the Sensor Fusion based Virtual...
isf_SensorDataTypes_t
The isf_altitude_types.h file contains the ISF data type definitions for use with the ISF generic alt...
uint32 isf_timestamp_t
Standard timestamp.
long int32
This defines int32 as long.
Definition: isf_types.h:32
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...
void fsl_fusion_virt_3D_orient_PeriodicCallback(void *pSensorHandle)
The orientation sensor adapter's periodic processing function.
Standard float type for three axis accelerometers.
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.
void fsl_fusion_task(uint32_t task_init_data)
Standard floating point type for single axis altitude sensor.
This defines the DSA sensor configuration parameter structure configuring the sensor settings by a su...
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.
The isf_sm_types.h contains the collection of type definitions used in the Sensor Manager Interface a...
The isf_accelerometer_types.h file contains the ISF data type definitions for use with the ISF generi...
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 ...