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

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

MMA955x_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 : MMA955x_2.c
4 ** CDE edition : Standard
5 ** Project : ISF2P2_K64F_MQX_PROJ
6 ** Processor : MK64FN1M0VLL12
7 ** Component : ISF_KSDK_Sensor_MMA955x_Pedometer
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 : MMA955x_2
16 ** Device Address : 0x4C
17 ** Comm Channel : SPI1
18 ** Is SPI Selected : yes
19 ** Chip Select : ChipSelect
20 ** Reset Sensor : SensorReset
21 ** Allowed Sample Rates : 488.28Hz
22 ** Allowed Full-scale Range : ±8 g
23 ** Contents :
24 ** No public methods
25 **
26 ** (c) Copyright Freescale Semiconductor Inc, 2015
27 http://www.freescale.com
28 ** ###################################################################*/
29 /*!
30 ** @file MMA955x_2.c
31 ** @version 01.00
32 ** @brief
33 **
34 */
35 /*!
36 ** @addtogroup MMA955x_2_module MMA955x_2 module documentation
37 ** @{
38 */
39
40 /* MODULE MMA955x_2. */
41
42 #include "MMA955x_2.h"
43 #include "isf_util.h"
44 #include "isf_spi_master_types.h"
45 #include "ChipSelect.h"
46 #include "SensorReset.h"
47
48 uint8 MMA955x_2_ConfigRegisterBuffer[MMA955x_2_CONFIG_REGISTER_SIZE];
49
50 // Last byte for the following 3 to be updated by mma955xSetSamplingRate().
51 uint8 SelectedSampleRate[] = { 0x06, 0x20, 0x0C, 0x01, 0x00 };
52 uint8 SelectedAFEPriority[] = { 0x01, 0x20, 0x32, 0x01, 0x00 };
53 uint8 SelectedMBoxPriority[] = { 0x01, 0x20, 0x30, 0x01, 0x00 };
54
55 const uint8 SampleRates[] = { 0x07, //488.28
56 0x08, //244.17
57 0x09, //122.07
58 0x0A, //61.04
59 0x0B, //30.52
60 0x0C, //15.26
61 0x0D, //7.63
62 0x0E }; //3.81
63 const uint8 ApplicationPriorities[] = { 0xD7, //488.28
64 0xD6, //244.17
65 0xD5, //122.07
66 0xD4, //61.04
67 0xD3, //30.52
68 0xD2, //15.26
69 0xD1, //7.63
70 0xD0 }; //3.81
71
72 const uint8 const FSRange_2g[] = { 0x06, 0x20, 0x00, 0x01, 0x40 };
73 const uint8 const FSRange_4g[] = { 0x06, 0x20, 0x00, 0x01, 0x80 };
74 const uint8 const FSRange_8g[] = { 0x06, 0x20, 0x00, 0x01, 0x00 };
75
76 const uint8 const WakeApplication[] = { 0x12, 0x20, 0x06, 0x01, 0x00 };
77 const uint8 const LegacyMode[] = { 0x18, 0x20, 0x00, 0x01, 0x10 };
78 const uint8 const NormalMode[] = { 0x18, 0x20, 0x00, 0x01, 0x00 };
79 const uint8 const SleepApplication[] = { 0x12, 0x20, 0x06, 0x01, 0x01 };
80 const uint8 const MBoxQRDataXYZ[] = { 0x04, 0x20, 0x2C, 0x0C, 0x06, 0x13, 0x06, 0x12, 0x06, 0x15, 0x06, 0x14, 0x06, 0x17, 0x06, 0x16 };
81
82 const uint8 const ReadPedometerData[] = { 0x15, 0x30, 0x00, 0x0C };
83 const uint8 const ReadPedometerConfiguration[] = { 0x15, 0x10, 0x00, 0x11 };
84 const uint8 const WritePedometerConfiguration[] = { 0x15, 0x20, 0x00, 0x11 }; //Remaining bytes of payload will be added by write function.
85
86 const mma955x_Command_t const MMA955x_InitializeSequence[] =
87 {
88 {
89 .offset = 0,
90 .nByteWrite = sizeof(MBoxQRDataXYZ),
91 .pWriteBuffer = (uint8* const)MBoxQRDataXYZ
92 }
93 };
94
95 const mma955x_Command_t const MMA955x_ConfigureSequence[] =
96 {
97 {
98 .offset = 0,
99 .nByteWrite = sizeof(FSRange_8g),
100 .pWriteBuffer = (uint8* const)FSRange_8g
101 },
102 {
103 .offset = 0,
104 .nByteWrite = sizeof(SelectedSampleRate),
105 .pWriteBuffer = (uint8* const)SelectedSampleRate
106 },
107 {
108 .offset = 0,
109 .nByteWrite = sizeof(SelectedAFEPriority),
110 .pWriteBuffer = (uint8* const)SelectedAFEPriority
111 },
112 {
113 .offset = 0,
114 .nByteWrite = sizeof(SelectedMBoxPriority),
115 .pWriteBuffer = (uint8* const)SelectedMBoxPriority
116 },
117 {
118 .offset = 0,
119 .nByteWrite = sizeof(WakeApplication),
120 .pWriteBuffer = (uint8* const)WakeApplication
121 }
122 };
123
124 const mma955x_Command_t const MMA955x_StartDataSequence[] =
125 {
126 {
127 .offset = 0,
128 .nByteWrite = sizeof(LegacyMode),
129 .pWriteBuffer = (uint8* const)LegacyMode
130 }
131 };
132
133 const mma955x_Command_t const MMA955x_StopDataSequence[] =
134 {
135 {
136 .offset = 0,
137 .nByteWrite = sizeof(NormalMode),
138 .pWriteBuffer = (uint8* const)NormalMode
139 }
140 };
141
142 const mma955x_Command_t const MMA955x_ShutdownDataSequence[] =
143 {
144 {
145 .offset = 0,
146 .nByteWrite = sizeof(SleepApplication),
147 .pWriteBuffer = (uint8* const)SleepApplication
148 }
149 };
150
151 const mma955x_Command_t const MMA955x_ReadConfigurationSequence[] =
152 {
153 {
154 .offset = 0,
155 .nByteWrite = sizeof(ReadPedometerConfiguration),
156 .pWriteBuffer = (uint8* const)ReadPedometerConfiguration
157 }
158 };
159
160 const mma955x_Command_t const MMA955x_WriteConfigurationSequence[] =
161 {
162 {
163 .offset = 0,
164 .nByteWrite = sizeof(WritePedometerConfiguration),
165 .pWriteBuffer = (uint8* const)WritePedometerConfiguration
166 }
167 };
168
169 const mma955x_Command_t const MMA955x_ReadPeadometerDataSequence[] =
170 {
171 {
172 .offset = 0,
173 .nByteWrite = sizeof(ReadPedometerData),
174 .pWriteBuffer = (uint8* const)ReadPedometerData
175 }
176 };
177
178 mma955x_Sensor_Specific_Settings_t MMA955x_2_Sensor_Specific_Config =
179 {
180 .sampleDataOffset = MMA955x_2_SAMPLE_OFFSET,
181 .sampleDataSize = MMA955x_2_SAMPLE_SIZE,
182 .commandReadOffset = MMA955x_2_CONFIG_REGISTER_READ_OFFSET,
183 .commandReadSize = MMA955x_2_CONFIG_REGISTER_SIZE,
184 .engFloatConversionFactor = MMA955x_2_ACC_FLOAT_CONVERSION_FACTOR_8g,
185 .engFixedTotalWidth = 32,
186 .engFixedIntegerWidth = 16,
187 .engFixedSignBit = 1,
188 .writeConfigCommands = { .numCommands=sizeof(MMA955x_WriteConfigurationSequence)/sizeof(mma955x_Command_t), .commands=MMA955x_WriteConfigurationSequence },
189 .readConfigCommands = { .numCommands=sizeof(MMA955x_ReadConfigurationSequence)/sizeof(mma955x_Command_t), .commands=MMA955x_ReadConfigurationSequence },
190 .initializeCommands = { .numCommands=sizeof(MMA955x_InitializeSequence)/sizeof(mma955x_Command_t), .commands=MMA955x_InitializeSequence },
191 .validateSettingsCommands = { .numCommands=0, .commands=NULL },
192 .configureCommands = { .numCommands=sizeof(MMA955x_ConfigureSequence)/sizeof(mma955x_Command_t), .commands=MMA955x_ConfigureSequence },
193 .startDataCommands = { .numCommands=sizeof(MMA955x_StartDataSequence)/sizeof(mma955x_Command_t), .commands=MMA955x_StartDataSequence },
194 .endDataCommands = { .numCommands=sizeof(MMA955x_StopDataSequence)/sizeof(mma955x_Command_t), .commands=MMA955x_StopDataSequence },
195 .calibrateCommands = { .numCommands=0, .commands=NULL },
196 .shutdownCommands = { .numCommands=sizeof(MMA955x_ShutdownDataSequence)/sizeof(mma955x_Command_t), .commands=MMA955x_ShutdownDataSequence },
197 .getPedometerDataCommands = { .numCommands=sizeof(MMA955x_ReadPeadometerDataSequence)/sizeof(mma955x_Command_t), .commands=MMA955x_ReadPeadometerDataSequence }
198 };
199
200 /*!
201 * @brief This creates the sensor adapter instance for the target sensor.
202 *
203 */
204 const isf_dsa_Adapter_t MMA955x_2_Adapter =
205 {
206 .devInfo.pSupportedSensorTypes = mma955x_SupportedSensorTypes,
207 .devInfo.pSupportedSensorDataTypes = mma955x_SupportedDataTypes,
208 .devInfo.nNativeDataSetSize = sizeof(mma955x_DataBuffer_t),
209 .control.Initialize = &fsl_mma955x_Initialize,
210 .control.ValidateSettings = &fsl_mma955x_ValidateSettings,
211 .control.Configure = &fsl_mma955x_Configure,
212 .control.StartData = &fsl_mma955x_StartData,
213 .control.EndData = &fsl_mma955x_EndData,
214 .control.Calibrate = &fsl_mma955x_Calibrate,
215 .control.Shutdown = &fsl_mma955x_Shutdown,
216 .control.Convert = &fsl_mma955x_Convert
217 };
218
219
220 #define FSL_SENSOR_SPI_CMD_LENG 0x1
221 spi_master_slaveInfo_t fsl_spi_sensor_type_MMA955x_2 = {
222 .slaveinit = (fnslaveinit_t)&fsl_955x_spi_slave_init,
223 .writepreProcess = (fnwritepreProcessing_t)fsl_955x_spi_slave_write_preprocess,
224 .writepostProcess = (fnwritepostProcossing_t)fsl_955x_spi_slave_write_postprocess,
225 .readpreProcess = (fnreadpreProcessing_t)fsl_955x_spi_slave_read_preprocess,
226 .readpostProcess = (fnreadpostProcossing_t)fsl_955x_spi_slave_read_postprocess
227 };
228
229 const spi_master_CommSpecificInfo_t MMA955x_2_DeviceInfo =
230 {
231 .busConfig =
232 {
233 .timeout = 1000U,
234 .device =
235 {
236 .bitsPerSec = 500000U,
237 .dataBusConfig.bitsPerFrame = 8U,
238 .dataBusConfig.clkPolarity = kDspiClockPolarity_ActiveHigh,
239 .dataBusConfig.clkPhase = kDspiClockPhase_FirstEdge,
240 .dataBusConfig.direction = kDspiMsbFirst,
241 },
242 .userConfig =
243 {
244 .whichCtar = kDspiCtar0,
245 .isSckContinuous = false,
246 .isChipSelectContinuous = false,
247 .whichPcs = kDspiPcs0,
248 .pcsPolarity = kDspiPcs_ActiveHigh,
249 },
250 },
251 .pSlaveInfo = &fsl_spi_sensor_type_MMA955x_2
252 };
253
254 static uint8 spiRead_CmdBuffer[64];
255 static uint8 spiRead_DataBuffer[64];
256 static uint8 spiWrite_CmdDataBuffer[64];
257
258
259 void mma955xSetSamplingRate(uint32 samplePeriod)
260 {
261 uint8 offset = 11; // The Min Value for period is 2048 2^(11) at 488.28Hz
262
263 while((samplePeriod >> offset++) > 1);
264 // The fifth byte is the setting byte to be written.
265 SelectedSampleRate[4] = SampleRates[offset-12];
266 SelectedAFEPriority[4] = ApplicationPriorities[offset-12];
267 SelectedMBoxPriority[4] = ApplicationPriorities[offset-12];
268 }
269
270 isf_status_t fsl_955x_spi_slave_init(void)
271 {
272 // Call the GPIO_LDD function to initialize the chip-select.
273 GPIO_DRV_OutputPinInit(ChipSelect_OutConfig0);
274 GPIO_DRV_OutputPinInit(ResetSensor_OutConfig0);
275
276 // SPI Mode switch sequence.
277 GPIO_DRV_ClearPinOutput(XTAL_K64_MAIN);
278 GPIO_DRV_SetPinOutput(J1_1);
279 OSA_TimeDelay(30);
280 GPIO_DRV_ClearPinOutput(J1_1);
281 OSA_TimeDelay(30);
282 GPIO_DRV_SetPinOutput(XTAL_K64_MAIN);
283
284 return ISF_SUCCESS;
285 }
286
287 isf_status_t fsl_955x_spi_slave_write_preprocess(void *pCmdOut, uint32 offset, uint32 size, void *pWritebuffer)
288 {
289 spi_mater_slaveCmd_t* pSlaveCmd = (spi_mater_slaveCmd_t*)pCmdOut;
290
291 uint8 *pWBuff = spiWrite_CmdDataBuffer;
292 uint8 *pRBuff = spiWrite_CmdDataBuffer + size + FSL_SENSOR_SPI_CMD_LENG;
293
294 // formatting the command for the FSL_SENSORS
295 *pWBuff = (offset | 0x40) << 1 ; // offset is the internal register address of the sensor at which write is performed.
296
297 // Copy the command
298 ISF_MEM_CPY((uint8*)pWritebuffer, (pWBuff + FSL_SENSOR_SPI_CMD_LENG), size);
299
300 // Create the slave command.
301 pSlaveCmd->size = size + FSL_SENSOR_SPI_CMD_LENG;
302 pSlaveCmd->pWriteBuffer = (uint8*)pWBuff;
303 pSlaveCmd->pReadBuffer = (uint8*)pRBuff;
304
305 // Call the GPIO_LDD function to clear chip-select.
306 GPIO_DRV_ClearPinOutput(XTAL_K64_MAIN);
307
308 return ISF_SUCCESS;
309 }
310
311 isf_status_t fsl_955x_spi_slave_write_postprocess(void *pCmdOut)
312 {
313 // Call the GPIO_LDD function to set chip-select.
314 GPIO_DRV_SetPinOutput(XTAL_K64_MAIN);
315
316 return ISF_SUCCESS;
317 }
318
319 isf_status_t fsl_955x_spi_slave_read_preprocess(void *pCmdOut, uint32 offset, uint32 size)
320 {
321 spi_mater_slaveCmd_t* pSlaveCmd = (spi_mater_slaveCmd_t*)pCmdOut;
322
323 uint8 *pWBuff = spiRead_CmdBuffer;
324 uint8 *pRBuff = spiRead_DataBuffer;
325
326 // formatting the command for the FSL_SENSORS
327 *pWBuff = (offset & 0x7F) << 1 ; // offset is the internal register address of the sensor at which write is performed.
328
329 // Create the slave command.
330 pSlaveCmd->size = size + FSL_SENSOR_SPI_CMD_LENG;
331 pSlaveCmd->pWriteBuffer = (uint8*)pWBuff;
332 pSlaveCmd->pReadBuffer = (uint8*)pRBuff;
333
334 // Call the GPIO_LDD function to clear chip-select.
335 GPIO_DRV_ClearPinOutput(XTAL_K64_MAIN);
336
337 return ISF_SUCCESS;
338 }
339
340 isf_status_t fsl_955x_spi_slave_read_postprocess(void *pCmdOut, void* pDataOut)
341 {
342 spi_mater_slaveCmd_t* pSlaveCmd = (spi_mater_slaveCmd_t*)pCmdOut;
343
344 ISF_MEM_CPY((uint8*)(pSlaveCmd->pReadBuffer + FSL_SENSOR_SPI_CMD_LENG), pDataOut , (pSlaveCmd->size - FSL_SENSOR_SPI_CMD_LENG) );
345
346 // Call the GPIO_LDD function to set chip-select.
347 GPIO_DRV_SetPinOutput(XTAL_K64_MAIN);
348
349 return ISF_SUCCESS;
350 }
351 /* END MMA955x_2. */
352
353 /*!
354 ** @}
355 */
356 /*
357 ** ###################################################################
358 **
359 ** This file was created by Processor Expert 10.5 [05.21]
360 ** for the Freescale Kinetis series of microcontrollers.
361 **
362 ** ###################################################################
363 */
MMA955x_2_ConfigRegisterBuffer
uint8 MMA955x_2_ConfigRegisterBuffer[MMA955x_2_CONFIG_REGISTER_SIZE]
Definition: MMA955x_2.c:48
fsl_mma955x_EndData
isf_dsa_status_t fsl_mma955x_EndData(isf_SensorHandle_t *pSensorHandle)
Definition: fsl_mma955x_i2cspi_pedo.c:313
MMA955x_2_SAMPLE_OFFSET
#define MMA955x_2_SAMPLE_OFFSET
Definition: MMA955x_2.h:56
spi_mater_SlaveCmd::size
uint32 size
Definition: isf_spi_master_types.h:39
mma955x_Sensor_Specific_Settings_t
Definition: mma955x.h:70
ApplicationPriorities
const uint8 ApplicationPriorities[]
Definition: MMA955x_2.c:63
uint8
unsigned char uint8
Definition: isf_types.h:76
spi_mater_slaveInfo::slaveinit
fnslaveinit_t slaveinit
Definition: isf_spi_master_types.h:53
ReadPedometerConfiguration
const uint8 const ReadPedometerConfiguration[]
Definition: MMA955x_2.c:83
spi_master_CommSpecificInfo_t
Definition: isf_spi_master_types.h:60
MMA955x_2_ACC_FLOAT_CONVERSION_FACTOR_8g
#define MMA955x_2_ACC_FLOAT_CONVERSION_FACTOR_8g
Definition: MMA955x_2.h:64
fsl_955x_spi_slave_write_preprocess
isf_status_t fsl_955x_spi_slave_write_preprocess(void *pCmdOut, uint32 offset, uint32 size, void *pWritebuffer)
Definition: MMA955x_2.c:287
mma955xSetSamplingRate
void mma955xSetSamplingRate(uint32 samplePeriod)
Definition: MMA955x_2.c:259
fsl_955x_spi_slave_read_postprocess
isf_status_t fsl_955x_spi_slave_read_postprocess(void *pCmdOut, void *pDataOut)
Definition: MMA955x_2.c:340
SelectedMBoxPriority
uint8 SelectedMBoxPriority[]
Definition: MMA955x_2.c:53
fsl_mma955x_Configure
isf_dsa_status_t fsl_mma955x_Configure(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
Definition: fsl_mma955x_i2cspi_pedo.c:180
fsl_955x_spi_slave_init
isf_status_t fsl_955x_spi_slave_init(void)
Definition: MMA955x_2.c:270
SampleRates
const uint8 SampleRates[]
Definition: MMA955x_2.c:55
ChipSelect_OutConfig0
const gpio_output_pin_user_config_t ChipSelect_OutConfig0[]
Configuration structure 0 for output pins.
Definition: ChipSelect.c:56
ISF_SUCCESS
Definition: isf.h:31
ISF_MEM_CPY
#define ISF_MEM_CPY(src, dest, number_of_bytes)
Macro for the memory copy.
Definition: isf_util.h:68
SensorReset.h
MBoxQRDataXYZ
const uint8 const MBoxQRDataXYZ[]
Definition: MMA955x_2.c:80
fsl_mma955x_Calibrate
isf_dsa_status_t fsl_mma955x_Calibrate(isf_SensorHandle_t *pSensorHandle, void *pCalData)
Definition: fsl_mma955x_i2cspi_pedo.c:380
mma955x_Command_t::offset
int32 offset
Definition: mma955x.h:59
MMA955x_StartDataSequence
const mma955x_Command_t const MMA955x_StartDataSequence[]
Definition: MMA955x_2.c:124
fsl_955x_spi_slave_write_postprocess
isf_status_t fsl_955x_spi_slave_write_postprocess(void *pCmdOut)
Definition: MMA955x_2.c:311
FSRange_8g
const uint8 const FSRange_8g[]
Definition: MMA955x_2.c:74
spi_mater_slaveInfo
This structure defines the slave specific spi information.
Definition: isf_spi_master_types.h:51
fsl_mma955x_Convert
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.
Definition: fsl_mma955x_i2cspi_pedo.c:529
MMA955x_WriteConfigurationSequence
const mma955x_Command_t const MMA955x_WriteConfigurationSequence[]
Definition: MMA955x_2.c:160
spi_master_CommSpecificInfo_t::busConfig
spi_master_busConfig_t busConfig
Definition: isf_spi_master_types.h:63
MMA955x_2_CONFIG_REGISTER_READ_OFFSET
#define MMA955x_2_CONFIG_REGISTER_READ_OFFSET
Definition: MMA955x_2.h:58
spi_mater_SlaveCmd::pWriteBuffer
uint8 * pWriteBuffer
Definition: isf_spi_master_types.h:41
fsl_mma955x_Initialize
isf_dsa_status_t fsl_mma955x_Initialize(isf_SensorHandle_t *pSensorHandle)
Definition: fsl_mma955x_i2cspi_pedo.c:57
ResetSensor_OutConfig0
const gpio_output_pin_user_config_t ResetSensor_OutConfig0[]
Configuration structure 0 for output pins.
Definition: ResetSensor.c:56
XTAL_K64_MAIN
Definition: ChipSelect.h:82
J1_1
Definition: SensorReset.h:82
ReadPedometerData
const uint8 const ReadPedometerData[]
Definition: MMA955x_2.c:82
fsl_mma955x_ValidateSettings
isf_dsa_status_t fsl_mma955x_ValidateSettings(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSubSettings)
Definition: fsl_mma955x_i2cspi_pedo.c:148
WakeApplication
const uint8 const WakeApplication[]
Definition: MMA955x_2.c:76
isf_dsa_Adapter_st::devInfo
isf_dsa_DeviceInfoBlock_t devInfo
Definition: isf_dsa_adapter.h:146
fsl_mma955x_Shutdown
isf_dsa_status_t fsl_mma955x_Shutdown(isf_SensorHandle_t *pSensorHandle)
Definition: fsl_mma955x_i2cspi_pedo.c:400
mma955x_DataBuffer_t
This structure defines the Pedometer sample data buffer format.
Definition: fsl_mma955x_i2cspi_pedo.h:28
FSRange_2g
const uint8 const FSRange_2g[]
Definition: MMA955x_2.c:72
isf_util.h
The isf_util.h file contains the utility method declarations and macros.
mma955x_Sensor_Specific_Settings_t::sampleDataOffset
const int32 sampleDataOffset
Definition: mma955x.h:72
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
FSRange_4g
const uint8 const FSRange_4g[]
Definition: MMA955x_2.c:73
FSL_SENSOR_SPI_CMD_LENG
#define FSL_SENSOR_SPI_CMD_LENG
Definition: MMA955x_2.c:220
isf_dsa_DeviceInfoBlock_st::pSupportedSensorTypes
isf_SensorTypes_t * pSupportedSensorTypes
Definition: isf_dsa_adapter.h:70
fnwritepreProcessing_t
isf_status_t(* fnwritepreProcessing_t)(void *cmdOut, uint32 offset, uint32 size, void *writebuffer)
Definition: isf_spi_master_types.h:45
fsl_spi_sensor_type_MMA955x_2
spi_master_slaveInfo_t fsl_spi_sensor_type_MMA955x_2
Definition: MMA955x_2.c:221
spi_mater_SlaveCmd
This structure defines the spi slave command format.
Definition: isf_spi_master_types.h:36
MMA955x_ReadConfigurationSequence
const mma955x_Command_t const MMA955x_ReadConfigurationSequence[]
Definition: MMA955x_2.c:151
fnwritepostProcossing_t
isf_status_t(* fnwritepostProcossing_t)(void *cmd)
Definition: isf_spi_master_types.h:46
MMA955x_2.h
SelectedAFEPriority
uint8 SelectedAFEPriority[]
Definition: MMA955x_2.c:52
MMA955x_2_Adapter
const isf_dsa_Adapter_t MMA955x_2_Adapter
This creates the sensor adapter instance for the target sensor.
Definition: MMA955x_2.c:204
fsl_955x_spi_slave_read_preprocess
isf_status_t fsl_955x_spi_slave_read_preprocess(void *pCmdOut, uint32 offset, uint32 size)
Definition: MMA955x_2.c:319
MMA955x_2_Sensor_Specific_Config
mma955x_Sensor_Specific_Settings_t MMA955x_2_Sensor_Specific_Config
This allows access to the sensor specific configuration for the target sensor.
Definition: MMA955x_2.c:178
fnreadpreProcessing_t
isf_status_t(* fnreadpreProcessing_t)(void *cmdout, uint32 offset, uint32 size)
Definition: isf_spi_master_types.h:47
mma955x_SupportedDataTypes
isf_SensorDataTypes_t mma955x_SupportedDataTypes[]
Definition: fsl_mma955x_i2cspi_pedo.c:29
WritePedometerConfiguration
const uint8 const WritePedometerConfiguration[]
Definition: MMA955x_2.c:84
isf_status_t
int32 isf_status_t
ISF return status type.
Definition: isf.h:76
spi_mater_SlaveCmd::pReadBuffer
uint8 * pReadBuffer
Definition: isf_spi_master_types.h:40
MMA955x_InitializeSequence
const mma955x_Command_t const MMA955x_InitializeSequence[]
Definition: MMA955x_2.c:86
MMA955x_2_SAMPLE_SIZE
#define MMA955x_2_SAMPLE_SIZE
Definition: MMA955x_2.h:57
SleepApplication
const uint8 const SleepApplication[]
Definition: MMA955x_2.c:79
MMA955x_ConfigureSequence
const mma955x_Command_t const MMA955x_ConfigureSequence[]
Definition: MMA955x_2.c:95
isf_spi_master_types.h
isf_spi_master_types.h defines the spi protocol adapter structure and types.
LegacyMode
const uint8 const LegacyMode[]
Definition: MMA955x_2.c:77
mma955x_Command_t
Definition: mma955x.h:57
MMA955x_ShutdownDataSequence
const mma955x_Command_t const MMA955x_ShutdownDataSequence[]
Definition: MMA955x_2.c:142
SelectedSampleRate
uint8 SelectedSampleRate[]
Definition: MMA955x_2.c:51
fnreadpostProcossing_t
isf_status_t(* fnreadpostProcossing_t)(void *cmd, void *dataOut)
Definition: isf_spi_master_types.h:48
spi_master_BusConfig_struct::timeout
isf_duration_t timeout
Definition: isf_spi_master_types.h:21
MMA955x_ReadPeadometerDataSequence
const mma955x_Command_t const MMA955x_ReadPeadometerDataSequence[]
Definition: MMA955x_2.c:169
fsl_mma955x_StartData
isf_dsa_status_t fsl_mma955x_StartData(isf_SensorHandle_t *pSensorHandle)
Definition: fsl_mma955x_i2cspi_pedo.c:252
ChipSelect.h
MMA955x_StopDataSequence
const mma955x_Command_t const MMA955x_StopDataSequence[]
Definition: MMA955x_2.c:133
mma955x_SupportedSensorTypes
isf_SensorTypes_t mma955x_SupportedSensorTypes[]
Supported sensor and data types.
Definition: fsl_mma955x_i2cspi_pedo.c:28
uint32
unsigned long int uint32
Definition: isf_types.h:78
NormalMode
const uint8 const NormalMode[]
Definition: MMA955x_2.c:78
MMA955x_2_DeviceInfo
const spi_master_CommSpecificInfo_t MMA955x_2_DeviceInfo
This allows access to the sensor communications specific configuration.
Definition: MMA955x_2.c:229
fnslaveinit_t
isf_status_t(* fnslaveinit_t)(void)
Definition: isf_spi_master_types.h:44
MMA955x_2_CONFIG_REGISTER_SIZE
#define MMA955x_2_CONFIG_REGISTER_SIZE
Definition: MMA955x_2.h:59
- © Freescale Semiconductor, Inc. 2016. All Rights Reserved.