| ISF 2.1 Intelligent Sensing Framework for Kinetis with Processor Expert

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Macros | Functions | Variables
fsl_fxos8700_i2cspi_6D_AccMag.c File Reference

The FXOS8700 is a 6-axis consumer combo device that includes an accelerometer and magnetometer from Freescale that supports both I2C and SPI protocols. This source file implements the interface for the FXOS8700 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 <mqxlite.h>`
`#include <isf.h>`
`#include <isf_types.h>`
`#include <lwmem.h>`
`#include <lwsem.h>`
`#include <lwevent.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_accelerometer_types.h>`
`#include <isf_magnetometer_types.h>`
`#include <isf_comm.h>`
`#include <isf_util.h>`
`#include <isf_sensors.h>`
`#include "fsl_i2c_master_driver.h"`
`#include "fsl_fxos8700_i2cspi_6D_AccMag.h"`
`#include "fxos8700.h"`
Include dependency graph for fsl_fxos8700_i2cspi_6D_AccMag.c:

Go to the source code of this file.

## Macros
#define | FXOS8700_MAG_FLOAT_CONVERSION_FACTOR (0.1)
#define | FXOS8700_MAG_FLOAT_CONVERSION_OFFSET (0.0)
#define | FXOS8700_MAG_FIXED_CONVERSION_FACTOR (1638)
#define | FXOS8700_MAG_FIXED_CONVERSION_OFFSET (0)
#define | MAX_ACCEL_FULL_SCALE_RANGE 2
#define | FXOS8700_SAMPLE_PERIOD_MAX 640000
#define | FXOS8700_SAMPLE_PERIOD_MIN 1250
#define | GET_ODR_CONFIG 0x0
#define | GET_ODR_VALUE 0x01
#define | NUM_STATUS_BYTES 1
#define | NUMBER_OF_AXES_3D 0x3
#define | NUMBER_OF_AXES_6D 0x6
#define | MAX_NUM_AXES 0x6
#define | MAX_FXOS8700_DM_BYTES 0x79
#define | NUM_INTERNAL_ADDRESS_BYTES 0x1
#define | GET_MODE(mode) ((mode) <= FXOS8700_MODE_HYBRID) ? (mode) : FXOS8700_MODE_HYBRID
#define | GET_STRUCT_MEMBER_ADDRESS(p, m) (&(p)->m)
#define | GET_MEMBER_SIZE(p, m) sizeof((p)->m)
#define | MAX_DATA_READ_SIZE (NUMBER_OF_AXES_6D * 2 + NUM_STATUS_BYTES + sizeof (extendAddress) / sizeof(uint8))

## 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...
void | fsl_fxos8700_i2cspi_6D_AccMag_PeriodicCallback (void *pSensorHandle)
| The callback function for the Bus Manager(BM). 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 *pNativeSample, void *pConvertedSample, int32 *numBytes)
| This function coverts the raw sample data to the desired output type. More...

## Variables
isf_SensorTypes_t | fxos8700_SupportedSensorTypes [] = { TYPE_ACCELEROMETER_3D, TYPE_MAGNETOMETER_3D, TYPE_NATIVE_SENSOR_TYPE }
| Supported sensor and data types for FXOS8700. More...
isf_SensorDataTypes_t | fxos8700_SupportedDataTypes [] = { TYPE_RAW_ACCELERATION_3D, TYPE_MAGNETIC_FIELD_STRENGTH_3D, TYPE_NATIVE_SENSOR_DATA_TYPE }
const fxo8700_ODR_Table_t | odrTable []
| The table that describes the configuration value based on ODR (output data rate). Note: This table is irregular after the 50HZ, so can't use FLOORLOG2 algorithm. More...
struct {
float floatFactor
float floatOffset
int32 fixedFactor
int32 fixedOffset
} | fxos8700AccelConvTable []
const uint8 | extendAddress [] = {FXOS8700_PL_STATUS, FXOS8700_FF_MT_SRC, FXOS8700_TRANSIENT_SRC, FXOS8700_PULSE_SRC, FXOS8700_M_THS_SRC}
| The table that describes the extended address space. More...

## Detailed Description

The FXOS8700 is a 6-axis consumer combo device that includes an accelerometer and magnetometer from Freescale that supports both I2C and SPI protocols. This source file implements the interface for the FXOS8700 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_fxos8700_i2cspi_6D_AccMag.c.c

Copyright (c) 2013, Freescale Semiconductor, Inc.

Definition in file fsl_fxos8700_i2cspi_6D_AccMag.c.

## Macro Definition Documentation

#define FXOS8700_MAG_FIXED_CONVERSION_FACTOR (1638)

Definition at line 69 of file fsl_fxos8700_i2cspi_6D_AccMag.c.

#define FXOS8700_MAG_FIXED_CONVERSION_OFFSET (0)

Definition at line 70 of file fsl_fxos8700_i2cspi_6D_AccMag.c.

#define FXOS8700_MAG_FLOAT_CONVERSION_FACTOR (0.1)

Definition at line 67 of file fsl_fxos8700_i2cspi_6D_AccMag.c.

#define FXOS8700_MAG_FLOAT_CONVERSION_OFFSET (0.0)

Definition at line 68 of file fsl_fxos8700_i2cspi_6D_AccMag.c.

#define FXOS8700_SAMPLE_PERIOD_MAX 640000

Definition at line 74 of file fsl_fxos8700_i2cspi_6D_AccMag.c.

#define FXOS8700_SAMPLE_PERIOD_MIN 1250

Definition at line 75 of file fsl_fxos8700_i2cspi_6D_AccMag.c.

#define GET_MEMBER_SIZE | ( |  | p,
|  |  | m
| ) |  | sizeof((p)->m)

Definition at line 99 of file fsl_fxos8700_i2cspi_6D_AccMag.c.

#define GET_MODE | ( |  | mode | ) | ((mode) <= FXOS8700_MODE_HYBRID) ? (mode) : FXOS8700_MODE_HYBRID

Definition at line 94 of file fsl_fxos8700_i2cspi_6D_AccMag.c.

#define GET_ODR_CONFIG 0x0

Definition at line 76 of file fsl_fxos8700_i2cspi_6D_AccMag.c.

Referenced by fsl_fxos8700_i2cspi_6D_AccMag_Configure().

#define GET_ODR_VALUE 0x01

Definition at line 77 of file fsl_fxos8700_i2cspi_6D_AccMag.c.

Referenced by fsl_fxos8700_i2cspi_6D_AccMag_ValidateSettings().

#define GET_STRUCT_MEMBER_ADDRESS | ( |  | p,
|  |  | m
| ) |  | (&(p)->m)

Definition at line 97 of file fsl_fxos8700_i2cspi_6D_AccMag.c.

#define MAX_ACCEL_FULL_SCALE_RANGE 2

Definition at line 72 of file fsl_fxos8700_i2cspi_6D_AccMag.c.

#define MAX_DATA_READ_SIZE (NUMBER_OF_AXES_6D * 2 + NUM_STATUS_BYTES + sizeof (extendAddress) / sizeof(uint8))

Definition at line 138 of file fsl_fxos8700_i2cspi_6D_AccMag.c.

#define MAX_FXOS8700_DM_BYTES 0x79

Definition at line 84 of file fsl_fxos8700_i2cspi_6D_AccMag.c.

#define MAX_NUM_AXES 0x6

Definition at line 83 of file fsl_fxos8700_i2cspi_6D_AccMag.c.

#define NUM_INTERNAL_ADDRESS_BYTES 0x1

Definition at line 87 of file fsl_fxos8700_i2cspi_6D_AccMag.c.

#define NUM_STATUS_BYTES 1

Definition at line 79 of file fsl_fxos8700_i2cspi_6D_AccMag.c.

#define NUMBER_OF_AXES_3D 0x3

Definition at line 81 of file fsl_fxos8700_i2cspi_6D_AccMag.c.

#define NUMBER_OF_AXES_6D 0x6

Definition at line 82 of file fsl_fxos8700_i2cspi_6D_AccMag.c.

## Variable Documentation

const uint8 extendAddress[] = {FXOS8700_PL_STATUS, FXOS8700_FF_MT_SRC, FXOS8700_TRANSIENT_SRC, FXOS8700_PULSE_SRC, FXOS8700_M_THS_SRC}

The table that describes the extended address space.

Definition at line 136 of file fsl_fxos8700_i2cspi_6D_AccMag.c.

int32 fixedFactor

Definition at line 122 of file fsl_fxos8700_i2cspi_6D_AccMag.c.

int32 fixedOffset

Definition at line 123 of file fsl_fxos8700_i2cspi_6D_AccMag.c.

float floatFactor

Definition at line 120 of file fsl_fxos8700_i2cspi_6D_AccMag.c.

float floatOffset

Definition at line 121 of file fsl_fxos8700_i2cspi_6D_AccMag.c.

const { ... } fxos8700AccelConvTable[]

Initial value:
=
{
{ 0.000061, 0.0, 8, 0},
{ 0.000122, 0.0, 16, 0},
{ 0.000244, 0.0, 32, 0}
}

const fxo8700_ODR_Table_t odrTable[]

Initial value:
={
{ 1250, 2500, 0},
{ 2500, 5000, 1},
{ 5000, 10000, 2},
{ 10000, 20000, 3},
{ 20000, 80000, 4},
{ 80000, 160000, 5},
{160000, 320000, 6},
{640000, 1280000, 7},
}

The table that describes the configuration value based on ODR (output data rate). Note: This table is irregular after the 50HZ, so can't use FLOORLOG2 algorithm.

Definition at line 105 of file fsl_fxos8700_i2cspi_6D_AccMag.c.

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