ISF  2.2 rev 5
Intelligent Sensing Framework for Kinetis with Processor Expert
fsl_fxls8952_i2c_3D_accel module documentation

Data Structures

struct  fxls8952_DataBuffer_t
 This structure defines the dummy DSA data buffer format. More...
 
struct  fxls8952_ODR_Table_tag
 the structure defines the ODR table between Hybrid and normal mode of device operation. More...
 
struct  fxls8952_ConfigTable_tag
 the structure defines the configuration table. More...
 

Macros

#define FXLS8952_ACCEL_FLOAT_CONVERSION_FACTOR   (0.1)
 
#define FXLS8952_ACCEL_FLOAT_CONVERSION_OFFSET   (0.0)
 
#define FXLS8952_ACCEL_FIXED_CONVERSION_FACTOR   (1638)
 
#define FXLS8952_ACCEL_FIXED_CONVERSION_OFFSET   (0)
 
#define MAX_ACCEL_FULL_SCALE_RANGE   FXLS8952_RANGE_MAX
 
#define FXLS8952_SAMPLE_PERIOD_MAX   1280409
 
#define FXLS8952_SAMPLE_PERIOD_MIN   312
 
#define GET_ODR_CONFIG   0x0
 
#define GET_ODR_VALUE   0x01
 
#define NUM_STATUS_BYTES   1
 
#define NUMBER_OF_AXES_3D   0x3
 
#define MAX_NUM_AXES   0x3
 
#define MAX_FXLS8952_DM_BYTES   0x30
 
#define NUM_INTERNAL_ADDRESS_BYTES   0x1
 
#define ASSIGN_REG_BITS_VALUE(addr, val, mask, shift)    (addr) = (((addr) & ~ (mask)) | (((val) << shift)& (mask)) )
 
#define GET_MODE(mode)   ((mode) <= FXLS8952_MODE_HYBRID) ? (mode) : FXLS8952_MODE_HYBRID
 
#define GET_STRUCT_MEMBER_ADDRESS(p, m)   (&(p)->m)
 
#define GET_MEMBER_SIZE(p, m)   sizeof((p)->m)
 
#define FXLS8952_WHO_AM_I_VALUE   0x18
 

Typedefs

typedef int32 fxls8952_Status_t
 fxls8952 internal return codes. More...
 
typedef enum fxls8952_Power_tag fxls8952_Power_t
 Enumeration for the fxls8952 power modes. More...
 
typedef enum fxls8952_InternalState_tag fxls8952_InternalState_t
 Enumeration for the fxls8952 driver internal states. More...
 
typedef enum fxls8952_Range_tag fxls8952_Range_t
 
typedef struct fxls8952_ODR_Table_tag fxls8952_ODR_Table_t
 the structure defines the ODR table between Hybrid and normal mode of device operation. More...
 
typedef struct fxls8952_ConfigTable_tag fxls8952_ConfigTable_t
 the structure defines the configuration table. More...
 

Enumerations

enum  fxls8952_Error_tag {
  FXLS8952_ERROR_WHOAMI = 1, FXLS8952_ERROR_WAITFORACTIVE, FXLS8952_ERROR_BURSTWRITE, FXLS8952_ERROR_CONFIG,
  FXLS8952_ERROR_SETPOWER, FXLS8952_ERRO_WRITE, FXLS8952_ERRO_READ
}
 Enumeration for the fxls8952 internal error codes. More...
 
enum  fxls8952_Power_tag { FXLS8952_POWER_STANDBY = 0, FXLS8952_POWER_ACTIVE = 1 }
 Enumeration for the fxls8952 power modes. More...
 
enum  fxls8952_InternalState_tag { FXLS8952_STATE_UNINTIALIZED, FXLS8952_STATE_INITIALIZED, FXLS8952_STATE_CONFIGURED, FXLS8952_STATE_STARTED }
 Enumeration for the fxls8952 driver internal states. More...
 
enum  fxls8952_Range_tag {
  FXLS8952_RANGE_2G = 0, FXLS8952_RANGE_4G = 1, FXLS8952_RANGE_8G = 2, FXLS8952_RANGE_16G = 3,
  FXLS8952_RANGE_MAX = FXLS8952_RANGE_16G
}
 

Functions

isf_dsa_status_t fsl_fxls8952_i2c_3D_accel_Initialize (isf_SensorHandle_t *pSensorHandle)
 This is the concrete implementation of the FXLS8952 sensor adapter initialization. More...
 
isf_dsa_status_t fsl_fxls8952_i2c_3D_accel_ValidateSettings (isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
 This is the concrete implementation of the FXLS8952 sensor adapter for validating current settings. More...
 
isf_dsa_status_t fsl_fxls8952_i2c_3D_accel_Configure (isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
 This is the concrete implementation of the FXLS8952 sensor adapter for configuration. More...
 
isf_dsa_status_t fsl_fxls8952_i2c_3D_accel_StartData (isf_SensorHandle_t *pSensorHandle)
 This is the concrete implementation of the FXLS8952 sensor adapter for start Data. More...
 
isf_dsa_status_t fsl_fxls8952_i2c_3D_accel_EndData (isf_SensorHandle_t *pSensorHandle)
 This is the concrete implementation of the FXLS8952 sensor adapter for End Data. More...
 
isf_dsa_status_t fsl_fxls8952_i2c_3D_accel_Calibrate (isf_SensorHandle_t *pSensorHandle, void *pCalData)
 This is the concrete implementation of the FXLS8952 sensor adapter for calibration . More...
 
isf_dsa_status_t fsl_fxls8952_i2c_3D_accel_Shutdown (isf_SensorHandle_t *pSensorHandle)
 This is the concrete implementation of the FXLS8952 sensor adapter for shutdown . More...
 
void fsl_fxls8952_i2c_3D_accel_PeriodicCallback (void *pSensorHandle)
 The callback function for the Bus Manager(BM). More...
 
isf_dsa_status_t fsl_fxls8952_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

uint8 LE_BE_check =0
 
isf_SensorTypes_t fxls8952_SupportedSensorTypes [] = { TYPE_ACCELEROMETER_3D, TYPE_NATIVE_SENSOR_TYPE }
 Supported sensor and data types for FXLS8952. More...
 
isf_SensorDataTypes_t fxls8952_SupportedDataTypes [] = { TYPE_RAW_ACCELERATION_3D , TYPE_NATIVE_SENSOR_DATA_TYPE }
 
const fxls8952_ODR_Table_t fxls8952_odrTable []
 The table that describes the configuration value based on ODR (output data rate). Note: This table is irregular after the 25HZ, so can't use FLOORLOG2 algorithm. More...
 
float   floatFactor
 
float   floatOffset
 
int32   fixedFactor
 
int32   fixedOffset
 
struct {
   float   floatFactor
 
   float   floatOffset
 
   int32   fixedFactor
 
   int32   fixedOffset
 
fxls8952AccelConvTable []
 
isf_SensorTypes_t fxls8952_SupportedSensorTypes []
 Supported sensor and data types for MMA8652. More...
 
isf_SensorDataTypes_t fxls8952_SupportedDataTypes []
 

Detailed Description

Macro Definition Documentation

#define ASSIGN_REG_BITS_VALUE (   addr,
  val,
  mask,
  shift 
)    (addr) = (((addr) & ~ (mask)) | (((val) << shift)& (mask)) )

Definition at line 102 of file fsl_fxls8952_i2c_3D_accel.c.

#define FXLS8952_ACCEL_FIXED_CONVERSION_FACTOR   (1638)

Definition at line 82 of file fsl_fxls8952_i2c_3D_accel.c.

#define FXLS8952_ACCEL_FIXED_CONVERSION_OFFSET   (0)

Definition at line 83 of file fsl_fxls8952_i2c_3D_accel.c.

#define FXLS8952_ACCEL_FLOAT_CONVERSION_FACTOR   (0.1)

Definition at line 80 of file fsl_fxls8952_i2c_3D_accel.c.

#define FXLS8952_ACCEL_FLOAT_CONVERSION_OFFSET   (0.0)

Definition at line 81 of file fsl_fxls8952_i2c_3D_accel.c.

#define FXLS8952_SAMPLE_PERIOD_MAX   1280409

Definition at line 87 of file fsl_fxls8952_i2c_3D_accel.c.

#define FXLS8952_SAMPLE_PERIOD_MIN   312

Definition at line 88 of file fsl_fxls8952_i2c_3D_accel.c.

#define FXLS8952_WHO_AM_I_VALUE   0x18

Definition at line 27 of file fsl_fxls8952_i2c_3D_accel.h.

#define GET_MEMBER_SIZE (   p,
 
)    sizeof((p)->m)

Definition at line 110 of file fsl_fxls8952_i2c_3D_accel.c.

#define GET_MODE (   mode)    ((mode) <= FXLS8952_MODE_HYBRID) ? (mode) : FXLS8952_MODE_HYBRID

Definition at line 105 of file fsl_fxls8952_i2c_3D_accel.c.

#define GET_ODR_CONFIG   0x0

Definition at line 89 of file fsl_fxls8952_i2c_3D_accel.c.

#define GET_ODR_VALUE   0x01

Definition at line 90 of file fsl_fxls8952_i2c_3D_accel.c.

#define GET_STRUCT_MEMBER_ADDRESS (   p,
 
)    (&(p)->m)

Definition at line 108 of file fsl_fxls8952_i2c_3D_accel.c.

#define MAX_ACCEL_FULL_SCALE_RANGE   FXLS8952_RANGE_MAX

Definition at line 85 of file fsl_fxls8952_i2c_3D_accel.c.

#define MAX_FXLS8952_DM_BYTES   0x30

Definition at line 96 of file fsl_fxls8952_i2c_3D_accel.c.

#define MAX_NUM_AXES   0x3

Definition at line 95 of file fsl_fxls8952_i2c_3D_accel.c.

#define NUM_INTERNAL_ADDRESS_BYTES   0x1

Definition at line 98 of file fsl_fxls8952_i2c_3D_accel.c.

#define NUM_STATUS_BYTES   1

Definition at line 92 of file fsl_fxls8952_i2c_3D_accel.c.

#define NUMBER_OF_AXES_3D   0x3

Definition at line 94 of file fsl_fxls8952_i2c_3D_accel.c.

Typedef Documentation

the structure defines the configuration table.

Enumeration for the fxls8952 driver internal states.

the structure defines the ODR table between Hybrid and normal mode of device operation.

Enumeration for the fxls8952 power modes.

fxls8952 internal return codes.

Definition at line 39 of file fsl_fxls8952_i2c_3D_accel.h.

Enumeration Type Documentation

Enumeration for the fxls8952 internal error codes.

Enumerator
FXLS8952_ERROR_WHOAMI 

Error occurred while reading FXLS8952_WHO_AM_I or the value was incorrect.

FXLS8952_ERROR_WAITFORACTIVE 

Error occurred while attempting to put device into active mode.

FXLS8952_ERROR_BURSTWRITE 

Error occurred while attempting to write a block of memory to the device.

FXLS8952_ERROR_CONFIG 

Error occurred while attempting to configure the device.

FXLS8952_ERROR_SETPOWER 

Error occurred while attempting to set the power mode of the device.

FXLS8952_ERRO_WRITE 

Error occurred while attempting to write the registers directly.

FXLS8952_ERRO_READ 

Error occurred while attempting to read the registers directly.

Definition at line 44 of file fsl_fxls8952_i2c_3D_accel.h.

Enumeration for the fxls8952 driver internal states.

Enumerator
FXLS8952_STATE_UNINTIALIZED 

initial state of the device.

FXLS8952_STATE_INITIALIZED 

FXLS8952_WHO_AM_I has been verified.

FXLS8952_STATE_CONFIGURED 

Device has been reset and configured.

FXLS8952_STATE_STARTED 

Device is in active mode and measuring data.

Definition at line 63 of file fsl_fxls8952_i2c_3D_accel.h.

Enumeration for the fxls8952 power modes.

Enumerator
FXLS8952_POWER_STANDBY 

Device in Standby mode. Less power consumption during the mode.

FXLS8952_POWER_ACTIVE 

Device in active mode.

Definition at line 56 of file fsl_fxls8952_i2c_3D_accel.h.

Enumerator
FXLS8952_RANGE_2G 
FXLS8952_RANGE_4G 
FXLS8952_RANGE_8G 
FXLS8952_RANGE_16G 
FXLS8952_RANGE_MAX 

Definition at line 70 of file fsl_fxls8952_i2c_3D_accel.h.

Function Documentation

isf_dsa_status_t fsl_fxls8952_i2c_3D_accel_Calibrate ( isf_SensorHandle_t pSensorHandle,
void *  pCalData 
)

This is the concrete implementation of the FXLS8952 sensor adapter for calibration .

The FXLS8952 does not provide the capability to be dynamically calibrated. Therefore, this function simply returns success.

Parameters
[in]pSensorHdlThis is a void pointer to the instance of the FXLS8952 sensor adapter.
Returns
::fsl_FXLS8952_i2c_3D_accel_Calibrate() returns a value of type isf_dsa_status_t indicating the success or failure of the function call.
Return values
ISF_SUCCESSis returned when the device is calibrated properly. Note: Currently, there is no return error type defined for this API.
Constraints:
None
Reentrant: Yes
Link Libraries:
fsl_FXLS8952_i2c_3D_accel.lib

Definition at line 578 of file fsl_fxls8952_i2c_3D_accel.c.

References ISF_SUCCESS.

isf_dsa_status_t fsl_fxls8952_i2c_3D_accel_Configure ( isf_SensorHandle_t pSensorHandle,
isf_dsa_SensorSettings_t pSensorSettings 
)

This is the concrete implementation of the FXLS8952 sensor adapter for configuration.

This function resets the sensor, applies the settings, and registers a callback with the Bus Manager(BM) timer. It does not yet start the timer, as this is done by fsl_FXLS8952_i2c_3D_accel_StartData().

Parameters
[in]pSensorHdlThis is a void pointer to the instance of the FXLS8952 sensor adapter.
[in]pConfigThe reference to the sensor configuration settings.
Returns
::fsl_FXLS8952_i2c_3D_accel_Configure() returns a value of type isf_dsa_status_t indicating the success or failure of the function call.
Return values
ISF_SUCCESSis returned when the device is configured successfully.
DSA_ERR_CONFIGUREis returned when the provided configuration settings could not be applied.
Constraints:
None
Reentrant: Yes
Link Libraries:
fsl_FXLS8952_i2c_3D_accel.lib

Definition at line 309 of file fsl_fxls8952_i2c_3D_accel.c.

References isf_SensorHandle_st::adapterStatus, BM_ERROR, bm_register_periodic_callback(), DeviceDescriptor_struct::cDescriptor, DeviceDescriptor_struct::deviceHandle, DeviceDescriptor_struct::deviceSemaphore, dm_channel_acquire_lock(), dm_channel_release_lock(), dm_device_read(), dm_device_write(), DSA_ERR_CONFIGURE, DSA_ERR_PARAM, DSA_STATE_CONFIGURED_STOPPED, DSA_STATE_INITIALIZED, fsl_fxls8952_i2c_3D_accel_PeriodicCallback(), FXLS8952_ACTIVE_MASK, FXLS8952_LE_BE_MASK, FXLS8952_SENS_CONFIG1, FXLS8952_SENS_CONFIG3, FXLS8952_SET_FIELD, isf_EventHandler_GetSignal(), isf_EventHandler_RegisterEvent(), ISF_SUCCESS, LE_BE_check, isf_dsa_SensorSettings_st::nSamplePeriod, isf_SensorHandle_st::pDeviceDescriptor, SensorConfig_st::pSensorSpecificSettings, isf_SensorHandle_st::pSensorStaticConfig, fxls8952_Sensor_Specific_Reg_t::regAddr, fxls8952_Sensor_Specific_Settings_t::regCount, fxls8952_Sensor_Specific_Settings_t::regPairs, fxls8952_Sensor_Specific_Reg_t::regValue, fxls8952_Sensor_Specific_Settings_t::signal, DeviceDescriptor_struct::token, and fxls8952_Sensor_Specific_Settings_t::usesInterrupts.

Here is the call graph for this function:

isf_dsa_status_t fsl_fxls8952_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 
)
isf_dsa_status_t fsl_fxls8952_i2c_3D_accel_EndData ( isf_SensorHandle_t pSensorHandle)

This is the concrete implementation of the FXLS8952 sensor adapter for End Data.

This function tells the Bus Manager to stop the callbacks and disable data collection.

Parameters
[in]pSensorHdlThis is a void pointer to the instance of the FXLS8952 sensor adapter.
Returns
::fsl_FXLS8952_i2c_3D_accel_EndData() returns a value of type isf_dsa_status_t indicating the success or failure of the function call.
Return values
ISF_SUCCESSis returned when the data collection stopped successfully.
DSA_ERR_PARAMis returned when a wrong parameter is passed into the function such as an invalid or NULL parameter.
Constraints:
None
Reentrant: Yes
Link Libraries:
fsl_FXLS8952_i2c_3D_accel.lib

Definition at line 517 of file fsl_fxls8952_i2c_3D_accel.c.

References isf_SensorHandle_st::adapterStatus, BM_ERROR, bm_stop(), DeviceDescriptor_struct::deviceHandle, DeviceDescriptor_struct::deviceSemaphore, DSA_ERR_END_DATA, DSA_ERR_PARAM, DSA_STATE_CONFIGURED_STARTED, DSA_STATE_CONFIGURED_STOPPED, FXLS8952_POWER_STANDBY, ISF_SUCCESS, isf_SensorHandle_st::pDeviceDescriptor, and DeviceDescriptor_struct::token.

Here is the call graph for this function:

isf_dsa_status_t fsl_fxls8952_i2c_3D_accel_Initialize ( isf_SensorHandle_t pSensorHandle)

This is the concrete implementation of the FXLS8952 sensor adapter initialization.

This function allocates memory for the device descriptor.

Parameters
[in]pSensorHandleThis is a void pointer to the instance of the FXLS8952 sensor adapter.
Returns
::fsl_FXLS8952_i2c_3D_accel_Initialize() returns a value of type isf_dsa_status_t indicating the success or failure of the function call.
Return values
ISF_SUCCESSis returned when the device is initialized properly.
DSA_ERR_PARAMis returned when a wrong parameter was passed into the function, i.e. an invalid or NULL parameter.
DSA_ERR_INITIALIZEis returned when the driver could not be initialized successfully.
Constraints:
None
Reentrant: Yes
Link Libraries:
fsl_FXLS8952_i2c_3D_accel.lib

Definition at line 179 of file fsl_fxls8952_i2c_3D_accel.c.

References fxls8952_DataBuffer_t::accel, isf_SensorHandle_st::adapterStatus, DeviceDescriptor_struct::cDescriptor, SensorConfig_st::channelId, COMM_STATE_OK, SensorConfig_st::commInfo, DeviceDescriptor_struct::deviceHandle, DeviceDescriptor_struct::deviceSemaphore, dm_channel_get_state(), dm_channel_init(), dm_channel_start(), dm_device_open(), DSA_ERR_INITIALIZE, DSA_ERR_PARAM, DSA_STATE_INITIALIZED, DSA_STATE_NOT_INITIALIZED, FXLS8952_WHOAMI_VALUE, ISF_SUCCESS, DeviceDescriptor_struct::pCurrentSample, isf_SensorHandle_st::pDeviceDescriptor, isf_SensorHandle_st::pSensorStaticConfig, DeviceDescriptor_struct::skipFramecnt, and fxls8952_DataBuffer_t::timeStamp.

Here is the call graph for this function:

void fsl_fxls8952_i2c_3D_accel_PeriodicCallback ( void *  pSensorHandle)

The callback function for the Bus Manager(BM).

The Bus Manager calls this function periodically based on the period configured for the FXLS8952.

Parameters
[in]pSensorHdlThis is a void pointer to the instance of the FXLS8952 sensor adapter.
Returns
Void There is no return value.
Constraints:
None
Reentrant: Yes
Link Libraries:
fsl_FXLS8952_i2c_3D_accel.lib

Definition at line 634 of file fsl_fxls8952_i2c_3D_accel.c.

References fxls8952_DataBuffer_t::accel, isf_SensorHandle_st::adapterStatus, isf_SensorHandle_st::controlData, DeviceDescriptor_struct::deviceHandle, DeviceDescriptor_struct::deviceSemaphore, dm_device_read(), dm_device_write(), DSA_STATE_CONFIGURED_STARTED, fsl_fxls8952_i2c_3D_accel_Convert(), FXLS8952_BUF_CONFIG2, FXLS8952_BUF_FLUSH_MASK, FXLS8952_BUF_STATUS, FXLS8952_BUF_X_LSB, FXLS8952_GET_FIELD, FXLS8952_INT_STATUS, FXLS8952_OUT_X_LSB, FXLS8952_SYS_MODE, isf_fifo_el_get_insert_pointer(), isf_fifo_el_increment(), ISF_FIFO_FULL, isf_fifo_lock(), isf_fifo_unlock(), isf_swap2byte(), isf_time_util_get_usec(), LE_BE_check, isf_dsa_ControlData_st::nEventFieldIndex, DeviceDescriptor_struct::pCurrentSample, isf_SensorHandle_st::pDeviceDescriptor, isf_dsa_ControlData_st::pEventGroup, isf_dsa_SensorSettings_st::pSampleBufferInfo, SensorConfig_st::pSensorSpecificSettings, isf_SensorHandle_st::pSensorStaticConfig, isf_dsa_SensorSettings_st::resultFormat, isf_dsa_SensorSettings_st::resultType, fxls8952_Sensor_Specific_Settings_t::samplePeriod, isf_dsa_ControlData_st::sensorSettings, DeviceDescriptor_struct::skipFramecnt, fxls8952_DataBuffer_t::timeStamp, TYPE_NATIVE_SENSOR_DATA_TYPE, and fxls8952_Sensor_Specific_Settings_t::usesBuffer.

Referenced by fsl_fxls8952_i2c_3D_accel_Configure().

Here is the call graph for this function:

Here is the caller graph for this function:

isf_dsa_status_t fsl_fxls8952_i2c_3D_accel_Shutdown ( isf_SensorHandle_t pSensorHandle)

This is the concrete implementation of the FXLS8952 sensor adapter for shutdown .

Parameters
[in]pSensorHdlThis is a void pointer to the instance of the FXLS8952 sensor adapter.
Returns
::fsl_FXLS8952_i2c_3D_accel_Shutdown() returns a value of type isf_dsa_status_t indicating the success or failure of the function call.
Return values
ISF_SUCCESSis returned when the device is calibrated properly. Note: Currently, there is no return error type defined for this API.
Constraints:
None
Reentrant: Yes
Link Libraries:
fsl_FXLS8952_i2c_3D_accel.lib

Definition at line 595 of file fsl_fxls8952_i2c_3D_accel.c.

References isf_SensorHandle_st::adapterStatus, bm_unregister_callback(), DSA_ERR_PARAM, DSA_STATE_INITIALIZED, isf_EventHandler_UnregisterEvent(), ISF_SUCCESS, isf_SensorHandle_st::pDeviceDescriptor, SensorConfig_st::pSensorSpecificSettings, isf_SensorHandle_st::pSensorStaticConfig, DeviceDescriptor_struct::token, and fxls8952_Sensor_Specific_Settings_t::usesInterrupts.

Here is the call graph for this function:

isf_dsa_status_t fsl_fxls8952_i2c_3D_accel_StartData ( isf_SensorHandle_t pSensorHandle)

This is the concrete implementation of the FXLS8952 sensor adapter for start Data.

This function tells the Bus Manager to start the callbacks periodically as defined in the bus configuration and enable the data collection.

Parameters
[in]pSensorHdlThis is a void pointer to the instance of the FXLS8952 sensor adapter.
Returns
::fsl_FXLS8952_i2c_3D_accel_StartData() returns a value of type isf_dsa_status_t indicating the success or failure of the function call.
Return values
ISF_SUCCESSis returned when the data collection callback triggered successfully.
DSA_ERR_PARAMis returned when a wrong parameter is passed into the function such as an invalid or NULL parameter.
Constraints:
None
Reentrant: Yes
Link Libraries:
fsl_FXLS8952_i2c_3D_accel.lib

Definition at line 450 of file fsl_fxls8952_i2c_3D_accel.c.

References isf_SensorHandle_st::adapterStatus, BM_ERROR, bm_start(), DeviceDescriptor_struct::deviceHandle, DeviceDescriptor_struct::deviceSemaphore, DSA_ERR_PARAM, DSA_ERR_START_DATA, DSA_STATE_CONFIGURED_STARTED, DSA_STATE_CONFIGURED_STOPPED, FALSE, FXLS8952_POWER_ACTIVE, ISF_SUCCESS, isf_SensorHandle_st::pDeviceDescriptor, SensorConfig_st::pSensorSpecificSettings, isf_SensorHandle_st::pSensorStaticConfig, DeviceDescriptor_struct::token, and fxls8952_Sensor_Specific_Settings_t::usesInterrupts.

Here is the call graph for this function:

isf_dsa_status_t fsl_fxls8952_i2c_3D_accel_ValidateSettings ( isf_SensorHandle_t pSensorHandle,
isf_dsa_SensorSettings_t pSensorSettings 
)

This is the concrete implementation of the FXLS8952 sensor adapter for validating current settings.

This function is responsible for validating the current settings and if the current settings are not valid settings, it provides the best suitable settings.

Parameters
[in]pSensorHdlThis is a void pointer to the instance of the FXLS8952 sensor adapter.
[in]pSettingsThe reference to the sensor settings.
Returns
::fsl_FXLS8952_i2c_3D_accel_ValidateSettings() returns a value of type isf_dsa_status_t indicating the success or failure of the function call.
Return values
ISF_SUCCESSis returned when the device settings are successfully validated.
::SM_DSA_RET_SETTINGS_CHANGEDis returned when the current settings have been changed.
Constraints:
None
Reentrant: Yes
Link Libraries:
fsl_FXLS8952_i2c_3D_accel.lib

Definition at line 264 of file fsl_fxls8952_i2c_3D_accel.c.

References DSA_ERR_PARAM, ISF_SUCCESS, isf_dsa_SensorSettings_st::nSamplePeriod, SensorConfig_st::pSensorSpecificSettings, isf_SensorHandle_st::pSensorStaticConfig, and fxls8952_Sensor_Specific_Settings_t::samplePeriod.

Variable Documentation

int32 fixedFactor

Definition at line 148 of file fsl_fxls8952_i2c_3D_accel.c.

int32 fixedFactor

Definition at line 148 of file fsl_fxls8952_i2c_3D_accel.c.

int32 fixedOffset

Definition at line 149 of file fsl_fxls8952_i2c_3D_accel.c.

int32 fixedOffset

Definition at line 149 of file fsl_fxls8952_i2c_3D_accel.c.

float floatFactor

Definition at line 146 of file fsl_fxls8952_i2c_3D_accel.c.

float floatFactor

Definition at line 146 of file fsl_fxls8952_i2c_3D_accel.c.

float floatOffset

Definition at line 147 of file fsl_fxls8952_i2c_3D_accel.c.

float floatOffset

Definition at line 147 of file fsl_fxls8952_i2c_3D_accel.c.

const fxls8952_ODR_Table_t fxls8952_odrTable[]
Initial value:
={
{ 312, 0},
{ 625, 1},
{ 1250, 2},
{ 2500, 3},
{ 5000, 4},
{ 10000, 5},
{ 20000, 6},
{ 40000, 7},
{ 80000, 8},
{ 160000, 9},
{ 320000, 10},
{ 640000, 11},
{ 1280000, 12},
{ 1280000, 13},
{ 1280000, 14},
{ 1280000, 15},
}

The table that describes the configuration value based on ODR (output data rate). Note: This table is irregular after the 25HZ, so can't use FLOORLOG2 algorithm.

The table that describes the configuration value based on ODR (output data rate). Note: This table is irregular after the 25HZ, so can't use FLOORLOG2 algorithm.

Definition at line 122 of file fsl_fxls8952_i2c_3D_accel.c.

Definition at line 72 of file fsl_fxls8952_i2c_3D_accel.c.

isf_SensorDataTypes_t fxls8952_SupportedDataTypes[]

Definition at line 248 of file fsl_fxls8952_i2c_3D_accel.h.

isf_SensorTypes_t fxls8952_SupportedSensorTypes = { TYPE_ACCELEROMETER_3D, TYPE_NATIVE_SENSOR_TYPE }

Supported sensor and data types for FXLS8952.

Supported sensor and data types for MMA8652.

Definition at line 71 of file fsl_fxls8952_i2c_3D_accel.c.

isf_SensorTypes_t fxls8952_SupportedSensorTypes[]

Supported sensor and data types for MMA8652.

Supported sensor and data types for MMA8652.

Definition at line 247 of file fsl_fxls8952_i2c_3D_accel.h.

const { ... } fxls8952AccelConvTable[]
Initial value:
=
{
{ 0.000061, 0.0, 16, 0},
{ 0.000122, 0.0, 32, 0},
{ 0.000244, 0.0, 64, 0},
{ 0.000488, 0.0, 128, 0}
}