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

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

fsl_mma955x_i2cspi_pedo.h
Go to the documentation of this file.
1 /**
2 ** @file fsl_mma955x.h
3 ** @brief The \b fsl_mma955x.h file contains the definitions and functions supporting the mma955x Intelligent Sensor Adapter
4 * @copyright Copyright (c) 2015, Freescale Semiconductor, Inc.
5 ** @version 01.00
6 ** @brief
7 **
8 */
9 /*!
10 ** @addtogroup fsl_mma955x_module fsl_mma955x module documentation
11 ** @{
12 */
13
14 #ifndef FSL_mma955x_I2C_PEDO_H_
15 #define FSL_mma955x_I2C_PEDO_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 #include "isf_devmsg.h"
23 #include "isf_bm.h"
24 #include "mma955x.h"
25
26
27 /*! @brief This structure defines the Pedometer sample data buffer format.*/
28 typedef struct {
29 uint32 timeStamp; /*!< The time stamp for the data packet.*/
30 int16 accel[3]; /*!< The accelerometer data. */
31 int16 temp; /*!< The temperature data. */
32 mma955x_PedometerData_t pedometerData; /*!< The pedometer native data. */
33 } mma955x_DataBuffer_t;
34
35 /*! @brief This structure defines the Pedometer Native data buffer format.*/
36 typedef struct {
37 uint32 timeStamp; /*!< The time stamp for the data packet.*/
38 mma955x_PedometerData_t pedometerData; /*!< The pedometer native data. */
39 } mma955x_PedometerNativeData_t;
40
41 typedef struct {
42 dm_ChannelDescriptor_t cDescriptor; /*!< Device Messaging channel descriptor */
43 dm_DeviceDescriptor_t deviceHandle; /*!< Device messaging device handle. */
44 LWSEM_STRUCT deviceSemaphore; /*!< Task synchronization mechanism for this data structure. */
45 bm_callback_token_t token; /*!< Bus Manager handle */
46 mma955x_DataBuffer_t* pCurrentSample; /*!< Holds the most recently read sample */
47 mma955x_appConfigRegister_t localCfgBuffer; /*!< Hold a local copy of the mma955x App config registers */
48 uint8 localCfgBufSize; /*!< Number of bytes on the localCfgBuffer array */
49 uint8 tempReadBuffer[32]; /*!< scratch buffer for result of miscellaneous reads */
50 } mma955x_DeviceDescriptor_t;
51
52 /*! @brief Supported sensor and data types for mma955x */
53 extern isf_SensorTypes_t mma955x_SupportedSensorTypes[];
54 extern isf_SensorDataTypes_t mma955x_SupportedDataTypes[];
55
56 /*
57 ** ===================================================================
58 ** Method : fsl_mma955x_Initialize (component ISFDSA)
59 ** @brief
60 **
61 ** Parameters :
62 ** NAME - DESCRIPTION
63 ** @param
64 ** void* pSensorHandle -
65 ** @return
66 ** int32_t -
67 ** ===================================================================
68 */
69 isf_dsa_status_t fsl_mma955x_Initialize( isf_SensorHandle_t *pSensorHandle);
70
71 /*
72 ** ===================================================================
73 ** Method : fsl_mag3110_i2c_3D_mag_ValidateSettings (component ISFDSA)
74 ** @brief
75 **
76 ** Parameters :
77 ** NAME - DESCRIPTION
78 ** @param
79 ** void* pSensorHandle -
80 ** @param
81 ** void* pSettings -
82 ** @return
83 ** int32_t -
84 ** ===================================================================
85 */
86 isf_dsa_status_t fsl_mma955x_ValidateSettings(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSubSettings);
87
88 /*
89 ** ===================================================================
90 ** Method : fsl_mag3110_i2c_3D_mag_Configure (component ISFDSA)
91 ** @brief
92 **
93 ** Parameters :
94 ** NAME - DESCRIPTION
95 ** @param
96 ** void* pSensorHandle -
97 ** @param
98 ** void* pConfigSettings -
99 ** @return
100 ** int32_t -
101 ** ===================================================================
102 */
103 isf_dsa_status_t fsl_mma955x_Configure(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings);
104
105 /*
106 ** ===================================================================
107 ** Method : fsl_mag3110_i2c_3D_mag_StartData (component ISFDSA)
108 ** @brief
109 **
110 ** Parameters :
111 ** NAME - DESCRIPTION
112 ** @param
113 ** void* pSensorHandle -
114 ** @return
115 ** int32_t -
116 ** ===================================================================
117 */
118 isf_dsa_status_t fsl_mma955x_StartData(isf_SensorHandle_t *pSensorHandle );
119
120 /*
121 ** ===================================================================
122 ** Method : fsl_mag3110_i2c_3D_mag_EndData (component ISFDSA)
123 ** @brief
124 **
125 ** Parameters :
126 ** NAME - DESCRIPTION
127 ** @param
128 ** void* pSensorHandle -
129 ** @return
130 ** int32_t -
131 ** ===================================================================
132 */
133 isf_dsa_status_t fsl_mma955x_EndData(isf_SensorHandle_t *pSensorHandle );
134
135 /*
136 ** ===================================================================
137 ** Method : fsl_mag3110_i2c_3D_mag_Calibrate (component ISFDSA)
138 ** @brief
139 **
140 ** Parameters :
141 ** NAME - DESCRIPTION
142 ** @param
143 ** void* pSensorHandle -
144 ** @return
145 ** int32_t -
146 ** ===================================================================
147 */
148 isf_dsa_status_t fsl_mma955x_Calibrate(isf_SensorHandle_t *pSensorHandle, void *pCalData );
149
150 /*
151 ** ===================================================================
152 ** Method : fsl_mag3110_i2c_3D_mag_Shutdown (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_mma955x_Shutdown(isf_SensorHandle_t *pSensorHandle );
164
165 /*
166 ** ===================================================================
167 ** Method : fsl_mag3110_i2c_3D_mag_PeriodicCallback (component ISFDSA)
168 ** @brief
169 **
170 ** Parameters :
171 ** NAME - DESCRIPTION
172 ** @param
173 ** void* pSensorHandle -
174 ** @return
175 ** void -
176 ** ===================================================================
177 */
178 void fsl_mma955x_PeriodicCallback(void *pSensorHandle);
179
180 /*
181 ** ===================================================================
182 ** Method : fsl_mag3110_i2c_3D_mag_Convert (component ISFDSA)
183 ** @brief
184 **
185 ** Parameters :
186 ** NAME - DESCRIPTION
187 ** @param
188 ** void* pSensorHandle -
189 ** @return
190 ** void -
191 ** ===================================================================
192 */
193 isf_dsa_status_t fsl_mma955x_Convert
194 (
195 volatile isf_SensorHandle_t *pSensorHandle,
196 isf_SensorDataTypes_t convertToType, isf_dsa_result_types_t resultType,
197 void *pNativeSample,
198 void *pConvertedSample,
199 int32 *numBytes
200 );
201
202 #endif
203 /* END FSL_mma955x_H_ */
204 /*!
205 ** @}
206 */
fsl_mma955x_EndData
isf_dsa_status_t fsl_mma955x_EndData(isf_SensorHandle_t *pSensorHandle)
Definition: fsl_mma955x_i2cspi_pedo.c:313
uint8
unsigned char uint8
Definition: isf_types.h:76
isf_dsa_adapter.h
fsl_mma955x_Configure
isf_dsa_status_t fsl_mma955x_Configure(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
Definition: fsl_mma955x_i2cspi_pedo.c:180
fsl_mma955x_Calibrate
isf_dsa_status_t fsl_mma955x_Calibrate(isf_SensorHandle_t *pSensorHandle, void *pCalData)
Definition: fsl_mma955x_i2cspi_pedo.c:380
mma955x_DeviceDescriptor_t::deviceSemaphore
LWSEM_STRUCT deviceSemaphore
Definition: fsl_mma955x_i2cspi_pedo.h:44
isf_bm.h
API definitions, types, and macros for the Intelligent Sensing Framework (ISF) Bus Manager (BM)...
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_mma955x_Convert
isf_dsa_status_t fsl_mma955x_Convert(volatile isf_SensorHandle_t *pSensorHandle, isf_SensorDataTypes_t convertToType, isf_dsa_result_types_t resultType, void *pNativeSample, void *pConvertedSample, int32 *numBytes)
This function converts the raw sample data to the desired output type.
Definition: fsl_mma955x_i2cspi_pedo.c:529
mma955x_DeviceDescriptor_t::token
bm_callback_token_t token
Definition: fsl_mma955x_i2cspi_pedo.h:45
mma955x_PedometerNativeData_t::timeStamp
uint32 timeStamp
Definition: fsl_mma955x_i2cspi_pedo.h:37
fsl_mma955x_PeriodicCallback
void fsl_mma955x_PeriodicCallback(void *pSensorHandle)
Definition: fsl_mma955x_i2cspi_pedo.c:440
bm_callback_token_t
uint32 bm_callback_token_t
This type defines the Bus Manager token. Each callback registered with the Bus Manager receives a uni...
Definition: isf_bm.h:79
isf_SensorTypes_t
isf_SensorTypes_t
Definition: isf_sensor_types.h:14
fsl_mma955x_Initialize
isf_dsa_status_t fsl_mma955x_Initialize(isf_SensorHandle_t *pSensorHandle)
Definition: fsl_mma955x_i2cspi_pedo.c:57
mma955x_PedometerNativeData_t::pedometerData
mma955x_PedometerData_t pedometerData
Definition: fsl_mma955x_i2cspi_pedo.h:38
fsl_mma955x_ValidateSettings
isf_dsa_status_t fsl_mma955x_ValidateSettings(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSubSettings)
Definition: fsl_mma955x_i2cspi_pedo.c:148
fsl_mma955x_Shutdown
isf_dsa_status_t fsl_mma955x_Shutdown(isf_SensorHandle_t *pSensorHandle)
Definition: fsl_mma955x_i2cspi_pedo.c:400
isf_dsa_status_t
int32 isf_dsa_status_t
This is the Sensor Manager API return type definition.
Definition: isf_dsa_adapter.h:21
mma955x_DataBuffer_t::pedometerData
mma955x_PedometerData_t pedometerData
Definition: fsl_mma955x_i2cspi_pedo.h:32
int16
signed short int int16
Definition: isf_types.h:73
mma955x_DataBuffer_t
This structure defines the Pedometer sample data buffer format.
Definition: fsl_mma955x_i2cspi_pedo.h:28
isf_dsa_result_types_t
enum isf_dsa_result_enums isf_dsa_result_types_t
mma955x_DeviceDescriptor_t::localCfgBuffer
mma955x_appConfigRegister_t localCfgBuffer
Definition: fsl_mma955x_i2cspi_pedo.h:47
mma955x_DeviceDescriptor_t::deviceHandle
dm_DeviceDescriptor_t deviceHandle
Definition: fsl_mma955x_i2cspi_pedo.h:43
isf_SensorDataTypes_t
isf_SensorDataTypes_t
Definition: isf_sensor_types.h:61
mma955x_PedometerNativeData_t
This structure defines the Pedometer Native data buffer format.
Definition: fsl_mma955x_i2cspi_pedo.h:36
isf.h
Main ISF header file. Contains code common to all ISF components.
mma955x_DataBuffer_t::timeStamp
uint32 timeStamp
Definition: fsl_mma955x_i2cspi_pedo.h:29
int32
signed long int int32
Definition: isf_types.h:74
mma955x_SupportedDataTypes
isf_SensorDataTypes_t mma955x_SupportedDataTypes[]
Definition: fsl_mma955x_i2cspi_pedo.c:29
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
mma955x_appConfigRegister_t
Definition: mma955x.h:27
mma955x.h
The mma955x.h contains the mma955x Intelligent Sensor register definitions, access macros...
fsl_mma955x_StartData
isf_dsa_status_t fsl_mma955x_StartData(isf_SensorHandle_t *pSensorHandle)
Definition: fsl_mma955x_i2cspi_pedo.c:252
mma955x_DeviceDescriptor_t::pCurrentSample
mma955x_DataBuffer_t * pCurrentSample
Definition: fsl_mma955x_i2cspi_pedo.h:46
mma955x_SupportedSensorTypes
isf_SensorTypes_t mma955x_SupportedSensorTypes[]
Supported sensor and data types for mma955x.
Definition: fsl_mma955x_i2cspi_pedo.c:28
uint32
unsigned long int uint32
Definition: isf_types.h:78
dm_DeviceDescriptor_struct
This structure defines a handle for the device.
Definition: isf_devmsg.h:61
isf_devmsg.h
isf_devmsg.h defines the API definitions and types for the Intelligent Sensing (ISF) Device Messaging...
isf_sm_types.h
The isf_sm_types.h contains the collection of type definitions used in the Sensor Manager Interface a...
mma955x_DeviceDescriptor_t
Definition: fsl_mma955x_i2cspi_pedo.h:41
mma955x_DataBuffer_t::temp
int16 temp
Definition: fsl_mma955x_i2cspi_pedo.h:31
mma955x_DeviceDescriptor_t::localCfgBufSize
uint8 localCfgBufSize
Definition: fsl_mma955x_i2cspi_pedo.h:48
dm_ChannelDescriptor_struct
This structure is a declaration of a channel descriptor type.
Definition: isf_devmsg.h:50
mma955x_DeviceDescriptor_t::cDescriptor
dm_ChannelDescriptor_t cDescriptor
Definition: fsl_mma955x_i2cspi_pedo.h:42
mma955x_PedometerData_t
Definition: mma955x.h:17
- © Freescale Semiconductor, Inc. 2016. All Rights Reserved.