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

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

FXLS8471_2.c
Go to the documentation of this file.
1 /* ###################################################################
2 ** This component module is generated by Processor Expert. Do not modify it.
3 ** Filename : FXLS8471_2.c
4 ** CDE edition : Community
5 ** Project : ISF2P2_K64F_MQX_PROJ
6 ** Processor : MK64FN1M0VLL12
7 ** Component : ISF_KSDK_Sensor_FXLS8471_Accelerometer
8 ** Version : Component 02.500, Driver 01.00, CPU db: 3.00.000
9 ** Repository : My Components
10 ** Compiler : GNU C Compiler
11 ** Date/Time : 2016-10-06, 13:38, # CodeGen: 0
12 ** Abstract :
13 **
14 ** Settings :
15 ** Component Name : FXLS8471_2
16 ** Device Address : 0x1E
17 ** Comm Channel : I2C1
18 ** Allowed Full-scale Ranges : ±0.244 mg/LSB
19 ** Sensor Specific Configuration : yes
20 ** XYZ_DATA_CFG : yes
21 ** HPF_OUT : 0
22 ** FS : 0
23 ** HP_FILTER_CUTOFF : yes
24 ** PULSE_HPF_BYP : 0
25 ** PULSE_LPF_EN : 0
26 ** SEL : 0
27 ** PL_CFG : yes
28 ** DBCNTM : 1
29 ** PL_EN : 0
30 ** PL_COUNT : 0
31 ** PL_BF_ZCOMP : yes
32 ** BKFR : 2
33 ** ZLOCK : 4
34 ** PL_THS_REG : yes
35 ** PL_THS : 16
36 ** HYS : 4
37 ** A_FFMT_CFG : yes
38 ** A_FFMT_ELE : 0
39 ** A_FFMT_OAE : 0
40 ** A_FFMT_ZEFE : 0
41 ** A_FFMT_YEFE : 0
42 ** A_FFMT_XEFE : 0
43 ** A_FFMT_THS : yes
44 ** A_FFMT_DBCNTM : 0
45 ** THS : 0
46 ** A_FFMT_COUNT : 0
47 ** PULSE_THSX : 0
48 ** PULSE_THSY : 0
49 ** PULSE_THSZ : 0
50 ** ASLP_COUNT : 0
51 ** CTRL_REG1 : yes
52 ** ASLP_RATE : 0
53 ** DR : 1
54 ** LNOISE : 0
55 ** CTRL_REG2 : yes
56 ** SMODS : 0
57 ** SLPE : 0
58 ** MODS : 0
59 ** OFF_X : 0
60 ** OFF_Y : 0
61 ** OFF_Z : 0
62 ** A_VECM_CFG : yes
63 ** A_VECM_ELE : 0
64 ** A_VECM_INITM : 0
65 ** A_VECM_UPDM : 0
66 ** A_VECM_EN : 0
67 ** A_VECM_THS : yes
68 ** A_VECM_DBCNTM : 0
69 ** A_VECM_THS : 0
70 ** A_VECM_CNT : 0
71 ** A_VECM_INITX : 0
72 ** A_VECM_INITY : 0
73 ** A_VECM_INITZ : 0
74 ** A_FFMT_THS_X : yes
75 ** A_FFMT_THS_XYZ_EN : 0
76 ** A_FFMT_THS_X : 0
77 ** A_FFMT_THS_Y : 0
78 ** A_FFMT_THS_Z : 0
79 ** Contents :
80 ** No public methods
81 **
82 ** For non-commercial use only.
83 (c) Copyright <company/user-name>, 2015,
84 http://www.<company>.com
85 mail: info@<company>.com
86 ** ###################################################################*/
87 /*!
88 ** @file FXLS8471_2.c
89 ** @version 01.00
90 ** @brief
91 **
92 */
93 /*!
94 ** @addtogroup FXLS8471_2_module FXLS8471_2 module documentation
95 ** @{
96 */
97
98 /* MODULE FXLS8471_2. */
99
100 #include "FXLS8471_2.h"
101 #include "isf_target.h"
102 #include "isf.h"
103 #include "isf_util.h"
104
105
106 fxls8471_Sensor_Specific_Settings_t FXLS8471_2_Sensor_Specific_Config =
107 {
108 .accelFullScaleRange = 0, // Capture the accelerometer full-scale range for use in conversion routines.
109 .regCount = 41, // Number of register pairs to follow
110 .regPairs =
111 {
112 { FXLS8471_F_SETUP, 0 },
113 { FXLS8471_TRIG_CFG, 0 },
114 // Data configuration registers.
115 { FXLS8471_XYZ_DATA_CFG, (FXLS8471_SET_FIELD(HPF_OUT,0)) | (FXLS8471_SET_FIELD(FS,0)) },
116 { FXLS8471_HP_FILTER_CUTOFF, (FXLS8471_SET_FIELD(PULSE_HPF_BYP,0)) | (FXLS8471_SET_FIELD(PULSE_LPF_EN,0)) | (FXLS8471_SET_FIELD(SEL,0)) },
117 // Portrait Landscape registers.
118 { FXLS8471_PL_CFG, (FXLS8471_SET_FIELD(DBCNTM,1)) | (FXLS8471_SET_FIELD(PL_EN,0)) },
119 { FXLS8471_PL_COUNT, 0 },
120 { FXLS8471_PL_BF_ZCOMP, (FXLS8471_SET_FIELD(BKFR,1)) | (FXLS8471_SET_FIELD(ZLOCK,4)) },
121 { FXLS8471_PL_THS, (FXLS8471_SET_FIELD(PL_THS,16)) | (FXLS8471_SET_FIELD(HYS,4)) },
122 { FXLS8471_PULSE_THSX, 0 },
123 { FXLS8471_PULSE_THSY, 0 },
124 { FXLS8471_PULSE_THSZ, 0 },
125 // Freefall/Motion Detection registers.
126 { FXLS8471_FFMT_CFG, (FXLS8471_SET_FIELD(A_FFMT_ELE,0)) | (FXLS8471_SET_FIELD(A_FFMT_OAE,0)) | (FXLS8471_SET_FIELD(A_FFMT_ZEFE,0)) | (FXLS8471_SET_FIELD(A_FFMT_YEFE,0)) | (FXLS8471_SET_FIELD(A_FFMT_XEFE,0)) },
127 { FXLS8471_FFMT_THS, (FXLS8471_SET_FIELD(A_FFMT_DBCNTM,0)) | (FXLS8471_SET_FIELD(A_FFMT_THS,0)) },
128 { FXLS8471_A_FFMT_THS_X_MSB, (FXLS8471_SET_FIELD(A_FFMT_THS_XYZ_EN,0) | 0 ) },
129 { FXLS8471_A_FFMT_THS_X_LSB, 0 },
130 { FXLS8471_A_FFMT_THS_Y_MSB, 0 },
131 { FXLS8471_A_FFMT_THS_Y_LSB, 0 },
132 { FXLS8471_A_FFMT_THS_Z_MSB, 0 },
133 { FXLS8471_A_FFMT_THS_Z_LSB, 0 },
134 { FXLS8471_FFMT_COUNT, 0 },
135 // Transient Detection registers.
136 { FXLS8471_TRANSIENT_CFG, 0 }, // Feature disabled by default (for now).
137 // Pulse Detection registers.
138 { FXLS8471_PULSE_CFG, 0 }, // Feature is disabled by default (for now).
139 // Auto-WAKE/SLEEP Detection registers.
140 { FXLS8471_ASLP_COUNT, 0 },
141 // System and Control registers.
142 { FXLS8471_CTRL_REG1, (FXLS8471_SET_FIELD(ASLP_RATE,0)) | (FXLS8471_SET_FIELD(DR,0)) | (FXLS8471_SET_FIELD(LNOISE,0)) | (FXLS8471_SET_FIELD(FREAD,0)) },
143 { FXLS8471_CTRL_REG2, (FXLS8471_SET_FIELD(SMODS,0)) | (FXLS8471_SET_FIELD(SLPE,0)) | (FXLS8471_SET_FIELD(MODS,0)) },
144 { FXLS8471_CTRL_REG3, 0 }, // Interrupt sources disabled, Active Low, Push-Pull Open Drain (defaults).
145 { FXLS8471_CTRL_REG4, 0 }, // Interrupts disabled (defaults).
146 { FXLS8471_CTRL_REG5, 0 }, // INT2 Pin (defaults).
147 // Calibration Offset registers.
148 { FXLS8471_OFF_X, 0 },
149 { FXLS8471_OFF_Y, 0 },
150 { FXLS8471_OFF_Z, 0 },
151 // Vector Magnitude Configuration registers.
152 { FXLS8471_A_VECM_CFG, (FXLS8471_SET_FIELD(A_VECM_ELE,0)) | (FXLS8471_SET_FIELD(A_VECM_INITM,0)) | (FXLS8471_SET_FIELD(A_VECM_UPDM,0)) | (FXLS8471_SET_FIELD(A_VECM_EN,0)) },
153 { FXLS8471_A_VECM_THS_MSB, (FXLS8471_SET_FIELD(A_VECM_DBCNTM,0)) | (FXLS8471_SET_FIELD(A_VECM_THS_MSB, 0)) },
154 { FXLS8471_A_VECM_THS_LSB, 0 },
155 { FXLS8471_A_VECM_CNT, 0 },
156 { FXLS8471_A_VECM_INITX_MSB, 0 },
157 { FXLS8471_A_VECM_INITX_LSB, 0 },
158 { FXLS8471_A_VECM_INITY_MSB, 0 },
159 { FXLS8471_A_VECM_INITY_LSB, 0 },
160 { FXLS8471_A_VECM_INITZ_MSB, 0 },
161 { FXLS8471_A_VECM_INITZ_LSB, 0 }
162 }
163 };
164
165 /*!
166 * @brief This creates the sensor adapter instance for the target sensor.
167 *
168 */
169 const isf_dsa_Adapter_t FXLS8471_2_Adapter =
170 {
171 .devInfo.pSupportedSensorTypes = fxls8471_SupportedSensorTypes,
172 .devInfo.pSupportedSensorDataTypes = fxls8471_SupportedDataTypes,
173 .devInfo.nNativeDataSetSize = sizeof(fxls8471_DataBuffer_t),
174 .control.Initialize = &fsl_fxls8471_i2cspi_3D_accel_Initialize,
175 .control.ValidateSettings = &fsl_fxls8471_i2cspi_3D_accel_ValidateSettings,
176 .control.Configure = &fsl_fxls8471_i2cspi_3D_accel_Configure,
177 .control.StartData = &fsl_fxls8471_i2cspi_3D_accel_StartData,
178 .control.EndData = &fsl_fxls8471_i2cspi_3D_accel_EndData,
179 .control.Calibrate = &fsl_fxls8471_i2cspi_3D_accel_Calibrate,
180 .control.Shutdown = &fsl_fxls8471_i2cspi_3D_accel_Shutdown,
181 .control.Convert = &fsl_fxls8471_i2cspi_3D_accel_Convert
182 };
183
184 const i2c_device_t FXLS8471_2_DeviceInfo =
185 {
186 .baudRate_kbps = 400, // default baud rate (kbps).
187 .address = 30 // instance specific device address.
188 };
189
190
191
192 /* END FXLS8471_2. */
193
194 /*!
195 ** @}
196 */
197 /*
198 ** ###################################################################
199 **
200 ** This file was created by Processor Expert 10.5 [05.21]
201 ** for the Freescale Kinetis series of microcontrollers.
202 **
203 ** ###################################################################
204 */
FXLS8471_A_VECM_CFG
Definition: fxls8471.h:68
isf_target.h
ISF board support header files.
FXLS8471_A_VECM_THS_MSB
Definition: fxls8471.h:69
FXLS8471_A_FFMT_THS_Y_LSB
Definition: fxls8471.h:82
FXLS8471_A_VECM_INITX_LSB
Definition: fxls8471.h:73
FXLS8471_A_VECM_INITY_LSB
Definition: fxls8471.h:75
FXLS8471_A_VECM_INITY_MSB
Definition: fxls8471.h:74
fsl_fxls8471_i2cspi_3D_accel_EndData
isf_dsa_status_t fsl_fxls8471_i2cspi_3D_accel_EndData(isf_SensorHandle_t *pSensorHandle)
Definition: fsl_fxls8471_i2cspi_3D_accel.c:377
fsl_fxls8471_i2cspi_3D_accel_Shutdown
isf_dsa_status_t fsl_fxls8471_i2cspi_3D_accel_Shutdown(isf_SensorHandle_t *pSensorHandle)
Definition: fsl_fxls8471_i2cspi_3D_accel.c:464
FXLS8471_A_VECM_THS_LSB
Definition: fxls8471.h:70
fxls8471_Sensor_Specific_Settings_t
Definition: fxls8471.h:477
FXLS8471_CTRL_REG2
Definition: fxls8471.h:60
FXLS8471_A_FFMT_THS_Z_LSB
Definition: fxls8471.h:84
FXLS8471_A_FFMT_THS_Y_MSB
Definition: fxls8471.h:81
FXLS8471_A_VECM_INITX_MSB
Definition: fxls8471.h:72
FXLS8471_PL_BF_ZCOMP
Definition: fxls8471.h:39
FXLS8471_A_VECM_INITZ_MSB
Definition: fxls8471.h:76
FXLS8471_PULSE_THSY
Definition: fxls8471.h:53
FXLS8471_SET_FIELD
#define FXLS8471_SET_FIELD(name, val)
Definition: fxls8471.h:96
fsl_fxls8471_i2cspi_3D_accel_Convert
isf_dsa_status_t fsl_fxls8471_i2cspi_3D_accel_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_fxls8471_i2cspi_3D_accel.c:590
FXLS8471_XYZ_DATA_CFG
Definition: fxls8471.h:34
FXLS8471_OFF_X
Definition: fxls8471.h:64
fsl_fxls8471_i2cspi_3D_accel_Configure
isf_dsa_status_t fsl_fxls8471_i2cspi_3D_accel_Configure(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
Definition: fsl_fxls8471_i2cspi_3D_accel.c:224
isf_dsa_Adapter_st::devInfo
isf_dsa_DeviceInfoBlock_t devInfo
Definition: isf_dsa_adapter.h:146
FXLS8471_CTRL_REG4
Definition: fxls8471.h:62
FXLS8471_A_FFMT_THS_X_MSB
Definition: fxls8471.h:79
fxls8471_SupportedSensorTypes
isf_SensorTypes_t fxls8471_SupportedSensorTypes[]
Supported sensor and data types for FXLS8471.
Definition: fsl_fxls8471_i2cspi_3D_accel.c:67
FXLS8471_A_FFMT_THS_X_LSB
Definition: fxls8471.h:80
FXLS8471_2.h
isf_util.h
The isf_util.h file contains the utility method declarations and macros.
fsl_fxls8471_i2cspi_3D_accel_Calibrate
isf_dsa_status_t fsl_fxls8471_i2cspi_3D_accel_Calibrate(isf_SensorHandle_t *pSensorHandle, void *pCalData)
Definition: fsl_fxls8471_i2cspi_3D_accel.c:444
isf_dsa_Adapter_st
This defines the DSA adapter structure required for static initialization of the concrete instance of...
Definition: isf_dsa_adapter.h:144
FXLS8471_HP_FILTER_CUTOFF
Definition: fxls8471.h:35
FXLS8471_PL_CFG
Definition: fxls8471.h:37
isf_dsa_DeviceInfoBlock_st::pSupportedSensorTypes
isf_SensorTypes_t * pSupportedSensorTypes
Definition: isf_dsa_adapter.h:70
FXLS8471_TRIG_CFG
Definition: fxls8471.h:30
FXLS8471_OFF_Y
Definition: fxls8471.h:65
FXLS8471_A_VECM_INITZ_LSB
Definition: fxls8471.h:77
FXLS8471_CTRL_REG5
Definition: fxls8471.h:63
fxls8471_SupportedDataTypes
isf_SensorDataTypes_t fxls8471_SupportedDataTypes[]
Definition: fsl_fxls8471_i2cspi_3D_accel.c:68
FXLS8471_PULSE_CFG
Definition: fxls8471.h:50
isf.h
Main ISF header file. Contains code common to all ISF components.
FXLS8471_FFMT_THS
Definition: fxls8471.h:43
fsl_fxls8471_i2cspi_3D_accel_ValidateSettings
isf_dsa_status_t fsl_fxls8471_i2cspi_3D_accel_ValidateSettings(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
Definition: fsl_fxls8471_i2cspi_3D_accel.c:195
FXLS8471_PL_THS
Definition: fxls8471.h:40
FXLS8471_F_SETUP
Definition: fxls8471.h:29
FXLS8471_PULSE_THSZ
Definition: fxls8471.h:54
FXLS8471_PULSE_THSX
Definition: fxls8471.h:52
fsl_fxls8471_i2cspi_3D_accel_StartData
isf_dsa_status_t fsl_fxls8471_i2cspi_3D_accel_StartData(isf_SensorHandle_t *pSensorHandle)
Definition: fsl_fxls8471_i2cspi_3D_accel.c:315
FXLS8471_A_FFMT_THS_Z_MSB
Definition: fxls8471.h:83
fxls8471_DataBuffer_t
This structure defines the dummy DSA data buffer format.
Definition: fsl_fxls8471_i2cspi_3D_accel.h:48
fxls8471_Sensor_Specific_Settings_t::accelFullScaleRange
uint8 accelFullScaleRange
Definition: fxls8471.h:479
FXLS8471_A_VECM_CNT
Definition: fxls8471.h:71
FXLS8471_TRANSIENT_CFG
Definition: fxls8471.h:46
FXLS8471_PL_COUNT
Definition: fxls8471.h:38
FXLS8471_CTRL_REG1
Definition: fxls8471.h:59
FXLS8471_CTRL_REG3
Definition: fxls8471.h:61
FXLS8471_2_DeviceInfo
const i2c_device_t FXLS8471_2_DeviceInfo
This allows access to the sensor communications specific configuration.
Definition: FXLS8471_2.c:184
FXLS8471_OFF_Z
Definition: fxls8471.h:66
FXLS8471_FFMT_COUNT
Definition: fxls8471.h:44
FXLS8471_2_Adapter
const isf_dsa_Adapter_t FXLS8471_2_Adapter
This creates the sensor adapter instance for the target sensor.
Definition: FXLS8471_2.c:169
FXLS8471_2_Sensor_Specific_Config
fxls8471_Sensor_Specific_Settings_t FXLS8471_2_Sensor_Specific_Config
This allows access to the sensor specific configuration for the target sensor.
Definition: FXLS8471_2.c:106
FXLS8471_ASLP_COUNT
Definition: fxls8471.h:58
fsl_fxls8471_i2cspi_3D_accel_Initialize
isf_dsa_status_t fsl_fxls8471_i2cspi_3D_accel_Initialize(isf_SensorHandle_t *pSensorHandle)
Definition: fsl_fxls8471_i2cspi_3D_accel.c:101
FXLS8471_FFMT_CFG
Definition: fxls8471.h:41
- © Freescale Semiconductor, Inc. 2016. All Rights Reserved.