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

- Main Page
- Modules
- Data Structures
- Files

Macros | Functions | Variables
MMA955x_1 module documentation

## Macros
#define | MMA955x_1_DATA_TYPE mma955x_PedometerNativeData_t
#define | MMA955x_1_SAMPLE_OFFSET (26)
#define | MMA955x_1_SAMPLE_SIZE (6)
#define | MMA955x_1_CONFIG_REGISTER_READ_OFFSET (0)
#define | MMA955x_1_CONFIG_REGISTER_SIZE (sizeof(mma955x_readConfigResponseBuffer_t))
#define | MMA955x_1_ACC_FLOAT_CONVERSION_FACTOR_2g (0.000061035156)
#define | MMA955x_1_ACC_FLOAT_CONVERSION_FACTOR_4g (0.000122070312)
#define | MMA955x_1_ACC_FLOAT_CONVERSION_FACTOR_8g (0.000244140624)

## Functions
void | mma955xSetSamplingRate (uint32 samplePeriod)

## Variables
uint8 | MMA955x_1_ConfigRegisterBuffer [MMA955x_1_CONFIG_REGISTER_SIZE]
uint8 | SelectedSampleRate [] = { 0x06, 0x20, 0x0C, 0x01, 0x00 }
uint8 | SelectedAFEPriority [] = { 0x01, 0x20, 0x32, 0x01, 0x00 }
uint8 | SelectedMBoxPriority [] = { 0x01, 0x20, 0x30, 0x01, 0x00 }
const uint8 | SampleRates []
const uint8 | ApplicationPriorities []
const uint8 const | FSRange_2g [] = { 0x06, 0x20, 0x00, 0x01, 0x40 }
const uint8 const | FSRange_4g [] = { 0x06, 0x20, 0x00, 0x01, 0x80 }
const uint8 const | FSRange_8g [] = { 0x06, 0x20, 0x00, 0x01, 0x00 }
const uint8 const | WakeApplication [] = { 0x12, 0x20, 0x06, 0x01, 0x00 }
const uint8 const | LegacyMode [] = { 0x18, 0x20, 0x00, 0x01, 0x10 }
const uint8 const | NormalMode [] = { 0x18, 0x20, 0x00, 0x01, 0x00 }
const uint8 const | SleepApplication [] = { 0x12, 0x20, 0x06, 0x01, 0x01 }
const uint8 const | MBoxQRDataXYZ [] = { 0x04, 0x20, 0x2C, 0x0C, 0x06, 0x13, 0x06, 0x12, 0x06, 0x15, 0x06, 0x14, 0x06, 0x17, 0x06, 0x16 }
const uint8 const | ReadPedometerData [] = { 0x15, 0x30, 0x00, 0x0C }
const uint8 const | ReadPedometerConfiguration [] = { 0x15, 0x10, 0x00, 0x11 }
const uint8 const | WritePedometerConfiguration [] = { 0x15, 0x20, 0x00, 0x11 }
const mma955x_Command_t const | MMA955x_InitializeSequence []
const mma955x_Command_t const | MMA955x_ConfigureSequence []
const mma955x_Command_t const | MMA955x_StartDataSequence []
const mma955x_Command_t const | MMA955x_StopDataSequence []
const mma955x_Command_t const | MMA955x_ShutdownDataSequence []
const mma955x_Command_t const | MMA955x_ReadConfigurationSequence []
const mma955x_Command_t const | MMA955x_WriteConfigurationSequence []
const mma955x_Command_t const | MMA955x_ReadPeadometerDataSequence []
mma955x_Sensor_Specific_Settings_t | MMA955x_1_Sensor_Specific_Config
| This allows access to the sensor specific configuration for the target sensor. More...
const isf_dsa_Adapter_t | MMA955x_1_Adapter
| This creates the sensor adapter instance for the target sensor. More...
const i2c_device_t | MMA955x_1_DeviceInfo
| This allows access to the sensor communications specific configuration. More...
mma955x_Sensor_Specific_Settings_t | MMA955x_1_Sensor_Specific_Config
| This allows access to the sensor specific configuration for the target sensor. More...
const isf_dsa_Adapter_t | MMA955x_1_Adapter
| This allows access to the sensor adapter instance for the target sensor. More...
const i2c_device_t | MMA955x_1_DeviceInfo
| This allows access to the sensor communications specific configuration. More...

## Detailed Description

## Macro Definition Documentation

#define MMA955x_1_ACC_FLOAT_CONVERSION_FACTOR_2g (0.000061035156)

Definition at line 57 of file MMA955x_1.h.

#define MMA955x_1_ACC_FLOAT_CONVERSION_FACTOR_4g (0.000122070312)

Definition at line 58 of file MMA955x_1.h.

#define MMA955x_1_ACC_FLOAT_CONVERSION_FACTOR_8g (0.000244140624)

Definition at line 59 of file MMA955x_1.h.

#define MMA955x_1_CONFIG_REGISTER_READ_OFFSET (0)

Definition at line 53 of file MMA955x_1.h.

#define MMA955x_1_CONFIG_REGISTER_SIZE (sizeof(mma955x_readConfigResponseBuffer_t))

Definition at line 54 of file MMA955x_1.h.

#define MMA955x_1_DATA_TYPE mma955x_PedometerNativeData_t

Definition at line 50 of file MMA955x_1.h.

#define MMA955x_1_SAMPLE_OFFSET (26)

Definition at line 51 of file MMA955x_1.h.

#define MMA955x_1_SAMPLE_SIZE (6)

Definition at line 52 of file MMA955x_1.h.

## Function Documentation

void mma955xSetSamplingRate | ( | uint32 | samplePeriod | ) |

Definition at line 221 of file MMA955x_1.c.

## Variable Documentation

const uint8 ApplicationPriorities[]

Initial value:
= { 0xD7,
0xD6,
0xD5,
0xD4,
0xD3,
0xD2,
0xD1,
0xD0 }

Definition at line 57 of file MMA955x_1.c.

Referenced by mma955xSetSamplingRate().

const uint8 const FSRange_2g[] = { 0x06, 0x20, 0x00, 0x01, 0x40 }

Definition at line 66 of file MMA955x_1.c.

const uint8 const FSRange_4g[] = { 0x06, 0x20, 0x00, 0x01, 0x80 }

Definition at line 67 of file MMA955x_1.c.

const uint8 const FSRange_8g[] = { 0x06, 0x20, 0x00, 0x01, 0x00 }

Definition at line 68 of file MMA955x_1.c.

const uint8 const LegacyMode[] = { 0x18, 0x20, 0x00, 0x01, 0x10 }

Definition at line 71 of file MMA955x_1.c.

const uint8 const MBoxQRDataXYZ[] = { 0x04, 0x20, 0x2C, 0x0C, 0x06, 0x13, 0x06, 0x12, 0x06, 0x15, 0x06, 0x14, 0x06, 0x17, 0x06, 0x16 }

Definition at line 74 of file MMA955x_1.c.

const isf_dsa_Adapter_t MMA955x_1_Adapter

This allows access to the sensor adapter instance for the target sensor.

This allows access to the sensor adapter instance for the target sensor.

Definition at line 198 of file MMA955x_1.c.

const isf_dsa_Adapter_t MMA955x_1_Adapter

Initial value:
=
{
.devInfo.pSupportedSensorTypes = mma955x_SupportedSensorTypes,
.devInfo.pSupportedSensorDataTypes = mma955x_SupportedDataTypes,
.devInfo.nNativeDataSetSize = sizeof(mma955x_DataBuffer_t),
.control.Initialize = &fsl_mma955x_Initialize,
.control.ValidateSettings = &fsl_mma955x_ValidateSettings,
.control.Configure = &fsl_mma955x_Configure,
.control.StartData = &fsl_mma955x_StartData,
.control.EndData = &fsl_mma955x_EndData,
.control.Calibrate = &fsl_mma955x_Calibrate,
.control.Shutdown = &fsl_mma955x_Shutdown,
.control.Convert = &fsl_mma955x_Convert
}
fsl_mma955x_EndData
isf_dsa_status_t fsl_mma955x_EndData(isf_SensorHandle_t *pSensorHandle)
Definition: fsl_mma955x_i2cspi_pedo.c:313
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_mma955x_Calibrate
isf_dsa_status_t fsl_mma955x_Calibrate(isf_SensorHandle_t *pSensorHandle, void *pCalData)
Definition: fsl_mma955x_i2cspi_pedo.c:380
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
fsl_mma955x_Initialize
isf_dsa_status_t fsl_mma955x_Initialize(isf_SensorHandle_t *pSensorHandle)
Definition: fsl_mma955x_i2cspi_pedo.c:57
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
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
mma955x_SupportedDataTypes
isf_SensorDataTypes_t mma955x_SupportedDataTypes[]
Definition: fsl_mma955x_i2cspi_pedo.c:29
fsl_mma955x_StartData
isf_dsa_status_t fsl_mma955x_StartData(isf_SensorHandle_t *pSensorHandle)
Definition: fsl_mma955x_i2cspi_pedo.c:252
mma955x_SupportedSensorTypes
isf_SensorTypes_t mma955x_SupportedSensorTypes[]
Supported sensor and data types.
Definition: fsl_mma955x_i2cspi_pedo.c:28

This creates the sensor adapter instance for the target sensor.

This allows access to the sensor adapter instance for the target sensor.

Definition at line 198 of file MMA955x_1.c.

uint8 MMA955x_1_ConfigRegisterBuffer[MMA955x_1_CONFIG_REGISTER_SIZE]

Definition at line 42 of file MMA955x_1.c.

const i2c_device_t MMA955x_1_DeviceInfo

This allows access to the sensor communications specific configuration.

Definition at line 213 of file MMA955x_1.c.

const i2c_device_t MMA955x_1_DeviceInfo

Initial value:
=
{
.baudRate_kbps = 400,
.address = 76
}

This allows access to the sensor communications specific configuration.

Definition at line 213 of file MMA955x_1.c.

mma955x_Sensor_Specific_Settings_t MMA955x_1_Sensor_Specific_Config

This allows access to the sensor specific configuration for the target sensor.

Definition at line 172 of file MMA955x_1.c.

mma955x_Sensor_Specific_Settings_t MMA955x_1_Sensor_Specific_Config

Initial value:
=
{
.sampleDataOffset = MMA955x_1_SAMPLE_OFFSET,
.sampleDataSize = MMA955x_1_SAMPLE_SIZE,
.commandReadOffset = MMA955x_1_CONFIG_REGISTER_READ_OFFSET,
.commandReadSize = MMA955x_1_CONFIG_REGISTER_SIZE,
.engFloatConversionFactor = MMA955x_1_ACC_FLOAT_CONVERSION_FACTOR_8g,
.engFixedTotalWidth = 32,
.engFixedIntegerWidth = 16,
.engFixedSignBit = 1,
.writeConfigCommands = { .numCommands=sizeof(MMA955x_WriteConfigurationSequence)/sizeof(mma955x_Command_t), .commands=MMA955x_WriteConfigurationSequence },
.readConfigCommands = { .numCommands=sizeof(MMA955x_ReadConfigurationSequence)/sizeof(mma955x_Command_t), .commands=MMA955x_ReadConfigurationSequence },
.initializeCommands = { .numCommands=sizeof(MMA955x_InitializeSequence)/sizeof(mma955x_Command_t), .commands=MMA955x_InitializeSequence },
.validateSettingsCommands = { .numCommands=0, .commands=NULL },
.configureCommands = { .numCommands=sizeof(MMA955x_ConfigureSequence)/sizeof(mma955x_Command_t), .commands=MMA955x_ConfigureSequence },
.startDataCommands = { .numCommands=sizeof(MMA955x_StartDataSequence)/sizeof(mma955x_Command_t), .commands=MMA955x_StartDataSequence },
.endDataCommands = { .numCommands=sizeof(MMA955x_StopDataSequence)/sizeof(mma955x_Command_t), .commands=MMA955x_StopDataSequence },
.calibrateCommands = { .numCommands=0, .commands=NULL },
.shutdownCommands = { .numCommands=sizeof(MMA955x_ShutdownDataSequence)/sizeof(mma955x_Command_t), .commands=MMA955x_ShutdownDataSequence },
.getPedometerDataCommands = { .numCommands=sizeof(MMA955x_ReadPeadometerDataSequence)/sizeof(mma955x_Command_t), .commands=MMA955x_ReadPeadometerDataSequence }
}
MMA955x_1_CONFIG_REGISTER_READ_OFFSET
#define MMA955x_1_CONFIG_REGISTER_READ_OFFSET
Definition: MMA955x_1.h:53
MMA955x_InitializeSequence
const mma955x_Command_t const MMA955x_InitializeSequence[]
Definition: MMA955x_1.c:80
MMA955x_ConfigureSequence
const mma955x_Command_t const MMA955x_ConfigureSequence[]
Definition: MMA955x_1.c:89
MMA955x_1_CONFIG_REGISTER_SIZE
#define MMA955x_1_CONFIG_REGISTER_SIZE
Definition: MMA955x_1.h:54
MMA955x_ReadPeadometerDataSequence
const mma955x_Command_t const MMA955x_ReadPeadometerDataSequence[]
Definition: MMA955x_1.c:163
MMA955x_1_SAMPLE_SIZE
#define MMA955x_1_SAMPLE_SIZE
Definition: MMA955x_1.h:52
MMA955x_ShutdownDataSequence
const mma955x_Command_t const MMA955x_ShutdownDataSequence[]
Definition: MMA955x_1.c:136
MMA955x_StopDataSequence
const mma955x_Command_t const MMA955x_StopDataSequence[]
Definition: MMA955x_1.c:127
MMA955x_1_ACC_FLOAT_CONVERSION_FACTOR_8g
#define MMA955x_1_ACC_FLOAT_CONVERSION_FACTOR_8g
Definition: MMA955x_1.h:59
MMA955x_1_SAMPLE_OFFSET
#define MMA955x_1_SAMPLE_OFFSET
Definition: MMA955x_1.h:51
mma955x_Command_t
Definition: mma955x.h:57
MMA955x_StartDataSequence
const mma955x_Command_t const MMA955x_StartDataSequence[]
Definition: MMA955x_1.c:118
MMA955x_ReadConfigurationSequence
const mma955x_Command_t const MMA955x_ReadConfigurationSequence[]
Definition: MMA955x_1.c:145
MMA955x_WriteConfigurationSequence
const mma955x_Command_t const MMA955x_WriteConfigurationSequence[]
Definition: MMA955x_1.c:154

This allows access to the sensor specific configuration for the target sensor.

Definition at line 172 of file MMA955x_1.c.

const mma955x_Command_t const MMA955x_ConfigureSequence[]

Initial value:
=
{
{
.offset = 0,
.nByteWrite = sizeof(FSRange_8g),
.pWriteBuffer = (uint8* const)FSRange_8g
},
{
.offset = 0,
.nByteWrite = sizeof(SelectedSampleRate),
.pWriteBuffer = (uint8* const)SelectedSampleRate
},
{
.offset = 0,
.nByteWrite = sizeof(SelectedAFEPriority),
.pWriteBuffer = (uint8* const)SelectedAFEPriority
},
{
.offset = 0,
.nByteWrite = sizeof(SelectedMBoxPriority),
.pWriteBuffer = (uint8* const)SelectedMBoxPriority
},
{
.offset = 0,
.nByteWrite = sizeof(WakeApplication),
.pWriteBuffer = (uint8* const)WakeApplication
}
}
uint8
unsigned char uint8
Definition: isf_types.h:76
WakeApplication
const uint8 const WakeApplication[]
Definition: MMA955x_1.c:70
SelectedAFEPriority
uint8 SelectedAFEPriority[]
Definition: MMA955x_1.c:46
FSRange_8g
const uint8 const FSRange_8g[]
Definition: MMA955x_1.c:68
SelectedSampleRate
uint8 SelectedSampleRate[]
Definition: MMA955x_1.c:45
SelectedMBoxPriority
uint8 SelectedMBoxPriority[]
Definition: MMA955x_1.c:47

Definition at line 89 of file MMA955x_1.c.

const mma955x_Command_t const MMA955x_InitializeSequence[]

Initial value:
=
{
{
.offset = 0,
.nByteWrite = sizeof(MBoxQRDataXYZ),
.pWriteBuffer = (uint8* const)MBoxQRDataXYZ
}
}
uint8
unsigned char uint8
Definition: isf_types.h:76
MBoxQRDataXYZ
const uint8 const MBoxQRDataXYZ[]
Definition: MMA955x_1.c:74

Definition at line 80 of file MMA955x_1.c.

const mma955x_Command_t const MMA955x_ReadConfigurationSequence[]

Initial value:
=
{
{
.offset = 0,
.nByteWrite = sizeof(ReadPedometerConfiguration),
.pWriteBuffer = (uint8* const)ReadPedometerConfiguration
}
}
uint8
unsigned char uint8
Definition: isf_types.h:76
ReadPedometerConfiguration
const uint8 const ReadPedometerConfiguration[]
Definition: MMA955x_1.c:77

Definition at line 145 of file MMA955x_1.c.

const mma955x_Command_t const MMA955x_ReadPeadometerDataSequence[]

Initial value:
=
{
{
.offset = 0,
.nByteWrite = sizeof(ReadPedometerData),
.pWriteBuffer = (uint8* const)ReadPedometerData
}
}
uint8
unsigned char uint8
Definition: isf_types.h:76
ReadPedometerData
const uint8 const ReadPedometerData[]
Definition: MMA955x_1.c:76

Definition at line 163 of file MMA955x_1.c.

const mma955x_Command_t const MMA955x_ShutdownDataSequence[]

Initial value:
=
{
{
.offset = 0,
.nByteWrite = sizeof(SleepApplication),
.pWriteBuffer = (uint8* const)SleepApplication
}
}
uint8
unsigned char uint8
Definition: isf_types.h:76
SleepApplication
const uint8 const SleepApplication[]
Definition: MMA955x_1.c:73

Definition at line 136 of file MMA955x_1.c.

const mma955x_Command_t const MMA955x_StartDataSequence[]

Initial value:
=
{
{
.offset = 0,
.nByteWrite = sizeof(LegacyMode),
.pWriteBuffer = (uint8* const)LegacyMode
}
}
uint8
unsigned char uint8
Definition: isf_types.h:76
LegacyMode
const uint8 const LegacyMode[]
Definition: MMA955x_1.c:71

Definition at line 118 of file MMA955x_1.c.

const mma955x_Command_t const MMA955x_StopDataSequence[]

Initial value:
=
{
{
.offset = 0,
.nByteWrite = sizeof(NormalMode),
.pWriteBuffer = (uint8* const)NormalMode
}
}
uint8
unsigned char uint8
Definition: isf_types.h:76
NormalMode
const uint8 const NormalMode[]
Definition: MMA955x_1.c:72

Definition at line 127 of file MMA955x_1.c.

const mma955x_Command_t const MMA955x_WriteConfigurationSequence[]

Initial value:
=
{
{
.offset = 0,
.nByteWrite = sizeof(WritePedometerConfiguration),
.pWriteBuffer = (uint8* const)WritePedometerConfiguration
}
}
uint8
unsigned char uint8
Definition: isf_types.h:76
WritePedometerConfiguration
const uint8 const WritePedometerConfiguration[]
Definition: MMA955x_1.c:78

Definition at line 154 of file MMA955x_1.c.

const uint8 const NormalMode[] = { 0x18, 0x20, 0x00, 0x01, 0x00 }

Definition at line 72 of file MMA955x_1.c.

const uint8 const ReadPedometerConfiguration[] = { 0x15, 0x10, 0x00, 0x11 }

Definition at line 77 of file MMA955x_1.c.

const uint8 const ReadPedometerData[] = { 0x15, 0x30, 0x00, 0x0C }

Definition at line 76 of file MMA955x_1.c.

const uint8 SampleRates[]

Initial value:
= { 0x07,
0x08,
0x09,
0x0A,
0x0B,
0x0C,
0x0D,
0x0E }

Definition at line 49 of file MMA955x_1.c.

Referenced by mma955xSetSamplingRate().

uint8 SelectedAFEPriority[] = { 0x01, 0x20, 0x32, 0x01, 0x00 }

Definition at line 46 of file MMA955x_1.c.

Referenced by mma955xSetSamplingRate().

uint8 SelectedMBoxPriority[] = { 0x01, 0x20, 0x30, 0x01, 0x00 }

Definition at line 47 of file MMA955x_1.c.

Referenced by mma955xSetSamplingRate().

uint8 SelectedSampleRate[] = { 0x06, 0x20, 0x0C, 0x01, 0x00 }

Definition at line 45 of file MMA955x_1.c.

Referenced by mma955xSetSamplingRate().

const uint8 const SleepApplication[] = { 0x12, 0x20, 0x06, 0x01, 0x01 }

Definition at line 73 of file MMA955x_1.c.

const uint8 const WakeApplication[] = { 0x12, 0x20, 0x06, 0x01, 0x00 }

Definition at line 70 of file MMA955x_1.c.

const uint8 const WritePedometerConfiguration[] = { 0x15, 0x20, 0x00, 0x11 }

Definition at line 78 of file MMA955x_1.c.

- © Freescale Semiconductor, Inc. 2016. All Rights Reserved.