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

Data Structures

struct  dataPair_t
 
struct  fLfiTable_t
 
struct  mpl3115_Specific_Settings_t
 This structure defines important settings. More...
 
struct  mpl3115_DataBuffer_t
 This structure defines the dummy DSA data buffer format. More...
 

Macros

#define MPL3115_PRESS_FLOAT_CONVERSION_FACTOR   0.000000061035
 
#define MPL3115_PRESS_FLOAT_CONVERSION_OFFSET   0.0
 
#define MPL3115_PRESS_FIXED_CONVERSION_FACTOR   (1000/4)
 
#define MPL3115_PRESS_FIXED_CONVERSION_OFFSET   0
 
#define MPL3115_ALT_FLOAT_CONVERSION_FACTOR   1.0
 
#define MPL3115_ALT_FLOAT_CONVERSION_OFFSET   0.0
 
#define MPL3115_ALT_FIXED_CONVERSION_FACTOR   1
 
#define MPL3115_ALT_FIXED_CONVERSION_OFFSET   0
 
#define MPL3115_TEMP_FLOAT_CONVERSION_FACTOR   256.0
 
#define MPL3115_TEMP_FLOAT_CONVERSION_OFFSET   0.0
 
#define MPL3115_TEMP_FIXED_CONVERSION_FACTOR   256
 
#define MPL3115_TEMP_FIXED_CONVERSION_OFFSET   0
 
#define MPL3115_ONE_SECOND   1000000
 
#define BYTES_FOR_FULL_READ   5
 This function retrieves the raw data from the MPL3115 sensor. More...
 
#define MPL3115_DEBUG   0
 
#define ABSOLUTE_VALUE(x)   ( (x) < 0.0 ? (-(x)) : (x))
 
#define ZERO_EPSILON   (1.0E-10)
 
#define IS_PRACTICALLY_ZERO(x)   ( ABSOLUTE_VALUE(x) < ZERO_EPSILON )
 

Enumerations

enum  { LFI_NO_EXTRAPOLATION = 0, LFI_TABLE_LIMITS = 1, LFI_EXTRAPOLATE = 2 }
 
enum  { LFI_SUCCESS = 0, LFI_BAD_TABLE = -1, LFI_BAD_PTR = -2, LFI_OUT_OF_RANGE = -3 }
 
enum  {
  FSL_MPL3115_ACCEL_800HZ = 1250, FSL_MPL3115_ACCEL_400HZ = 2500, FSL_MPL3115_ACCEL_200HZ = 5000, FSL_MPL3115_ACCEL_100HZ = 10000,
  FSL_MPL3115_ACCEL_50HZ = 20000, FSL_MPL3115_ACCEL_12p5HZ = 80000, FSL_MPL3115_ACCEL_6p25HZ = 160000, FSL_MPL3115_ACCEL_1p56HZ = 640000
}
 This enumerator describes the available sample rates for the MPL3115 accelerometer. More...
 
enum  { FSL_MPL3115_ACCEL_SCALE_2G = 0, FSL_MPL3115_ACCEL_SCALE_4G = 1, FSL_MPL3115_ACCEL_SCALE_8G = 2 }
 This enumerator describes the available acceleration ranges for the MM865X family of accelerometers. More...
 

Functions

long fLfi (const fLfiTable_t *lookupTable, float lFiIn, float *lfiOut)
 
void mpl3115_Reset (int32_t *status, void *pSensorHandle)
 This function resets the MPL3115 sensor resulting in a default configuration for all registers. More...
 
void mpl3115_CheckId (int32_t *status, void *pSensorHandle)
 This function validates the MPL3115 sensor is connected via the I2C bus. More...
 
void mpl3115_SetMode (int32_t *status, void *pSensorHandle, int32_t Mode)
 This function sets the MPL3115 part to the requested mode. More...
 
void mpl3115_ValidateConfig (int32_t *status, void *pSensorHandle, void *pSettings)
 This function validates the configuration for the MPL3115 sensor. More...
 
isf_dsa_status_t mpl3115_SetConfig (isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pConfigSettings)
 This function sets the MPL3115 sensor configuration. More...
 
int32 convertPressureToAltitude (uint32 pressure)
 
isf_dsa_status_t mpl3115_GetData (isf_SensorHandle_t *pSensorHandle, mpl3115_DataBuffer_t *pData)
 
isf_dsa_status_t fsl_mpl3115_i2c_1D_press_Initialize (isf_SensorHandle_t *pSensorHandle)
 
isf_dsa_status_t fsl_mpl3115_i2c_1D_press_ValidateSettings (isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
 
isf_dsa_status_t fsl_mpl3115_i2c_1D_press_Configure (isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
 
isf_dsa_status_t fsl_mpl3115_i2c_1D_press_StartData (isf_SensorHandle_t *pSensorHandle)
 
isf_dsa_status_t fsl_mpl3115_i2c_1D_press_EndData (isf_SensorHandle_t *pSensorHandle)
 
isf_dsa_status_t fsl_mpl3115_i2c_1D_press_Calibrate (isf_SensorHandle_t *pSensorHandle, void *pCalData)
 
isf_dsa_status_t fsl_mpl3115_i2c_1D_press_Shutdown (isf_SensorHandle_t *pSensorHandle)
 
void fsl_mpl3115_i2c_1D_press_PeriodicCallback (void *pSensorHandle)
 
isf_dsa_status_t fsl_mpl3115_i2c_1D_press_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...
 
void mpl3115_ReadRegisters (isf_SensorHandle_t *pSensorHandle)
 

Variables

isf_SensorTypes_t mpl3115_SupportedSensorTypes [] = { TYPE_THERMOMETER, TYPE_ALTIMETER, TYPE_BAROMETER, TYPE_ABSOLUTE_PRESSURE_SENSOR, TYPE_NATIVE_SENSOR_TYPE }
 Supported sensor and data types for MPL3115. More...
 
isf_SensorDataTypes_t mpl3115_SupportedDataTypes [] = { TYPE_TEMPERATURE, TYPE_ALTITUDE, TYPE_PRESSURE, TYPE_NATIVE_SENSOR_DATA_TYPE }
 
isf_SensorTypes_t mpl3115_SupportedSensorTypes []
 Supported sensor and data types for MPL3115. More...
 
isf_SensorDataTypes_t mpl3115_SupportedDataTypes []
 

Detailed Description

Macro Definition Documentation

#define ABSOLUTE_VALUE (   x)    ( (x) < 0.0 ? (-(x)) : (x))

Definition at line 994 of file fsl_mpl3115_i2c_1D_press.c.

#define BYTES_FOR_FULL_READ   5

This function retrieves the raw data from the MPL3115 sensor.

Definition at line 902 of file fsl_mpl3115_i2c_1D_press.c.

Referenced by mpl3115_GetData().

#define IS_PRACTICALLY_ZERO (   x)    ( ABSOLUTE_VALUE(x) < ZERO_EPSILON )

Definition at line 996 of file fsl_mpl3115_i2c_1D_press.c.

Referenced by fLfi().

#define MPL3115_ALT_FIXED_CONVERSION_FACTOR   1

Definition at line 44 of file fsl_mpl3115_i2c_1D_press.c.

#define MPL3115_ALT_FIXED_CONVERSION_OFFSET   0

Definition at line 45 of file fsl_mpl3115_i2c_1D_press.c.

#define MPL3115_ALT_FLOAT_CONVERSION_FACTOR   1.0

Definition at line 42 of file fsl_mpl3115_i2c_1D_press.c.

#define MPL3115_ALT_FLOAT_CONVERSION_OFFSET   0.0

Definition at line 43 of file fsl_mpl3115_i2c_1D_press.c.

#define MPL3115_DEBUG   0

Definition at line 928 of file fsl_mpl3115_i2c_1D_press.c.

#define MPL3115_ONE_SECOND   1000000

Definition at line 154 of file fsl_mpl3115_i2c_1D_press.c.

Referenced by mpl3115_ValidateConfig().

#define MPL3115_PRESS_FIXED_CONVERSION_FACTOR   (1000/4)

Definition at line 40 of file fsl_mpl3115_i2c_1D_press.c.

#define MPL3115_PRESS_FIXED_CONVERSION_OFFSET   0

Definition at line 41 of file fsl_mpl3115_i2c_1D_press.c.

#define MPL3115_PRESS_FLOAT_CONVERSION_FACTOR   0.000000061035

Definition at line 38 of file fsl_mpl3115_i2c_1D_press.c.

#define MPL3115_PRESS_FLOAT_CONVERSION_OFFSET   0.0

Definition at line 39 of file fsl_mpl3115_i2c_1D_press.c.

#define MPL3115_TEMP_FIXED_CONVERSION_FACTOR   256

Definition at line 48 of file fsl_mpl3115_i2c_1D_press.c.

#define MPL3115_TEMP_FIXED_CONVERSION_OFFSET   0

Definition at line 49 of file fsl_mpl3115_i2c_1D_press.c.

#define MPL3115_TEMP_FLOAT_CONVERSION_FACTOR   256.0

Definition at line 46 of file fsl_mpl3115_i2c_1D_press.c.

#define MPL3115_TEMP_FLOAT_CONVERSION_OFFSET   0.0

Definition at line 47 of file fsl_mpl3115_i2c_1D_press.c.

#define ZERO_EPSILON   (1.0E-10)

Definition at line 995 of file fsl_mpl3115_i2c_1D_press.c.

Enumeration Type Documentation

anonymous enum
Enumerator
LFI_NO_EXTRAPOLATION 
LFI_TABLE_LIMITS 
LFI_EXTRAPOLATE 

Definition at line 51 of file fsl_mpl3115_i2c_1D_press.c.

anonymous enum
Enumerator
LFI_SUCCESS 
LFI_BAD_TABLE 
LFI_BAD_PTR 
LFI_OUT_OF_RANGE 

Definition at line 57 of file fsl_mpl3115_i2c_1D_press.c.

anonymous enum

This enumerator describes the available sample rates for the MPL3115 accelerometer.

Enumerator
FSL_MPL3115_ACCEL_800HZ 

800 Hz

FSL_MPL3115_ACCEL_400HZ 

400 Hz

FSL_MPL3115_ACCEL_200HZ 

200 Hz

FSL_MPL3115_ACCEL_100HZ 

100 Hz

FSL_MPL3115_ACCEL_50HZ 

50 Hz

FSL_MPL3115_ACCEL_12p5HZ 

12.5 Hz

FSL_MPL3115_ACCEL_6p25HZ 

6.25 Hz

FSL_MPL3115_ACCEL_1p56HZ 

1.56 Hz

Definition at line 27 of file fsl_mpl3115_i2c_1D_press.h.

anonymous enum

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

Enumerator
FSL_MPL3115_ACCEL_SCALE_2G 

select +/-2G range

FSL_MPL3115_ACCEL_SCALE_4G 

select +/-4G range

FSL_MPL3115_ACCEL_SCALE_8G 

select +/-8G range

Definition at line 39 of file fsl_mpl3115_i2c_1D_press.h.

Function Documentation

int32 convertPressureToAltitude ( uint32  pressure)

Definition at line 980 of file fsl_mpl3115_i2c_1D_press.c.

References fLfi().

Referenced by mpl3115_GetData().

Here is the call graph for this function:

Here is the caller graph for this function:

long fLfi ( const fLfiTable_t lookupTable,
float  lFiIn,
float *  lfiOut 
)
isf_dsa_status_t fsl_mpl3115_i2c_1D_press_Calibrate ( isf_SensorHandle_t pSensorHandle,
void *  pCalData 
)

Definition at line 525 of file fsl_mpl3115_i2c_1D_press.c.

References ISF_SUCCESS.

isf_dsa_status_t fsl_mpl3115_i2c_1D_press_Convert ( volatile isf_SensorHandle_t pSensorHandle,
isf_SensorDataTypes_t  convertToType,
isf_dsa_result_types_t  resultType,
void *  pNativeSample,
void *  pConvertedSample,
int32 numBytes 
)
isf_dsa_status_t fsl_mpl3115_i2c_1D_press_Shutdown ( isf_SensorHandle_t pSensorHandle)
isf_dsa_status_t fsl_mpl3115_i2c_1D_press_ValidateSettings ( isf_SensorHandle_t pSensorHandle,
isf_dsa_SensorSettings_t pSensorSettings 
)

Definition at line 283 of file fsl_mpl3115_i2c_1D_press.c.

References DSA_ERR_PARAM, and mpl3115_ValidateConfig().

Here is the call graph for this function:

void mpl3115_CheckId ( int32_t *  status,
void *  pSensorHandle 
)

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

Definition at line 798 of file fsl_mpl3115_i2c_1D_press.c.

References DeviceDescriptor_struct::deviceHandle, dm_device_read(), ISF_SUCCESS, MPL3115_WHO_AM_I, MPL3115_WHOAMI_VALUE, isf_SensorHandle_st::pDeviceDescriptor, and SENSOR_ERROR_CHECKID.

Referenced by fsl_mpl3115_i2c_1D_press_Initialize().

Here is the call graph for this function:

Here is the caller graph for this function:

void mpl3115_ReadRegisters ( isf_SensorHandle_t pSensorHandle)

Definition at line 931 of file fsl_mpl3115_i2c_1D_press.c.

References DeviceDescriptor_struct::deviceHandle, dm_device_read(), MPL3115_OFF_H, MPL3115_WHO_AM_I, and isf_SensorHandle_st::pDeviceDescriptor.

Referenced by mpl3115_SetConfig().

Here is the call graph for this function:

Here is the caller graph for this function:

void mpl3115_Reset ( int32_t *  status,
void *  pSensorHandle 
)

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

Definition at line 773 of file fsl_mpl3115_i2c_1D_press.c.

References DeviceDescriptor_struct::deviceHandle, dm_device_write(), DSA_ERR_INITIALIZE, ISF_SUCCESS, MPL3115_CTRL_REG1, MPL3115_RST_MASK, and isf_SensorHandle_st::pDeviceDescriptor.

Here is the call graph for this function:

isf_dsa_status_t mpl3115_SetConfig ( isf_SensorHandle_t pSensorHandle,
isf_dsa_SensorSettings_t pConfigSettings 
)
void mpl3115_SetMode ( int32_t *  status,
void *  pSensorHandle,
int32_t  Mode 
)

This function sets the MPL3115 part to the requested mode.

Definition at line 839 of file fsl_mpl3115_i2c_1D_press.c.

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

Referenced by fsl_mpl3115_i2c_1D_press_Configure(), fsl_mpl3115_i2c_1D_press_EndData(), and fsl_mpl3115_i2c_1D_press_StartData().

Here is the caller graph for this function:

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

This function validates the configuration for the MPL3115 sensor.

Definition at line 821 of file fsl_mpl3115_i2c_1D_press.c.

References DSA_RET_SETTINGS_CHANGED, ISF_SUCCESS, MPL3115_ONE_SECOND, and isf_dsa_SensorSettings_st::nSamplePeriod.

Referenced by fsl_mpl3115_i2c_1D_press_ValidateSettings().

Here is the caller graph for this function:

Variable Documentation

isf_SensorDataTypes_t mpl3115_SupportedDataTypes[]

Definition at line 157 of file fsl_mpl3115_i2c_1D_press.c.

isf_SensorTypes_t mpl3115_SupportedSensorTypes[]

Supported sensor and data types for MPL3115.

Definition at line 156 of file fsl_mpl3115_i2c_1D_press.c.

Supported sensor and data types for MPL3115.

Definition at line 156 of file fsl_mpl3115_i2c_1D_press.c.