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

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

fsl_fxos8700_i2cspi_6D_AccMag.h
Go to the documentation of this file.
1 /**
2 * @file fsl_fxos8700_i2cspi_6D_AccMag.h
3 * @brief The \b fsl_fxos8700_i2cspi_6D_AccMag.h file contains the definitions and functions supporting the FXOS8700 Sensor adapter header file
4
5 * @copyright Copyright (c) 2015, Freescale Semiconductor, Inc.
6 * @version 01.00
7 * @addtogroup fsl_fxos8700_i2cspi_6D_AccMag_module fsl_fxos8700_i2cspi_6D_AccMag module documentation
8 * @{
9 */
10
11 #ifndef FSL_FXOS8700_I2CSPI_6D_ACCMAG_H_
12 #define FSL_FXOS8700_I2CSPI_6D_ACCMAG_H_
13
14 /* Include shared modules, which are used for whole project */
15 #include "isf.h"
16
17 #include "isf_sm_types.h"
18 #include "isf_dsa_adapter.h"
19
20
21 /**
22 * @brief FXOS8700 expected WHO_AM_I value.
23 */
24 #define FXOS8700_WHO_AM_I_VALUE1 0xC7
25 #define FXOS8700_WHO_AM_I_VALUE2 0xC9
26 #define FXOS8700_WHO_AM_I_VALUE3 0xCA //WHO_AM_I value of future SPI fix parts
27
28
29 /**
30 * @brief FXOS8700 internal return codes.
31 */
32 typedef int32 fxos8700_Status_t;
33 /**
34 * @brief Enumeration for the FXOS8700 internal error codes.
35 */
36 enum fxos8700_Error_tag {
37 FXOS8700_ERROR_WHOAMI = 1, /*!< Error occurred while reading ::FXOS8700_WHO_AM_I or the value was incorrect. */
38 FXOS8700_ERROR_WAITFORACTIVE, /*!< Error occurred while attempting to put device into active mode. */
39 FXOS8700_ERROR_BURSTWRITE, /*!< Error occurred while attempting to write a block of memory to the device. */
40 FXOS8700_ERROR_CONFIG, /*!< Error occurred while attempting to configure the device. */
41 FXOS8700_ERROR_SETPOWER, /*!< Error occurred while attempting to set the power mode of the device. */
42 FX0S8700_ERRO_WRITE, /*!< Error occurred while attempting to write the registers directly. */
43 FX0S8700_ERRO_READ, /*!< Error occurred while attempting to read the registers directly. */
44 };
45 /**
46 * @brief Enumeration for the FXOS8700 power modes.
47 */
48 typedef enum fxos8700_Power_tag {
49 FXOS8700_POWER_STANDBY = 0, /*!< Device in Standby mode. Less power consumption during the mode.*/
50 FXOS8700_POWER_ACTIVE = 1, /*!< Device in active mode.*/
51 } fxos8700_Power_t;
52 /**
53 * @brief Enumeration for the FXOS8700 driver internal states.
54 */
55 typedef enum fxos8700_InternalState_tag {
56 FXOS8700_STATE_UNINTIALIZED, /*!< initial state of the device.*/
57 FXOS8700_STATE_INITIALIZED, /*!< FXOS8700_WHO_AM_I has been verified. */
58 FXOS8700_STATE_CONFIGURED, /*!< Device has been reset and configured. */
59 FXOS8700_STATE_STARTED, /*!< Device is in active mode and measuring data. */
60 } fxos8700_InternalState_t;
61
62 /*! @brief The enumeration, fxos8700_Mode_tag, defines the operational modes of the FXOS8700.*/
63 typedef enum fxos8700_Mode_tag {
64 FXOS8700_MODE_ACCELEROMETER = 0, /*<! The device is in accelerometer mode only.*/
65 FXOS8700_MODE_MAGNETOMETER = 1, /*<! The device is in magnetometer mode only.*/
66 FXOS8700_MODE_HYBRID = 3, /*<! The device is in hybrid mode, where both the
67 accelerometer and magnetometer are active.
68 The value is not sequential because this value is
69 used directly by the device to set the mode.*/
70 FXOS8700_MODE_EXTEND = 4, /*<! Extended functionality for algorithms output.It also provides algorithmic data, in addition to accelerometer and magnetometer data.*/
71 } fxos8700_Mode_t;
72 /*! @brief The enumeration, fxos8700_Range_tag, defines the acceleration range of the FXOS8700.*/
73 typedef enum fxos8700_Range_tag {
74 FXOS8700_RANGE_2G = 0, /*<!Acceleration range is 2G.*/
75 FXOS8700_RANGE_4G = 1, /*<!Acceleration range is 4G.*/
76 FXOS8700_RANGE_8G = 2, /*<!Acceleration range is 8G.*/
77 FXOS8700_RANGE_MAX = FXOS8700_RANGE_8G,
78 } fxos8700_Range_t;
79 /*! @brief The enumeration, fxos8700_Resolution_tag, defines the bit resolution of the FXOS8700.*/
80 typedef enum fxos8700_Resolution_tag {
81 FXOS8700_RESOLUTION_8_BIT = 1, /*<!8 bit resolution.*/
82 FXOS8700_RESOLUTION_NORMAL = 2, /*<!Normal resolution for the accelerometer is 14 bits and the magnetometer is 16 bits.*/
83 } fxos8700_Resolution_t;
84
85 /**
86 * @brief the structure defines the ODR table between Hybrid and normal mode of device operation.
87 */
88 typedef struct fxos8700_ODR_Table_tag{
89 uint32 periodNormalMode; /*!< Normal Mode ODR value in millisecond. */
90 uint32 periodHybridMode; /*!< Hybrid mode ODR value in millisecond. */
91 uint8 configVal; /*!< configuration value correspond to given ODR in millisecond. */
92 }fxo8700_ODR_Table_t;
93
94 /**
95 * @brief the structure defines the configuration table.
96 */
97 typedef struct fxos8700_ConfigTable_tag{
98 void *memberVariable; /*!< reference to the member variable. */
99 uint8 startAddress; /*!< start address to the member variable. */
100 uint8 size; /*!< size of the memeber to be configured. */
101 }fxos8700_ConfigTable_t;
102
103 /*! @brief This structure defines the dummy DSA data buffer format.*/
104 typedef struct {
105 uint32 timeStamp; /*!< The time stamp for the data packet.*/
106 int16 accel[3]; /*!< The accelerometer data */
107 int16 mag[3]; /*!< The magnetometer data */
108 uint8 addr; /*!< The device "address" can uniquely identify the sensor */
109 } fxos8700_DataBuffer_t;
110
111 /*! @brief Supported sensor and data types for fxos8700 */
112 extern isf_SensorTypes_t fxos8700_SupportedSensorTypes[];
113 extern isf_SensorDataTypes_t fxos8700_SupportedDataTypes[];
114
115
116 /*
117 ** ===================================================================
118 ** Method : fsl_fxos8700_i2cspi_6D_AccMag_Initialize
119 ** @brief
120 **
121 ** Parameters :
122 ** NAME - DESCRIPTION
123 ** @param
124 ** isf_SensorHandle_t *pSensorHandle
125 ** @return
126 ** isf_dsa_status_t -
127 ** ===================================================================
128 */
129 isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_Initialize(isf_SensorHandle_t *pSensorHandle);
130
131 /*
132 ** ===================================================================
133 ** Method : fsl_fxos8700_i2cspi_6D_AccMag_ValidateSettings
134 ** @brief
135 **
136 ** Parameters :
137 ** NAME - DESCRIPTION
138 ** @param
139 ** isf_SensorHandle_t *pSensorHandle
140 ** @param
141 ** isf_SubscriptionSettings_t *pSettings
142 ** @return
143 ** isf_dsa_status_t -
144 ** ===================================================================
145 */
146 isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_ValidateSettings(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings);
147
148 /*
149 ** ===================================================================
150 ** Method : fsl_fxos8700_i2cspi_6D_AccMag_Configure
151 ** @brief
152 **
153 ** Parameters :
154 ** NAME - DESCRIPTION
155 ** @param
156 ** isf_SensorHandle_t *pSensorHandle
157 ** @param
158 ** isf_SubscriptionSettings_t *pConfigSettings
159 ** @return
160 ** isf_dsa_status_t -
161 ** ===================================================================
162 */
163 isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_Configure(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings);
164
165 /*
166 ** ===================================================================
167 ** Method : fsl_fxos8700_i2cspi_6D_AccMag_StartData
168 ** @brief
169 **
170 ** Parameters :
171 ** NAME - DESCRIPTION
172 ** @param
173 ** isf_SensorHandle_t *pSensorHandle
174 ** @return
175 ** isf_dsa_status_t -
176 ** ===================================================================
177 */
178 isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_StartData(isf_SensorHandle_t *pSensorHandle);
179
180 /*
181 ** ===================================================================
182 ** Method : fsl_fxos8700_i2cspi_6D_AccMag_EndData
183 ** @brief
184 **
185 ** Parameters :
186 ** NAME - DESCRIPTION
187 ** @param
188 ** isf_SensorHandle_t *pSensorHandle
189 ** @return
190 ** isf_dsa_status_t -
191 ** ===================================================================
192 */
193 isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_EndData(isf_SensorHandle_t *pSensorHandle);
194
195 /*
196 ** ===================================================================
197 ** Method : fsl_fxos8700_i2cspi_6D_AccMag_Calibrate
198 ** @brief
199 **
200 ** Parameters :
201 ** NAME - DESCRIPTION
202 ** @param
203 ** isf_SensorHandle_t *pSensorHandle
204 ** @return
205 ** isf_dsa_status_t -
206 ** ===================================================================
207 */
208 isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_Calibrate(isf_SensorHandle_t *pSensorHandle, void *pCalData );
209
210 /*
211 ** ===================================================================
212 ** Method : fsl_fxos8700_i2cspi_6D_AccMag_Shutdown
213 ** @brief
214 **
215 ** Parameters :
216 ** NAME - DESCRIPTION
217 ** @param
218 ** isf_SensorHandle_t *pSensorHandle
219 ** @return
220 ** isf_dsa_status_t -
221 ** ===================================================================
222 */
223 isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_Shutdown(isf_SensorHandle_t *pSensorHandle );
224
225 /*
226 ** ===================================================================
227 ** Method : fsl_fxos8700_i2cspi_6D_AccMag_Convert
228 ** @brief The DSA interface conversion function to convert native samples to specified standard types
229 **
230 ** Parameters :
231 ** NAME - DESCRIPTION
232 ** @param
233 ** isf_SensorHandle_t *pSensorHandle
234 ** @return
235 ** void -
236 ** ===================================================================
237 */
238 isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_Convert(volatile isf_SensorHandle_t *pSensorHandle, isf_SensorDataTypes_t convertToType, isf_dsa_result_types_t resultType, void *nativeSample, void *convertedSample, int32 *numBytes );
239 /*
240 ** ===================================================================
241 ** Method : fsl_fxos8700_i2cspi_6D_AccMag_PeriodicCallback (component ISFDSA)
242 ** @brief
243 **
244 ** Parameters :
245 ** NAME - DESCRIPTION
246 ** @param
247 ** isf_SensorHandle_t *pSensorHandle
248 ** @return
249 ** void -
250 ** ===================================================================
251 */
252 void fsl_fxos8700_i2cspi_6D_AccMag_PeriodicCallback(void* pSensorHandle);
253
254 /* END FSL_FXOS8700_I2CSPI_6D_ACCMAG. */
255 #endif
256 /* ifndef FSL_FXOS8700_I2CSPI_6D_ACCMAG_H_ */
257 /*!
258 ** @}
259 */
FXOS8700_STATE_CONFIGURED
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:58
FX0S8700_ERRO_WRITE
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:42
fxos8700_ODR_Table_tag::periodNormalMode
uint32 periodNormalMode
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:89
uint8
unsigned char uint8
Definition: isf_types.h:76
fxos8700_Status_t
int32 fxos8700_Status_t
FXOS8700 internal return codes.
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:32
isf_dsa_adapter.h
fxos8700_DataBuffer_t
This structure defines the dummy DSA data buffer format.
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:104
fsl_fxos8700_i2cspi_6D_AccMag_PeriodicCallback
void fsl_fxos8700_i2cspi_6D_AccMag_PeriodicCallback(void *pSensorHandle)
The callback function for the Bus Manager(BM).
Definition: fsl_fxos8700_i2cspi_6D_AccMag.c:587
FXOS8700_STATE_STARTED
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:59
FXOS8700_RESOLUTION_8_BIT
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:81
fxos8700_Range_tag
fxos8700_Range_tag
The enumeration, fxos8700_Range_tag, defines the acceleration range of the FXOS8700.
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:73
fxos8700_ConfigTable_tag
the structure defines the configuration table.
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:97
FXOS8700_ERROR_CONFIG
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:40
FXOS8700_ERROR_SETPOWER
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:41
FXOS8700_MODE_ACCELEROMETER
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:64
FXOS8700_ERROR_WAITFORACTIVE
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:38
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_fxos8700_i2cspi_6D_AccMag_Initialize
isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_Initialize(isf_SensorHandle_t *pSensorHandle)
This is the concrete implementation of the FXOS8700 sensor adapter initialization.
Definition: fsl_fxos8700_i2cspi_6D_AccMag.c:151
fxos8700_Power_t
enum fxos8700_Power_tag fxos8700_Power_t
Enumeration for the FXOS8700 power modes.
fxos8700_InternalState_t
enum fxos8700_InternalState_tag fxos8700_InternalState_t
Enumeration for the FXOS8700 driver internal states.
fxos8700_ConfigTable_tag::memberVariable
void * memberVariable
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:98
FXOS8700_MODE_EXTEND
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:70
fxos8700_DataBuffer_t::timeStamp
uint32 timeStamp
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:105
isf_SensorTypes_t
isf_SensorTypes_t
Definition: isf_sensor_types.h:14
fxos8700_Range_t
enum fxos8700_Range_tag fxos8700_Range_t
The enumeration, fxos8700_Range_tag, defines the acceleration range of the FXOS8700.
FXOS8700_RESOLUTION_NORMAL
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:82
FXOS8700_STATE_INITIALIZED
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:57
fxos8700_SupportedSensorTypes
isf_SensorTypes_t fxos8700_SupportedSensorTypes[]
Supported sensor and data types for fxos8700.
Definition: fsl_fxos8700_i2cspi_6D_AccMag.c:53
FXOS8700_POWER_STANDBY
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:49
fxos8700_DataBuffer_t::addr
uint8 addr
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:108
fsl_fxos8700_i2cspi_6D_AccMag_Configure
isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_Configure(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
This is the concrete implementation of the FXOS8700 sensor adapter for configuration.
Definition: fsl_fxos8700_i2cspi_6D_AccMag.c:282
fsl_fxos8700_i2cspi_6D_AccMag_StartData
isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_StartData(isf_SensorHandle_t *pSensorHandle)
This is the concrete implementation of the FXOS8700 sensor adapter for start Data.
Definition: fsl_fxos8700_i2cspi_6D_AccMag.c:411
FXOS8700_ERROR_WHOAMI
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:37
isf_dsa_status_t
int32 isf_dsa_status_t
This is the Sensor Manager API return type definition.
Definition: isf_dsa_adapter.h:21
fsl_fxos8700_i2cspi_6D_AccMag_Calibrate
isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_Calibrate(isf_SensorHandle_t *pSensorHandle, void *pCalData)
This is the concrete implementation of the FXOS8700 sensor adapter for calibration ...
Definition: fsl_fxos8700_i2cspi_6D_AccMag.c:544
fxos8700_InternalState_tag
fxos8700_InternalState_tag
Enumeration for the FXOS8700 driver internal states.
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:55
int16
signed short int int16
Definition: isf_types.h:73
fsl_fxos8700_i2cspi_6D_AccMag_Convert
isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_Convert(volatile isf_SensorHandle_t *pSensorHandle, isf_SensorDataTypes_t convertToType, isf_dsa_result_types_t resultType, void *nativeSample, void *convertedSample, int32 *numBytes)
This function coverts the raw sample data to the desired output type.
Definition: fsl_fxos8700_i2cspi_6D_AccMag.c:735
isf_dsa_result_types_t
enum isf_dsa_result_enums isf_dsa_result_types_t
FX0S8700_ERRO_READ
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:43
fxos8700_SupportedDataTypes
isf_SensorDataTypes_t fxos8700_SupportedDataTypes[]
Definition: fsl_fxos8700_i2cspi_6D_AccMag.c:54
isf_SensorDataTypes_t
isf_SensorDataTypes_t
Definition: isf_sensor_types.h:61
fxos8700_Error_tag
fxos8700_Error_tag
Enumeration for the FXOS8700 internal error codes.
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:36
FXOS8700_POWER_ACTIVE
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:50
FXOS8700_RANGE_2G
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:74
isf.h
Main ISF header file. Contains code common to all ISF components.
int32
signed long int int32
Definition: isf_types.h:74
FXOS8700_STATE_UNINTIALIZED
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:56
fxos8700_Mode_t
enum fxos8700_Mode_tag fxos8700_Mode_t
The enumeration, fxos8700_Mode_tag, defines the operational modes of the FXOS8700.
fxos8700_ODR_Table_tag::configVal
uint8 configVal
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:91
FXOS8700_ERROR_BURSTWRITE
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:39
fxos8700_ConfigTable_t
struct fxos8700_ConfigTable_tag fxos8700_ConfigTable_t
the structure defines the configuration table.
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
fxos8700_ConfigTable_tag::size
uint8 size
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:100
FXOS8700_RANGE_MAX
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:77
fxos8700_Power_tag
fxos8700_Power_tag
Enumeration for the FXOS8700 power modes.
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:48
fsl_fxos8700_i2cspi_6D_AccMag_Shutdown
isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_Shutdown(isf_SensorHandle_t *pSensorHandle)
This is the concrete implementation of the FXOS8700 sensor adapter for shutdown . ...
Definition: fsl_fxos8700_i2cspi_6D_AccMag.c:561
fxo8700_ODR_Table_t
struct fxos8700_ODR_Table_tag fxo8700_ODR_Table_t
the structure defines the ODR table between Hybrid and normal mode of device operation.
fxos8700_ODR_Table_tag
the structure defines the ODR table between Hybrid and normal mode of device operation.
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:88
uint32
unsigned long int uint32
Definition: isf_types.h:78
fsl_fxos8700_i2cspi_6D_AccMag_EndData
isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_EndData(isf_SensorHandle_t *pSensorHandle)
This is the concrete implementation of the FXOS8700 sensor adapter for End Data.
Definition: fsl_fxos8700_i2cspi_6D_AccMag.c:478
isf_sm_types.h
The isf_sm_types.h contains the collection of type definitions used in the Sensor Manager Interface a...
fxos8700_Resolution_t
enum fxos8700_Resolution_tag fxos8700_Resolution_t
The enumeration, fxos8700_Resolution_tag, defines the bit resolution of the FXOS8700.
FXOS8700_RANGE_4G
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:75
FXOS8700_RANGE_8G
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:76
FXOS8700_MODE_HYBRID
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:66
FXOS8700_MODE_MAGNETOMETER
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:65
fxos8700_Resolution_tag
fxos8700_Resolution_tag
The enumeration, fxos8700_Resolution_tag, defines the bit resolution of the FXOS8700.
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:80
fsl_fxos8700_i2cspi_6D_AccMag_ValidateSettings
isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_ValidateSettings(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
This is the concrete implementation of the FXOS8700 sensor adapter for validating current settings...
Definition: fsl_fxos8700_i2cspi_6D_AccMag.c:241
fxos8700_ODR_Table_tag::periodHybridMode
uint32 periodHybridMode
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:90
fxos8700_Mode_tag
fxos8700_Mode_tag
The enumeration, fxos8700_Mode_tag, defines the operational modes of the FXOS8700.
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:63
fxos8700_ConfigTable_tag::startAddress
uint8 startAddress
Definition: fsl_fxos8700_i2cspi_6D_AccMag.h:99
- © Freescale Semiconductor, Inc. 2016. All Rights Reserved.