ISF  2.2 rev 5
Intelligent Sensing Framework for Kinetis with Processor Expert
fsl_fxls8952_i2c_3D_accel.h
Go to the documentation of this file.
1 /**
2  * @file fsl_fxls8952_i2c_3D_accel.h
3  * @brief The \b fsl_fxls8952_i2c_3D_accel.h file contains the definitions and functions supporting the FXLS8952 Sensor adapter header file
4  * @copyright Copyright (c) 2015, Freescale Semiconductor, Inc.
5  * @version 01.00
6  * @brief
7  *
8  */
9 /*!
10 ** @addtogroup fsl_fxls8952_i2c_3D_accel_module fsl_fxls8952_i2c_3D_accel module documentation
11 ** @{
12 */
13 
14 #ifndef FSL_FXLS8952_I2C_3D_ACCEL_H
15 #define FSL_FXLS8952_I2C_3D_ACCEL_H
16 
17 /* MODULE fsl_fxls8952_i2c_3D_accel. */
18 
19 /* Include shared modules, which are used for whole project */
20 #include "isf.h"
21 
22 
23 #include "isf_sm_types.h"
24 #include "isf_dsa_adapter.h"
25 
26 // WHO_AM_I
27 #define FXLS8952_WHO_AM_I_VALUE 0x18
28 
29 /*! @brief This structure defines the dummy DSA data buffer format.*/
30 typedef struct {
31  uint32 timeStamp; /*!< The time stamp for the data packet.*/
32  int16 accel[3]; /*!< The accel data */
34 
35 
36 /**
37  * @brief fxls8952 internal return codes.
38  */
40 
41 /**
42  * @brief Enumeration for the fxls8952 internal error codes.
43  */
45  FXLS8952_ERROR_WHOAMI = 1, /*!< Error occurred while reading ::FXLS8952_WHO_AM_I or the value was incorrect. */
46  FXLS8952_ERROR_WAITFORACTIVE, /*!< Error occurred while attempting to put device into active mode. */
47  FXLS8952_ERROR_BURSTWRITE, /*!< Error occurred while attempting to write a block of memory to the device. */
48  FXLS8952_ERROR_CONFIG, /*!< Error occurred while attempting to configure the device. */
49  FXLS8952_ERROR_SETPOWER, /*!< Error occurred while attempting to set the power mode of the device. */
50  FXLS8952_ERRO_WRITE, /*!< Error occurred while attempting to write the registers directly. */
51  FXLS8952_ERRO_READ, /*!< Error occurred while attempting to read the registers directly. */
52 };
53 /**
54  * @brief Enumeration for the fxls8952 power modes.
55  */
56 typedef enum fxls8952_Power_tag {
57  FXLS8952_POWER_STANDBY = 0, /*!< Device in Standby mode. Less power consumption during the mode.*/
58  FXLS8952_POWER_ACTIVE = 1, /*!< Device in active mode.*/
60 /**
61  * @brief Enumeration for the fxls8952 driver internal states.
62  */
64  FXLS8952_STATE_UNINTIALIZED, /*!< initial state of the device.*/
65  FXLS8952_STATE_INITIALIZED, /*!< FXLS8952_WHO_AM_I has been verified. */
66  FXLS8952_STATE_CONFIGURED, /*!< Device has been reset and configured. */
67  FXLS8952_STATE_STARTED, /*!< Device is in active mode and measuring data. */
69 
70 typedef enum fxls8952_Range_tag {
77 
78 /**
79  * @brief the structure defines the ODR table between Hybrid and normal mode of device operation.
80  */
81 typedef struct fxls8952_ODR_Table_tag{
82  uint32 periodNormalMode; /*!< Normal Mode ODR value in millisecond. */
83  uint8 configVal; /*!< configuration value correspond to given ODR in millisecond. */
85 
86 /**
87  * @brief the structure defines the configuration table.
88  */
89 typedef struct fxls8952_ConfigTable_tag{
90  void *memberVariable; /*!< reference to the member variable. */
91  uint8 startAddress; /*!< start address to the member variable. */
92  uint8 size; /*!< size of the memeber to be configured. */
94 
95 
96 
97 /*! @brief Supported sensor and data types for MMA8652 */
100 
101 /*
102 ** ===================================================================
103 ** Method : fsl_fxls8952_i2c_3D_accel_Initialize (component ISFDSA)
104 ** @brief
105 **
106 ** Parameters :
107 ** NAME - DESCRIPTION
108 ** @param
109 ** void* pSensorHandle -
110 ** @return
111 ** int32_t -
112 ** ===================================================================
113 */
115 
116 /*
117 ** ===================================================================
118 ** Method : fsl_fxls8952_i2c_3D_accel_ValidateSettings (component ISFDSA)
119 ** @brief
120 **
121 ** Parameters :
122 ** NAME - DESCRIPTION
123 ** @param
124 ** void* pSensorHandle -
125 ** @param
126 ** void* pSettings -
127 ** @return
128 ** int32_t -
129 ** ===================================================================
130 */
132 
133 /*
134 ** ===================================================================
135 ** Method : fsl_fxls8952_i2c_3D_accel_Configure (component ISFDSA)
136 ** @brief
137 **
138 ** Parameters :
139 ** NAME - DESCRIPTION
140 ** @param
141 ** void* pSensorHandle -
142 ** @param
143 ** void* pConfigSettings -
144 ** @return
145 ** int32_t -
146 ** ===================================================================
147 */
149 
150 /*
151 ** ===================================================================
152 ** Method : fsl_fxls8952_i2c_3D_accel_StartData (component ISFDSA)
153 ** @brief
154 **
155 ** Parameters :
156 ** NAME - DESCRIPTION
157 ** @param
158 ** void* pSensorHandle -
159 ** @return
160 ** int32_t -
161 ** ===================================================================
162 */
164 
165 /*
166 ** ===================================================================
167 ** Method : fsl_fxls8952_i2c_3D_accel_EndData (component ISFDSA)
168 ** @brief
169 **
170 ** Parameters :
171 ** NAME - DESCRIPTION
172 ** @param
173 ** void* pSensorHandle -
174 ** @return
175 ** int32_t -
176 ** ===================================================================
177 */
179 
180 /*
181 ** ===================================================================
182 ** Method : fsl_fxls8952_i2c_3D_accel_Calibrate (component ISFDSA)
183 ** @brief
184 **
185 ** Parameters :
186 ** NAME - DESCRIPTION
187 ** @param
188 ** void* pSensorHandle -
189 ** @return
190 ** int32_t -
191 ** ===================================================================
192 */
194 
195 /*
196 ** ===================================================================
197 ** Method : fsl_fxls8952_i2c_3D_accel_Shutdown (component ISFDSA)
198 ** @brief
199 **
200 ** Parameters :
201 ** NAME - DESCRIPTION
202 ** @param
203 ** void* pSensorHandle -
204 ** @return
205 ** int32_t -
206 ** ===================================================================
207 */
209 
210 /*
211 ** ===================================================================
212 ** Method : fsl_fxls8952_i2c_3D_accel_PeriodicCallback (component ISFDSA)
213 ** @brief
214 **
215 ** Parameters :
216 ** NAME - DESCRIPTION
217 ** @param
218 ** void* pSensorHandle -
219 ** @return
220 ** void -
221 ** ===================================================================
222 */
223 void fsl_fxls8952_i2c_3D_accel_PeriodicCallback(void *pSensorHandle);
224 
225 /*
226 ** ===================================================================
227 ** Method : fsl_fxls8952_i2c_3D_accel_Convert (component ISFDSA)
228 ** @brief
229 **
230 ** Parameters :
231 ** NAME - DESCRIPTION
232 ** @param
233 ** void* pSensorHandle -
234 ** @return
235 ** void -
236 ** ===================================================================
237 */
239  (
240  volatile isf_SensorHandle_t *pSensorHandle,
241  isf_SensorDataTypes_t convertToType, isf_dsa_result_types_t resultType,
242  void *pNativeSample,
243  void *pConvertedSample,
244  int32 *numBytes
245  );
246 
249 #endif
250 /* ifndef FSL_FXLS8952_I2C_3D_ACCEL_H */
251 /*!
252 ** @}
253 */
fxls8952_Error_tag
Enumeration for the fxls8952 internal error codes.
void fsl_fxls8952_i2c_3D_accel_PeriodicCallback(void *pSensorHandle)
The callback function for the Bus Manager(BM).
unsigned char uint8
Definition: isf_types.h:76
struct fxls8952_ConfigTable_tag fxls8952_ConfigTable_t
the structure defines the configuration table.
fxls8952_Power_tag
Enumeration for the fxls8952 power modes.
the structure defines the ODR table between Hybrid and normal mode of device operation.
This defines the DSA sensor device handle structure used to invoke the adapter access functions...
isf_dsa_status_t fsl_fxls8952_i2c_3D_accel_Shutdown(isf_SensorHandle_t *pSensorHandle)
This is the concrete implementation of the FXLS8952 sensor adapter for shutdown . ...
isf_dsa_status_t fsl_fxls8952_i2c_3D_accel_Calibrate(isf_SensorHandle_t *pSensorHandle, void *pCalData)
This is the concrete implementation of the FXLS8952 sensor adapter for calibration ...
isf_dsa_status_t fsl_fxls8952_i2c_3D_accel_ValidateSettings(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
This is the concrete implementation of the FXLS8952 sensor adapter for validating current settings...
isf_dsa_status_t fsl_fxls8952_i2c_3D_accel_Configure(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
This is the concrete implementation of the FXLS8952 sensor adapter for configuration.
fxls8952_InternalState_tag
Enumeration for the fxls8952 driver internal states.
isf_dsa_status_t fsl_fxls8952_i2c_3D_accel_Initialize(isf_SensorHandle_t *pSensorHandle)
This is the concrete implementation of the FXLS8952 sensor adapter initialization.
isf_SensorTypes_t
int32 isf_dsa_status_t
This is the Sensor Manager API return type definition.
signed short int int16
Definition: isf_types.h:73
int32 fxls8952_Status_t
fxls8952 internal return codes.
enum isf_dsa_result_enums isf_dsa_result_types_t
the structure defines the configuration table.
isf_dsa_status_t fsl_fxls8952_i2c_3D_accel_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.
isf_SensorDataTypes_t
enum fxls8952_Power_tag fxls8952_Power_t
Enumeration for the fxls8952 power modes.
Main ISF header file. Contains code common to all ISF components.
isf_SensorTypes_t fxls8952_SupportedSensorTypes[]
Supported sensor and data types for MMA8652.
signed long int int32
Definition: isf_types.h:74
struct fxls8952_ODR_Table_tag fxls8952_ODR_Table_t
the structure defines the ODR table between Hybrid and normal mode of device operation.
enum fxls8952_Range_tag fxls8952_Range_t
isf_dsa_status_t fsl_fxls8952_i2c_3D_accel_StartData(isf_SensorHandle_t *pSensorHandle)
This is the concrete implementation of the FXLS8952 sensor adapter for start Data.
This defines the DSA sensor configuration parameter structure configuring the sensor settings by a su...
isf_SensorDataTypes_t fxls8952_SupportedDataTypes[]
unsigned long int uint32
Definition: isf_types.h:78
enum fxls8952_InternalState_tag fxls8952_InternalState_t
Enumeration for the fxls8952 driver internal states.
The isf_sm_types.h contains the collection of type definitions used in the Sensor Manager Interface a...
isf_dsa_status_t fsl_fxls8952_i2c_3D_accel_EndData(isf_SensorHandle_t *pSensorHandle)
This is the concrete implementation of the FXLS8952 sensor adapter for End Data.
This structure defines the dummy DSA data buffer format.