ISF  2.2 rev 5
Intelligent Sensing Framework for Kinetis with Processor Expert
MPL3115_1.c
Go to the documentation of this file.
1 /* ###################################################################
2 ** This component module is generated by Processor Expert. Do not modify it.
3 ** Filename : MPL3115_1.c
4 ** CDE edition : Community
5 ** Project : ISF2P2_K64F_MQX_PROJ
6 ** Processor : MK64FN1M0VLL12
7 ** Component : ISF_KSDK_Sensor_MPL3115_Pressure
8 ** Version : Component 02.500, Driver 01.00, CPU db: 3.00.000
9 ** Repository : My Components
10 ** Compiler : GNU C Compiler
11 ** Date/Time : 2016-10-06, 13:38, # CodeGen: 0
12 ** Abstract :
13 **
14 ** Settings :
15 ** Component Name : MPL3115_1
16 ** Sensor Specific Configuration : yes
17 ** BAR_IN : 50663
18 ** CTRL_REG1 : yes
19 ** OS : 0
20 ** OFF_P : 0
21 ** OFF_T : 0
22 ** Device Address : 0x60
23 ** Comm Channel : I2C1
24 ** Contents :
25 ** No public methods
26 **
27 ** For non-commercial use only.
28 (c) Copyright <company/user-name>, 2015,
29 http://www.<company>.com
30 mail: info@<company>.com
31 ** ###################################################################*/
32 /*!
33 ** @file MPL3115_1.c
34 ** @version 01.00
35 ** @brief
36 **
37 */
38 /*!
39 ** @addtogroup MPL3115_1_module MPL3115_1 module documentation
40 ** @{
41 */
42 
43 /* MODULE MPL3115_1. */
44 
45 #include "MPL3115_1.h"
46 #include "mpl3115.h"
47 
49 {
50  .regCount = 28, // Number of register pairs to follow
51  .regPairs =
52  {
53  // Data configuration registers.
54  { MPL3115_F_SETUP, 0 },
55  { MPL3115_PT_DATA_CFG, (MPL3115_SET_FIELD(DREM,1)) | (MPL3115_SET_FIELD(PDEFE,1)) | (MPL3115_SET_FIELD(TDEFE,1)) },
56  { MPL3115_BAR_IN_MSB, 197 },
57  { MPL3115_BAR_IN_LSB, 231 },
58  { MPL3115_P_ARM_MSB, 0 },
59  { MPL3115_P_ARM_LSB, 0 },
60  { MPL3115_T_ARM, 0 },
61  { MPL3115_P_ARM_WND_MSB, 0 },
62  { MPL3115_P_ARM_WND_LSB, 0 },
63  { MPL3115_T_ARM_WND, 0 },
64  { MPL3115_P_MIN_MSB, 0 },
65  { MPL3115_P_MIN_CSB, 0 },
66  { MPL3115_P_MIN_LSB, 0 },
67  { MPL3115_P_MAX_MSB, 0 },
68  { MPL3115_P_MAX_CSB, 0 },
69  { MPL3115_P_MAX_LSB, 0 },
70  { MPL3115_T_MIN_MSB, 0 },
71  { MPL3115_T_MIN_LSB, 0 },
72  { MPL3115_T_MAX_MSB, 0 },
73  { MPL3115_T_MAX_LSB, 0 },
75  { MPL3115_CTRL_REG2, 0 },
76  { MPL3115_CTRL_REG3, 0 },
77  { MPL3115_CTRL_REG4, 0 },
78  { MPL3115_CTRL_REG5, 0 },
79  { MPL3115_OFF_P, 0 },
80  { MPL3115_OFF_T, 0 },
81  { MPL3115_OFF_H, 0 }
82  }
83  };
84 
85 /*!
86  * @brief This creates the sensor adapter instance for the target sensor.
87  *
88  */
90 {
92  .devInfo.pSupportedSensorDataTypes = mpl3115_SupportedDataTypes,
93  .devInfo.nNativeDataSetSize = sizeof(mpl3115_DataBuffer_t),
94  .control.Initialize = &fsl_mpl3115_i2c_1D_press_Initialize,
95  .control.ValidateSettings = &fsl_mpl3115_i2c_1D_press_ValidateSettings,
96  .control.Configure = &fsl_mpl3115_i2c_1D_press_Configure,
97  .control.StartData = &fsl_mpl3115_i2c_1D_press_StartData,
98  .control.EndData = &fsl_mpl3115_i2c_1D_press_EndData,
99  .control.Calibrate = &fsl_mpl3115_i2c_1D_press_Calibrate,
100  .control.Shutdown = &fsl_mpl3115_i2c_1D_press_Shutdown,
101  .control.Convert = &fsl_mpl3115_i2c_1D_press_Convert
102 };
103 
104 const i2c_device_t MPL3115_1_DeviceInfo =
105 {
106  .baudRate_kbps = 400, // default baud rate (kbps).
107  .address = 96 // instance specific device address.
108 };
109 
110 
111 /* END MPL3115_1. */
112 
113 /*!
114 ** @}
115 */
116 /*
117 ** ###################################################################
118 **
119 ** This file was created by Processor Expert 10.5 [05.21]
120 ** for the Freescale Kinetis series of microcontrollers.
121 **
122 ** ###################################################################
123 */
isf_dsa_status_t fsl_mpl3115_i2c_1D_press_Shutdown(isf_SensorHandle_t *pSensorHandle)
isf_dsa_status_t fsl_mpl3115_i2c_1D_press_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.
isf_SensorDataTypes_t mpl3115_SupportedDataTypes[]
isf_dsa_status_t fsl_mpl3115_i2c_1D_press_Configure(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
isf_dsa_status_t fsl_mpl3115_i2c_1D_press_Calibrate(isf_SensorHandle_t *pSensorHandle, void *pCalData)
isf_dsa_DeviceInfoBlock_t devInfo
This structure defines the dummy DSA data buffer format.
isf_dsa_status_t fsl_mpl3115_i2c_1D_press_ValidateSettings(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
This defines the DSA adapter structure required for static initialization of the concrete instance of...
The mpl3115.h contains the MPL3115 Pressure sensor register definitions, access macros, and device access functions.
isf_SensorTypes_t * pSupportedSensorTypes
const isf_dsa_Adapter_t MPL3115_1_Adapter
This creates the sensor adapter instance for the target sensor.
Definition: MPL3115_1.c:89
#define MPL3115_SET_FIELD(name, val)
Definition: mpl3115.h:81
isf_dsa_status_t fsl_mpl3115_i2c_1D_press_StartData(isf_SensorHandle_t *pSensorHandle)
const i2c_device_t MPL3115_1_DeviceInfo
This allows access to the sensor communications specific configuration.
Definition: MPL3115_1.c:104
isf_SensorTypes_t mpl3115_SupportedSensorTypes[]
Supported sensor and data types for MPL3115.
mpl3115_Sensor_Specific_Settings_t MPL3115_1_Sensor_Specific_Config
This allows access to the sensor specific configuration for the target sensor.
Definition: MPL3115_1.c:48
isf_dsa_status_t fsl_mpl3115_i2c_1D_press_Initialize(isf_SensorHandle_t *pSensorHandle)
isf_dsa_status_t fsl_mpl3115_i2c_1D_press_EndData(isf_SensorHandle_t *pSensorHandle)