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

Data Structures

struct  fxls8471_Specific_Settings_t
 This structure defines important settings. More...
 
struct  fxls8471_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 FXLS8471 sensor. More...
 

Typedefs

typedef int32 fxls8471_status_t
 

Enumerations

enum  {
  FSL_FXLS8471_ACCEL_800HZ = 1250, FSL_FXLS8471_ACCEL_400HZ = 2500, FSL_FXLS8471_ACCEL_200HZ = 5000, FSL_FXLS8471_ACCEL_100HZ = 10000,
  FSL_FXLS8471_ACCEL_50HZ = 20000, FSL_FXLS8471_ACCEL_12p5HZ = 80000, FSL_FXLS8471_ACCEL_6p25HZ = 160000, FSL_FXLS8471_ACCEL_1p56HZ = 640000
}
 This enumerator describes the available sample rates for the FXLS8471 accelerometer. More...
 
enum  { FSL_FXLS8471_ACCEL_SCALE_2G = 0, FSL_FXLS8471_ACCEL_SCALE_4G = 1, FSL_FXLS8471_ACCEL_SCALE_8G = 2 }
 This enumerator describes the available acceleration ranges for the MM865X family of accelerometers. More...
 

Functions

void fxls8471_Reset (int32_t *status, void *pSensorHandle)
 This function resets the FXLS8471 sensor resulting in a default configuration for all registers. More...
 
void fxls8471_CheckId (int32_t *status, void *pSensorHandle)
 This function validates the FXLS8471 sensor is connected via the I2C bus. More...
 
void fxls8471_SetMode (int32_t *status, void *pSensorHandle, int32_t Mode)
 This function sets the FXLS8471 part to the requested mode. More...
 
void fxls8471_ValidateConfig (int32_t *status, void *pSensorHandle, void *pSettings)
 This function validates the configuration for the FXLS8471 sensor. More...
 
isf_dsa_status_t fxls8471_GetConfig (isf_dsa_SensorSettings_t *pRequiredSettings, DeviceDescriptor_t *pDeviceDes)
 This function obtains the configuration register values for a given user configuration of the FXLS8471. If the configuration has changed then it returns true and saves the new configuration. More...
 
isf_dsa_status_t fxls8471_SetConfig (isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pConfigSettings)
 This function sets the FXLS8471 sensor configuration. More...
 
isf_dsa_status_t fxls8471_GetData (isf_SensorHandle_t *pSensorHandle, void *pBuffer)
 
isf_dsa_status_t fsl_fxls8471_i2cspi_3D_accel_Initialize (isf_SensorHandle_t *pSensorHandle)
 
isf_dsa_status_t fsl_fxls8471_i2cspi_3D_accel_ValidateSettings (isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
 
isf_dsa_status_t fsl_fxls8471_i2cspi_3D_accel_Configure (isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
 
isf_dsa_status_t fsl_fxls8471_i2cspi_3D_accel_StartData (isf_SensorHandle_t *pSensorHandle)
 
isf_dsa_status_t fsl_fxls8471_i2cspi_3D_accel_EndData (isf_SensorHandle_t *pSensorHandle)
 
isf_dsa_status_t fsl_fxls8471_i2cspi_3D_accel_Calibrate (isf_SensorHandle_t *pSensorHandle, void *pCalData)
 
isf_dsa_status_t fsl_fxls8471_i2cspi_3D_accel_Shutdown (isf_SensorHandle_t *pSensorHandle)
 
void fsl_fxls8471_i2cspi_3D_accel_PeriodicCallback (void *pSensorHandle)
 
isf_dsa_status_t fsl_fxls8471_i2cspi_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
 
fxls8471AccelConvTable []
 
isf_SensorTypes_t fxls8471_SupportedSensorTypes [] = { TYPE_ACCELEROMETER_3D, TYPE_NATIVE_SENSOR_TYPE }
 Supported sensor and data types for FXLS8471. More...
 
isf_SensorDataTypes_t fxls8471_SupportedDataTypes [] = { TYPE_RAW_ACCELERATION_3D, TYPE_NATIVE_SENSOR_DATA_TYPE }
 
isf_SensorTypes_t fxls8471_SupportedSensorTypes []
 Supported sensor and data types for FXLS8471. More...
 
isf_SensorDataTypes_t fxls8471_SupportedDataTypes []
 

Detailed Description

Macro Definition Documentation

#define BYTES_FOR_FULL_READ   7

This function retrieves the raw data from the FXLS8471 sensor.

Definition at line 804 of file fsl_fxls8471_i2cspi_3D_accel.c.

Referenced by fxls8471_GetData().

Typedef Documentation

Definition at line 70 of file fsl_fxls8471_i2cspi_3D_accel.c.

Enumeration Type Documentation

anonymous enum

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

Enumerator
FSL_FXLS8471_ACCEL_800HZ 

800 Hz

FSL_FXLS8471_ACCEL_400HZ 

400 Hz

FSL_FXLS8471_ACCEL_200HZ 

200 Hz

FSL_FXLS8471_ACCEL_100HZ 

100 Hz

FSL_FXLS8471_ACCEL_50HZ 

50 Hz

FSL_FXLS8471_ACCEL_12p5HZ 

12.5 Hz

FSL_FXLS8471_ACCEL_6p25HZ 

6.25 Hz

FSL_FXLS8471_ACCEL_1p56HZ 

1.56 Hz

Definition at line 27 of file fsl_fxls8471_i2cspi_3D_accel.h.

anonymous enum

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

Enumerator
FSL_FXLS8471_ACCEL_SCALE_2G 

select +/-2G range

FSL_FXLS8471_ACCEL_SCALE_4G 

select +/-4G range

FSL_FXLS8471_ACCEL_SCALE_8G 

select +/-8G range

Definition at line 39 of file fsl_fxls8471_i2cspi_3D_accel.h.

Function Documentation

isf_dsa_status_t fsl_fxls8471_i2cspi_3D_accel_Calibrate ( isf_SensorHandle_t pSensorHandle,
void *  pCalData 
)

Definition at line 449 of file fsl_fxls8471_i2cspi_3D_accel.c.

References ISF_SUCCESS.

isf_dsa_status_t fsl_fxls8471_i2cspi_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 592 of file fsl_fxls8471_i2cspi_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_fxls8471_i2cspi_3D_accel_PeriodicCallback().

Here is the caller graph for this function:

isf_dsa_status_t fsl_fxls8471_i2cspi_3D_accel_Shutdown ( isf_SensorHandle_t pSensorHandle)
isf_dsa_status_t fsl_fxls8471_i2cspi_3D_accel_ValidateSettings ( isf_SensorHandle_t pSensorHandle,
isf_dsa_SensorSettings_t pSensorSettings 
)

Definition at line 207 of file fsl_fxls8471_i2cspi_3D_accel.c.

References DSA_ERR_PARAM, and fxls8471_ValidateConfig().

Here is the call graph for this function:

void fxls8471_CheckId ( int32_t *  status,
void *  pSensorHandle 
)

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

Definition at line 695 of file fsl_fxls8471_i2cspi_3D_accel.c.

References DeviceDescriptor_struct::deviceHandle, dm_device_read(), FXLS8471_WHO_AM_I, FXLS8471_WHOAMI_VALUE, ISF_SUCCESS, isf_SensorHandle_st::pDeviceDescriptor, and SENSOR_ERROR_CHECKID.

Referenced by fsl_fxls8471_i2cspi_3D_accel_Initialize().

Here is the call graph for this function:

Here is the caller graph for this function:

isf_dsa_status_t fxls8471_GetConfig ( isf_dsa_SensorSettings_t pRequiredSettings,
DeviceDescriptor_t pDeviceDes 
)

This function obtains the configuration register values for a given user configuration of the FXLS8471. 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
fxls8471_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_fxls8471_i2cspi_3D_accel.lib

Definition at line 887 of file fsl_fxls8471_i2cspi_3D_accel.c.

References DSA_RET_SETTINGS_CHANGED, FALSE, FSL_FXLS8471_ACCEL_800HZ, isf_dsa_SensorSettings_st::nSamplePeriod, fxls8471_Specific_Settings_t::sampleRateIndex, and TRUE.

Referenced by fxls8471_ValidateConfig().

Here is the caller graph for this function:

isf_dsa_status_t fxls8471_GetData ( isf_SensorHandle_t pSensorHandle,
void *  pBuffer 
)
void fxls8471_Reset ( int32_t *  status,
void *  pSensorHandle 
)

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

Definition at line 665 of file fsl_fxls8471_i2cspi_3D_accel.c.

References DeviceDescriptor_struct::deviceHandle, dm_device_write(), DSA_ERR_INITIALIZE, FXLS8471_ASLP_COUNT, FXLS8471_CTRL_REG2, FXLS8471_RST_MASK, ISF_SUCCESS, and isf_SensorHandle_st::pDeviceDescriptor.

Here is the call graph for this function:

isf_dsa_status_t fxls8471_SetConfig ( isf_SensorHandle_t pSensorHandle,
isf_dsa_SensorSettings_t pConfigSettings 
)
void fxls8471_SetMode ( int32_t *  status,
void *  pSensorHandle,
int32_t  Mode 
)

This function sets the FXLS8471 part to the requested mode.

Definition at line 740 of file fsl_fxls8471_i2cspi_3D_accel.c.

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

Referenced by fsl_fxls8471_i2cspi_3D_accel_Configure(), fsl_fxls8471_i2cspi_3D_accel_EndData(), and fsl_fxls8471_i2cspi_3D_accel_StartData().

Here is the caller graph for this function:

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

This function validates the configuration for the FXLS8471 sensor.

Definition at line 718 of file fsl_fxls8471_i2cspi_3D_accel.c.

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

Referenced by fsl_fxls8471_i2cspi_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 58 of file fsl_fxls8471_i2cspi_3D_accel.c.

int32 fixedOffset

Definition at line 59 of file fsl_fxls8471_i2cspi_3D_accel.c.

float floatFactor

Definition at line 56 of file fsl_fxls8471_i2cspi_3D_accel.c.

float floatOffset

Definition at line 57 of file fsl_fxls8471_i2cspi_3D_accel.c.

isf_SensorDataTypes_t fxls8471_SupportedDataTypes[]

Definition at line 67 of file fsl_fxls8471_i2cspi_3D_accel.c.

Definition at line 67 of file fsl_fxls8471_i2cspi_3D_accel.c.

isf_SensorTypes_t fxls8471_SupportedSensorTypes[]

Supported sensor and data types for FXLS8471.

Definition at line 66 of file fsl_fxls8471_i2cspi_3D_accel.c.

isf_SensorTypes_t fxls8471_SupportedSensorTypes[] = { TYPE_ACCELEROMETER_3D, TYPE_NATIVE_SENSOR_TYPE }

Supported sensor and data types for FXLS8471.

Definition at line 66 of file fsl_fxls8471_i2cspi_3D_accel.c.

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