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

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Macros | Functions | Variables
fsl_mma8491q_i2c_3D_accel.c File Reference

The fsl_mma8491q_i2c_3D_accel.c contains the MMA8491Q Accelerometer family routine Set implementations. Freescale supports several families of 3-axis intelligent accelerometers with overlapping register definitions and feature sets. This file implements a sensor adapter for this part families. More...

`#include "mma8491q.h"`
`#include "isf_devmsg.h"`
`#include "isf_sensors.h"`
`#include "isf_accelerometer_types.h"`
`#include "fsl_mma8491q_i2c_3D_accel.h"`
`#include "SensorEnable.h"`
`#include "OutX.h"`
`#include "OutY.h"`
`#include "OutZ.h"`
Include dependency graph for fsl_mma8491q_i2c_3D_accel.c:

Go to the source code of this file.

## Macros
#define | T_ON_8491Q_MICROSECONDS (700)
#define | mma8491q_xyz_format(destination, msb, lsb) destination = (((uint16)msb) << 8) | lsb;
#define | MMA8491Q_ACCEL_FLOAT_CONVERSION_FACTOR 0.000244
#define | MMA8491Q_ACCEL_FIXED_CONVERSION_FACTOR 16
#define | DATA_BUFFER_SIZE_8491Q (7)

## Functions
void | mma8491q_CheckId (int32_t *status, void *pSensorHandle)
| This function validates the MMA8491Q sensor is connected via the I2C bus. More...
isf_dsa_status_t | mma8491q_getAccelData (DeviceDescriptor_t *pDescriptor, int16 *pAccelData)
isf_dsa_status_t | fsl_mma8491q_i2c_3D_accel_Initialize (isf_SensorHandle_t *pSensorHandle)
isf_dsa_status_t | fsl_mma8491q_i2c_3D_accel_ValidateSettings (isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
isf_dsa_status_t | fsl_mma8491q_i2c_3D_accel_Configure (isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
isf_status_t | fsl_mma8491q_i2c_3D_accel_Calibrate (isf_SensorHandle_t *pSensorHandle, void *pCalData)
isf_status_t | fsl_mma8491q_i2c_3D_accel_StartData (isf_SensorHandle_t *pSensorHandle)
isf_status_t | fsl_mma8491q_i2c_3D_accel_EndData (isf_SensorHandle_t *pSensorHandle)
isf_dsa_status_t | fsl_mma8491q_i2c_3D_accel_Shutdown (isf_SensorHandle_t *pSensorHandle)
void | fsl_mma8491q_i2c_3D_accel_PeriodicCallback (void *pSensorHandle)
void | fsl_mma8491q_read_data_OneShotCallback (void *pSensorHandle)
isf_dsa_status_t | fsl_mma8491q_i2c_3D_accel_Convert (volatile isf_SensorHandle_t *pSensorHandle, isf_SensorDataTypes_t convertToType, isf_dsa_result_types_t resultType, void *pNativeSample, void *pConvertedSample, int32 *numBytes)

## Variables
const uint32_t | en_pin = J199_3
const uint32_t | x_out_pin = J1_5
const uint32_t | y_out_pin = J1_5
const uint32_t | z_out_pin = J1_5
volatile mma8491q_mode_t | mma8491q_mode
isf_SensorTypes_t | mma8491q_SupportedSensorTypes [] = { TYPE_ACCELEROMETER_3D, TYPE_NATIVE_SENSOR_TYPE }
| Supported sensor and data types for MMA8491q. More...
isf_SensorDataTypes_t | mma8491q_SupportedDataTypes [] = { TYPE_RAW_ACCELERATION_3D, TYPE_NATIVE_SENSOR_DATA_TYPE }

## Detailed Description

The fsl_mma8491q_i2c_3D_accel.c contains the MMA8491Q Accelerometer family routine Set implementations. Freescale supports several families of 3-axis intelligent accelerometers with overlapping register definitions and feature sets. This file implements a sensor adapter for this part families.

Copyright
  Copyright (c) 2015, Freescale Semiconductor, Inc.

Definition in file fsl_mma8491q_i2c_3D_accel.c.

## Macro Definition Documentation

#define DATA_BUFFER_SIZE_8491Q (7)

Definition at line 596 of file fsl_mma8491q_i2c_3D_accel.c.

Referenced by mma8491q_getAccelData().

#define MMA8491Q_ACCEL_FIXED_CONVERSION_FACTOR 16

Definition at line 45 of file fsl_mma8491q_i2c_3D_accel.c.

#define MMA8491Q_ACCEL_FLOAT_CONVERSION_FACTOR 0.000244

Definition at line 44 of file fsl_mma8491q_i2c_3D_accel.c.

#define mma8491q_xyz_format | ( |  | destination,
|  |  | msb,
|  |  | lsb
| ) |  | destination = (((uint16)msb) << 8) | lsb;

Definition at line 32 of file fsl_mma8491q_i2c_3D_accel.c.

Referenced by mma8491q_getAccelData().

#define T_ON_8491Q_MICROSECONDS (700)

Definition at line 26 of file fsl_mma8491q_i2c_3D_accel.c.

Referenced by fsl_mma8491q_i2c_3D_accel_Configure().

## Function Documentation

void mma8491q_CheckId | ( | int32_t * | status,
|  | void * | pSensorHandle
| ) |  |

This function validates the MMA8491Q sensor is connected via the I2C bus.

Definition at line 574 of file fsl_mma8491q_i2c_3D_accel.c.

References DeviceDescriptor_struct::deviceHandle, dm_device_read(), ISF_SUCCESS, MMA8491Q_WHOAMI_VALUE, isf_SensorHandle_st::pDeviceDescriptor, and SENSOR_ERROR_CHECKID.

Referenced by fsl_mma8491q_i2c_3D_accel_Initialize().

Here is the call graph for this function:

Here is the caller graph for this function:

isf_dsa_status_t mma8491q_getAccelData | ( | DeviceDescriptor_t * | pDescriptor,
|  | int16 * | pAccelData
| ) |  |

Definition at line 600 of file fsl_mma8491q_i2c_3D_accel.c.

References DATA_BUFFER_SIZE_8491Q, DeviceDescriptor_struct::deviceHandle, dm_device_read(), ISF_SUCCESS, MMA8491Q_DATA_FAIL, MMA8491Q_DATA_SUCCESS, MMA8491Q_STATUS_00, mma8491q_xyz_format, SENSOR_ERROR_GETDATA, and ZYXDR_MASK.

Referenced by fsl_mma8491q_read_data_OneShotCallback().

Here is the call graph for this function:

Here is the caller graph for this function:

## Variable Documentation

const uint32_t en_pin = J199_3

Definition at line 35 of file fsl_mma8491q_i2c_3D_accel.c.

Referenced by fsl_mma8491q_i2c_3D_accel_EndData(), fsl_mma8491q_i2c_3D_accel_Initialize(), fsl_mma8491q_i2c_3D_accel_PeriodicCallback(), and fsl_mma8491q_read_data_OneShotCallback().

volatile mma8491q_mode_t mma8491q_mode

Definition at line 55 of file fsl_mma8491q_i2c_3D_accel.c.

Referenced by fsl_mma8491q_i2c_3D_accel_Configure(), fsl_mma8491q_i2c_3D_accel_PeriodicCallback(), fsl_mma8491q_i2c_3D_accel_Shutdown(), and fsl_mma8491q_read_data_OneShotCallback().

const uint32_t x_out_pin = J1_5

Definition at line 36 of file fsl_mma8491q_i2c_3D_accel.c.

Referenced by fsl_mma8491q_read_data_OneShotCallback().

const uint32_t y_out_pin = J1_5

Definition at line 37 of file fsl_mma8491q_i2c_3D_accel.c.

Referenced by fsl_mma8491q_read_data_OneShotCallback().

const uint32_t z_out_pin = J1_5

Definition at line 38 of file fsl_mma8491q_i2c_3D_accel.c.

Referenced by fsl_mma8491q_read_data_OneShotCallback().

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