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

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

fsl_mma865x_i2c_3D_accel.h
Go to the documentation of this file.
1 /**
2 * @file fsl_mma865x_i2c_3D_accel.h
3 * @brief The \b fsl_mma865x_i2c_3D_accel.h file contains the definitions and functions supporting the MMA865x Sensor adapter header file
4 * @copyright Copyright (c) 2015, Freescale Semiconductor, Inc.
5 * @version 01.00
6 * @brief
7 *
8 */
9 /*!
10 ** @addtogroup fsl_mma865x_i2c_3D_accel_module fsl_mma865x_i2c_3D_accel module documentation
11 ** @{
12 */
13
14 #ifndef FSL_MMA865x_I2C_3D_ACCEL_H_
15 #define FSL_MMA865x_I2C_3D_ACCEL_H_
16
17 /* Include shared modules, which are used for whole project */
18 #include "isf.h"
19
20 #include "isf_sm_types.h"
21 #include "isf_dsa_adapter.h"
22
23 /*! @brief This enumerator describes the available sample rates for the MM865X family of accelerometers. */
24 enum {
25 FSL_MMA865x_ACCEL_800HZ = 1250, //!< 800 Hz
26 FSL_MMA865x_ACCEL_400HZ = 2500, //!< 400 Hz
27 FSL_MMA865x_ACCEL_200HZ = 5000, //!< 200 Hz
28 FSL_MMA865x_ACCEL_100HZ = 10000, //!< 100 Hz
29 FSL_MMA865x_ACCEL_50HZ = 20000, //!< 50 Hz
30 FSL_MMA865x_ACCEL_12p5HZ = 80000, //!< 12.5 Hz
31 FSL_MMA865x_ACCEL_6p25HZ = 160000, //!< 6.25 Hz
32 FSL_MMA865x_ACCEL_1p56HZ = 640000 //!< 1.56 Hz
33 };
34
35 /*! @brief This enumerator describes the available output resolutions for the MM865X family of accelerometers. */
36 enum {
37 FSL_MMA865x_ACCEL_DATA_FULL = 0, //!< select full-scale resolution
38 FSL_MMA865x_ACCEL_DATA_8BIT = 1 //!< select 8-bit resolution
39 };
40
41 /*! @brief This enumerator describes the available acceleration ranges for the MM865X family of accelerometers. */
42 enum {
43 FSL_MMA865x_ACCEL_SCALE_2G = 0, //!< select +/-2G range
44 FSL_MMA865x_ACCEL_SCALE_4G = 1, //!< select +/-4G range
45 FSL_MMA865x_ACCEL_SCALE_8G = 2 //!< select +/-8G range
46 };
47
48 /*! @brief This structure defines important settings.*/
49 typedef struct
50 {
51 uint8 sampleRateIndex; //!< Holds the ODR index into the rate array fsl_mma865x_period */
52 } mma865x_Specific_Settings_t;
53
54 /*! @brief This structure defines the dummy DSA data buffer format.*/
55 typedef struct {
56 uint32 timeStamp; /*!< The time stamp for the data packet.*/
57 int16 accel[3]; /*!< The accelerometer data */
58 uint8 addr; /*!< The device "address" can uniquely identify the sensor */
59 } mma865x_DataBuffer_t;
60
61 /*! @brief Supported sensor and data types for MMA865x */
62 extern isf_SensorTypes_t mma865x_SupportedSensorTypes[];
63 extern isf_SensorDataTypes_t mma865x_SupportedDataTypes[];
64
65
66 /*
67 ** ===================================================================
68 ** Method : fsl_mma865x_i2c_3D_accel_Initialize
69 ** @brief
70 **
71 ** Parameters :
72 ** NAME - DESCRIPTION
73 ** @param
74 ** isf_SensorHandle_t *pSensorHandle
75 ** @return
76 ** isf_dsa_status_t -
77 ** ===================================================================
78 */
79 isf_dsa_status_t fsl_mma865x_i2c_3D_accel_Initialize(isf_SensorHandle_t *pSensorHandle);
80
81 /*
82 ** ===================================================================
83 ** Method : fsl_mma865x_i2c_3D_accel_ValidateSettings
84 ** @brief
85 **
86 ** Parameters :
87 ** NAME - DESCRIPTION
88 ** @param
89 ** isf_SensorHandle_t *pSensorHandle
90 ** @param
91 ** isf_SubscriptionSettings_t *pSettings
92 ** @return
93 ** isf_dsa_status_t -
94 ** ===================================================================
95 */
96 isf_dsa_status_t fsl_mma865x_i2c_3D_accel_ValidateSettings(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings);
97
98 /*
99 ** ===================================================================
100 ** Method : fsl_mma865x_i2c_3D_accel_Configure
101 ** @brief
102 **
103 ** Parameters :
104 ** NAME - DESCRIPTION
105 ** @param
106 ** isf_SensorHandle_t *pSensorHandle
107 ** @param
108 ** isf_SubscriptionSettings_t *pConfigSettings
109 ** @return
110 ** isf_dsa_status_t -
111 ** ===================================================================
112 */
113 isf_dsa_status_t fsl_mma865x_i2c_3D_accel_Configure(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings);
114
115 /*
116 ** ===================================================================
117 ** Method : fsl_mma865x_i2c_3D_accel_StartData
118 ** @brief
119 **
120 ** Parameters :
121 ** NAME - DESCRIPTION
122 ** @param
123 ** isf_SensorHandle_t *pSensorHandle
124 ** @return
125 ** isf_dsa_status_t -
126 ** ===================================================================
127 */
128 isf_dsa_status_t fsl_mma865x_i2c_3D_accel_StartData(isf_SensorHandle_t *pSensorHandle);
129
130 /*
131 ** ===================================================================
132 ** Method : fsl_mma865x_i2c_3D_accel_EndData
133 ** @brief
134 **
135 ** Parameters :
136 ** NAME - DESCRIPTION
137 ** @param
138 ** isf_SensorHandle_t *pSensorHandle
139 ** @return
140 ** isf_dsa_status_t -
141 ** ===================================================================
142 */
143 isf_dsa_status_t fsl_mma865x_i2c_3D_accel_EndData(isf_SensorHandle_t *pSensorHandle);
144
145 /*
146 ** ===================================================================
147 ** Method : fsl_mma865x_i2c_3D_accel_Calibrate
148 ** @brief
149 **
150 ** Parameters :
151 ** NAME - DESCRIPTION
152 ** @param
153 ** isf_SensorHandle_t *pSensorHandle
154 ** @return
155 ** isf_dsa_status_t -
156 ** ===================================================================
157 */
158 isf_dsa_status_t fsl_mma865x_i2c_3D_accel_Calibrate(isf_SensorHandle_t *pSensorHandle, void *pCalData );
159
160 /*
161 ** ===================================================================
162 ** Method : fsl_mma865x_i2c_3D_accel_Shutdown
163 ** @brief
164 **
165 ** Parameters :
166 ** NAME - DESCRIPTION
167 ** @param
168 ** isf_SensorHandle_t *pSensorHandle
169 ** @return
170 ** isf_dsa_status_t -
171 ** ===================================================================
172 */
173 isf_dsa_status_t fsl_mma865x_i2c_3D_accel_Shutdown(isf_SensorHandle_t *pSensorHandle );
174
175 /*
176 ** ===================================================================
177 ** Method : fsl_mma865x_i2c_3D_accel_Convert
178 ** @brief The DSA interface conversion function to convert native samples to specified standard types
179 **
180 ** Parameters :
181 ** NAME - DESCRIPTION
182 ** @param
183 ** isf_SensorHandle_t *pSensorHandle
184 ** @return
185 ** void -
186 ** ===================================================================
187 */
188 isf_dsa_status_t fsl_mma865x_i2c_3D_accel_Convert(volatile isf_SensorHandle_t *pSensorHandle, isf_SensorDataTypes_t convertToType, isf_dsa_result_types_t resultType, void *nativeSample, void *convertedSample, int32 *numBytes );
189 /*
190 ** ===================================================================
191 ** Method : fsl_mma865x_i2c_3D_accel_PeriodicCallback (component ISFDSA)
192 ** @brief
193 **
194 ** Parameters :
195 ** NAME - DESCRIPTION
196 ** @param
197 ** isf_SensorHandle_t *pSensorHandle
198 ** @return
199 ** void -
200 ** ===================================================================
201 */
202 void fsl_mma865x_i2c_3D_accel_PeriodicCallback(void* pSensorHandle);
203
204 #endif
205 /* END FSL_MMA865x_I2C_3D_ACCEL_H_ */
206 /*!
207 ** @}
208 */
209
fsl_mma865x_i2c_3D_accel_Initialize
isf_dsa_status_t fsl_mma865x_i2c_3D_accel_Initialize(isf_SensorHandle_t *pSensorHandle)
Definition: fsl_mma865x_i2c_3D_accel.c:102
FSL_MMA865x_ACCEL_1p56HZ
1.56 Hz
Definition: fsl_mma865x_i2c_3D_accel.h:32
mma865x_DataBuffer_t
This structure defines the dummy DSA data buffer format.
Definition: fsl_mma865x_i2c_3D_accel.h:55
uint8
unsigned char uint8
Definition: isf_types.h:76
FSL_MMA865x_ACCEL_50HZ
50 Hz
Definition: fsl_mma865x_i2c_3D_accel.h:29
isf_dsa_adapter.h
fsl_mma865x_i2c_3D_accel_EndData
isf_dsa_status_t fsl_mma865x_i2c_3D_accel_EndData(isf_SensorHandle_t *pSensorHandle)
Definition: fsl_mma865x_i2c_3D_accel.c:378
FSL_MMA865x_ACCEL_200HZ
200 Hz
Definition: fsl_mma865x_i2c_3D_accel.h:27
FSL_MMA865x_ACCEL_12p5HZ
12.5 Hz
Definition: fsl_mma865x_i2c_3D_accel.h:30
fsl_mma865x_i2c_3D_accel_Calibrate
isf_dsa_status_t fsl_mma865x_i2c_3D_accel_Calibrate(isf_SensorHandle_t *pSensorHandle, void *pCalData)
Definition: fsl_mma865x_i2c_3D_accel.c:445
FSL_MMA865x_ACCEL_800HZ
800 Hz
Definition: fsl_mma865x_i2c_3D_accel.h:25
isf_SensorHandle_st
This defines the DSA sensor device handle structure used to invoke the adapter access functions...
Definition: isf_dsa_adapter.h:107
mma865x_Specific_Settings_t::sampleRateIndex
uint8 sampleRateIndex
Holds the ODR index into the rate array fsl_mma865x_period */.
Definition: fsl_mma865x_i2c_3D_accel.h:51
fsl_mma865x_i2c_3D_accel_StartData
isf_dsa_status_t fsl_mma865x_i2c_3D_accel_StartData(isf_SensorHandle_t *pSensorHandle)
Definition: fsl_mma865x_i2c_3D_accel.c:316
mma865x_SupportedDataTypes
isf_SensorDataTypes_t mma865x_SupportedDataTypes[]
Definition: fsl_mma865x_i2c_3D_accel.c:69
isf_SensorTypes_t
isf_SensorTypes_t
Definition: isf_sensor_types.h:14
isf_dsa_status_t
int32 isf_dsa_status_t
This is the Sensor Manager API return type definition.
Definition: isf_dsa_adapter.h:21
mma865x_SupportedSensorTypes
isf_SensorTypes_t mma865x_SupportedSensorTypes[]
Supported sensor and data types for MMA865x.
Definition: fsl_mma865x_i2c_3D_accel.c:68
int16
signed short int int16
Definition: isf_types.h:73
FSL_MMA865x_ACCEL_SCALE_8G
select +/-8G range
Definition: fsl_mma865x_i2c_3D_accel.h:45
fsl_mma865x_i2c_3D_accel_Convert
isf_dsa_status_t fsl_mma865x_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_mma865x_i2c_3D_accel.c:591
fsl_mma865x_i2c_3D_accel_Shutdown
isf_dsa_status_t fsl_mma865x_i2c_3D_accel_Shutdown(isf_SensorHandle_t *pSensorHandle)
Definition: fsl_mma865x_i2c_3D_accel.c:465
FSL_MMA865x_ACCEL_SCALE_4G
select +/-4G range
Definition: fsl_mma865x_i2c_3D_accel.h:44
isf_dsa_result_types_t
enum isf_dsa_result_enums isf_dsa_result_types_t
fsl_mma865x_i2c_3D_accel_PeriodicCallback
void fsl_mma865x_i2c_3D_accel_PeriodicCallback(void *pSensorHandle)
Definition: fsl_mma865x_i2c_3D_accel.c:494
isf_SensorDataTypes_t
isf_SensorDataTypes_t
Definition: isf_sensor_types.h:61
mma865x_DataBuffer_t::timeStamp
uint32 timeStamp
Definition: fsl_mma865x_i2c_3D_accel.h:56
isf.h
Main ISF header file. Contains code common to all ISF components.
int32
signed long int int32
Definition: isf_types.h:74
FSL_MMA865x_ACCEL_DATA_8BIT
select 8-bit resolution
Definition: fsl_mma865x_i2c_3D_accel.h:38
FSL_MMA865x_ACCEL_400HZ
400 Hz
Definition: fsl_mma865x_i2c_3D_accel.h:26
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
FSL_MMA865x_ACCEL_DATA_FULL
select full-scale resolution
Definition: fsl_mma865x_i2c_3D_accel.h:37
FSL_MMA865x_ACCEL_100HZ
100 Hz
Definition: fsl_mma865x_i2c_3D_accel.h:28
fsl_mma865x_i2c_3D_accel_Configure
isf_dsa_status_t fsl_mma865x_i2c_3D_accel_Configure(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
Definition: fsl_mma865x_i2c_3D_accel.c:225
fsl_mma865x_i2c_3D_accel_ValidateSettings
isf_dsa_status_t fsl_mma865x_i2c_3D_accel_ValidateSettings(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
Definition: fsl_mma865x_i2c_3D_accel.c:196
mma865x_Specific_Settings_t
This structure defines important settings.
Definition: fsl_mma865x_i2c_3D_accel.h:49
mma865x_DataBuffer_t::addr
uint8 addr
Definition: fsl_mma865x_i2c_3D_accel.h:58
uint32
unsigned long int uint32
Definition: isf_types.h:78
FSL_MMA865x_ACCEL_SCALE_2G
select +/-2G range
Definition: fsl_mma865x_i2c_3D_accel.h:43
isf_sm_types.h
The isf_sm_types.h contains the collection of type definitions used in the Sensor Manager Interface a...
FSL_MMA865x_ACCEL_6p25HZ
6.25 Hz
Definition: fsl_mma865x_i2c_3D_accel.h:31
- © Freescale Semiconductor, Inc. 2016. All Rights Reserved.