ISF  2.1
Intelligent Sensing Framework for Kinetis with Processor Expert
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
FXOS8700_1.c
Go to the documentation of this file.
1 /* ###################################################################
2 ** THIS COMPONENT MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
3 ** Filename : FXOS8700_1.c
4 ** CDE edition : Community
5 ** Project : ISF_K64F_CW_PROJ
6 ** Processor : MK64FN1M0VLL12
7 ** Component : ISF_Sensor_FXOS8700_ECompass
8 ** Version : Component 01.000, Driver 01.00, CPU db: 3.00.000
9 ** Compiler : GNU C Compiler
10 ** Date/Time : 2015-03-03, 11:01, # CodeGen: 0
11 ** Abstract :
12 **
13 ** Settings :
14 ** Contents :
15 ** No public methods
16 **
17 ** For non-commercial use only.
18 (c) Copyright <company/user-name>, 2014
19 http://www.<company>.com
20 mail: info@<company>.com
21 ** ###################################################################*/
22 /*!
23 ** @file FXOS8700_1.c
24 ** @version 01.00
25 ** @brief
26 **
27 */
28 /*!
29 ** @addtogroup FXOS8700_1_module FXOS8700_1 module documentation
30 ** @{
31 */
32 
33 /* MODULE FXOS8700_1. */
34 
35 #include "FXOS8700_1.h"
36 
38 {
39  .accelFullScaleRange = 0, // Capture the accelerometer full-scale range for use in conversion routines.
40  .regCount = 30, // Number of register pairs to follow
41  .regPairs =
42  {
43  { FXOS8700_INT_SOURCE, 0 },
44  // Data configuration registers.
46  { FXOS8700_HP_FILTER_CUTOFF, (FXOS8700_SET_FIELD(PULSE_HPF_BYP,0)) | (FXOS8700_SET_FIELD(PULSE_LPF_EN,0)) | (FXOS8700_SET_FIELD(SEL,0)) },
47  // Portrait Landscape registers.
48  { FXOS8700_PL_CFG, (FXOS8700_SET_FIELD(DBCNTM,1)) | (FXOS8700_SET_FIELD(PL_EN,0)) },
49  { FXOS8700_PL_COUNT, 0 },
51  { FXOS8700_PL_THS_REG, (FXOS8700_SET_FIELD(PL_THS,16)) | (FXOS8700_SET_FIELD(HYS,4)) },
52  // Freefall/Motion Detection registers.
53  { FXOS8700_FF_MT_CFG, (FXOS8700_SET_FIELD(ELE,0)) | (FXOS8700_SET_FIELD(OAE,0)) | (FXOS8700_SET_FIELD(ZEFE,0)) | (FXOS8700_SET_FIELD(YEFE,0)) | (FXOS8700_SET_FIELD(XEFE,0)) },
54  { FXOS8700_FF_MT_THS, (FXOS8700_SET_FIELD(DBCNTM,0)) | (FXOS8700_SET_FIELD(THS,0)) },
55  { FXOS8700_FF_MT_COUNT, 0 },
56  // Transient Detection registers.
57  { FXOS8700_TRANSIENT_CFG, 0 }, // Feature disabled by default (for now).
58  // Pulse Detection registers.
59  { FXOS8700_PULSE_CFG, 0 }, // Feature is disabled by default (for now).
60  // Auto-WAKE/SLEEP Detection registers.
61  { FXOS8700_ASLP_COUNT, 0 },
62  // System and Control registers.
63  { FXOS8700_CTRL_REG1, (FXOS8700_SET_FIELD(ASLP_RATE,0)) | (FXOS8700_SET_FIELD(DR,0)) | (FXOS8700_SET_FIELD(LNOISE,0)) | (FXOS8700_SET_FIELD(F_READ,0)) },
64  { FXOS8700_CTRL_REG2, (FXOS8700_SET_FIELD(SMODS,0)) | (FXOS8700_SET_FIELD(SLPE,0)) | (FXOS8700_SET_FIELD(MODS,0)) },
65  { FXOS8700_CTRL_REG3, 0 }, // Interrupt sources disabled, Active Low, Push-Pull Open Drain (defaults).
66  { FXOS8700_CTRL_REG4, 0 }, // Interrupts disabled (defaults).
67  { FXOS8700_CTRL_REG5, 0 }, // INT2 Pin (defaults).
68  // Calibration Offset registers.
69  { FXOS8700_OFF_X, 0 },
70  { FXOS8700_OFF_Y, 0 },
71  { FXOS8700_OFF_Z, 0 },
72  { FXOS8700_M_OFF_X_MSB, 0 },
73  { FXOS8700_M_OFF_X_LSB, 0 },
74  { FXOS8700_M_OFF_Y_MSB, 0 },
75  { FXOS8700_M_OFF_Y_LSB, 0 },
76  { FXOS8700_M_OFF_Z_MSB, 0 },
77  { FXOS8700_M_OFF_Z_LSB, 0 },
78  { FXOS8700_M_CTRL_REG2, (FXOS8700_SET_FIELD(M_AUTOINC,0)) | (FXOS8700_SET_FIELD(M_RST_CNT,3)) },
79  { FXOS8700_M_CTRL_REG2, (FXOS8700_SET_FIELD(M_AUTOINC,1)) | (FXOS8700_SET_FIELD(M_RST_CNT,3)) },
80  { FXOS8700_M_CTRL_REG3, (FXOS8700_SET_FIELD(M_RAW,0)) | (FXOS8700_SET_FIELD(M_ASLP_OS,0)) | (FXOS8700_SET_FIELD(M_THS_XYZ_UPDATE,0)) }
81  }
82  };
83 
84 /*!
85  * @brief This creates the sensor adapter instance for the target sensor.
86  *
87  */
89 {
91  .devInfo.pSupportedSensorDataTypes = fxos8700_SupportedDataTypes,
92  .devInfo.nNativeDataSetSize = sizeof(fxos8700_DataBuffer_t),
93  .control.Initialize = &fsl_fxos8700_i2cspi_6D_AccMag_Initialize,
94  .control.ValidateSettings = &fsl_fxos8700_i2cspi_6D_AccMag_ValidateSettings,
95  .control.Configure = &fsl_fxos8700_i2cspi_6D_AccMag_Configure,
96  .control.StartData = &fsl_fxos8700_i2cspi_6D_AccMag_StartData,
97  .control.EndData = &fsl_fxos8700_i2cspi_6D_AccMag_EndData,
98  .control.Calibrate = &fsl_fxos8700_i2cspi_6D_AccMag_Calibrate,
99  .control.Shutdown = &fsl_fxos8700_i2cspi_6D_AccMag_Shutdown,
100  .control.Convert = &fsl_fxos8700_i2cspi_6D_AccMag_Convert
101 };
102 
104 {
105  .addrType = 0, // 7-bit addresses for now.
106  .baudRate_kbps = 400, // default baud rate (kbps).
107  .address = 30 // instance specific device address.
108 };
109 
110 /* END FXOS8700_1. */
111 
112 /*!
113 ** @}
114 */
115 /*
116 ** ###################################################################
117 **
118 ** This file was created by Processor Expert 10.3 [05.09]
119 ** for the Freescale Kinetis series of microcontrollers.
120 **
121 ** ###################################################################
122 */
#define FXOS8700_SET_FIELD(name, val)
Definition: fxos8700.h:144
This structure defines the dummy DSA data buffer format.
Information necessary to communicate with an I2C slave device.
const i2c_device_t FXOS8700_1_DeviceInfo
This allows access to the sensor communications specific configuration.
Definition: FXOS8700_1.c:103
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.
isf_SensorTypes_t fxos8700_SupportedSensorTypes[]
Supported sensor and data types for FXOS8700.
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.
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.
isf_dsa_DeviceInfoBlock_t devInfo
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 ...
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 *pNativeSample, void *pConvertedSample, int32 *numBytes)
This function coverts the raw sample data to the desired output type.
This defines the DSA adapter structure required for static initialization of the concrete instance of...
isf_SensorTypes_t * pSupportedSensorTypes
isf_SensorDataTypes_t fxos8700_SupportedDataTypes[]
const isf_dsa_Adapter_t FXOS8700_1_Adapter
This creates the sensor adapter instance for the target sensor.
Definition: FXOS8700_1.c:88
fxos8700_Sensor_Specific_Settings_t FXOS8700_1_Sensor_Specific_Config
This allows access to the sensor specific configuration for the target sensor.
Definition: FXOS8700_1.c:37
LDD_I2C_TAddrType addrType
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 . ...
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.
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...