ISF  2.1
Intelligent Sensing Framework for Kinetis with Processor Expert
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
fsl_fxos8700_i2cspi_6D_AccMag.h
Go to the documentation of this file.
1 /**
2  * @file fsl_fxos8700_i2cspi_6D_AccMag.h
3  * @brief The \b fsl_fxos8700_i2cspi_6D_AccMag.h file contains the definitions and functions supporting the FXOS8700 Sensor adapter header file
4 
5  * @copyright Copyright (c) 2014, Freescale Semiconductor, Inc.
6  * @version 01.00
7  * @addtogroup fsl_fxos8700_i2cspi_6D_AccMag_module fsl_fxos8700_i2cspi_6D_AccMag module documentation
8  * @{
9 */
10 
11 #ifndef FSL_FXOS8700_I2CSPI_6D_ACCMAG_H_
12 #define FSL_FXOS8700_I2CSPI_6D_ACCMAG_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 
27 /**
28  * @brief FXOS8700 expected WHO_AM_I value.
29  */
30 #define FXOS8700_WHO_AM_I_VALUE1 0xC7
31 #define FXOS8700_WHO_AM_I_VALUE2 0xC9
32 
33 
34 /**
35  * @brief FXOS8700 internal return codes.
36  */
38 /**
39  * @brief Enumeration for the FXOS8700 internal error codes.
40  */
42  FXOS8700_ERROR_WHOAMI = 1, /*!< Error occurred while reading ::FXOS8700_WHO_AM_I or the value was incorrect. */
43  FXOS8700_ERROR_WAITFORACTIVE, /*!< Error occurred while attempting to put device into active mode. */
44  FXOS8700_ERROR_BURSTWRITE, /*!< Error occurred while attempting to write a block of memory to the device. */
45  FXOS8700_ERROR_CONFIG, /*!< Error occurred while attempting to configure the device. */
46  FXOS8700_ERROR_SETPOWER, /*!< Error occurred while attempting to set the power mode of the device. */
47  FX0S8700_ERRO_WRITE, /*!< Error occurred while attempting to write the registers directly. */
48  FX0S8700_ERRO_READ, /*!< Error occurred while attempting to read the registers directly. */
49 };
50 /**
51  * @brief Enumeration for the FXOS8700 power modes.
52  */
53 typedef enum fxos8700_Power_tag {
54  FXOS8700_POWER_STANDBY = 0, /*!< Device in Standby mode. Less power consumption during the mode.*/
55  FXOS8700_POWER_ACTIVE = 1, /*!< Device in active mode.*/
57 /**
58  * @brief Enumeration for the FXOS8700 driver internal states.
59  */
61  FXOS8700_STATE_UNINTIALIZED, /*!< initial state of the device.*/
62  FXOS8700_STATE_INITIALIZED, /*!< FXOS8700_WHO_AM_I has been verified. */
63  FXOS8700_STATE_CONFIGURED, /*!< Device has been reset and configured. */
64  FXOS8700_STATE_STARTED, /*!< Device is in active mode and measuring data. */
66 
67 /*! @brief The enumeration, fxos8700_Mode_tag, defines the operational modes of the FXOS8700.*/
68 typedef enum fxos8700_Mode_tag {
69  FXOS8700_MODE_ACCELEROMETER = 0, /*<! The device is in accelerometer mode only.*/
70  FXOS8700_MODE_MAGNETOMETER = 1, /*<! The device is in magnetometer mode only.*/
71  FXOS8700_MODE_HYBRID = 3, /*<! The device is in hybrid mode, where both the
72  accelerometer and magnetometer are active.
73  The value is not sequential because this value is
74  used directly by the device to set the mode.*/
75  FXOS8700_MODE_EXTEND = 4, /*<! Extended functionality for algorithms output.It also provides algorithmic data, in addition to accelerometer and magnetometer data.*/
77 /*! @brief The enumeration, fxos8700_Range_tag, defines the acceleration range of the FXOS8700.*/
78 typedef enum fxos8700_Range_tag {
79  FXOS8700_RANGE_2G = 0, /*<!Acceleration range is 2G.*/
80  FXOS8700_RANGE_4G = 1, /*<!Acceleration range is 4G.*/
81  FXOS8700_RANGE_8G = 2, /*<!Acceleration range is 8G.*/
84 /*! @brief The enumeration, fxos8700_Resolution_tag, defines the bit resolution of the FXOS8700.*/
86  FXOS8700_RESOLUTION_8_BIT = 1, /*<!8 bit resolution.*/
87  FXOS8700_RESOLUTION_NORMAL = 2, /*<!Normal resolution for the accelerometer is 14 bits and the magnetometer is 16 bits.*/
89 
90 /**
91  * @brief the structure defines the ODR table between Hybrid and normal mode of device operation.
92  */
93 typedef struct fxos8700_ODR_Table_tag{
94  uint32 periodNormalMode; /*!< Normal Mode ODR value in millisecond. */
95  uint32 periodHybridMode; /*!< Hybrid mode ODR value in millisecond. */
96  uint8 configVal; /*!< configuration value correspond to given ODR in millisecond. */
98 
99 /**
100  * @brief the structure defines the configuration table.
101  */
103  void *memberVariable; /*!< reference to the member variable. */
104  uint8 startAddress; /*!< start address to the member variable. */
105  uint8 size; /*!< size of the memeber to be configured. */
107 
108 /*! @brief This structure defines the dummy DSA data buffer format.*/
109 typedef struct {
110  uint32 timeStamp; /*!< The time stamp for the data packet.*/
111  int16 accel[3]; /*!< The accelerometer data */
112  int16 mag[3]; /*!< The magnetometer data */
113  uint8 addr; /*!< The device "address" can uniquely identify the sensor */
115 
116 /*! @brief Supported sensor and data types for fxos8700 */
119 
120 
121 /*
122  ** ===================================================================
123  ** Method : fsl_fxos8700_i2cspi_6D_AccMag_Initialize
124  ** @brief
125  **
126  ** Parameters :
127  ** NAME - DESCRIPTION
128  ** @param
129  ** isf_SensorHandle_t *pSensorHandle
130  ** @return
131  ** isf_dsa_status_t -
132  ** ===================================================================
133  */
135 
136 /*
137  ** ===================================================================
138  ** Method : fsl_fxos8700_i2cspi_6D_AccMag_ValidateSettings
139  ** @brief
140  **
141  ** Parameters :
142  ** NAME - DESCRIPTION
143  ** @param
144  ** isf_SensorHandle_t *pSensorHandle
145  ** @param
146  ** isf_SubscriptionSettings_t *pSettings
147  ** @return
148  ** isf_dsa_status_t -
149  ** ===================================================================
150  */
152 
153 /*
154  ** ===================================================================
155  ** Method : fsl_fxos8700_i2cspi_6D_AccMag_Configure
156  ** @brief
157  **
158  ** Parameters :
159  ** NAME - DESCRIPTION
160  ** @param
161  ** isf_SensorHandle_t *pSensorHandle
162  ** @param
163  ** isf_SubscriptionSettings_t *pConfigSettings
164  ** @return
165  ** isf_dsa_status_t -
166  ** ===================================================================
167  */
169 
170 /*
171  ** ===================================================================
172  ** Method : fsl_fxos8700_i2cspi_6D_AccMag_StartData
173  ** @brief
174  **
175  ** Parameters :
176  ** NAME - DESCRIPTION
177  ** @param
178  ** isf_SensorHandle_t *pSensorHandle
179  ** @return
180  ** isf_dsa_status_t -
181  ** ===================================================================
182  */
184 
185 /*
186  ** ===================================================================
187  ** Method : fsl_fxos8700_i2cspi_6D_AccMag_EndData
188  ** @brief
189  **
190  ** Parameters :
191  ** NAME - DESCRIPTION
192  ** @param
193  ** isf_SensorHandle_t *pSensorHandle
194  ** @return
195  ** isf_dsa_status_t -
196  ** ===================================================================
197  */
199 
200 /*
201  ** ===================================================================
202  ** Method : fsl_fxos8700_i2cspi_6D_AccMag_Calibrate
203  ** @brief
204  **
205  ** Parameters :
206  ** NAME - DESCRIPTION
207  ** @param
208  ** isf_SensorHandle_t *pSensorHandle
209  ** @return
210  ** isf_dsa_status_t -
211  ** ===================================================================
212  */
214 
215 /*
216  ** ===================================================================
217  ** Method : fsl_fxos8700_i2cspi_6D_AccMag_Shutdown
218  ** @brief
219  **
220  ** Parameters :
221  ** NAME - DESCRIPTION
222  ** @param
223  ** isf_SensorHandle_t *pSensorHandle
224  ** @return
225  ** isf_dsa_status_t -
226  ** ===================================================================
227  */
229 
230 /*
231  ** ===================================================================
232  ** Method : fsl_fxos8700_i2cspi_6D_AccMag_Convert
233  ** @brief The DSA interface conversion function to convert native samples to specified standard types
234  **
235  ** Parameters :
236  ** NAME - DESCRIPTION
237  ** @param
238  ** isf_SensorHandle_t *pSensorHandle
239  ** @return
240  ** void -
241  ** ===================================================================
242  */
243 isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_Convert(volatile isf_SensorHandle_t *pSensorHandle, isf_SensorDataTypes_t convertToType, isf_dsa_result_types_t resultType, void *nativeSample, void *convertedSample, int32 *numBytes );
244 /*
245  ** ===================================================================
246  ** Method : fsl_fxos8700_i2cspi_6D_AccMag_PeriodicCallback (component ISFDSA)
247  ** @brief
248  **
249  ** Parameters :
250  ** NAME - DESCRIPTION
251  ** @param
252  ** isf_SensorHandle_t *pSensorHandle
253  ** @return
254  ** void -
255  ** ===================================================================
256  */
257 void fsl_fxos8700_i2cspi_6D_AccMag_PeriodicCallback(void* pSensorHandle);
258 
259 /* END FSL_FXOS8700_I2CSPI_6D_ACCMAG. */
260 #endif
261 /* ifndef FSL_FXOS8700_I2CSPI_6D_ACCMAG_H_ */
262 /*!
263 ** @}
264 */
unsigned char uint8
This defines uint8 as unsigned char.
Definition: isf_types.h:18
int32 fxos8700_Status_t
FXOS8700 internal return codes.
This structure defines the dummy DSA data buffer format.
void fsl_fxos8700_i2cspi_6D_AccMag_PeriodicCallback(void *pSensorHandle)
The callback function for the Bus Manager(BM).
fxos8700_Range_tag
The enumeration, fxos8700_Range_tag, defines the acceleration range of the FXOS8700.
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_fxos8700_i2cspi_6D_AccMag_Initialize(isf_SensorHandle_t *pSensorHandle)
This is the concrete implementation of the FXOS8700 sensor adapter initialization.
enum fxos8700_Power_tag fxos8700_Power_t
Enumeration for the FXOS8700 power modes.
enum fxos8700_InternalState_tag fxos8700_InternalState_t
Enumeration for the FXOS8700 driver internal states.
unsigned long uint32
This defines uint32 as unsigned long.
Definition: isf_types.h:36
isf_SensorTypes_t
enum fxos8700_Range_tag fxos8700_Range_t
The enumeration, fxos8700_Range_tag, defines the acceleration range of the FXOS8700.
isf_SensorTypes_t fxos8700_SupportedSensorTypes[]
Supported sensor and data types for fxos8700.
isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_Configure(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
This is the concrete implementation of the FXOS8700 sensor adapter for configuration.
isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_StartData(isf_SensorHandle_t *pSensorHandle)
This is the concrete implementation of the FXOS8700 sensor adapter for start Data.
int32 isf_dsa_status_t
This is the Sensor Manager API return type definition.
isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_Calibrate(isf_SensorHandle_t *pSensorHandle, void *pCalData)
This is the concrete implementation of the FXOS8700 sensor adapter for calibration ...
fxos8700_InternalState_tag
Enumeration for the FXOS8700 driver internal states.
isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_Convert(volatile isf_SensorHandle_t *pSensorHandle, isf_SensorDataTypes_t convertToType, isf_dsa_result_types_t resultType, void *nativeSample, void *convertedSample, int32 *numBytes)
This function coverts the raw sample data to the desired output type.
enum isf_dsa_result_enums isf_dsa_result_types_t
isf_SensorDataTypes_t fxos8700_SupportedDataTypes[]
isf_SensorDataTypes_t
fxos8700_Error_tag
Enumeration for the FXOS8700 internal error codes.
long int32
This defines int32 as long.
Definition: isf_types.h:32
short int16
This defines int16 as short.
Definition: isf_types.h:23
enum fxos8700_Mode_tag fxos8700_Mode_t
The enumeration, fxos8700_Mode_tag, defines the operational modes of the FXOS8700.
struct fxos8700_ConfigTable_tag fxos8700_ConfigTable_t
the structure defines the configuration table.
This defines the DSA sensor configuration parameter structure configuring the sensor settings by a su...
fxos8700_Power_tag
Enumeration for the FXOS8700 power modes.
isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_Shutdown(isf_SensorHandle_t *pSensorHandle)
This is the concrete implementation of the FXOS8700 sensor adapter for shutdown . ...
struct fxos8700_ODR_Table_tag fxo8700_ODR_Table_t
the structure defines the ODR table between Hybrid and normal mode of device operation.
the structure defines the ODR table between Hybrid and normal mode of device operation.
isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_EndData(isf_SensorHandle_t *pSensorHandle)
This is the concrete implementation of the FXOS8700 sensor adapter for End Data.
The isf_sm_types.h contains the collection of type definitions used in the Sensor Manager Interface a...
enum fxos8700_Resolution_tag fxos8700_Resolution_t
The enumeration, fxos8700_Resolution_tag, defines the bit resolution of the FXOS8700.
fxos8700_Resolution_tag
The enumeration, fxos8700_Resolution_tag, defines the bit resolution of the FXOS8700.
isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_ValidateSettings(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
This is the concrete implementation of the FXOS8700 sensor adapter for validating current settings...
fxos8700_Mode_tag
The enumeration, fxos8700_Mode_tag, defines the operational modes of the FXOS8700.