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

Data Structures

struct  fxos8700_ODR_Table_tag
 the structure defines the ODR table between Hybrid and normal mode of device operation. More...
 
struct  fxos8700_ConfigTable_tag
 the structure defines the configuration table. More...
 
struct  fxos8700_DataBuffer_t
 This structure defines the dummy DSA data buffer format. More...
 

Macros

#define FXOS8700_WHO_AM_I_VALUE1   0xC7
 FXOS8700 expected WHO_AM_I value. More...
 
#define FXOS8700_WHO_AM_I_VALUE2   0xC9
 

Typedefs

typedef int32 fxos8700_Status_t
 FXOS8700 internal return codes. More...
 
typedef enum fxos8700_Power_tag fxos8700_Power_t
 Enumeration for the FXOS8700 power modes. More...
 
typedef enum
fxos8700_InternalState_tag 
fxos8700_InternalState_t
 Enumeration for the FXOS8700 driver internal states. More...
 
typedef enum fxos8700_Mode_tag fxos8700_Mode_t
 The enumeration, fxos8700_Mode_tag, defines the operational modes of the FXOS8700. More...
 
typedef enum fxos8700_Range_tag fxos8700_Range_t
 The enumeration, fxos8700_Range_tag, defines the acceleration range of the FXOS8700. More...
 
typedef enum
fxos8700_Resolution_tag 
fxos8700_Resolution_t
 The enumeration, fxos8700_Resolution_tag, defines the bit resolution of the FXOS8700. More...
 
typedef struct
fxos8700_ODR_Table_tag 
fxo8700_ODR_Table_t
 the structure defines the ODR table between Hybrid and normal mode of device operation. More...
 
typedef struct
fxos8700_ConfigTable_tag 
fxos8700_ConfigTable_t
 the structure defines the configuration table. More...
 

Enumerations

enum  fxos8700_Error_tag {
  FXOS8700_ERROR_WHOAMI = 1, FXOS8700_ERROR_WAITFORACTIVE, FXOS8700_ERROR_BURSTWRITE, FXOS8700_ERROR_CONFIG,
  FXOS8700_ERROR_SETPOWER, FX0S8700_ERRO_WRITE, FX0S8700_ERRO_READ
}
 Enumeration for the FXOS8700 internal error codes. More...
 
enum  fxos8700_Power_tag { FXOS8700_POWER_STANDBY = 0, FXOS8700_POWER_ACTIVE = 1 }
 Enumeration for the FXOS8700 power modes. More...
 
enum  fxos8700_InternalState_tag { FXOS8700_STATE_UNINTIALIZED, FXOS8700_STATE_INITIALIZED, FXOS8700_STATE_CONFIGURED, FXOS8700_STATE_STARTED }
 Enumeration for the FXOS8700 driver internal states. More...
 
enum  fxos8700_Mode_tag { FXOS8700_MODE_ACCELEROMETER = 0, FXOS8700_MODE_MAGNETOMETER = 1, FXOS8700_MODE_HYBRID = 3, FXOS8700_MODE_EXTEND = 4 }
 The enumeration, fxos8700_Mode_tag, defines the operational modes of the FXOS8700. More...
 
enum  fxos8700_Range_tag { FXOS8700_RANGE_2G = 0, FXOS8700_RANGE_4G = 1, FXOS8700_RANGE_8G = 2, FXOS8700_RANGE_MAX = FXOS8700_RANGE_8G }
 The enumeration, fxos8700_Range_tag, defines the acceleration range of the FXOS8700. More...
 
enum  fxos8700_Resolution_tag { FXOS8700_RESOLUTION_8_BIT = 1, FXOS8700_RESOLUTION_NORMAL = 2 }
 The enumeration, fxos8700_Resolution_tag, defines the bit resolution of the FXOS8700. More...
 

Functions

isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_Initialize (isf_SensorHandle_t *pSensorHandle)
 This is the concrete implementation of the FXOS8700 sensor adapter initialization. More...
 
isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_ValidateSettings (isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
 This is the concrete implementation of the FXOS8700 sensor adapter for validating current settings. More...
 
isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_Configure (isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
 This is the concrete implementation of the FXOS8700 sensor adapter for configuration. More...
 
isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_StartData (isf_SensorHandle_t *pSensorHandle)
 This is the concrete implementation of the FXOS8700 sensor adapter for start Data. More...
 
isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_EndData (isf_SensorHandle_t *pSensorHandle)
 This is the concrete implementation of the FXOS8700 sensor adapter for End Data. More...
 
isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_Calibrate (isf_SensorHandle_t *pSensorHandle, void *pCalData)
 This is the concrete implementation of the FXOS8700 sensor adapter for calibration . More...
 
isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_Shutdown (isf_SensorHandle_t *pSensorHandle)
 This is the concrete implementation of the FXOS8700 sensor adapter for shutdown . More...
 
isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_Convert (volatile isf_SensorHandle_t *pSensorHandle, isf_SensorDataTypes_t convertToType, isf_dsa_result_types_t resultType, void *nativeSample, void *convertedSample, int32 *numBytes)
 This function coverts the raw sample data to the desired output type. More...
 
void fsl_fxos8700_i2cspi_6D_AccMag_PeriodicCallback (void *pSensorHandle)
 The callback function for the Bus Manager(BM). More...
 

Variables

isf_SensorTypes_t fxos8700_SupportedSensorTypes []
 Supported sensor and data types for fxos8700. More...
 
isf_SensorDataTypes_t fxos8700_SupportedDataTypes []
 

Detailed Description

Macro Definition Documentation

#define FXOS8700_WHO_AM_I_VALUE1   0xC7

FXOS8700 expected WHO_AM_I value.

Definition at line 30 of file fsl_fxos8700_i2cspi_6D_AccMag.h.

Referenced by fsl_fxos8700_i2cspi_6D_AccMag_Initialize().

#define FXOS8700_WHO_AM_I_VALUE2   0xC9

Typedef Documentation

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

the structure defines the configuration table.

Enumeration for the FXOS8700 driver internal states.

The enumeration, fxos8700_Mode_tag, defines the operational modes of the FXOS8700.

Enumeration for the FXOS8700 power modes.

The enumeration, fxos8700_Range_tag, defines the acceleration range of the FXOS8700.

The enumeration, fxos8700_Resolution_tag, defines the bit resolution of the FXOS8700.

FXOS8700 internal return codes.

Definition at line 37 of file fsl_fxos8700_i2cspi_6D_AccMag.h.

Enumeration Type Documentation

Enumeration for the FXOS8700 internal error codes.

Enumerator
FXOS8700_ERROR_WHOAMI 

Error occurred while reading FXOS8700_WHO_AM_I or the value was incorrect.

FXOS8700_ERROR_WAITFORACTIVE 

Error occurred while attempting to put device into active mode.

FXOS8700_ERROR_BURSTWRITE 

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

FXOS8700_ERROR_CONFIG 

Error occurred while attempting to configure the device.

FXOS8700_ERROR_SETPOWER 

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

FX0S8700_ERRO_WRITE 

Error occurred while attempting to write the registers directly.

FX0S8700_ERRO_READ 

Error occurred while attempting to read the registers directly.

Definition at line 41 of file fsl_fxos8700_i2cspi_6D_AccMag.h.

Enumeration for the FXOS8700 driver internal states.

Enumerator
FXOS8700_STATE_UNINTIALIZED 

initial state of the device.

FXOS8700_STATE_INITIALIZED 

FXOS8700_WHO_AM_I has been verified.

FXOS8700_STATE_CONFIGURED 

Device has been reset and configured.

FXOS8700_STATE_STARTED 

Device is in active mode and measuring data.

Definition at line 60 of file fsl_fxos8700_i2cspi_6D_AccMag.h.

The enumeration, fxos8700_Mode_tag, defines the operational modes of the FXOS8700.

Enumerator
FXOS8700_MODE_ACCELEROMETER 
FXOS8700_MODE_MAGNETOMETER 
FXOS8700_MODE_HYBRID 
FXOS8700_MODE_EXTEND 

Definition at line 68 of file fsl_fxos8700_i2cspi_6D_AccMag.h.

Enumeration for the FXOS8700 power modes.

Enumerator
FXOS8700_POWER_STANDBY 

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

FXOS8700_POWER_ACTIVE 

Device in active mode.

Definition at line 53 of file fsl_fxos8700_i2cspi_6D_AccMag.h.

The enumeration, fxos8700_Range_tag, defines the acceleration range of the FXOS8700.

Enumerator
FXOS8700_RANGE_2G 
FXOS8700_RANGE_4G 
FXOS8700_RANGE_8G 
FXOS8700_RANGE_MAX 

Definition at line 78 of file fsl_fxos8700_i2cspi_6D_AccMag.h.

The enumeration, fxos8700_Resolution_tag, defines the bit resolution of the FXOS8700.

Enumerator
FXOS8700_RESOLUTION_8_BIT 
FXOS8700_RESOLUTION_NORMAL 

Definition at line 85 of file fsl_fxos8700_i2cspi_6D_AccMag.h.

Function Documentation

isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_Calibrate ( isf_SensorHandle_t pSensorHandle,
void *  pCalData 
)

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

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

Parameters
[in]pSensorHandleThis is a pointer to the instance of the FXOS8700 sensor adapter.
[in]pCalDataThis is a void pointer to the instance of the FXOS8700 calibration data.
Returns
fsl_fxos8700_i2cspi_6D_AccMag_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_fxos8700_i2cspi_6D_AccMag.lib

Definition at line 541 of file fsl_fxos8700_i2cspi_6D_AccMag.c.

References ISF_SUCCESS.

isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_Configure ( isf_SensorHandle_t pSensorHandle,
isf_dsa_SensorSettings_t pSensorSettings 
)

This is the concrete implementation of the FXOS8700 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_fxos8700_i2cspi_6D_AccMag_StartData().

Parameters
[in]pSensorHandleThis is a pointer to the instance of the FXAS21000 sensor adapter.
[in]pSensorSettingsThe reference to the sensor configuration settings.
Returns
fsl_fxos8700_i2cspi_6D_AccMag_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_fxos8700_i2cspi_6D_AccMag.lib

Definition at line 286 of file fsl_fxos8700_i2cspi_6D_AccMag.c.

References isf_SensorHandle_st::adapterStatus, BM_ERROR, bm_register_periodic_callback(), DeviceDescriptor_struct::cDescriptor, isf_SensorHandle_st::controlData, 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_fxos8700_i2cspi_6D_AccMag_PeriodicCallback(), FXOS8700_ACTIVE_MASK, FXOS8700_CTRL_REG1, FXOS8700_MODE_HYBRID, FXOS8700_SET_FIELD, GET_ODR_CONFIG, ISF_SUCCESS, isf_dsa_SensorSettings_st::nSamplePeriod, isf_SensorHandle_st::pDeviceDescriptor, SensorConfig_st::pSensorSpecificSettings, isf_SensorHandle_st::pSensorStaticConfig, fxos8700_Sensor_Specific_Reg_t::regAddr, fxos8700_Sensor_Specific_Settings_t::regCount, fxos8700_Sensor_Specific_Settings_t::regPairs, fxos8700_Sensor_Specific_Reg_t::regValue, isf_dsa_ControlData_st::sensorSettings, and DeviceDescriptor_struct::token.

Here is the call graph for this function:

isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_Convert ( volatile isf_SensorHandle_t pSensorHandle,
isf_SensorDataTypes_t  convertToType,
isf_dsa_result_types_t  resultType,
void *  nativeSample,
void *  convertedSample,
int32 numBytes 
)
isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_EndData ( isf_SensorHandle_t pSensorHandle)

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

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

Parameters
[in]pSensorHandleThis is a pointer to the instance of the FXOS8700 sensor adapter.
Returns
fsl_fxos8700_i2cspi_6D_AccMag_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_fxos8700_i2cspi_6D_AccMag.lib

Definition at line 477 of file fsl_fxos8700_i2cspi_6D_AccMag.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, FXOS8700_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_fxos8700_i2cspi_6D_AccMag_Initialize ( isf_SensorHandle_t pSensorHandle)

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

This function allocates memory for the device descriptor.

Parameters
[in]pSensorHandleThis is a void pointer to the instance of the FXOS8700 sensor adapter.
Returns
fsl_fxos8700_i2cspi_6D_AccMag_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_fxos8700_i2cspi_6D_AccMag.lib

Definition at line 155 of file fsl_fxos8700_i2cspi_6D_AccMag.c.

References fxos8700_DataBuffer_t::accel, isf_SensorHandle_st::adapterStatus, fxos8700_DataBuffer_t::addr, 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, FXOS8700_WHO_AM_I_VALUE1, FXOS8700_WHO_AM_I_VALUE2, ISF_SUCCESS, fxos8700_DataBuffer_t::mag, DeviceDescriptor_struct::pCurrentSample, isf_SensorHandle_st::pDeviceDescriptor, isf_SensorHandle_st::pSensorStaticConfig, DeviceDescriptor_struct::skipFramecnt, and fxos8700_DataBuffer_t::timeStamp.

Here is the call graph for this function:

void fsl_fxos8700_i2cspi_6D_AccMag_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 FXOS8700.

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

Definition at line 584 of file fsl_fxos8700_i2cspi_6D_AccMag.c.

References fxos8700_DataBuffer_t::accel, isf_SensorHandle_st::adapterStatus, isf_SensorHandle_st::controlData, DeviceDescriptor_struct::deviceHandle, DeviceDescriptor_struct::deviceSemaphore, dm_device_read(), DSA_STATE_CONFIGURED_STARTED, fsl_fxos8700_i2cspi_6D_AccMag_Convert(), FXOS8700_M_OUT_X_MSB, FXOS8700_MODE_ACCELEROMETER, FXOS8700_MODE_HYBRID, FXOS8700_MODE_MAGNETOMETER, FXOS8700_OUT_X_MSB, isf_fifo_el_get_insert_pointer(), isf_fifo_el_increment(), ISF_FIFO_FULL, isf_fifo_lock(), isf_fifo_unlock(), isf_time_util_get_usec(), fxos8700_DataBuffer_t::mag, 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, isf_dsa_ControlData_st::sensorSettings, DeviceDescriptor_struct::skipFramecnt, fxos8700_DataBuffer_t::timeStamp, and TYPE_NATIVE_SENSOR_DATA_TYPE.

Referenced by fsl_fxos8700_i2cspi_6D_AccMag_Configure().

Here is the call graph for this function:

Here is the caller graph for this function:

isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_Shutdown ( isf_SensorHandle_t pSensorHandle)

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

Parameters
[in]pSensorHandleThis is a pointer to the instance of the FXOS8700 sensor adapter.
Returns
fsl_fxos8700_i2cspi_6D_AccMag_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_fxos8700_i2cspi_6D_AccMag.lib

Definition at line 558 of file fsl_fxos8700_i2cspi_6D_AccMag.c.

References isf_SensorHandle_st::adapterStatus, bm_unregister_callback(), DSA_ERR_PARAM, DSA_STATE_INITIALIZED, ISF_SUCCESS, isf_SensorHandle_st::pDeviceDescriptor, and DeviceDescriptor_struct::token.

Here is the call graph for this function:

isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_StartData ( isf_SensorHandle_t pSensorHandle)

This is the concrete implementation of the FXOS8700 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]pSensorHandleThis is a pointer to the instance of the FXOS8700 sensor adapter.
Returns
fsl_fxos8700_i2cspi_6D_AccMag_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_fxos8700_i2cspi_6D_AccMag.lib

Definition at line 412 of file fsl_fxos8700_i2cspi_6D_AccMag.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, FXOS8700_POWER_ACTIVE, ISF_SUCCESS, fxos8700_Sensor_Specific_Settings_t::mode, isf_SensorHandle_st::pDeviceDescriptor, SensorConfig_st::pSensorSpecificSettings, isf_SensorHandle_st::pSensorStaticConfig, and DeviceDescriptor_struct::token.

Here is the call graph for this function:

isf_dsa_status_t fsl_fxos8700_i2cspi_6D_AccMag_ValidateSettings ( isf_SensorHandle_t pSensorHandle,
isf_dsa_SensorSettings_t pSensorSettings 
)

This is the concrete implementation of the FXOS8700 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]pSensorHandleThis is a pointer to the instance of the FXOS8700 sensor adapter.
[in]pSensorSettingsThe reference to the sensor settings.
Returns
fsl_fxos8700_i2cspi_6D_AccMag_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.
DSA_RET_SETTINGS_CHANGEDis returned when the current settings have been changed.
Constraints:
None
Reentrant: Yes
Link Libraries:
fsl_fxos8700_i2cspi_6D_AccMag.lib

Definition at line 245 of file fsl_fxos8700_i2cspi_6D_AccMag.c.

References DSA_ERR_PARAM, DSA_RET_SETTINGS_CHANGED, GET_ODR_VALUE, ISF_SUCCESS, fxos8700_Sensor_Specific_Settings_t::mode, isf_dsa_SensorSettings_st::nSamplePeriod, SensorConfig_st::pSensorSpecificSettings, and isf_SensorHandle_st::pSensorStaticConfig.

Variable Documentation

isf_SensorDataTypes_t fxos8700_SupportedDataTypes[]

Definition at line 59 of file fsl_fxos8700_i2cspi_6D_AccMag.c.

isf_SensorTypes_t fxos8700_SupportedSensorTypes[]

Supported sensor and data types for fxos8700.

Supported sensor and data types for fxos8700.

Definition at line 58 of file fsl_fxos8700_i2cspi_6D_AccMag.c.