ISF  2.2 rev 5
Intelligent Sensing Framework for Kinetis with Processor Expert
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. */
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. */
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 */
51 
52 /*! @brief Supported sensor and data types for mma955x */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
isf_dsa_status_t fsl_mma955x_EndData(isf_SensorHandle_t *pSensorHandle)
unsigned char uint8
Definition: isf_types.h:76
isf_dsa_status_t fsl_mma955x_Configure(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
isf_dsa_status_t fsl_mma955x_Calibrate(isf_SensorHandle_t *pSensorHandle, void *pCalData)
API definitions, types, and macros for the Intelligent Sensing Framework (ISF) Bus Manager (BM)...
This defines the DSA sensor device handle structure used to invoke the adapter access functions...
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.
void fsl_mma955x_PeriodicCallback(void *pSensorHandle)
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_dsa_status_t fsl_mma955x_Initialize(isf_SensorHandle_t *pSensorHandle)
mma955x_PedometerData_t pedometerData
isf_dsa_status_t fsl_mma955x_ValidateSettings(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSubSettings)
isf_dsa_status_t fsl_mma955x_Shutdown(isf_SensorHandle_t *pSensorHandle)
int32 isf_dsa_status_t
This is the Sensor Manager API return type definition.
mma955x_PedometerData_t pedometerData
signed short int int16
Definition: isf_types.h:73
This structure defines the Pedometer sample data buffer format.
enum isf_dsa_result_enums isf_dsa_result_types_t
mma955x_appConfigRegister_t localCfgBuffer
dm_DeviceDescriptor_t deviceHandle
isf_SensorDataTypes_t
This structure defines the Pedometer Native data buffer format.
Main ISF header file. Contains code common to all ISF components.
signed long int int32
Definition: isf_types.h:74
isf_SensorDataTypes_t mma955x_SupportedDataTypes[]
This defines the DSA sensor configuration parameter structure configuring the sensor settings by a su...
The mma955x.h contains the mma955x Intelligent Sensor register definitions, access macros...
isf_dsa_status_t fsl_mma955x_StartData(isf_SensorHandle_t *pSensorHandle)
mma955x_DataBuffer_t * pCurrentSample
isf_SensorTypes_t mma955x_SupportedSensorTypes[]
Supported sensor and data types for mma955x.
unsigned long int uint32
Definition: isf_types.h:78
This structure defines a handle for the device.
Definition: isf_devmsg.h:61
isf_devmsg.h defines the API definitions and types for the Intelligent Sensing (ISF) Device Messaging...
The isf_sm_types.h contains the collection of type definitions used in the Sensor Manager Interface a...
This structure is a declaration of a channel descriptor type.
Definition: isf_devmsg.h:50
dm_ChannelDescriptor_t cDescriptor