ISF  2.1
Intelligent Sensing Framework for Kinetis with Processor Expert
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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

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]pSensorHdlThis 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_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_fusion_virt_3D_orient.lib

Definition at line 714 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]pSensorHdlThis is a void pointer to the instance of the fusion sensor adapter.
[in]pConfigThe 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_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_fusion_virt_3D_orient.lib

Definition at line 308 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, isf_dsa_Adapter_st::devInfo, DSA_ERR_PARAM, DSA_RESULT_TYPE_ENG_FLOAT, DSA_STATE_CONFIGURED_STOPPED, DSA_STATE_INITIALIZED, fusion_algorithmConfig_t::gyroOversampleRatio, isf_fifo_init(), ISF_SUCCESS, fusion_algorithmConfig_t::magOversampleRatio, isf_SubscriptionSettings_t::nFifoDepth, isf_dsa_DeviceInfoBlock_st::nNativeDataSetSize, isf_SubscriptionSettings_t::nSamplePeriod, isf_dsa_SensorSettings_st::nSamplePeriod, isf_SubscriptionSettings_t::nSettingsToUse, SensorConfig_st::pAdapter, isf_SensorHandle_st::pDeviceDescriptor, SensorConfig_st::pSensorSpecificSettings, isf_SensorHandle_st::pSensorStaticConfig, isf_SubscriptionSettings_t::resultFormat, isf_SubscriptionSettings_t::resultType, TYPE_ALTITUDE, 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 
)
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]pSensorHdlThis 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_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_fusion_virt_3D_orient.lib

Definition at line 621 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]pSensorHandleThis 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_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_fusion_virt_3D_orient.lib

Definition at line 126 of file fsl_fusion_virt_3D_orient.c.

References ACCEL_DATA_READY_EVENT, isf_SensorHandle_st::adapterStatus, 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_DeviceDescriptor_t::fusionState, GYRO_DATA_READY_EVENT, HYBRID_SENSOR_DATA_READY_EVENT, init_sensor(), MAG_DATA_READY_EVENT, fsl_fusion_DeviceDescriptor_t::MagCalEventStruct, isf_SensorHandle_st::pDeviceDescriptor, PRESSURE_DATA_READY_EVENT, 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]pSensorHdlThis 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 775 of file fsl_fusion_virt_3D_orient.c.

References isf_Acceleration3D_Float_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__float_t::angularVelocity, isf_SensorHandle_st::controlData, convert_sensor_data(), DSA_RESULT_TYPE_ENG_FLOAT, isf_MagneticFieldStrength3D_float_t::fieldStrength, float32_To_AcFixed(), 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, HYBRID_SENSOR_DATA_READY_EVENT, 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(), MAG_DATA_READY_EVENT, MAG_GET_HAL_X_VALUE, MAG_GET_HAL_Y_VALUE, MAG_GET_HAL_Z_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, isf_SensorHandle_st::pDeviceDescriptor, isf_dsa_ControlData_st::pEventGroup, 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_Meters1D_float_t::timestamp, isf_AngularVelocity3D__float_t::timestamp, isf_Acceleration3D_Float_t::timestamp, isf_MagneticFieldStrength3D_float_t::timestamp, TYPE_MAGNETIC_FIELD_STRENGTH_3D, TYPE_NATIVE_SENSOR_DATA_TYPE, TYPE_RAW_ACCELERATION_3D, 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]pSensorHdlThis 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_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_fusion_virt_3D_orient.lib

Definition at line 731 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, shutdown_sensor(), and USE_MAGNETOMETER.

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]pSensorHdlThis 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_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_fusion_virt_3D_orient.lib

Definition at line 528 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]pSensorHdlThis is a void pointer to the instance of the orientation sensor adapter.
[in]pSettingsThe 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_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_fusion_virt_3D_orient.lib

< Sample period in microseconds

< Sample period in microseconds

< The desired data type of the subscription

Definition at line 245 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_DIR_COSINE_MATRIX, TYPE_EULER_3D, TYPE_NATIVE_SENSOR_DATA_TYPE, TYPE_QUATERNION, and TYPE_ROTATIONAL_RATE_3D.

void fsl_MagCal_task ( uint32_t  task_init_data)

Definition at line 1114 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 MagCal_Task_task().

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 86 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 85 of file fsl_fusion_virt_3D_orient.c.