ISF  2.1
Intelligent Sensing Framework for Kinetis with Processor Expert
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
fsl_mma865x_i2c_3D_accel module documentation

Data Structures

struct  mma865x_Specific_Settings_t
 This structure defines important settings. More...
 
struct  mma865x_DataBuffer_t
 This structure defines the dummy DSA data buffer format. More...
 

Macros

#define BYTES_FOR_FULL_READ   7
 This function retrieves the raw data from the MMA865x sensor. More...
 

Typedefs

typedef int32 mma865x_status_t
 

Enumerations

enum  {
  FSL_MMA865x_ACCEL_800HZ = 1250, FSL_MMA865x_ACCEL_400HZ = 2500, FSL_MMA865x_ACCEL_200HZ = 5000, FSL_MMA865x_ACCEL_100HZ = 10000,
  FSL_MMA865x_ACCEL_50HZ = 20000, FSL_MMA865x_ACCEL_12p5HZ = 80000, FSL_MMA865x_ACCEL_6p25HZ = 160000, FSL_MMA865x_ACCEL_1p56HZ = 640000
}
 This enumerator describes the available sample rates for the MM865X family of accelerometers. More...
 
enum  { FSL_MMA865x_ACCEL_DATA_FULL = 0, FSL_MMA865x_ACCEL_DATA_8BIT = 1 }
 This enumerator describes the available output resolutions for the MM865X family of accelerometers. More...
 
enum  { FSL_MMA865x_ACCEL_SCALE_2G = 0, FSL_MMA865x_ACCEL_SCALE_4G = 1, FSL_MMA865x_ACCEL_SCALE_8G = 2 }
 This enumerator describes the available acceleration ranges for the MM865X family of accelerometers. More...
 

Functions

void mma865x_Reset (int32_t *status, void *pSensorHandle)
 This function resets the MMA865x sensor resulting in a default configuration for all registers. More...
 
void mma865x_CheckId (int32_t *status, void *pSensorHandle)
 This function validates the MMA865x sensor is connected via the I2C bus. More...
 
void mma865x_SetMode (int32_t *status, void *pSensorHandle, int32_t Mode)
 This function sets the MMA865x part to the requested mode. More...
 
void mma865x_ValidateConfig (int32_t *status, void *pSensorHandle, void *pSettings)
 This function validates the configuration for the MMA865x sensor. More...
 
isf_dsa_status_t mma865x_GetConfig (isf_dsa_SensorSettings_t *pRequiredSettings, DeviceDescriptor_t *pDeviceDes)
 This function obtains the configuration register values for a given user configuration of the MMA865x. If the configuration has changed then it returns true and saves the new configuration. More...
 
isf_dsa_status_t mma865x_SetConfig (isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pConfigSettings)
 This function sets the MMA865x sensor configuration. More...
 
isf_dsa_status_t mma865x_GetData (isf_SensorHandle_t *pSensorHandle, void *pBuffer)
 
isf_dsa_status_t fsl_mma865x_i2c_3D_accel_Initialize (isf_SensorHandle_t *pSensorHandle)
 
isf_dsa_status_t fsl_mma865x_i2c_3D_accel_ValidateSettings (isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
 
isf_dsa_status_t fsl_mma865x_i2c_3D_accel_Configure (isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
 
isf_dsa_status_t fsl_mma865x_i2c_3D_accel_StartData (isf_SensorHandle_t *pSensorHandle)
 
isf_dsa_status_t fsl_mma865x_i2c_3D_accel_EndData (isf_SensorHandle_t *pSensorHandle)
 
isf_dsa_status_t fsl_mma865x_i2c_3D_accel_Calibrate (isf_SensorHandle_t *pSensorHandle, void *pCalData)
 
isf_dsa_status_t fsl_mma865x_i2c_3D_accel_Shutdown (isf_SensorHandle_t *pSensorHandle)
 
void fsl_mma865x_i2c_3D_accel_PeriodicCallback (void *pSensorHandle)
 
isf_dsa_status_t fsl_mma865x_i2c_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. More...
 

Variables

struct {
   float   floatFactor
 
   float   floatOffset
 
   int32   fixedFactor
 
   int32   fixedOffset
 
mma865xAccelConvTable []
 
isf_SensorTypes_t mma865x_SupportedSensorTypes [] = { TYPE_ACCELEROMETER_3D, TYPE_NATIVE_SENSOR_TYPE }
 Supported sensor and data types for MMA865x. More...
 
isf_SensorDataTypes_t mma865x_SupportedDataTypes [] = { TYPE_RAW_ACCELERATION_3D, TYPE_NATIVE_SENSOR_DATA_TYPE }
 
isf_SensorTypes_t mma865x_SupportedSensorTypes []
 Supported sensor and data types for MMA865x. More...
 
isf_SensorDataTypes_t mma865x_SupportedDataTypes []
 

Detailed Description

Macro Definition Documentation

#define BYTES_FOR_FULL_READ   7

This function retrieves the raw data from the MMA865x sensor.

Definition at line 788 of file fsl_mma865x_i2c_3D_accel.c.

Referenced by mma865x_GetData().

Typedef Documentation

Definition at line 70 of file fsl_mma865x_i2c_3D_accel.c.

Enumeration Type Documentation

anonymous enum

This enumerator describes the available sample rates for the MM865X family of accelerometers.

Enumerator
FSL_MMA865x_ACCEL_800HZ 

800 Hz

FSL_MMA865x_ACCEL_400HZ 

400 Hz

FSL_MMA865x_ACCEL_200HZ 

200 Hz

FSL_MMA865x_ACCEL_100HZ 

100 Hz

FSL_MMA865x_ACCEL_50HZ 

50 Hz

FSL_MMA865x_ACCEL_12p5HZ 

12.5 Hz

FSL_MMA865x_ACCEL_6p25HZ 

6.25 Hz

FSL_MMA865x_ACCEL_1p56HZ 

1.56 Hz

Definition at line 30 of file fsl_mma865x_i2c_3D_accel.h.

anonymous enum

This enumerator describes the available output resolutions for the MM865X family of accelerometers.

Enumerator
FSL_MMA865x_ACCEL_DATA_FULL 

select full-scale resolution

FSL_MMA865x_ACCEL_DATA_8BIT 

select 8-bit resolution

Definition at line 42 of file fsl_mma865x_i2c_3D_accel.h.

anonymous enum

This enumerator describes the available acceleration ranges for the MM865X family of accelerometers.

Enumerator
FSL_MMA865x_ACCEL_SCALE_2G 

select +/-2G range

FSL_MMA865x_ACCEL_SCALE_4G 

select +/-4G range

FSL_MMA865x_ACCEL_SCALE_8G 

select +/-8G range

Definition at line 48 of file fsl_mma865x_i2c_3D_accel.h.

Function Documentation

isf_dsa_status_t fsl_mma865x_i2c_3D_accel_Calibrate ( isf_SensorHandle_t pSensorHandle,
void *  pCalData 
)

Definition at line 433 of file fsl_mma865x_i2c_3D_accel.c.

References ISF_SUCCESS.

isf_dsa_status_t fsl_mma865x_i2c_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 at line 576 of file fsl_mma865x_i2c_3D_accel.c.

References DSA_ERR_BAD_RESULT_TYPE, DSA_ERR_BAD_SENSOR_DATA_TYPE, DSA_RESULT_TYPE_ENG_FIXED, DSA_RESULT_TYPE_ENG_FLOAT, SensorConfig_st::pSensorSpecificSettings, isf_SensorHandle_st::pSensorStaticConfig, and TYPE_RAW_ACCELERATION_3D.

Referenced by fsl_mma865x_i2c_3D_accel_PeriodicCallback().

Here is the caller graph for this function:

isf_dsa_status_t fsl_mma865x_i2c_3D_accel_Shutdown ( isf_SensorHandle_t pSensorHandle)
isf_dsa_status_t fsl_mma865x_i2c_3D_accel_ValidateSettings ( isf_SensorHandle_t pSensorHandle,
isf_dsa_SensorSettings_t pSensorSettings 
)

Definition at line 191 of file fsl_mma865x_i2c_3D_accel.c.

References DSA_ERR_PARAM, and mma865x_ValidateConfig().

Here is the call graph for this function:

void mma865x_CheckId ( int32_t *  status,
void *  pSensorHandle 
)

This function validates the MMA865x sensor is connected via the I2C bus.

Definition at line 679 of file fsl_mma865x_i2c_3D_accel.c.

References DeviceDescriptor_struct::deviceHandle, dm_device_read(), ISF_SUCCESS, MMA865x_WHO_AM_I, MMA865x_WHOAMI_VALUE_8652, MMA865x_WHOAMI_VALUE_8653, isf_SensorHandle_st::pDeviceDescriptor, and SENSOR_ERROR_CHECKID.

Referenced by fsl_mma865x_i2c_3D_accel_Initialize().

Here is the call graph for this function:

Here is the caller graph for this function:

isf_dsa_status_t mma865x_GetConfig ( isf_dsa_SensorSettings_t pRequiredSettings,
DeviceDescriptor_t pDeviceDes 
)

This function obtains the configuration register values for a given user configuration of the MMA865x. If the configuration has changed then it returns true and saves the new configuration.

Parameters
[out]pRequiredSettingsupdate the data period in settings
[out]pDeviceDesupdate the data rate in the generic sensor structure for this device
Returns
mma865x_GetConfig() returns a value of type isf_dsa_status_t indicating the success or failure of the function call.
Return values
0is returned when the configuration is valid.
1is returned when the configuration is modified.
Constraints:
None
Reentrant: Yes
Link Libraries:
lib_fsl_mma865x_i2c_3D_accel.lib

Definition at line 868 of file fsl_mma865x_i2c_3D_accel.c.

References DSA_RET_SETTINGS_CHANGED, FALSE, FSL_MMA865x_ACCEL_800HZ, isf_dsa_SensorSettings_st::nSamplePeriod, mma865x_Specific_Settings_t::sampleRateIndex, and TRUE.

Referenced by mma865x_ValidateConfig().

Here is the caller graph for this function:

isf_dsa_status_t mma865x_GetData ( isf_SensorHandle_t pSensorHandle,
void *  pBuffer 
)
void mma865x_Reset ( int32_t *  status,
void *  pSensorHandle 
)

This function resets the MMA865x sensor resulting in a default configuration for all registers.

Definition at line 649 of file fsl_mma865x_i2c_3D_accel.c.

References DeviceDescriptor_struct::deviceHandle, dm_device_write(), DSA_ERR_INITIALIZE, ISF_SUCCESS, MMA865x_ASLP_COUNT, MMA865x_CTRL_REG2, MMA865x_RST_MASK, and isf_SensorHandle_st::pDeviceDescriptor.

Here is the call graph for this function:

isf_dsa_status_t mma865x_SetConfig ( isf_SensorHandle_t pSensorHandle,
isf_dsa_SensorSettings_t pConfigSettings 
)
void mma865x_SetMode ( int32_t *  status,
void *  pSensorHandle,
int32_t  Mode 
)

This function sets the MMA865x part to the requested mode.

Definition at line 724 of file fsl_mma865x_i2c_3D_accel.c.

References DeviceDescriptor_struct::deviceHandle, and isf_SensorHandle_st::pDeviceDescriptor.

Referenced by fsl_mma865x_i2c_3D_accel_Configure(), fsl_mma865x_i2c_3D_accel_EndData(), and fsl_mma865x_i2c_3D_accel_StartData().

Here is the caller graph for this function:

void mma865x_ValidateConfig ( int32_t *  status,
void *  pSensorHandle,
void *  pSettings 
)

This function validates the configuration for the MMA865x sensor.

Definition at line 702 of file fsl_mma865x_i2c_3D_accel.c.

References DSA_RET_SETTINGS_CHANGED, ISF_SUCCESS, mma865x_GetConfig(), and isf_SensorHandle_st::pDeviceDescriptor.

Referenced by fsl_mma865x_i2c_3D_accel_ValidateSettings().

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

int32 fixedFactor

Definition at line 57 of file fsl_mma865x_i2c_3D_accel.c.

int32 fixedOffset

Definition at line 58 of file fsl_mma865x_i2c_3D_accel.c.

float floatFactor

Definition at line 55 of file fsl_mma865x_i2c_3D_accel.c.

float floatOffset

Definition at line 56 of file fsl_mma865x_i2c_3D_accel.c.

Definition at line 67 of file fsl_mma865x_i2c_3D_accel.c.

isf_SensorDataTypes_t mma865x_SupportedDataTypes[]

Definition at line 67 of file fsl_mma865x_i2c_3D_accel.c.

isf_SensorTypes_t mma865x_SupportedSensorTypes[] = { TYPE_ACCELEROMETER_3D, TYPE_NATIVE_SENSOR_TYPE }

Supported sensor and data types for MMA865x.

Definition at line 66 of file fsl_mma865x_i2c_3D_accel.c.

isf_SensorTypes_t mma865x_SupportedSensorTypes[]

Supported sensor and data types for MMA865x.

Definition at line 66 of file fsl_mma865x_i2c_3D_accel.c.

const { ... } mma865xAccelConvTable[]
Initial value:
=
{
{ 0.000061, 0.0, 8, 0},
{ 0.000122, 0.0, 16, 0},
{ 0.000244, 0.0, 32, 0}
}