| ISF 2.2 rev 5 Intelligent Sensing Framework for Kinetis with Processor Expert

- Main Page
- Modules
- Data Structures
- Files

Data Structures | Functions | Variables
fsl_fusion_virt_3D_orient module documentation

## Data Structures
struct | fsl_orientation_DataBuffer_t
struct | fsl_fusion_Sensor_Specific_Settings_t
struct | fsl_fusion_DeviceDescriptor_t

## Functions
isf_dsa_status_t | fsl_fusion_virt_3D_orient_Initialize (isf_SensorHandle_t *pSensorHandle)
| This is the concrete implementation of the orientation sensor adapter initialization. More...
isf_dsa_status_t | fsl_fusion_virt_3D_orient_ValidateSettings (isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSubSettings)
| This is the concrete implementation of the orientation sensor adapter for validating current settings. More...
isf_dsa_status_t | fsl_fusion_virt_3D_orient_Configure (isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
| This is the concrete implementation of the fusion sensor adapter configuration function. More...
isf_dsa_status_t | fsl_fusion_virt_3D_orient_StartData (isf_SensorHandle_t *pSensorHandle)
| This is the concrete implementation of the orientation sensor adapter for start Data. More...
isf_dsa_status_t | fsl_fusion_virt_3D_orient_EndData (isf_SensorHandle_t *pSensorHandle)
| This is the concrete implementation of the orientation sensor adapter for End Data. More...
isf_dsa_status_t | fsl_fusion_virt_3D_orient_Calibrate (isf_SensorHandle_t *pSensorHandle, void *pCalData)
| This is the concrete implementation of the orientation sensor adapter for calibration . More...
isf_dsa_status_t | fsl_fusion_virt_3D_orient_Shutdown (isf_SensorHandle_t *pSensorHandle)
| This is the concrete implementation of the orientation sensor adapter for shutdown . More...
void | fsl_fusion_virt_3D_orient_PeriodicCallback (void *pSensorHandle)
| The orientation sensor adapter's periodic processing function. More...
isf_dsa_status_t | fsl_fusion_virt_3D_orient_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 | fsl_MagCal_task (uint32_t task_init_data)
void | fsl_fusion_task (uint32_t task_init_data)

## Variables
isf_SensorTypes_t | fsl_fusion_SupportedSensorTypes []
| Supported sensor and data types for MMA8652. More...
isf_SensorDataTypes_t | fsl_fusion_SupportedDataTypes []

## Detailed Description

## Function Documentation

void fsl_fusion_task | ( | uint32_t | task_init_data | ) |

Definition at line 1144 of file fsl_fusion_virt_3D_orient.c.

References FALSE, fsl_fusion_virt_3D_orient_PeriodicCallback(), Fusion_Init(), fsl_fusion_DeviceDescriptor_t::fusionState, HYBRID_SENSOR_DATA_READY_EVENT, isf_SensorHandle_st::pDeviceDescriptor, SensorConfig_st::pSensorSpecificSettings, isf_SensorHandle_st::pSensorStaticConfig, SENSOR_DATA_READY_EVENT, fsl_fusion_DeviceDescriptor_t::sensorLWEvent, and isf_SensorHandle_st::signalledEvents.

Referenced by fsl_fusion_virt_3D_orient_Initialize().

Here is the call graph for this function:

Here is the caller graph for this function:

isf_dsa_status_t fsl_fusion_virt_3D_orient_Calibrate | ( | isf_SensorHandle_t * | pSensorHandle,
|  | void * | pCalData
| ) |  |

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

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

Parameters

  [in] | pSensorHdl | This is a void pointer to the instance of the orientation sensor adapter.

Returns
  fsl_fusion_virt_3D_orient_Calibrate() returns a value of type isf_dsa_status_t indicating the success or failure of the function call.

Return values

  ISF_SUCCESS | is 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_fusion_virt_3D_orient.lib

Definition at line 742 of file fsl_fusion_virt_3D_orient.c.

References ISF_SUCCESS.

isf_dsa_status_t fsl_fusion_virt_3D_orient_Configure | ( | isf_SensorHandle_t * | pSensorHandle,
|  | isf_dsa_SensorSettings_t * | pSensorSettings
| ) |  |

This is the concrete implementation of the fusion sensor adapter configuration function.

This function resets the fusion state and calls the underlying AGM adapter's Configure functions.

Parameters

  [in] | pSensorHdl | This is a void pointer to the instance of the fusion sensor adapter.
  [in] | pConfig | The reference to the sensor configuration settings.

Returns
  fsl_fusion_virt_3D_orient_Configure() returns a value of type isf_dsa_status_t indicating the success or failure of the function call.

Return values

  ISF_SUCCESS | is returned when the device is configured successfully.
  DSA_ERR_CONFIGURE | is returned when the provided configuration settings could not be applied.

Constraints:
  None

Reentrant: Yes

Link Libraries:
  fsl_fusion_virt_3D_orient.lib

Definition at line 394 of file fsl_fusion_virt_3D_orient.c.

References fusion_algorithmConfig_t::accelOversampleRatio, isf_SensorHandle_st::adapterStatus, fsl_fusion_Sensor_Specific_Settings_t::algorithmConfig, configure_sensor(), fsl_fusion_DeviceDescriptor_t::deviceSemaphore, DSA_ERR_PARAM, DSA_RESULT_TYPE_RAW_COUNTS, DSA_STATE_CONFIGURED_STOPPED, DSA_STATE_INITIALIZED, fusion_algorithmConfig_t::gyroOversampleRatio, ISF_SUCCESS, fusion_algorithmConfig_t::magOversampleRatio, isf_SubscriptionSettings_t::nFifoDepth, isf_SubscriptionSettings_t::nSamplePeriod, isf_dsa_SensorSettings_st::nSamplePeriod, isf_SubscriptionSettings_t::nSettingsToUse, isf_SensorHandle_st::pDeviceDescriptor, fusion_algorithmConfig_t::pressureOversampleRatio, SensorConfig_st::pSensorSpecificSettings, isf_SensorHandle_st::pSensorStaticConfig, isf_SubscriptionSettings_t::resultFormat, isf_SubscriptionSettings_t::resultType, TYPE_MAGNETIC_FIELD_STRENGTH_3D, TYPE_NATIVE_SENSOR_DATA_TYPE, TYPE_RAW_ACCELERATION_3D, and TYPE_ROTATIONAL_RATE_3D.

Here is the call graph for this function:

isf_dsa_status_t fsl_fusion_virt_3D_orient_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 1257 of file fsl_fusion_virt_3D_orient.c.

References DSA_ERR_BAD_RESULT_TYPE, DSA_ERR_BAD_SENSOR_DATA_TYPE, DSA_RESULT_TYPE_ENG_FLOAT, SensorConfig_st::pSensorSpecificSettings, isf_SensorHandle_st::pSensorStaticConfig, TYPE_ALTITUDE, TYPE_DIR_COSINE_MATRIX, TYPE_EULER_3D, TYPE_MAGNETIC_FIELD_STRENGTH_3D, TYPE_QUATERNION, TYPE_RAW_ACCELERATION_3D, TYPE_ROTATIONAL_RATE_3D, and TYPE_TEMPERATURE.

Referenced by fsl_fusion_virt_3D_orient_PeriodicCallback().

Here is the caller graph for this function:

isf_dsa_status_t fsl_fusion_virt_3D_orient_EndData | ( | isf_SensorHandle_t * | pSensorHandle | ) |

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

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

Parameters

  [in] | pSensorHdl | This is a void pointer to the instance of the orientation sensor adapter.

Returns
  fsl_fusion_virt_3D_orient_EndData() returns a value of type isf_dsa_status_t indicating the success or failure of the function call.

Return values

  ISF_SUCCESS | is returned when the data collection stopped successfully.
  DSA_ERR_PARAM | is returned when a wrong parameter is passed into the function such as an invalid or NULL parameter.

Constraints:
  None

Reentrant: Yes

Link Libraries:
  fsl_fusion_virt_3D_orient.lib

Definition at line 649 of file fsl_fusion_virt_3D_orient.c.

References isf_SensorHandle_st::adapterStatus, fsl_fusion_DeviceDescriptor_t::deviceSemaphore, DSA_ERR_END_DATA, DSA_ERR_PARAM, DSA_STATE_CONFIGURED_STOPPED, ISF_SUCCESS, isf_SensorHandle_st::pDeviceDescriptor, SensorConfig_st::pSensorSpecificSettings, isf_SensorHandle_st::pSensorStaticConfig, and stop_sensor().

Here is the call graph for this function:

isf_dsa_status_t fsl_fusion_virt_3D_orient_Initialize | ( | isf_SensorHandle_t * | pSensorHandle | ) |

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

This function allocates memory for the device descriptor.

Parameters

  [in] | pSensorHandle | This is a void pointer to the instance of the orientation sensor adapter.

Returns
  fsl_fusion_virt_3D_orient_Initialize() returns a value of type isf_dsa_status_t indicating the success or failure of the function call.

Return values

  ISF_SUCCESS | is returned when the device is initialized properly.
  DSA_ERR_PARAM | is returned when a wrong parameter was passed into the function, i.e. an invalid or NULL parameter.
  DSA_ERR_INITIALIZE | is returned when the driver could not be initialized successfully.

Constraints:
  None

Reentrant: Yes

Link Libraries:
  fsl_fusion_virt_3D_orient.lib

Definition at line 154 of file fsl_fusion_virt_3D_orient.c.

References ACCEL_DATA_READY_EVENT, fusion_algorithmConfig_t::accelOversampleRatio, isf_SensorHandle_st::adapterStatus, fsl_fusion_Sensor_Specific_Settings_t::algorithmConfig, fusion_state_t::algorithmToUse, fsl_fusion_Sensor_Specific_Settings_t::algorithmToUse, fsl_fusion_DeviceDescriptor_t::deviceSemaphore, DSA_ERR_INITIALIZE, DSA_ERR_PARAM, DSA_STATE_INITIALIZED, DSA_STATE_NOT_INITIALIZED, fsl_fusion_task(), fsl_MagCal_task(), fsl_fusion_DeviceDescriptor_t::fusionState, GYRO_DATA_READY_EVENT, fusion_algorithmConfig_t::gyroOversampleRatio, HYBRID_SENSOR_DATA_READY_EVENT, init_sensor(), isf_fifo_init(), MAG_DATA_READY_EVENT, fsl_fusion_DeviceDescriptor_t::MagCalEventStruct, fusion_algorithmConfig_t::magOversampleRatio, isf_SensorHandle_st::pDeviceDescriptor, PRESSURE_DATA_READY_EVENT, fusion_algorithmConfig_t::pressureOversampleRatio, SensorConfig_st::pSensorSpecificSettings, isf_SensorHandle_st::pSensorStaticConfig, SENSOR_DATA_READY_EVENT, fsl_fusion_DeviceDescriptor_t::sensorDataReady, and fsl_fusion_DeviceDescriptor_t::sensorLWEvent.

Here is the call graph for this function:

void fsl_fusion_virt_3D_orient_PeriodicCallback | ( | void * | pSensorHandle | ) |

The orientation sensor adapter's periodic processing function.

This function is invoked periodically whenever new sensor data is available from its underlying sensors.

Parameters

  [in] | pSensorHdl | This is a void pointer to the instance of the orientation sensor adapter.

Returns
  Void There is no return value.

Constraints:
  None

Reentrant: Yes

Link Libraries:
  fsl_fusion_virt_3D_orient.lib

Definition at line 801 of file fsl_fusion_virt_3D_orient.c.

References isf_Acceleration3D_RawCount_t::accel, ACCEL_DATA_READY_EVENT, ACCEL_GET_HAL_X_VALUE, ACCEL_GET_HAL_Y_VALUE, ACCEL_GET_HAL_Z_VALUE, ACCEL_HAL_X_INDEX, ACCEL_HAL_Y_INDEX, ACCEL_HAL_Z_INDEX, isf_Meters1D_float_t::altitude, isf_AngularVelocity3D_RawCount_t::angularVelocity, isf_SensorHandle_st::controlData, convert_sensor_data(), DSA_RESULT_TYPE_ENG_FLOAT, isf_MagneticFieldStrength3D_RawCount_t::fieldStrength, fsl_fusion_virt_3D_orient_Convert(), Fusion_Init(), Fusion_Run(), fsl_fusion_DeviceDescriptor_t::fusionState, GYRO_DATA_READY_EVENT, GYRO_GET_HAL_X_VALUE, GYRO_GET_HAL_Y_VALUE, GYRO_GET_HAL_Z_VALUE, GYRO_HAL_X_INDEX, GYRO_HAL_Y_INDEX, GYRO_HAL_Z_INDEX, isf_fifo_el_clear(), isf_fifo_el_get_insert_pointer(), isf_fifo_el_increment(), isf_fifo_el_traverse(), ISF_FIFO_FULL, isf_fifo_lock(), ISF_FIFO_NO_MORE_ENTRIES, isf_fifo_unlock(), iUpdateMagnetometerBuffer(), MAG_DATA_READY_EVENT, MAG_GET_HAL_X_VALUE, MAG_GET_HAL_Y_VALUE, MAG_HAL_X_INDEX, MAG_HAL_Y_INDEX, MAG_HAL_Z_INDEX, MAGCAL_EVENT_FLAG, fsl_fusion_DeviceDescriptor_t::MagCalEventStruct, isf_dsa_ControlData_st::nEventFieldIndex, OVERSAMPLE_RATIO, isf_SensorHandle_st::pDeviceDescriptor, isf_dsa_ControlData_st::pEventGroup, PRESSURE_DATA_MASK, PRESSURE_DATA_READY_EVENT, isf_dsa_SensorSettings_st::pSampleBufferInfo, SensorConfig_st::pSensorSpecificSettings, isf_SensorHandle_st::pSensorStaticConfig, isf_dsa_SensorSettings_st::resultFormat, isf_dsa_SensorSettings_st::resultType, SENSOR_DATA_READY_EVENT, fsl_fusion_DeviceDescriptor_t::sensorDataReady, isf_dsa_ControlData_st::sensorSettings, isf_SensorHandle_st::signalledEvents, isf_DegreesCelsius1D_float_t::temperature, isf_Meters1D_float_t::timestamp, isf_AngularVelocity3D_RawCount_t::timestamp, isf_Acceleration3D_RawCount_t::timestamp, isf_MagneticFieldStrength3D_RawCount_t::timestamp, TYPE_ALTITUDE, TYPE_NATIVE_SENSOR_DATA_TYPE, TYPE_TEMPERATURE, X, Y, and Z.

Referenced by fsl_fusion_task().

Here is the call graph for this function:

Here is the caller graph for this function:

isf_dsa_status_t fsl_fusion_virt_3D_orient_Shutdown | ( | isf_SensorHandle_t * | pSensorHandle | ) |

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

Parameters

  [in] | pSensorHdl | This is a void pointer to the instance of the orientation sensor adapter.

Returns
  fsl_fusion_virt_3D_orient_Shutdown() returns a value of type isf_dsa_status_t indicating the success or failure of the function call.

Return values

  ISF_SUCCESS | is 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_fusion_virt_3D_orient.lib

Definition at line 759 of file fsl_fusion_virt_3D_orient.c.

References isf_SensorHandle_st::adapterStatus, DSA_ERR_PARAM, DSA_STATE_INITIALIZED, ISF_SUCCESS, isf_SensorHandle_st::pDeviceDescriptor, SensorConfig_st::pSensorSpecificSettings, isf_SensorHandle_st::pSensorStaticConfig, and shutdown_sensor().

Here is the call graph for this function:

isf_dsa_status_t fsl_fusion_virt_3D_orient_StartData | ( | isf_SensorHandle_t * | pSensorHandle | ) |

This is the concrete implementation of the orientation 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] | pSensorHdl | This is a void pointer to the instance of the orientation sensor adapter.

Returns
  fsl_fusion_virt_3D_orient_StartData() returns a value of type isf_dsa_status_t indicating the success or failure of the function call.

Return values

  ISF_SUCCESS | is returned when the data collection callback triggered successfully.
  DSA_ERR_PARAM | is returned when a wrong parameter is passed into the function such as an invalid or NULL parameter.

Constraints:
  None

Reentrant: Yes

Link Libraries:
  fsl_fusion_virt_3D_orient.lib

Definition at line 555 of file fsl_fusion_virt_3D_orient.c.

References isf_SensorHandle_st::adapterStatus, fsl_fusion_DeviceDescriptor_t::deviceSemaphore, DSA_ERR_PARAM, DSA_ERR_START_DATA, DSA_STATE_CONFIGURED_STARTED, DSA_STATE_CONFIGURED_STOPPED, ISF_SUCCESS, isf_SensorHandle_st::pDeviceDescriptor, SensorConfig_st::pSensorSpecificSettings, isf_SensorHandle_st::pSensorStaticConfig, and start_sensor().

Here is the call graph for this function:

isf_dsa_status_t fsl_fusion_virt_3D_orient_ValidateSettings | ( | isf_SensorHandle_t * | pSensorHandle,
|  | isf_dsa_SensorSettings_t * | pSensorSettings
| ) |  |

This is the concrete implementation of the orientation 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] | pSensorHdl | This is a void pointer to the instance of the orientation sensor adapter.
  [in] | pSettings | The reference to the sensor settings.

Returns
  fsl_fusion_virt_3D_orient_ValidateSettings() returns a value of type isf_dsa_status_t indicating the success or failure of the function call.

Return values

  ISF_SUCCESS | is returned when the device settings are successfully validated.
  ::SM_DSA_RET_SETTINGS_CHANGED | is returned when the current settings have been changed.

Constraints:
  None

Reentrant: Yes

Link Libraries:
  fsl_fusion_virt_3D_orient.lib

< Sample period in microseconds

< Sample period in microseconds

< The desired data type of the subscription

Definition at line 322 of file fsl_fusion_virt_3D_orient.c.

References DSA_ERR_BAD_SENSOR_DATA_TYPE, DSA_ERR_PARAM, DSA_ERR_VALIDATE_SETTINGS, DSA_RESULT_TYPE_ENG_FLOAT, ISF_SUCCESS, isf_dsa_SensorSettings_st::nSamplePeriod, isf_SensorHandle_st::pDeviceDescriptor, SensorConfig_st::pSensorSpecificSettings, isf_SensorHandle_st::pSensorStaticConfig, isf_dsa_SensorSettings_st::resultFormat, isf_dsa_SensorSettings_st::resultType, TYPE_ALTITUDE, TYPE_DIR_COSINE_MATRIX, TYPE_EULER_3D, TYPE_MAGNETIC_FIELD_STRENGTH_3D, TYPE_NATIVE_SENSOR_DATA_TYPE, TYPE_QUATERNION, TYPE_RAW_ACCELERATION_3D, TYPE_ROTATIONAL_RATE_3D, and TYPE_TEMPERATURE.

void fsl_MagCal_task | ( | uint32_t | task_init_data | ) |

Definition at line 1225 of file fsl_fusion_virt_3D_orient.c.

References FALSE, fsl_fusion_DeviceDescriptor_t::fusionState, MAGCAL_EVENT_FLAG, MagCal_Run(), fsl_fusion_DeviceDescriptor_t::MagCalEventStruct, and isf_SensorHandle_st::pDeviceDescriptor.

Referenced by fsl_fusion_virt_3D_orient_Initialize().

Here is the call graph for this function:

Here is the caller graph for this function:

## Variable Documentation

isf_SensorDataTypes_t fsl_fusion_SupportedDataTypes[]

Definition at line 102 of file fsl_fusion_virt_3D_orient.c.

isf_SensorTypes_t fsl_fusion_SupportedSensorTypes[]

Supported sensor and data types for MMA8652.

Supported sensor and data types for MMA8652.

Definition at line 92 of file fsl_fusion_virt_3D_orient.c.

- © Freescale Semiconductor, Inc. 2016. All Rights Reserved.