| ISF 2.1 Intelligent Sensing Framework for Kinetis with Processor Expert

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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) 2014, 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 "PE_Types.h"
19 #include "PE_Error.h"
20 #include "PE_Const.h"
21 #include "IO_Map.h"
22 /* Include inherited components */
23
24 #include "Cpu.h"
25
26 #include "isf_sm_types.h"
27 #include "isf_dsa_adapter.h"
28
29 /*! @brief This enumerator describes the available sample rates for the MM865X family of accelerometers. */
30 enum {
31 FSL_MMA865x_ACCEL_800HZ = 1250, //!< 800 Hz
32 FSL_MMA865x_ACCEL_400HZ = 2500, //!< 400 Hz
33 FSL_MMA865x_ACCEL_200HZ = 5000, //!< 200 Hz
34 FSL_MMA865x_ACCEL_100HZ = 10000, //!< 100 Hz
35 FSL_MMA865x_ACCEL_50HZ = 20000, //!< 50 Hz
36 FSL_MMA865x_ACCEL_12p5HZ = 80000, //!< 12.5 Hz
37 FSL_MMA865x_ACCEL_6p25HZ = 160000, //!< 6.25 Hz
38 FSL_MMA865x_ACCEL_1p56HZ = 640000 //!< 1.56 Hz
39 };
40
41 /*! @brief This enumerator describes the available output resolutions for the MM865X family of accelerometers. */
42 enum {
43 FSL_MMA865x_ACCEL_DATA_FULL = 0, //!< select full-scale resolution
44 FSL_MMA865x_ACCEL_DATA_8BIT = 1 //!< select 8-bit resolution
45 };
46
47 /*! @brief This enumerator describes the available acceleration ranges for the MM865X family of accelerometers. */
48 enum {
49 FSL_MMA865x_ACCEL_SCALE_2G = 0, //!< select +/-2G range
50 FSL_MMA865x_ACCEL_SCALE_4G = 1, //!< select +/-4G range
51 FSL_MMA865x_ACCEL_SCALE_8G = 2 //!< select +/-8G range
52 };
53
54 /*! @brief This structure defines important settings.*/
55 typedef struct
56 {
57 uint8 sampleRateIndex; //!< Holds the ODR index into the rate array fsl_mma865x_period */
58 } mma865x_Specific_Settings_t;
59
60 /*! @brief This structure defines the dummy DSA data buffer format.*/
61 typedef struct {
62 uint32 timeStamp; /*!< The time stamp for the data packet.*/
63 int16 accel[3]; /*!< The accelerometer data */
64 uint8 addr; /*!< The device "address" can uniquely identify the sensor */
65 } mma865x_DataBuffer_t;
66
67 /*! @brief Supported sensor and data types for MMA865x */
68 extern isf_SensorTypes_t mma865x_SupportedSensorTypes[];
69 extern isf_SensorDataTypes_t mma865x_SupportedDataTypes[];
70
71
72 /*
73 ** ===================================================================
74 ** Method : fsl_mma865x_i2c_3D_accel_Initialize
75 ** @brief
76 **
77 ** Parameters :
78 ** NAME - DESCRIPTION
79 ** @param
80 ** isf_SensorHandle_t *pSensorHandle
81 ** @return
82 ** isf_dsa_status_t -
83 ** ===================================================================
84 */
85 isf_dsa_status_t fsl_mma865x_i2c_3D_accel_Initialize(isf_SensorHandle_t *pSensorHandle);
86
87 /*
88 ** ===================================================================
89 ** Method : fsl_mma865x_i2c_3D_accel_ValidateSettings
90 ** @brief
91 **
92 ** Parameters :
93 ** NAME - DESCRIPTION
94 ** @param
95 ** isf_SensorHandle_t *pSensorHandle
96 ** @param
97 ** isf_SubscriptionSettings_t *pSettings
98 ** @return
99 ** isf_dsa_status_t -
100 ** ===================================================================
101 */
102 isf_dsa_status_t fsl_mma865x_i2c_3D_accel_ValidateSettings(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings);
103
104 /*
105 ** ===================================================================
106 ** Method : fsl_mma865x_i2c_3D_accel_Configure
107 ** @brief
108 **
109 ** Parameters :
110 ** NAME - DESCRIPTION
111 ** @param
112 ** isf_SensorHandle_t *pSensorHandle
113 ** @param
114 ** isf_SubscriptionSettings_t *pConfigSettings
115 ** @return
116 ** isf_dsa_status_t -
117 ** ===================================================================
118 */
119 isf_dsa_status_t fsl_mma865x_i2c_3D_accel_Configure(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings);
120
121 /*
122 ** ===================================================================
123 ** Method : fsl_mma865x_i2c_3D_accel_StartData
124 ** @brief
125 **
126 ** Parameters :
127 ** NAME - DESCRIPTION
128 ** @param
129 ** isf_SensorHandle_t *pSensorHandle
130 ** @return
131 ** isf_dsa_status_t -
132 ** ===================================================================
133 */
134 isf_dsa_status_t fsl_mma865x_i2c_3D_accel_StartData(isf_SensorHandle_t *pSensorHandle);
135
136 /*
137 ** ===================================================================
138 ** Method : fsl_mma865x_i2c_3D_accel_EndData
139 ** @brief
140 **
141 ** Parameters :
142 ** NAME - DESCRIPTION
143 ** @param
144 ** isf_SensorHandle_t *pSensorHandle
145 ** @return
146 ** isf_dsa_status_t -
147 ** ===================================================================
148 */
149 isf_dsa_status_t fsl_mma865x_i2c_3D_accel_EndData(isf_SensorHandle_t *pSensorHandle);
150
151 /*
152 ** ===================================================================
153 ** Method : fsl_mma865x_i2c_3D_accel_Calibrate
154 ** @brief
155 **
156 ** Parameters :
157 ** NAME - DESCRIPTION
158 ** @param
159 ** isf_SensorHandle_t *pSensorHandle
160 ** @return
161 ** isf_dsa_status_t -
162 ** ===================================================================
163 */
164 isf_dsa_status_t fsl_mma865x_i2c_3D_accel_Calibrate(isf_SensorHandle_t *pSensorHandle, void *pCalData );
165
166 /*
167 ** ===================================================================
168 ** Method : fsl_mma865x_i2c_3D_accel_Shutdown
169 ** @brief
170 **
171 ** Parameters :
172 ** NAME - DESCRIPTION
173 ** @param
174 ** isf_SensorHandle_t *pSensorHandle
175 ** @return
176 ** isf_dsa_status_t -
177 ** ===================================================================
178 */
179 isf_dsa_status_t fsl_mma865x_i2c_3D_accel_Shutdown(isf_SensorHandle_t *pSensorHandle );
180
181 /*
182 ** ===================================================================
183 ** Method : fsl_mma865x_i2c_3D_accel_Convert
184 ** @brief The DSA interface conversion function to convert native samples to specified standard types
185 **
186 ** Parameters :
187 ** NAME - DESCRIPTION
188 ** @param
189 ** isf_SensorHandle_t *pSensorHandle
190 ** @return
191 ** void -
192 ** ===================================================================
193 */
194 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 );
195 /*
196 ** ===================================================================
197 ** Method : fsl_mma865x_i2c_3D_accel_PeriodicCallback (component ISFDSA)
198 ** @brief
199 **
200 ** Parameters :
201 ** NAME - DESCRIPTION
202 ** @param
203 ** isf_SensorHandle_t *pSensorHandle
204 ** @return
205 ** void -
206 ** ===================================================================
207 */
208 void fsl_mma865x_i2c_3D_accel_PeriodicCallback(void* pSensorHandle);
209
210 #endif
211 /* END FSL_MMA865x_I2C_3D_ACCEL_H_ */
212 /*!
213 ** @}
214 */
215
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:100
FSL_MMA865x_ACCEL_1p56HZ
1.56 Hz
Definition: fsl_mma865x_i2c_3D_accel.h:38
mma865x_DataBuffer_t
This structure defines the dummy DSA data buffer format.
Definition: fsl_mma865x_i2c_3D_accel.h:61
uint8
unsigned char uint8
This defines uint8 as unsigned char.
Definition: isf_types.h:18
FSL_MMA865x_ACCEL_50HZ
50 Hz
Definition: fsl_mma865x_i2c_3D_accel.h:35
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:369
FSL_MMA865x_ACCEL_200HZ
200 Hz
Definition: fsl_mma865x_i2c_3D_accel.h:33
FSL_MMA865x_ACCEL_12p5HZ
12.5 Hz
Definition: fsl_mma865x_i2c_3D_accel.h:36
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:433
FSL_MMA865x_ACCEL_800HZ
800 Hz
Definition: fsl_mma865x_i2c_3D_accel.h:31
isf_SensorHandle_st
This defines the DSA sensor device handle structure used to invoke the adapter access functions...
Definition: isf_dsa_adapter.h:109
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:57
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:309
uint32
unsigned long uint32
This defines uint32 as unsigned long.
Definition: isf_types.h:36
mma865x_SupportedDataTypes
isf_SensorDataTypes_t mma865x_SupportedDataTypes[]
Definition: fsl_mma865x_i2c_3D_accel.c:67
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:23
mma865x_SupportedSensorTypes
isf_SensorTypes_t mma865x_SupportedSensorTypes[]
Supported sensor and data types for MMA865x.
Definition: fsl_mma865x_i2c_3D_accel.c:66
FSL_MMA865x_ACCEL_SCALE_8G
select +/-8G range
Definition: fsl_mma865x_i2c_3D_accel.h:51
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:576
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:453
FSL_MMA865x_ACCEL_SCALE_4G
select +/-4G range
Definition: fsl_mma865x_i2c_3D_accel.h:50
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:482
isf_SensorDataTypes_t
isf_SensorDataTypes_t
Definition: isf_sensor_types.h:61
int32
long int32
This defines int32 as long.
Definition: isf_types.h:32
mma865x_DataBuffer_t::timeStamp
uint32 timeStamp
Definition: fsl_mma865x_i2c_3D_accel.h:62
int16
short int16
This defines int16 as short.
Definition: isf_types.h:23
FSL_MMA865x_ACCEL_DATA_8BIT
select 8-bit resolution
Definition: fsl_mma865x_i2c_3D_accel.h:44
FSL_MMA865x_ACCEL_400HZ
400 Hz
Definition: fsl_mma865x_i2c_3D_accel.h:32
isf_dsa_SensorSettings_st
This defines the DSA sensor configuration parameter structure configuring the sensor settings by a su...
Definition: isf_dsa_adapter.h:81
FSL_MMA865x_ACCEL_DATA_FULL
select full-scale resolution
Definition: fsl_mma865x_i2c_3D_accel.h:43
FSL_MMA865x_ACCEL_100HZ
100 Hz
Definition: fsl_mma865x_i2c_3D_accel.h:34
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:220
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:191
mma865x_Specific_Settings_t
This structure defines important settings.
Definition: fsl_mma865x_i2c_3D_accel.h:55
mma865x_DataBuffer_t::addr
uint8 addr
Definition: fsl_mma865x_i2c_3D_accel.h:64
FSL_MMA865x_ACCEL_SCALE_2G
select +/-2G range
Definition: fsl_mma865x_i2c_3D_accel.h:49
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:37
- © Freescale Semiconductor, Inc. 2015. All Rights Reserved.