![]() |
ISF
2.2 rev 5
Intelligent Sensing Framework for Kinetis with Processor Expert
|
The FXAS21002 is a 3-axis Angular Rate Gyroscope from Freescale that supports both I2C and SPI protocols. This source file implements the interface for the FXAS21002 Sensor Adapter. It uses Device Messaging (DM), which abstracts away the differences between the I2C and SPI protocols, to communicate with the device. This choice is made via the system communication file, isf_sysconf_comms.c. This file also uses the Bus Manager (BM) to schedule a periodic callback for reading new sensor data and sending the data to the Sensor Manager (SM). More...
#include <isf.h>
#include <isf_types.h>
#include <isf_sm_api.h>
#include <isf_dsa_adapter.h>
#include <isf_bm.h>
#include <isf_sensor_types.h>
#include <isf_fifo.h>
#include <isf_gyrometer_types.h>
#include <isf_temperature_types.h>
#include <isf_comm.h>
#include <isf_util.h>
#include <isf_sensors.h>
#include "fsl_os_abstraction.h"
#include "fsl_fxas21002_i2cspi_3D_gyro.h"
#include "fxas21002.h"
Go to the source code of this file.
Macros | |
#define | MAX_GYRO_FULL_SCALE_RANGE 2 |
#define | FXAS21002_SAMPLE_PERIOD_MAX 640000 |
#define | FXAS21002_SAMPLE_PERIOD_MIN 5000 |
#define | GET_ODR_CONFIG 0x0 |
#define | GET_ODR_VALUE 0x01 |
#define | MAX_FXAS21002_DM_BYTES 0x16 |
#define | NUM_INTERNAL_ADDRESS_BYTES 0x1 |
#define | MAX_DATA_READ_SIZE 6 |
#define | MAX_BUF_SIZE 6 |
#define | TEMPERATURE_DATA_READ_SIZE 1 |
Size of Device Temperature Data to be Read. More... | |
#define | TEMPERATURE_BUF_SIZE 1 |
Size of Temperature buffer size. More... | |
#define | FXAS21002_TEMP_FLOAT_CONVERSION_FACTOR (1.0F/65536.0F) |
FXAS21002 temperature conversion to store in ISF sensors standard floating point temperature (degC) More... | |
#define | FXAS21002_TEMP_FLOAT_CONVERSION_OFFSET 0.0 |
#define | FXAS21002_TEMP_FIXED_CONVERSION_FACTOR 65536 /* 16bits left shift */ |
FXAS21002 temperature conversion to store in ISF sensors standard fixed point temperature (degC) More... | |
#define | FXAS21002_TEMP_FIXED_CONVERSION_OFFSET 0 |
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 *pSensorSettings) |
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... | |
The FXAS21002 is a 3-axis Angular Rate Gyroscope from Freescale that supports both I2C and SPI protocols. This source file implements the interface for the FXAS21002 Sensor Adapter. It uses Device Messaging (DM), which abstracts away the differences between the I2C and SPI protocols, to communicate with the device. This choice is made via the system communication file, isf_sysconf_comms.c. This file also uses the Bus Manager (BM) to schedule a periodic callback for reading new sensor data and sending the data to the Sensor Manager (SM).
File: fsl_fxas21002_i2cspi_3D_gyro.c.c
Copyright (c) 2015, Freescale Semiconductor, Inc.
Definition in file fsl_fxas21002_i2cspi_3D_gyro.c.
#define FXAS21002_SAMPLE_PERIOD_MAX 640000 |
Definition at line 66 of file fsl_fxas21002_i2cspi_3D_gyro.c.
#define FXAS21002_SAMPLE_PERIOD_MIN 5000 |
Definition at line 67 of file fsl_fxas21002_i2cspi_3D_gyro.c.
#define FXAS21002_TEMP_FIXED_CONVERSION_FACTOR 65536 /* 16bits left shift */ |
FXAS21002 temperature conversion to store in ISF sensors standard fixed point temperature (degC)
Definition at line 163 of file fsl_fxas21002_i2cspi_3D_gyro.c.
#define FXAS21002_TEMP_FIXED_CONVERSION_OFFSET 0 |
Definition at line 164 of file fsl_fxas21002_i2cspi_3D_gyro.c.
#define FXAS21002_TEMP_FLOAT_CONVERSION_FACTOR (1.0F/65536.0F) |
FXAS21002 temperature conversion to store in ISF sensors standard floating point temperature (degC)
Definition at line 155 of file fsl_fxas21002_i2cspi_3D_gyro.c.
#define FXAS21002_TEMP_FLOAT_CONVERSION_OFFSET 0.0 |
Definition at line 156 of file fsl_fxas21002_i2cspi_3D_gyro.c.
#define GET_ODR_CONFIG 0x0 |
Definition at line 68 of file fsl_fxas21002_i2cspi_3D_gyro.c.
#define GET_ODR_VALUE 0x01 |
Definition at line 69 of file fsl_fxas21002_i2cspi_3D_gyro.c.
#define MAX_BUF_SIZE 6 |
Definition at line 136 of file fsl_fxas21002_i2cspi_3D_gyro.c.
Referenced by fsl_fxas21002_i2cspi_3D_gyro_PeriodicCallback().
#define MAX_DATA_READ_SIZE 6 |
Definition at line 135 of file fsl_fxas21002_i2cspi_3D_gyro.c.
Referenced by fsl_fxas21002_i2cspi_3D_gyro_PeriodicCallback().
#define MAX_FXAS21002_DM_BYTES 0x16 |
Definition at line 71 of file fsl_fxas21002_i2cspi_3D_gyro.c.
#define MAX_GYRO_FULL_SCALE_RANGE 2 |
Definition at line 64 of file fsl_fxas21002_i2cspi_3D_gyro.c.
#define NUM_INTERNAL_ADDRESS_BYTES 0x1 |
Definition at line 72 of file fsl_fxas21002_i2cspi_3D_gyro.c.
#define TEMPERATURE_BUF_SIZE 1 |
Size of Temperature buffer size.
Definition at line 148 of file fsl_fxas21002_i2cspi_3D_gyro.c.
Referenced by fsl_fxas21002_i2cspi_3D_gyro_PeriodicCallback().
#define TEMPERATURE_DATA_READ_SIZE 1 |
Size of Device Temperature Data to be Read.
Definition at line 142 of file fsl_fxas21002_i2cspi_3D_gyro.c.
Referenced by fsl_fxas21002_i2cspi_3D_gyro_PeriodicCallback().
int32 fixedFactor |
Definition at line 111 of file fsl_fxas21002_i2cspi_3D_gyro.c.
int32 fixedOffset |
Definition at line 112 of file fsl_fxas21002_i2cspi_3D_gyro.c.
float floatFactor |
Definition at line 109 of file fsl_fxas21002_i2cspi_3D_gyro.c.
float floatOffset |
Definition at line 110 of file fsl_fxas21002_i2cspi_3D_gyro.c.
const fxas21000_ODR_Table_t fxas21000_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.
Definition at line 79 of file fsl_fxas21002_i2cspi_3D_gyro.c.
const { ... } fxas21000GyroConvTable[] |
const uint8 fxas21002_extendAddress[] = {FXAS21002_F_STATUS, FXAS21002_F_SETUP, FXAS21002_F_EVENT, FXAS21002_INT_SRC_FLAG} |
The table that describes the extended address space.
Definition at line 133 of file fsl_fxas21002_i2cspi_3D_gyro.c.
const fxas21002_ODR_Table_t fxas21002_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.
Definition at line 94 of file fsl_fxas21002_i2cspi_3D_gyro.c.
const { ... } fxas21002GyroConvTable[] |
uint8 whoami_read_val |
Definition at line 51 of file fsl_fxas21002_i2cspi_3D_gyro.c.
Referenced by fsl_fxas21002_i2cspi_3D_gyro_Configure().