| ISF 2.2 rev 5 Intelligent Sensing Framework for Kinetis with Processor Expert

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

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 */
33 } fxls8952_DataBuffer_t;
34
35
36 /**
37 * @brief fxls8952 internal return codes.
38 */
39 typedef int32 fxls8952_Status_t;
40
41 /**
42 * @brief Enumeration for the fxls8952 internal error codes.
43 */
44 enum fxls8952_Error_tag {
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.*/
59 } fxls8952_Power_t;
60 /**
61 * @brief Enumeration for the fxls8952 driver internal states.
62 */
63 typedef enum fxls8952_InternalState_tag {
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. */
68 } fxls8952_InternalState_t;
69
70 typedef enum fxls8952_Range_tag {
71 FXLS8952_RANGE_2G = 0,
72 FXLS8952_RANGE_4G = 1,
73 FXLS8952_RANGE_8G = 2,
74 FXLS8952_RANGE_16G = 3,
75 FXLS8952_RANGE_MAX = FXLS8952_RANGE_16G,
76 } fxls8952_Range_t;
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. */
84 }fxls8952_ODR_Table_t;
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. */
93 }fxls8952_ConfigTable_t;
94
95
96
97 /*! @brief Supported sensor and data types for MMA8652 */
98 extern isf_SensorTypes_t fxls8952_SupportedSensorTypes[];
99 extern isf_SensorDataTypes_t fxls8952_SupportedDataTypes[];
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 */
114 isf_dsa_status_t fsl_fxls8952_i2c_3D_accel_Initialize( isf_SensorHandle_t *pSensorHandle);
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 */
131 isf_dsa_status_t fsl_fxls8952_i2c_3D_accel_ValidateSettings(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSubSettings);
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 */
148 isf_dsa_status_t fsl_fxls8952_i2c_3D_accel_Configure(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings);
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 */
163 isf_dsa_status_t fsl_fxls8952_i2c_3D_accel_StartData(isf_SensorHandle_t *pSensorHandle );
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 */
178 isf_dsa_status_t fsl_fxls8952_i2c_3D_accel_EndData(isf_SensorHandle_t *pSensorHandle );
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 */
193 isf_dsa_status_t fsl_fxls8952_i2c_3D_accel_Calibrate(isf_SensorHandle_t *pSensorHandle, void *pCalData );
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 */
208 isf_dsa_status_t fsl_fxls8952_i2c_3D_accel_Shutdown(isf_SensorHandle_t *pSensorHandle );
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 */
238 isf_dsa_status_t fsl_fxls8952_i2c_3D_accel_Convert
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
247 extern isf_SensorTypes_t fxls8952_SupportedSensorTypes[];
248 extern isf_SensorDataTypes_t fxls8952_SupportedDataTypes[];
249 #endif
250 /* ifndef FSL_FXLS8952_I2C_3D_ACCEL_H */
251 /*!
252 ** @}
253 */
fxls8952_Error_tag
fxls8952_Error_tag
Enumeration for the fxls8952 internal error codes.
Definition: fsl_fxls8952_i2c_3D_accel.h:44
fsl_fxls8952_i2c_3D_accel_PeriodicCallback
void fsl_fxls8952_i2c_3D_accel_PeriodicCallback(void *pSensorHandle)
The callback function for the Bus Manager(BM).
Definition: fsl_fxls8952_i2c_3D_accel.c:634
uint8
unsigned char uint8
Definition: isf_types.h:76
isf_dsa_adapter.h
fxls8952_ODR_Table_tag::configVal
uint8 configVal
Definition: fsl_fxls8952_i2c_3D_accel.h:83
fxls8952_ConfigTable_t
struct fxls8952_ConfigTable_tag fxls8952_ConfigTable_t
the structure defines the configuration table.
FXLS8952_ERRO_READ
Definition: fsl_fxls8952_i2c_3D_accel.h:51
fxls8952_ConfigTable_tag::memberVariable
void * memberVariable
Definition: fsl_fxls8952_i2c_3D_accel.h:90
fxls8952_Power_tag
fxls8952_Power_tag
Enumeration for the fxls8952 power modes.
Definition: fsl_fxls8952_i2c_3D_accel.h:56
fxls8952_ODR_Table_tag
the structure defines the ODR table between Hybrid and normal mode of device operation.
Definition: fsl_fxls8952_i2c_3D_accel.h:81
fxls8952_ODR_Table_tag::periodNormalMode
uint32 periodNormalMode
Definition: fsl_fxls8952_i2c_3D_accel.h:82
isf_SensorHandle_st
This defines the DSA sensor device handle structure used to invoke the adapter access functions...
Definition: isf_dsa_adapter.h:107
fsl_fxls8952_i2c_3D_accel_Shutdown
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 . ...
Definition: fsl_fxls8952_i2c_3D_accel.c:595
fsl_fxls8952_i2c_3D_accel_Calibrate
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 ...
Definition: fsl_fxls8952_i2c_3D_accel.c:578
fsl_fxls8952_i2c_3D_accel_ValidateSettings
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...
Definition: fsl_fxls8952_i2c_3D_accel.c:264
fsl_fxls8952_i2c_3D_accel_Configure
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.
Definition: fsl_fxls8952_i2c_3D_accel.c:309
FXLS8952_RANGE_8G
Definition: fsl_fxls8952_i2c_3D_accel.h:73
fxls8952_InternalState_tag
fxls8952_InternalState_tag
Enumeration for the fxls8952 driver internal states.
Definition: fsl_fxls8952_i2c_3D_accel.h:63
FXLS8952_ERRO_WRITE
Definition: fsl_fxls8952_i2c_3D_accel.h:50
FXLS8952_RANGE_16G
Definition: fsl_fxls8952_i2c_3D_accel.h:74
fxls8952_DataBuffer_t::timeStamp
uint32 timeStamp
Definition: fsl_fxls8952_i2c_3D_accel.h:31
fsl_fxls8952_i2c_3D_accel_Initialize
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.
Definition: fsl_fxls8952_i2c_3D_accel.c:179
isf_SensorTypes_t
isf_SensorTypes_t
Definition: isf_sensor_types.h:14
FXLS8952_ERROR_SETPOWER
Definition: fsl_fxls8952_i2c_3D_accel.h:49
FXLS8952_POWER_ACTIVE
Definition: fsl_fxls8952_i2c_3D_accel.h:58
FXLS8952_STATE_INITIALIZED
Definition: fsl_fxls8952_i2c_3D_accel.h:65
isf_dsa_status_t
int32 isf_dsa_status_t
This is the Sensor Manager API return type definition.
Definition: isf_dsa_adapter.h:21
int16
signed short int int16
Definition: isf_types.h:73
FXLS8952_RANGE_2G
Definition: fsl_fxls8952_i2c_3D_accel.h:71
fxls8952_Status_t
int32 fxls8952_Status_t
fxls8952 internal return codes.
Definition: fsl_fxls8952_i2c_3D_accel.h:39
FXLS8952_STATE_CONFIGURED
Definition: fsl_fxls8952_i2c_3D_accel.h:66
isf_dsa_result_types_t
enum isf_dsa_result_enums isf_dsa_result_types_t
FXLS8952_ERROR_BURSTWRITE
Definition: fsl_fxls8952_i2c_3D_accel.h:47
fxls8952_ConfigTable_tag::size
uint8 size
Definition: fsl_fxls8952_i2c_3D_accel.h:92
fxls8952_ConfigTable_tag
the structure defines the configuration table.
Definition: fsl_fxls8952_i2c_3D_accel.h:89
fsl_fxls8952_i2c_3D_accel_Convert
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.
Definition: fsl_fxls8952_i2c_3D_accel.c:801
isf_SensorDataTypes_t
isf_SensorDataTypes_t
Definition: isf_sensor_types.h:61
fxls8952_Power_t
enum fxls8952_Power_tag fxls8952_Power_t
Enumeration for the fxls8952 power modes.
FXLS8952_RANGE_4G
Definition: fsl_fxls8952_i2c_3D_accel.h:72
isf.h
Main ISF header file. Contains code common to all ISF components.
FXLS8952_ERROR_CONFIG
Definition: fsl_fxls8952_i2c_3D_accel.h:48
fxls8952_SupportedSensorTypes
isf_SensorTypes_t fxls8952_SupportedSensorTypes[]
Supported sensor and data types for MMA8652.
Definition: fsl_fxls8952_i2c_3D_accel.h:247
int32
signed long int int32
Definition: isf_types.h:74
FXLS8952_ERROR_WHOAMI
Definition: fsl_fxls8952_i2c_3D_accel.h:45
fxls8952_ODR_Table_t
struct fxls8952_ODR_Table_tag fxls8952_ODR_Table_t
the structure defines the ODR table between Hybrid and normal mode of device operation.
fxls8952_Range_t
enum fxls8952_Range_tag fxls8952_Range_t
fxls8952_ConfigTable_tag::startAddress
uint8 startAddress
Definition: fsl_fxls8952_i2c_3D_accel.h:91
fsl_fxls8952_i2c_3D_accel_StartData
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.
Definition: fsl_fxls8952_i2c_3D_accel.c:450
FXLS8952_ERROR_WAITFORACTIVE
Definition: fsl_fxls8952_i2c_3D_accel.h:46
isf_dsa_SensorSettings_st
This defines the DSA sensor configuration parameter structure configuring the sensor settings by a su...
Definition: isf_dsa_adapter.h:79
fxls8952_Range_tag
fxls8952_Range_tag
Definition: fsl_fxls8952_i2c_3D_accel.h:70
fxls8952_SupportedDataTypes
isf_SensorDataTypes_t fxls8952_SupportedDataTypes[]
Definition: fsl_fxls8952_i2c_3D_accel.h:248
uint32
unsigned long int uint32
Definition: isf_types.h:78
fxls8952_InternalState_t
enum fxls8952_InternalState_tag fxls8952_InternalState_t
Enumeration for the fxls8952 driver internal states.
isf_sm_types.h
The isf_sm_types.h contains the collection of type definitions used in the Sensor Manager Interface a...
fsl_fxls8952_i2c_3D_accel_EndData
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.
Definition: fsl_fxls8952_i2c_3D_accel.c:517
FXLS8952_STATE_UNINTIALIZED
Definition: fsl_fxls8952_i2c_3D_accel.h:64
FXLS8952_RANGE_MAX
Definition: fsl_fxls8952_i2c_3D_accel.h:75
FXLS8952_STATE_STARTED
Definition: fsl_fxls8952_i2c_3D_accel.h:67
FXLS8952_POWER_STANDBY
Definition: fsl_fxls8952_i2c_3D_accel.h:57
fxls8952_DataBuffer_t
This structure defines the dummy DSA data buffer format.
Definition: fsl_fxls8952_i2c_3D_accel.h:30
- © Freescale Semiconductor, Inc. 2016. All Rights Reserved.