| 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
MMA865x_1.c
Go to the documentation of this file.
1 /* ###################################################################
2 ** THIS COMPONENT MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
3 ** Filename : MMA865x_1.c
4 ** CDE edition : Community
5 ** Project : ISF_K64F_CW_PROJ
6 ** Processor : MK64FN1M0VLL12
7 ** Component : ISF_Sensor_MMA865x_Accelerometer
8 ** Version : Component 01.000, Driver 01.00, CPU db: 3.00.000
9 ** Compiler : GNU C Compiler
10 ** Date/Time : 2015-03-03, 11:01, # CodeGen: 0
11 ** Abstract :
12 **
13 ** Settings :
14 ** Contents :
15 ** No public methods
16 **
17 ** For non-commercial use only.
18 (c) Copyright <company/user-name>, 2014
19 http://www.<company>.com
20 mail: info@<company>.com
21 ** ###################################################################*/
22 /*!
23 ** @file MMA865x_1.c
24 ** @version 01.00
25 ** @brief
26 **
27 */
28 /*!
29 ** @addtogroup MMA865x_1_module MMA865x_1 module documentation
30 ** @{
31 */
32
33 /* MODULE MMA865x_1. */
34
35 #include "MMA865x_1.h"
36 #include "mma865x.h"
37
38 mma865x_Sensor_Specific_Settings_t MMA865x_1_Sensor_Specific_Config =
39 {
40 .accelFullScaleRange = 0, // Capture the accelerometer full-scale range for use in conversion routines.
41 .regCount = 20, // Number of register pairs to follow
42 .regPairs =
43 {
44 // Data configuration registers.
45 { MMA865x_XYZ_DATA_CFG, (MMA865x_SET_FIELD(HPF_OUT,0)) | (MMA865x_SET_FIELD(FS,0)) },
46 { MMA865x_HP_FILTER_CUTOFF, (MMA865x_SET_FIELD(PULSE_HPF_BYP,0)) | (MMA865x_SET_FIELD(PULSE_LPF_EN,0)) | (MMA865x_SET_FIELD(SEL,0)) },
47 // Portrait Landscape registers.
48 { MMA865x_PL_CFG, (MMA865x_SET_FIELD(DBCNTM,1)) | (MMA865x_SET_FIELD(PL_EN,0)) },
49 { MMA865x_PL_COUNT, 0 },
50 { MMA865x_PL_BF_ZCOMP, (MMA865x_SET_FIELD(BKFR,1)) | (MMA865x_SET_FIELD(ZLOCK,4)) },
51 { MMA865x_PL_P_L_THS, (MMA865x_SET_FIELD(P_L_THS,16)) | (MMA865x_SET_FIELD(HYS,4)) },
52 // Freefall/Motion Detection registers.
53 { MMA865x_FF_MT_CFG, (MMA865x_SET_FIELD(ELE,0)) | (MMA865x_SET_FIELD(OAE,0)) | (MMA865x_SET_FIELD(ZEFE,0)) | (MMA865x_SET_FIELD(YEFE,0)) | (MMA865x_SET_FIELD(XEFE,0)) },
54 { MMA865x_FF_MT_THS, (MMA865x_SET_FIELD(DBCNTM,0)) | (MMA865x_SET_FIELD(THS,0)) },
55 { MMA865x_FF_MT_COUNT, 0 },
56 // Transient Detection registers.
57 { MMA865x_TRANSIENT_CFG, 0 }, // Feature disabled by default (for now).
58 // Pulse Detection registers.
59 { MMA865x_PULSE_CFG, 0 }, // Feature is disabled by default (for now).
60 // Auto-WAKE/SLEEP Detection registers.
61 { MMA865x_ASLP_COUNT, 0 },
62 // System and Control registers.
63 { MMA865x_CTRL_REG1, (MMA865x_SET_FIELD(ASLP_RATE,0)) | (MMA865x_SET_FIELD(DR,0)) | (MMA865x_SET_FIELD(FREAD,0)) },
64 { MMA865x_CTRL_REG2, (MMA865x_SET_FIELD(ST,0)) | (MMA865x_SET_FIELD(RST,0)) | (MMA865x_SET_FIELD(SMODS,0)) | (MMA865x_SET_FIELD(SLPE,0)) | (MMA865x_SET_FIELD(MODS,0)) },
65 { MMA865x_CTRL_REG3, 0 }, // Interrupt sources disabled, Active Low, Push-Pull Open Drain (defaults).
66 { MMA865x_CTRL_REG4, 0 }, // Interrupts disabled (defaults).
67 { MMA865x_CTRL_REG5, 0 }, // INT2 Pin (defaults).
68 // Calibration Offset registers.
69 { MMA865x_OFF_X, 0 },
70 { MMA865x_OFF_Y, 0 },
71 { MMA865x_OFF_Z, 0 }
72 }
73 };
74
75 /*!
76 * @brief This creates the sensor adapter instance for the target sensor.
77 *
78 */
79 const isf_dsa_Adapter_t MMA865x_1_Adapter =
80 {
81 .devInfo.pSupportedSensorTypes = mma865x_SupportedSensorTypes,
82 .devInfo.pSupportedSensorDataTypes = mma865x_SupportedDataTypes,
83 .devInfo.nNativeDataSetSize = sizeof(mma865x_DataBuffer_t),
84 .control.Initialize = &fsl_mma865x_i2c_3D_accel_Initialize,
85 .control.ValidateSettings = &fsl_mma865x_i2c_3D_accel_ValidateSettings,
86 .control.Configure = &fsl_mma865x_i2c_3D_accel_Configure,
87 .control.StartData = &fsl_mma865x_i2c_3D_accel_StartData,
88 .control.EndData = &fsl_mma865x_i2c_3D_accel_EndData,
89 .control.Calibrate = &fsl_mma865x_i2c_3D_accel_Calibrate,
90 .control.Shutdown = &fsl_mma865x_i2c_3D_accel_Shutdown,
91 .control.Convert = &fsl_mma865x_i2c_3D_accel_Convert
92 };
93
94 const i2c_device_t MMA865x_1_DeviceInfo =
95 {
96 .addrType = 0, // 7-bit addresses for now.
97 .baudRate_kbps = 400, // default baud rate (kbps).
98 .address = 29 // instance specific device address.
99 };
100
101
102 /* END MMA865x_1. */
103
104 /*!
105 ** @}
106 */
107 /*
108 ** ###################################################################
109 **
110 ** This file was created by Processor Expert 10.3 [05.09]
111 ** for the Freescale Kinetis series of microcontrollers.
112 **
113 ** ###################################################################
114 */
MMA865x_TRANSIENT_CFG
Definition: mma865x.h:50
fsl_mma865x_i2c_3D_accel_Initialize
isf_dsa_status_t fsl_mma865x_i2c_3D_accel_Initialize(isf_SensorHandle_t *pSensorHandle)
Definition: fsl_mma865x_i2c_3D_accel.c:100
mma865x_DataBuffer_t
This structure defines the dummy DSA data buffer format.
Definition: fsl_mma865x_i2c_3D_accel.h:61
fsl_mma865x_i2c_3D_accel_EndData
isf_dsa_status_t fsl_mma865x_i2c_3D_accel_EndData(isf_SensorHandle_t *pSensorHandle)
Definition: fsl_mma865x_i2c_3D_accel.c:369
mma865x_Sensor_Specific_Settings_t::accelFullScaleRange
uint8 accelFullScaleRange
Definition: mma865x.h:518
MMA865x_OFF_X
Definition: mma865x.h:68
MMA865x_CTRL_REG1
Definition: mma865x.h:63
MMA865x_FF_MT_THS
Definition: mma865x.h:44
fsl_mma865x_i2c_3D_accel_Calibrate
isf_dsa_status_t fsl_mma865x_i2c_3D_accel_Calibrate(isf_SensorHandle_t *pSensorHandle, void *pCalData)
Definition: fsl_mma865x_i2c_3D_accel.c:433
MMA865x_PL_COUNT
Definition: mma865x.h:39
MMA865x_1_Adapter
const isf_dsa_Adapter_t MMA865x_1_Adapter
This creates the sensor adapter instance for the target sensor.
Definition: MMA865x_1.c:79
I2CDeviceInfo
Information necessary to communicate with an I2C slave device.
Definition: fsl_i2c_master_driver.h:30
mma865x.h
The mma865x.h contains the MMA865x Accelerometer register definitions, access macros, and device access functions.
fsl_mma865x_i2c_3D_accel_StartData
isf_dsa_status_t fsl_mma865x_i2c_3D_accel_StartData(isf_SensorHandle_t *pSensorHandle)
Definition: fsl_mma865x_i2c_3D_accel.c:309
MMA865x_ASLP_COUNT
Definition: mma865x.h:62
MMA865x_PULSE_CFG
Definition: mma865x.h:54
MMA865x_OFF_Z
Definition: mma865x.h:70
MMA865x_HP_FILTER_CUTOFF
Definition: mma865x.h:36
mma865x_SupportedDataTypes
isf_SensorDataTypes_t mma865x_SupportedDataTypes[]
Definition: fsl_mma865x_i2c_3D_accel.c:67
MMA865x_SET_FIELD
#define MMA865x_SET_FIELD(name, val)
Definition: mma865x.h:81
MMA865x_CTRL_REG3
Definition: mma865x.h:65
mma865x_Sensor_Specific_Settings_t
Definition: mma865x.h:516
isf_dsa_Adapter_st::devInfo
isf_dsa_DeviceInfoBlock_t devInfo
Definition: isf_dsa_adapter.h:146
mma865x_SupportedSensorTypes
isf_SensorTypes_t mma865x_SupportedSensorTypes[]
Supported sensor and data types for MMA865x.
Definition: fsl_mma865x_i2c_3D_accel.c:66
MMA865x_PL_CFG
Definition: mma865x.h:38
MMA865x_FF_MT_CFG
Definition: mma865x.h:42
fsl_mma865x_i2c_3D_accel_Convert
isf_dsa_status_t fsl_mma865x_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)
This function coverts the raw sample data to the desired output type.
Definition: fsl_mma865x_i2c_3D_accel.c:576
MMA865x_PL_BF_ZCOMP
Definition: mma865x.h:40
fsl_mma865x_i2c_3D_accel_Shutdown
isf_dsa_status_t fsl_mma865x_i2c_3D_accel_Shutdown(isf_SensorHandle_t *pSensorHandle)
Definition: fsl_mma865x_i2c_3D_accel.c:453
MMA865x_FF_MT_COUNT
Definition: mma865x.h:45
isf_dsa_Adapter_st
This defines the DSA adapter structure required for static initialization of the concrete instance of...
Definition: isf_dsa_adapter.h:144
isf_dsa_DeviceInfoBlock_st::pSupportedSensorTypes
isf_SensorTypes_t * pSupportedSensorTypes
Definition: isf_dsa_adapter.h:72
MMA865x_1.h
I2CDeviceInfo::addrType
LDD_I2C_TAddrType addrType
Definition: fsl_i2c_master_driver.h:34
MMA865x_CTRL_REG2
Definition: mma865x.h:64
MMA865x_1_DeviceInfo
const i2c_device_t MMA865x_1_DeviceInfo
This allows access to the sensor communications specific configuration.
Definition: MMA865x_1.c:94
fsl_mma865x_i2c_3D_accel_Configure
isf_dsa_status_t fsl_mma865x_i2c_3D_accel_Configure(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
Definition: fsl_mma865x_i2c_3D_accel.c:220
fsl_mma865x_i2c_3D_accel_ValidateSettings
isf_dsa_status_t fsl_mma865x_i2c_3D_accel_ValidateSettings(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
Definition: fsl_mma865x_i2c_3D_accel.c:191
MMA865x_PL_P_L_THS
Definition: mma865x.h:41
MMA865x_OFF_Y
Definition: mma865x.h:69
MMA865x_1_Sensor_Specific_Config
mma865x_Sensor_Specific_Settings_t MMA865x_1_Sensor_Specific_Config
This allows access to the sensor specific configuration for the target sensor.
Definition: MMA865x_1.c:38
MMA865x_CTRL_REG5
Definition: mma865x.h:67
MMA865x_CTRL_REG4
Definition: mma865x.h:66
MMA865x_XYZ_DATA_CFG
Definition: mma865x.h:35
- © Freescale Semiconductor, Inc. 2015. All Rights Reserved.