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

Data Structures

struct  fxas21002_DataBuffer_t
 This structure defines the dummy DSA data buffer format. More...
 
struct  fxas21002_ODR_Table_tag
 the structure defines the ODR table between Hybrid and normal mode of FXAS21002 operation. More...
 
struct  fxas21000_ODR_Table_tag
 the structure defines the ODR table between Hybrid and normal mode of FXAS21000 operation. More...
 
struct  fxas21002_ConfigTable_tag
 the structure defines the configuration table. More...
 

Macros

#define FXAS21002_WHO_AM_I_VALUE   0xD6
 Define the WHO_AM_I register values for both possible sensor variations. More...
 
#define FXAS21000_WHO_AM_I_VALUE   0xD1
 

Typedefs

typedef int32 fxas21002_Status_t
 FXAS21002 internal return codes. More...
 
typedef enum fxas21002_Power_tag fxas21002_Power_t
 Enumeration for the FXAS21002 power modes. More...
 
typedef enum
fxas21002_InternalState_tag 
fxas21002_InternalState_t
 Enumeration for the FXAS21002 driver internal states. More...
 
typedef enum fxas21002_Range_tag fxas21002_Range_t
 
typedef struct
fxas21002_ODR_Table_tag 
fxas21002_ODR_Table_t
 the structure defines the ODR table between Hybrid and normal mode of FXAS21002 operation. More...
 
typedef struct
fxas21000_ODR_Table_tag 
fxas21000_ODR_Table_t
 the structure defines the ODR table between Hybrid and normal mode of FXAS21000 operation. More...
 
typedef struct
fxas21002_ConfigTable_tag 
fxas21002_ConfigTable_t
 the structure defines the configuration table. More...
 

Enumerations

enum  fxas21002_Error_tag {
  FXAS21002_ERROR_WHOAMI = 1, FXAS21002_ERROR_WAITFORACTIVE, FXAS21002_ERROR_BURSTWRITE, FXAS21002_ERROR_CONFIG,
  FXAS21002_ERROR_SETPOWER, FXAS21002_ERROR_WRITE, FXAS21002_ERROR_READ
}
 Enumeration for the FXAS21002 internal error codes. More...
 
enum  fxas21002_Power_tag { FXAS21002_POWER_STANDBY = 0, FXAS21002_POWER_ACTIVE = 1 }
 Enumeration for the FXAS21002 power modes. More...
 
enum  fxas21002_InternalState_tag { FXAS21002_STATE_UNINTIALIZED, FXAS21002_STATE_INITIALIZED, FXAS21002_STATE_CONFIGURED, FXAS21002_STATE_STARTED }
 Enumeration for the FXAS21002 driver internal states. More...
 
enum  fxas21002_Range_tag { FXAS21002_RANGE_2000DPS = 0, FXAS21002_RANGE_1000DPS = 1, FXAS21002_RANGE_500DPS = 2, FXAS21002_RANGE_MAX = FXAS21002_RANGE_2000DPS }
 

Functions

isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_Initialize (isf_SensorHandle_t *pSensorHandle)
 This is the concrete implementation of the FXAS21002 sensor adapter initialization. More...
 
isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_ValidateSettings (isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSubSettings)
 This is the concrete implementation of the FXAS21002 sensor adapter for validating current settings. More...
 
isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_Configure (isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
 This is the concrete implementation of the FXAS21002 sensor adapter for configuration. More...
 
isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_StartData (isf_SensorHandle_t *pSensorHandle)
 This is the concrete implementation of the FXAS21002 sensor adapter for start Data. More...
 
isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_EndData (isf_SensorHandle_t *pSensorHandle)
 This is the concrete implementation of the FXAS21002 sensor adapter for End Data. More...
 
isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_Calibrate (isf_SensorHandle_t *pSensorHandle, void *pCalData)
 This is the concrete implementation of the FXAS21002 sensor adapter for calibration . More...
 
isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_Shutdown (isf_SensorHandle_t *pSensorHandle)
 This is the concrete implementation of the FXAS21002 sensor adapter for shutdown . More...
 
void fsl_fxas21002_i2cspi_3D_gyro_PeriodicCallback (void *pSensorHandle)
 The callback function for the Bus Manager(BM). More...
 
isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_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

isf_SensorTypes_t fxas21002_SupportedSensorTypes []
 Supported sensor and data types for MMA8652. More...
 
isf_SensorDataTypes_t fxas21002_SupportedDataTypes []
 
isf_SensorTypes_t fxas21002_SupportedSensorTypes [] = { TYPE_GYROMETER_3D, TYPE_NATIVE_SENSOR_TYPE }
 Supported sensor and data types for FXAS21002. More...
 
isf_SensorDataTypes_t fxas21002_SupportedDataTypes [] = { TYPE_ROTATIONAL_RATE_3D , TYPE_NATIVE_SENSOR_DATA_TYPE }
 

Detailed Description

Macro Definition Documentation

#define FXAS21000_WHO_AM_I_VALUE   0xD1

Definition at line 28 of file fsl_fxas21002_i2cspi_3D_gyro.h.

#define FXAS21002_WHO_AM_I_VALUE   0xD6

Define the WHO_AM_I register values for both possible sensor variations.

Definition at line 27 of file fsl_fxas21002_i2cspi_3D_gyro.h.

Typedef Documentation

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

the structure defines the configuration table.

Enumeration for the FXAS21002 driver internal states.

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

Enumeration for the FXAS21002 power modes.

FXAS21002 internal return codes.

Definition at line 41 of file fsl_fxas21002_i2cspi_3D_gyro.h.

Enumeration Type Documentation

Enumeration for the FXAS21002 internal error codes.

Enumerator
FXAS21002_ERROR_WHOAMI 

Error occurred while reading FXAS21002_WHO_AM_I or the value was incorrect.

FXAS21002_ERROR_WAITFORACTIVE 

Error occurred while attempting to put device into active mode.

FXAS21002_ERROR_BURSTWRITE 

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

FXAS21002_ERROR_CONFIG 

Error occurred while attempting to configure the device.

FXAS21002_ERROR_SETPOWER 

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

FXAS21002_ERROR_WRITE 

Error occurred while attempting to write the registers directly.

FXAS21002_ERROR_READ 

Error occurred while attempting to read the registers directly.

Definition at line 46 of file fsl_fxas21002_i2cspi_3D_gyro.h.

Enumeration for the FXAS21002 driver internal states.

Enumerator
FXAS21002_STATE_UNINTIALIZED 

initial state of the device.

FXAS21002_STATE_INITIALIZED 

FXAS21002_WHO_AM_I has been verified.

FXAS21002_STATE_CONFIGURED 

Device has been reset and configured.

FXAS21002_STATE_STARTED 

Device is in active mode and measuring data.

Definition at line 65 of file fsl_fxas21002_i2cspi_3D_gyro.h.

Enumeration for the FXAS21002 power modes.

Enumerator
FXAS21002_POWER_STANDBY 

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

FXAS21002_POWER_ACTIVE 

Device in active mode.

Definition at line 58 of file fsl_fxas21002_i2cspi_3D_gyro.h.

Enumerator
FXAS21002_RANGE_2000DPS 
FXAS21002_RANGE_1000DPS 
FXAS21002_RANGE_500DPS 
FXAS21002_RANGE_MAX 

Definition at line 72 of file fsl_fxas21002_i2cspi_3D_gyro.h.

Function Documentation

isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_Calibrate ( isf_SensorHandle_t pSensorHandle,
void *  pCalData 
)

This is the concrete implementation of the FXAS21002 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 FXAS21002 sensor adapter.
[in]pCalDataThis is a void pointer to the calibration data.
Returns
fsl_fxas21002_i2cspi_3D_gyro_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_fxas21002_i2cspi_3D_gyro.lib

Definition at line 538 of file fsl_fxas21002_i2cspi_3D_gyro.c.

References ISF_SUCCESS.

isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_Configure ( isf_SensorHandle_t pSensorHandle,
isf_dsa_SensorSettings_t pSensorSettings 
)

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

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

Definition at line 285 of file fsl_fxas21002_i2cspi_3D_gyro.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_fxas21002_i2cspi_3D_gyro_PeriodicCallback(), FXAS21000_WHOAMI_VALUE, FXAS21002_ACTIVE_MASK, FXAS21002_CTRL_REG1, FXAS21002_READY_MASK, FXAS21002_SET_FIELD, ISF_SUCCESS, isf_dsa_SensorSettings_st::nSamplePeriod, isf_SensorHandle_st::pDeviceDescriptor, SensorConfig_st::pSensorSpecificSettings, isf_SensorHandle_st::pSensorStaticConfig, fxas21002_Sensor_Specific_Reg_t::regAddr, fxas21002_Sensor_Specific_Settings_t::regCount, fxas21002_Sensor_Specific_Settings_t::regPairs, fxas21002_Sensor_Specific_Reg_t::regValue, DeviceDescriptor_struct::token, and whoami_read_val.

Here is the call graph for this function:

isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_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 693 of file fsl_fxas21002_i2cspi_3D_gyro.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_ROTATIONAL_RATE_3D.

Referenced by fsl_fxas21002_i2cspi_3D_gyro_PeriodicCallback().

Here is the caller graph for this function:

isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_EndData ( isf_SensorHandle_t pSensorHandle)

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

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

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

Definition at line 474 of file fsl_fxas21002_i2cspi_3D_gyro.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, FXAS21002_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_fxas21002_i2cspi_3D_gyro_Initialize ( isf_SensorHandle_t pSensorHandle)

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

This function allocates memory for the device descriptor.

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

Definition at line 157 of file fsl_fxas21002_i2cspi_3D_gyro.c.

References isf_SensorHandle_st::adapterStatus, fxas21002_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, FXAS21000_WHOAMI_VALUE, FXAS21002_WHOAMI_VALUE, fxas21002_DataBuffer_t::gyro, ISF_SUCCESS, DeviceDescriptor_struct::pCurrentSample, isf_SensorHandle_st::pDeviceDescriptor, isf_SensorHandle_st::pSensorStaticConfig, DeviceDescriptor_struct::skipFramecnt, and fxas21002_DataBuffer_t::timeStamp.

Here is the call graph for this function:

void fsl_fxas21002_i2cspi_3D_gyro_PeriodicCallback ( void *  pSensorHandle)
isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_Shutdown ( isf_SensorHandle_t pSensorHandle)

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

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

Definition at line 555 of file fsl_fxas21002_i2cspi_3D_gyro.c.

References isf_SensorHandle_st::adapterStatus, bm_unregister_callback(), DSA_ERR_PARAM, DSA_ERR_SHUTDOWN, 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_fxas21002_i2cspi_3D_gyro_StartData ( isf_SensorHandle_t pSensorHandle)

This is the concrete implementation of the FXAS21002 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 void pointer to the instance of the FXAS21002 sensor adapter.
Returns
fsl_fxas21002_i2cspi_3D_gyro_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_fxas21002_i2cspi_3D_gyro.lib

Definition at line 414 of file fsl_fxas21002_i2cspi_3D_gyro.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, FXAS21002_POWER_ACTIVE, ISF_SUCCESS, isf_SensorHandle_st::pDeviceDescriptor, and DeviceDescriptor_struct::token.

Here is the call graph for this function:

isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_ValidateSettings ( isf_SensorHandle_t pSensorHandle,
isf_dsa_SensorSettings_t pSensorSettings 
)

This is the concrete implementation of the FXAS21002 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 void pointer to the instance of the FXAS21002 sensor adapter.
[in]pSensorSettingsThe reference to the sensor settings.
Returns
fsl_fxas21002_i2cspi_3D_gyro_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_fxas21002_i2cspi_3D_gyro.lib

Definition at line 246 of file fsl_fxas21002_i2cspi_3D_gyro.c.

References DSA_ERR_PARAM, DSA_RET_SETTINGS_CHANGED, ISF_SUCCESS, and isf_dsa_SensorSettings_st::nSamplePeriod.

Variable Documentation

Definition at line 60 of file fsl_fxas21002_i2cspi_3D_gyro.c.

isf_SensorDataTypes_t fxas21002_SupportedDataTypes[]

Definition at line 260 of file fsl_fxas21002_i2cspi_3D_gyro.h.

isf_SensorTypes_t fxas21002_SupportedSensorTypes = { TYPE_GYROMETER_3D, TYPE_NATIVE_SENSOR_TYPE }

Supported sensor and data types for FXAS21002.

Supported sensor and data types for MMA8652.

Definition at line 59 of file fsl_fxas21002_i2cspi_3D_gyro.c.

isf_SensorTypes_t fxas21002_SupportedSensorTypes[]

Supported sensor and data types for MMA8652.

Supported sensor and data types for MMA8652.

Definition at line 259 of file fsl_fxas21002_i2cspi_3D_gyro.h.