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

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

FXLC95000_1.c
Go to the documentation of this file.
1 /* ###################################################################
2 ** This component module is generated by Processor Expert. Do not modify it.
3 ** Filename : FXLC95000_1.c
4 ** CDE edition : Standard
5 ** Project : ISF2P2_K64F_MQX_PROJ
6 ** Processor : MK64FN1M0VLL12
7 ** Component : ISF_KSDK_Sensor_FXLC95000_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 : FXLC95000_1
16 ** Device Address : 0x4C
17 ** Comm Channel : I2C1
18 ** Allowed Sample Rates : 800Hz
19 ** Allowed Full-scale Range : ±2 g
20 ** Contents :
21 ** No public methods
22 **
23 ** (c) Copyright Freescale Semiconductor Inc, 2015
24 http://www.freescale.com
25 ** ###################################################################*/
26 /*!
27 ** @file FXLC95000_1.c
28 ** @version 01.00
29 ** @brief
30 **
31 */
32 /*!
33 ** @addtogroup FXLC95000_1_module FXLC95000_1 module documentation
34 ** @{
35 */
36
37 /* MODULE FXLC95000_1. */
38
39 #include "FXLC95000_1.h"
40 #include "isf_util.h"
41
42 uint8 FXLC95000_1_ConfigRegisterBuffer[FXLC95000_1_CONFIG_REGISTER_SIZE];
43
44 const uint8 const BootToFlash[] = { 0x29, 0x00, 0xFF, 0xFF, 0xFF, 0xFF };
45 const uint8 const ConfigureMBoxCmd1[] = { 0x01, 0x02, 0x18, 0x14, 0x02, 0x03, 0x02, 0x02, 0x02, 0x01, 0x02, 0x00, 0x02, 0x05, 0x02, 0x04, 0x02, 0x07, 0x02, 0x06, 0x02, 0x09, 0x02, 0x08 };
46 const uint8 const ReadConfigRegistersCmd[] = { 0x02, 0x01, FXLC95000_1_CONFIG_REGISTER_CMD_OFFSET, FXLC95000_1_CONFIG_REGISTER_SIZE };
47 const uint8 const QuickReadInterruptEnable[] = { 0x01, 0x02, 0x39, 0x01, 0x03 };
48 const uint8 const QuickReadInterruptDisable[] = { 0x01, 0x02, 0x39, 0x01, 0x02 };
49 const uint8 const StartDataCmd[] = { 0x02, 0x02, 0x00, 0x01, 0x52 };
50 const uint8 const EndDataCmd[] = { 0x02, 0x02, 0x00, 0x01, 0x51 };
51 const uint8 const ShutdownCmd[] = { 0x02, 0x02, 0x00, 0x01, 0x50 };
52 const uint8 const ConfigWritePreamble[] = { 0x02, 0x02, FXLC95000_1_CONFIG_REGISTER_CMD_OFFSET, FXLC95000_1_CONFIG_REGISTER_SIZE };
53 const uint8 const UnprotectFlash[] = { 0x40, 0x00 };
54 const uint8 const EraseMainFlashArray[] = { 0x12, 0xC5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF };
55 const uint8 const ProtectFlash[] = { 0x38, 0x00 };
56
57 const fxlc95000_Command_t const InitializeSequence[] =
58 {
59 {
60 .offset = 0,
61 .nByteWrite = sizeof(BootToFlash),
62 .pWriteBuffer = (uint8* const)&BootToFlash
63 }
64 };
65
66 const fxlc95000_Command_t const ReadConfigRegistersSequence[] =
67 {
68 {
69 .offset = 0,
70 .nByteWrite = sizeof(ReadConfigRegistersCmd),
71 .pWriteBuffer = (uint8* const)&ReadConfigRegistersCmd
72 }
73 };
74
75 const fxlc95000_Command_t const ConfigureSequence[] =
76 {
77 {
78 .offset = 0,
79 .nByteWrite = sizeof(ConfigureMBoxCmd1),
80 .pWriteBuffer = (uint8* const)&ConfigureMBoxCmd1
81 },
82 {
83 .offset = 0,
84 .nByteWrite = sizeof(QuickReadInterruptEnable),
85 .pWriteBuffer = (uint8* const)&QuickReadInterruptEnable
86 }
87 };
88
89 const fxlc95000_Command_t const StartDataSequence[] =
90 {
91 {
92 .offset = 0,
93 .nByteWrite = sizeof(StartDataCmd),
94 .pWriteBuffer = (uint8* const)&StartDataCmd
95 }
96 };
97
98 const fxlc95000_Command_t const EndDataSequence[] =
99 {
100 {
101 .offset = 0,
102 .nByteWrite = sizeof(EndDataCmd),
103 .pWriteBuffer = (uint8* const)&EndDataCmd
104 }
105 };
106
107
108 const fxlc95000_Command_t const ShutdownSequence[] =
109 {
110 {
111 .offset = 0,
112 .nByteWrite = sizeof(ShutdownCmd),
113 .pWriteBuffer = (uint8* const)&ShutdownCmd
114 }
115 };
116
117 const fxlc95000_Command_t const WriteConfigPreambleSequence[] =
118 {
119 {
120 .offset = 0,
121 .nByteWrite = sizeof(ConfigWritePreamble),
122 .pWriteBuffer = (uint8* const)&ConfigWritePreamble
123 }
124 };
125
126 const fxlc95000_Command_t const FlashPreprocessSequence[] =
127 {
128 {
129 .offset = 0,
130 .nByteWrite = sizeof(UnprotectFlash),
131 .pWriteBuffer = (uint8* const)&UnprotectFlash
132 },
133 {
134 .offset = 0,
135 .nByteWrite = sizeof(EraseMainFlashArray),
136 .pWriteBuffer = (uint8* const)&EraseMainFlashArray
137 }
138 };
139
140 const fxlc95000_Command_t const FlashPostprocessSequence[] =
141 {
142 {
143 .offset = 0,
144 .nByteWrite = sizeof(ProtectFlash),
145 .pWriteBuffer = (uint8* const)&ProtectFlash
146 }
147 };
148
149 fxlc95000_Sensor_Specific_Settings_t FXLC95000_1_Sensor_Specific_Config =
150 {
151 .sampleDataOffset = FXLC95000_1_SAMPLE_OFFSET,
152 .sampleDataSize = FXLC95000_1_SAMPLE_SIZE,
153 .configRegisterReadOffset = FXLC95000_1_CONFIG_REGISTER_READ_OFFSET,
154 .configRegisterReadSize = FXLC95000_1_CONFIG_REGISTER_SIZE,
155 .engFloatConversionFactor = FXLC95000_1_ACC_FLOAT_CONVERSION_FACTOR,
156 .engFixedTotalWidth = 32,
157 .engFixedIntegerWidth = 16,
158 .engFixedSignBit = 1,
159 .resolution = FXLC95000_1_ACC_ACCEL_RESOLUTION_16_BIT,
160 .range = FXLC95000_1_ACC_ACCEL_RANGE_2G,
161 .mode = FXLC95000_1_ACC_MODE_ACCEL_ONLY,
162 .writeConfigRegisterPreamble = { .numCommands=sizeof(WriteConfigPreambleSequence)/sizeof(fxlc95000_Command_t),.commands=WriteConfigPreambleSequence},
163 .readConfigCommands = { .numCommands=sizeof(ReadConfigRegistersSequence)/sizeof(fxlc95000_Command_t),.commands=ReadConfigRegistersSequence},
164 .initializeCommands = { .numCommands=sizeof(InitializeSequence)/sizeof(fxlc95000_Command_t),.commands=InitializeSequence},
165 .validateSettingsCommands = { .numCommands=0, .commands=NULL},
166 .configureCommands = { .numCommands=sizeof(ConfigureSequence)/sizeof(fxlc95000_Command_t), .commands=ConfigureSequence},
167 .startDataCommands = { .numCommands=sizeof(StartDataSequence)/sizeof(fxlc95000_Command_t), .commands=StartDataSequence},
168 .endDataCommands = { .numCommands=sizeof(EndDataSequence)/sizeof(fxlc95000_Command_t), .commands=EndDataSequence},
169 .calibrateCommands = { .numCommands=0, .commands=NULL},
170 .shutdownCommands = { .numCommands=sizeof(ShutdownSequence)/sizeof(fxlc95000_Command_t), .commands=ShutdownSequence},
171 .getDataCommands = { .numCommands=0, .commands=NULL},
172 .flashPreprocessCommands = { .numCommands=sizeof(FlashPreprocessSequence)/sizeof(fxlc95000_Command_t), .commands=FlashPreprocessSequence},
173 .flashPostprocessCommands = { .numCommands=sizeof(FlashPostprocessSequence)/sizeof(fxlc95000_Command_t), .commands=FlashPostprocessSequence}
174 };
175
176 /*!
177 * @brief This creates the sensor adapter instance for the target sensor.
178 *
179 */
180 const isf_dsa_Adapter_t FXLC95000_1_Adapter =
181 {
182 .devInfo.pSupportedSensorTypes = fxlc95000_SupportedSensorTypes,
183 .devInfo.pSupportedSensorDataTypes = fxlc95000_SupportedDataTypes,
184 .devInfo.nNativeDataSetSize = sizeof(fxlc95000_DataBuffer_t),
185 .control.Initialize = &fsl_fxlc95000_Initialize,
186 .control.ValidateSettings = &fsl_fxlc95000_ValidateSettings,
187 .control.Configure = &fsl_fxlc95000_Configure,
188 .control.StartData = &fsl_fxlc95000_StartData,
189 .control.EndData = &fsl_fxlc95000_EndData,
190 .control.Calibrate = &fsl_fxlc95000_Calibrate,
191 .control.Shutdown = &fsl_fxlc95000_Shutdown,
192 .control.Flash = &fsl_fxlc95000_Flash,
193 .control.Convert = &fsl_fxlc95000_Convert
194 };
195
196 const i2c_device_t FXLC95000_1_DeviceInfo =
197 {
198 .baudRate_kbps = 400, // default baud rate (kbps).
199 .address = 76 // instance specific device address.
200 };
201
202
203
204 /* END FXLC95000_1. */
205
206 /*!
207 ** @}
208 */
209 /*
210 ** ###################################################################
211 **
212 ** This file was created by Processor Expert 10.5 [05.21]
213 ** for the Freescale Kinetis series of microcontrollers.
214 **
215 ** ###################################################################
216 */
FXLC95000_1_Adapter
const isf_dsa_Adapter_t FXLC95000_1_Adapter
This creates the sensor adapter instance for the target sensor.
Definition: FXLC95000_1.c:180
uint8
unsigned char uint8
Definition: isf_types.h:76
StartDataSequence
const fxlc95000_Command_t const StartDataSequence[]
Definition: FXLC95000_1.c:89
fsl_fxlc95000_Calibrate
isf_dsa_status_t fsl_fxlc95000_Calibrate(isf_SensorHandle_t *pSensorHandle, void *pCalData)
Definition: fsl_fxlc95000_i2cspi_pedo.c:376
FXLC95000_1_CONFIG_REGISTER_CMD_OFFSET
#define FXLC95000_1_CONFIG_REGISTER_CMD_OFFSET
Definition: FXLC95000_1.h:53
FXLC95000_1_SAMPLE_OFFSET
#define FXLC95000_1_SAMPLE_OFFSET
Definition: FXLC95000_1.h:51
FXLC95000_1_SAMPLE_SIZE
#define FXLC95000_1_SAMPLE_SIZE
Definition: FXLC95000_1.h:52
ConfigWritePreamble
const uint8 const ConfigWritePreamble[]
Definition: FXLC95000_1.c:52
fxlc95000_Sensor_Specific_Settings_t::sampleDataOffset
const int32 sampleDataOffset
Definition: fxlc95000.h:65
QuickReadInterruptEnable
const uint8 const QuickReadInterruptEnable[]
Definition: FXLC95000_1.c:47
ReadConfigRegistersSequence
const fxlc95000_Command_t const ReadConfigRegistersSequence[]
Definition: FXLC95000_1.c:66
fsl_fxlc95000_Flash
isf_dsa_status_t fsl_fxlc95000_Flash(isf_SensorHandle_t *pSensorHandle, void *pFlashData, uint8 numBytes)
Definition: fsl_fxlc95000_i2cspi_pedo.c:530
fxlc95000_SupportedDataTypes
isf_SensorDataTypes_t fxlc95000_SupportedDataTypes[]
Definition: fsl_fxlc95000_i2cspi_pedo.c:28
FXLC95000_1_CONFIG_REGISTER_READ_OFFSET
#define FXLC95000_1_CONFIG_REGISTER_READ_OFFSET
Definition: FXLC95000_1.h:54
fxlc95000_Sensor_Specific_Settings_t
Definition: fxlc95000.h:63
WriteConfigPreambleSequence
const fxlc95000_Command_t const WriteConfigPreambleSequence[]
Definition: FXLC95000_1.c:117
fxlc95000_DataBuffer_t
This structure defines the dummy DSA data buffer format.
Definition: fsl_fxlc95000_i2cspi_pedo.h:28
fsl_fxlc95000_Convert
isf_dsa_status_t fsl_fxlc95000_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_fxlc95000_i2cspi_pedo.c:652
fsl_fxlc95000_Configure
isf_dsa_status_t fsl_fxlc95000_Configure(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
Definition: fsl_fxlc95000_i2cspi_pedo.c:166
FXLC95000_1_CONFIG_REGISTER_SIZE
#define FXLC95000_1_CONFIG_REGISTER_SIZE
Definition: FXLC95000_1.h:55
FlashPreprocessSequence
const fxlc95000_Command_t const FlashPreprocessSequence[]
Definition: FXLC95000_1.c:126
InitializeSequence
const fxlc95000_Command_t const InitializeSequence[]
Definition: FXLC95000_1.c:57
fsl_fxlc95000_EndData
isf_dsa_status_t fsl_fxlc95000_EndData(isf_SensorHandle_t *pSensorHandle)
Definition: fsl_fxlc95000_i2cspi_pedo.c:315
QuickReadInterruptDisable
const uint8 const QuickReadInterruptDisable[]
Definition: FXLC95000_1.c:48
FXLC95000_1_ACC_ACCEL_RESOLUTION_16_BIT
#define FXLC95000_1_ACC_ACCEL_RESOLUTION_16_BIT
Definition: FXLC95000_1.h:62
fxlc95000_Command_t
Definition: fxlc95000.h:50
EraseMainFlashArray
const uint8 const EraseMainFlashArray[]
Definition: FXLC95000_1.c:54
isf_dsa_Adapter_st::devInfo
isf_dsa_DeviceInfoBlock_t devInfo
Definition: isf_dsa_adapter.h:146
UnprotectFlash
const uint8 const UnprotectFlash[]
Definition: FXLC95000_1.c:53
EndDataCmd
const uint8 const EndDataCmd[]
Definition: FXLC95000_1.c:50
fxlc95000_SupportedSensorTypes
isf_SensorTypes_t fxlc95000_SupportedSensorTypes[]
Supported sensor and data types.
Definition: fsl_fxlc95000_i2cspi_pedo.c:27
isf_util.h
The isf_util.h file contains the utility method declarations and macros.
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
ConfigureSequence
const fxlc95000_Command_t const ConfigureSequence[]
Definition: FXLC95000_1.c:75
FXLC95000_1_ACC_ACCEL_RANGE_2G
#define FXLC95000_1_ACC_ACCEL_RANGE_2G
Definition: FXLC95000_1.h:58
isf_dsa_DeviceInfoBlock_st::pSupportedSensorTypes
isf_SensorTypes_t * pSupportedSensorTypes
Definition: isf_dsa_adapter.h:70
fsl_fxlc95000_ValidateSettings
isf_dsa_status_t fsl_fxlc95000_ValidateSettings(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSubSettings)
Definition: fsl_fxlc95000_i2cspi_pedo.c:133
FXLC95000_1_ACC_MODE_ACCEL_ONLY
#define FXLC95000_1_ACC_MODE_ACCEL_ONLY
Definition: FXLC95000_1.h:61
ConfigureMBoxCmd1
const uint8 const ConfigureMBoxCmd1[]
Definition: FXLC95000_1.c:45
ShutdownCmd
const uint8 const ShutdownCmd[]
Definition: FXLC95000_1.c:51
StartDataCmd
const uint8 const StartDataCmd[]
Definition: FXLC95000_1.c:49
fsl_fxlc95000_StartData
isf_dsa_status_t fsl_fxlc95000_StartData(isf_SensorHandle_t *pSensorHandle)
Definition: fsl_fxlc95000_i2cspi_pedo.c:256
fsl_fxlc95000_Initialize
isf_dsa_status_t fsl_fxlc95000_Initialize(isf_SensorHandle_t *pSensorHandle)
Definition: fsl_fxlc95000_i2cspi_pedo.c:56
fsl_fxlc95000_Shutdown
isf_dsa_status_t fsl_fxlc95000_Shutdown(isf_SensorHandle_t *pSensorHandle)
Definition: fsl_fxlc95000_i2cspi_pedo.c:396
ShutdownSequence
const fxlc95000_Command_t const ShutdownSequence[]
Definition: FXLC95000_1.c:108
EndDataSequence
const fxlc95000_Command_t const EndDataSequence[]
Definition: FXLC95000_1.c:98
FXLC95000_1.h
FXLC95000_1_ACC_FLOAT_CONVERSION_FACTOR
#define FXLC95000_1_ACC_FLOAT_CONVERSION_FACTOR
Definition: FXLC95000_1.h:57
FXLC95000_1_ConfigRegisterBuffer
uint8 FXLC95000_1_ConfigRegisterBuffer[FXLC95000_1_CONFIG_REGISTER_SIZE]
Definition: FXLC95000_1.c:42
ProtectFlash
const uint8 const ProtectFlash[]
Definition: FXLC95000_1.c:55
ReadConfigRegistersCmd
const uint8 const ReadConfigRegistersCmd[]
Definition: FXLC95000_1.c:46
BootToFlash
const uint8 const BootToFlash[]
Definition: FXLC95000_1.c:44
FXLC95000_1_DeviceInfo
const i2c_device_t FXLC95000_1_DeviceInfo
This allows access to the sensor communications specific configuration.
Definition: FXLC95000_1.c:196
fxlc95000_Command_t::offset
int32 offset
Definition: fxlc95000.h:52
FXLC95000_1_Sensor_Specific_Config
fxlc95000_Sensor_Specific_Settings_t FXLC95000_1_Sensor_Specific_Config
This allows access to the sensor specific configuration for the target sensor.
Definition: FXLC95000_1.c:149
FlashPostprocessSequence
const fxlc95000_Command_t const FlashPostprocessSequence[]
Definition: FXLC95000_1.c:140
- © Freescale Semiconductor, Inc. 2016. All Rights Reserved.