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

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

fsl_mpl3115_i2c_1D_press.h
Go to the documentation of this file.
1 /**
2 * @file fsl_mpl3115_i2c_1D_press.h
3 * @brief The \b fsl_mpl3115_i2c_1D_press.h file contains the definitions and functions supporting the MMA8652 Sensor adapter header file
4 * @copyright Copyright (c) 2015, Freescale Semiconductor, Inc.
5 * @version 01.00
6 * @brief
7 *
8 */
9 /*!
10 ** @addtogroup fsl_mpl3115_i2c_1D_press_module fsl_mpl3115_i2c_1D_press module documentation
11 ** @{
12 */
13
14 #ifndef FSL_MPL3115_I2C_1D_PRESS_H_
15 #define FSL_MPL3115_I2C_1D_PRESS_H_
16
17 /* Include shared modules, which are used for whole project */
18 #include "isf.h"
19 #include "isf_sm_types.h"
20 #include "isf_dsa_adapter.h"
21
22 /*! @brief This enumerator describes the available sample rates for the MPL3115 accelerometer */
23 enum {
24 FSL_MPL3115_ACCEL_800HZ = 1250, //!< 800 Hz
25 FSL_MPL3115_ACCEL_400HZ = 2500, //!< 400 Hz
26 FSL_MPL3115_ACCEL_200HZ = 5000, //!< 200 Hz
27 FSL_MPL3115_ACCEL_100HZ = 10000, //!< 100 Hz
28 FSL_MPL3115_ACCEL_50HZ = 20000, //!< 50 Hz
29 FSL_MPL3115_ACCEL_12p5HZ = 80000, //!< 12.5 Hz
30 FSL_MPL3115_ACCEL_6p25HZ = 160000, //!< 6.25 Hz
31 FSL_MPL3115_ACCEL_1p56HZ = 640000 //!< 1.56 Hz
32 };
33
34 /*! @brief This enumerator describes the available acceleration ranges for the MM865X family of accelerometers. */
35 enum {
36 FSL_MPL3115_ACCEL_SCALE_2G = 0, //!< select +/-2G range
37 FSL_MPL3115_ACCEL_SCALE_4G = 1, //!< select +/-4G range
38 FSL_MPL3115_ACCEL_SCALE_8G = 2 //!< select +/-8G range
39 };
40
41 /*! @brief This structure defines important settings.*/
42 typedef struct
43 {
44 uint8 sampleRateIndex; //!< Holds the ODR index into the rate array fsl_mpl3115_period */
45 } mpl3115_Specific_Settings_t;
46
47 /*! @brief This structure defines the dummy DSA data buffer format.*/
48 typedef struct
49 {
50 uint32 timestamp;
51 //!< Time stamp value in micro-seconds.
52 uint32 pressure;
53 //!< Sensor pressure output: unsigned 20-bits justified to MSBs;
54 //!< MS 18-bits are integer Pascals; LS 2-bits are fractional Pascals.
55 int32 altitude;
56 //!< Sensor altitude output: 2's complement 20-bits justified to MSBs;
57 //!< MS 16-bits are integer meters; LS 4-bits are fractional meters.
58 int16 temperature;
59 //!< Sensor temperature output; 2's complement 12-bits justified to MSBs;
60 //!< MS 8-bits are integer degrees Celsius; LS 4-bits are fractional degrees Celsius.
61 } mpl3115_DataBuffer_t;
62
63 /**
64 * @brief the structure defines the OS table for MPL3115 operation.
65 */
66 typedef struct {
67 uint32 samplePeriod; /* Sample period in micro-seconds. */
68 uint8 osConfigVal; /* Corresponding to Over-sample (OS) ratio */
69 }mpl3115_OS_Table_t;
70
71 /*! @brief Supported sensor and data types for MPL3115 */
72 extern isf_SensorTypes_t mpl3115_SupportedSensorTypes[];
73 extern isf_SensorDataTypes_t mpl3115_SupportedDataTypes[];
74
75
76 /*
77 ** ===================================================================
78 ** Method : fsl_mpl3115_i2c_1D_press_Initialize
79 ** @brief
80 **
81 ** Parameters :
82 ** NAME - DESCRIPTION
83 ** @param
84 ** isf_SensorHandle_t *pSensorHandle
85 ** @return
86 ** isf_dsa_status_t -
87 ** ===================================================================
88 */
89 isf_dsa_status_t fsl_mpl3115_i2c_1D_press_Initialize(isf_SensorHandle_t *pSensorHandle);
90
91 /*
92 ** ===================================================================
93 ** Method : fsl_mpl3115_i2c_1D_press_ValidateSettings
94 ** @brief
95 **
96 ** Parameters :
97 ** NAME - DESCRIPTION
98 ** @param
99 ** isf_SensorHandle_t *pSensorHandle
100 ** @param
101 ** isf_SubscriptionSettings_t *pSettings
102 ** @return
103 ** isf_dsa_status_t -
104 ** ===================================================================
105 */
106 isf_dsa_status_t fsl_mpl3115_i2c_1D_press_ValidateSettings(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings);
107
108 /*
109 ** ===================================================================
110 ** Method : fsl_mpl3115_i2c_1D_press_Configure
111 ** @brief
112 **
113 ** Parameters :
114 ** NAME - DESCRIPTION
115 ** @param
116 ** isf_SensorHandle_t *pSensorHandle
117 ** @param
118 ** isf_SubscriptionSettings_t *pConfigSettings
119 ** @return
120 ** isf_dsa_status_t -
121 ** ===================================================================
122 */
123 isf_dsa_status_t fsl_mpl3115_i2c_1D_press_Configure(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings);
124
125 /*
126 ** ===================================================================
127 ** Method : fsl_mpl3115_i2c_1D_press_StartData
128 ** @brief
129 **
130 ** Parameters :
131 ** NAME - DESCRIPTION
132 ** @param
133 ** isf_SensorHandle_t *pSensorHandle
134 ** @return
135 ** isf_dsa_status_t -
136 ** ===================================================================
137 */
138 isf_dsa_status_t fsl_mpl3115_i2c_1D_press_StartData(isf_SensorHandle_t *pSensorHandle);
139
140 /*
141 ** ===================================================================
142 ** Method : fsl_mpl3115_i2c_1D_press_EndData
143 ** @brief
144 **
145 ** Parameters :
146 ** NAME - DESCRIPTION
147 ** @param
148 ** isf_SensorHandle_t *pSensorHandle
149 ** @return
150 ** isf_dsa_status_t -
151 ** ===================================================================
152 */
153 isf_dsa_status_t fsl_mpl3115_i2c_1D_press_EndData(isf_SensorHandle_t *pSensorHandle);
154
155 /*
156 ** ===================================================================
157 ** Method : fsl_mpl3115_i2c_1D_press_Calibrate
158 ** @brief
159 **
160 ** Parameters :
161 ** NAME - DESCRIPTION
162 ** @param
163 ** isf_SensorHandle_t *pSensorHandle
164 ** @return
165 ** isf_dsa_status_t -
166 ** ===================================================================
167 */
168 isf_dsa_status_t fsl_mpl3115_i2c_1D_press_Calibrate(isf_SensorHandle_t *pSensorHandle, void *pCalData );
169
170 /*
171 ** ===================================================================
172 ** Method : fsl_mpl3115_i2c_1D_press_Shutdown
173 ** @brief
174 **
175 ** Parameters :
176 ** NAME - DESCRIPTION
177 ** @param
178 ** isf_SensorHandle_t *pSensorHandle
179 ** @return
180 ** isf_dsa_status_t -
181 ** ===================================================================
182 */
183 isf_dsa_status_t fsl_mpl3115_i2c_1D_press_Shutdown(isf_SensorHandle_t *pSensorHandle );
184
185 /*
186 ** ===================================================================
187 ** Method : fsl_mpl3115_i2c_1D_press_Convert
188 ** @brief The DSA interface conversion function to convert native samples to specified standard types
189 **
190 ** Parameters :
191 ** NAME - DESCRIPTION
192 ** @param
193 ** isf_SensorHandle_t *pSensorHandle
194 ** @return
195 ** void -
196 ** ===================================================================
197 */
198 isf_dsa_status_t fsl_mpl3115_i2c_1D_press_Convert(volatile isf_SensorHandle_t *pSensorHandle, isf_SensorDataTypes_t convertToType, isf_dsa_result_types_t resultType, void *nativeSample, void *convertedSample, int32 *numBytes );
199 /*
200 ** ===================================================================
201 ** Method : fsl_mpl3115_i2c_1D_press_PeriodicCallback (component ISFDSA)
202 ** @brief
203 **
204 ** Parameters :
205 ** NAME - DESCRIPTION
206 ** @param
207 ** isf_SensorHandle_t *pSensorHandle
208 ** @return
209 ** void -
210 ** ===================================================================
211 */
212 void fsl_mpl3115_i2c_1D_press_PeriodicCallback(void* pSensorHandle);
213
214 #endif
215 /* END FSL_MPL3115_I2C_1D_PRESS_H_ */
216 /*!
217 ** @}
218 */
219
FSL_MPL3115_ACCEL_SCALE_8G
select +/-8G range
Definition: fsl_mpl3115_i2c_1D_press.h:38
uint8
unsigned char uint8
Definition: isf_types.h:76
mpl3115_OS_Table_t::osConfigVal
uint8 osConfigVal
Definition: fsl_mpl3115_i2c_1D_press.h:68
FSL_MPL3115_ACCEL_SCALE_2G
select +/-2G range
Definition: fsl_mpl3115_i2c_1D_press.h:36
FSL_MPL3115_ACCEL_1p56HZ
1.56 Hz
Definition: fsl_mpl3115_i2c_1D_press.h:31
FSL_MPL3115_ACCEL_6p25HZ
6.25 Hz
Definition: fsl_mpl3115_i2c_1D_press.h:30
isf_dsa_adapter.h
FSL_MPL3115_ACCEL_12p5HZ
12.5 Hz
Definition: fsl_mpl3115_i2c_1D_press.h:29
mpl3115_OS_Table_t::samplePeriod
uint32 samplePeriod
Definition: fsl_mpl3115_i2c_1D_press.h:67
FSL_MPL3115_ACCEL_200HZ
200 Hz
Definition: fsl_mpl3115_i2c_1D_press.h:26
fsl_mpl3115_i2c_1D_press_Shutdown
isf_dsa_status_t fsl_mpl3115_i2c_1D_press_Shutdown(isf_SensorHandle_t *pSensorHandle)
Definition: fsl_mpl3115_i2c_1D_press.c:571
fsl_mpl3115_i2c_1D_press_Convert
isf_dsa_status_t fsl_mpl3115_i2c_1D_press_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_mpl3115_i2c_1D_press.c:713
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_MPL3115_ACCEL_SCALE_4G
select +/-4G range
Definition: fsl_mpl3115_i2c_1D_press.h:37
isf_SensorTypes_t
isf_SensorTypes_t
Definition: isf_sensor_types.h:14
FSL_MPL3115_ACCEL_50HZ
50 Hz
Definition: fsl_mpl3115_i2c_1D_press.h:28
mpl3115_SupportedDataTypes
isf_SensorDataTypes_t mpl3115_SupportedDataTypes[]
Definition: fsl_mpl3115_i2c_1D_press.c:168
mpl3115_OS_Table_t
the structure defines the OS table for MPL3115 operation.
Definition: fsl_mpl3115_i2c_1D_press.h:66
fsl_mpl3115_i2c_1D_press_Configure
isf_dsa_status_t fsl_mpl3115_i2c_1D_press_Configure(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
Definition: fsl_mpl3115_i2c_1D_press.c:330
fsl_mpl3115_i2c_1D_press_Calibrate
isf_dsa_status_t fsl_mpl3115_i2c_1D_press_Calibrate(isf_SensorHandle_t *pSensorHandle, void *pCalData)
Definition: fsl_mpl3115_i2c_1D_press.c:551
isf_dsa_status_t
int32 isf_dsa_status_t
This is the Sensor Manager API return type definition.
Definition: isf_dsa_adapter.h:21
mpl3115_Specific_Settings_t
This structure defines important settings.
Definition: fsl_mpl3115_i2c_1D_press.h:42
mpl3115_DataBuffer_t
This structure defines the dummy DSA data buffer format.
Definition: fsl_mpl3115_i2c_1D_press.h:48
fsl_mpl3115_i2c_1D_press_ValidateSettings
isf_dsa_status_t fsl_mpl3115_i2c_1D_press_ValidateSettings(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
Definition: fsl_mpl3115_i2c_1D_press.c:301
FSL_MPL3115_ACCEL_400HZ
400 Hz
Definition: fsl_mpl3115_i2c_1D_press.h:25
int16
signed short int int16
Definition: isf_types.h:73
mpl3115_DataBuffer_t::altitude
int32 altitude
Definition: fsl_mpl3115_i2c_1D_press.h:55
isf_dsa_result_types_t
enum isf_dsa_result_enums isf_dsa_result_types_t
isf_SensorDataTypes_t
isf_SensorDataTypes_t
Definition: isf_sensor_types.h:61
fsl_mpl3115_i2c_1D_press_PeriodicCallback
void fsl_mpl3115_i2c_1D_press_PeriodicCallback(void *pSensorHandle)
Definition: fsl_mpl3115_i2c_1D_press.c:600
FSL_MPL3115_ACCEL_100HZ
100 Hz
Definition: fsl_mpl3115_i2c_1D_press.h:27
isf.h
Main ISF header file. Contains code common to all ISF components.
fsl_mpl3115_i2c_1D_press_StartData
isf_dsa_status_t fsl_mpl3115_i2c_1D_press_StartData(isf_SensorHandle_t *pSensorHandle)
Definition: fsl_mpl3115_i2c_1D_press.c:421
int32
signed long int int32
Definition: isf_types.h:74
mpl3115_DataBuffer_t::temperature
int16 temperature
Definition: fsl_mpl3115_i2c_1D_press.h:58
mpl3115_Specific_Settings_t::sampleRateIndex
uint8 sampleRateIndex
Holds the ODR index into the rate array fsl_mpl3115_period */.
Definition: fsl_mpl3115_i2c_1D_press.h:44
mpl3115_SupportedSensorTypes
isf_SensorTypes_t mpl3115_SupportedSensorTypes[]
Supported sensor and data types for MPL3115.
Definition: fsl_mpl3115_i2c_1D_press.c:167
mpl3115_DataBuffer_t::pressure
uint32 pressure
Definition: fsl_mpl3115_i2c_1D_press.h:52
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_MPL3115_ACCEL_800HZ
800 Hz
Definition: fsl_mpl3115_i2c_1D_press.h:24
uint32
unsigned long int uint32
Definition: isf_types.h:78
isf_sm_types.h
The isf_sm_types.h contains the collection of type definitions used in the Sensor Manager Interface a...
fsl_mpl3115_i2c_1D_press_Initialize
isf_dsa_status_t fsl_mpl3115_i2c_1D_press_Initialize(isf_SensorHandle_t *pSensorHandle)
Definition: fsl_mpl3115_i2c_1D_press.c:206
fsl_mpl3115_i2c_1D_press_EndData
isf_dsa_status_t fsl_mpl3115_i2c_1D_press_EndData(isf_SensorHandle_t *pSensorHandle)
Definition: fsl_mpl3115_i2c_1D_press.c:484
mpl3115_DataBuffer_t::timestamp
uint32 timestamp
Time stamp value in micro-seconds.
Definition: fsl_mpl3115_i2c_1D_press.h:50
- © Freescale Semiconductor, Inc. 2016. All Rights Reserved.