ISF  2.2 rev 5
Intelligent Sensing Framework for Kinetis with Processor Expert
MAG3110_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 : MAG3110_1.c
4 ** CDE edition : Community
5 ** Project : ISF2P2_K64F_MQX_PROJ
6 ** Processor : MK64FN1M0VLL12
7 ** Component : ISF_KSDK_Sensor_MAG3110_Magnetometer
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 : MAG3110_1
16 ** Sensor Specific Configuration : yes
17 ** OFF_X : 0
18 ** OFF_Y : 0
19 ** OFF_Z : 0
20 ** CTRL_REG1 : yes
21 ** OS : 0
22 ** CTRL_REG2 : yes
23 ** AUTO_MRST_EN - Automatic magnetic sensor reset.: 1
24 ** RAW - Data output correction : 0
25 ** Device Address : 0xE
26 ** Comm Channel : I2C1
27 ** Contents :
28 ** No public methods
29 **
30 ** For non-commercial use only.
31 (c) Copyright <company/user-name>, 2015,
32 http://www.<company>.com
33 mail: info@<company>.com
34 ** ###################################################################*/
35 /*!
36 ** @file MAG3110_1.c
37 ** @version 01.00
38 ** @brief
39 **
40 */
41 /*!
42 ** @addtogroup MAG3110_1_module MAG3110_1 module documentation
43 ** @{
44 */
45 
46 /* MODULE MAG3110_1. */
47 
48 #include "MAG3110_1.h"
49 #include "mag3110.h"
50 
52 {
53  .regCount = 8, // Number of register pairs to follow
54  .overSamplingRatio = 0,
55  .regPairs =
56  {
57  { MAG3110_OFF_X_MSB, 0 },
58  { MAG3110_OFF_X_LSB, 0 },
59  { MAG3110_OFF_Y_MSB, 0 },
60  { MAG3110_OFF_Y_LSB, 0 },
61  { MAG3110_OFF_Z_MSB, 0 },
62  { MAG3110_OFF_Z_LSB, 0 },
63  { MAG3110_CTRL_REG1, 0, },
64  { MAG3110_CTRL_REG2, (MAG3110_SET_FIELD(AUTO_MRST_EN,1)) | (MAG3110_SET_FIELD(RAW,0)) | MAG3110_SET_FIELD(MAG_RST,0) }
65  }
66  };
67 
68 /*!
69  * @brief This creates the sensor adapter instance for the target sensor.
70  *
71  */
73 {
75  .devInfo.pSupportedSensorDataTypes = mag3110_SupportedDataTypes,
76  .devInfo.nNativeDataSetSize = sizeof(mag3110_DataBuffer_t),
77  .control.Initialize = &fsl_mag3110_i2c_3D_mag_Initialize,
78  .control.ValidateSettings = &fsl_mag3110_i2c_3D_mag_ValidateSettings,
79  .control.Configure = &fsl_mag3110_i2c_3D_mag_Configure,
80  .control.StartData = &fsl_mag3110_i2c_3D_mag_StartData,
81  .control.EndData = &fsl_mag3110_i2c_3D_mag_EndData,
82  .control.Calibrate = &fsl_mag3110_i2c_3D_mag_Calibrate,
83  .control.Shutdown = &fsl_mag3110_i2c_3D_mag_Shutdown,
84  .control.Convert = &fsl_mag3110_i2c_3D_mag_Convert
85 };
86 
87 const i2c_device_t MAG3110_1_DeviceInfo =
88 {
89  .baudRate_kbps = 400, // default baud rate (kbps).
90  .address = 14 // instance specific device address.
91 };
92 
93 /* END MAG3110_1. */
94 
95 /*!
96 ** @}
97 */
98 /*
99 ** ###################################################################
100 **
101 ** This file was created by Processor Expert 10.5 [05.21]
102 ** for the Freescale Kinetis series of microcontrollers.
103 **
104 ** ###################################################################
105 */
const i2c_device_t MAG3110_1_DeviceInfo
This allows access to the sensor communications specific configuration.
Definition: MAG3110_1.c:87
This structure defines the dummy DSA data buffer format.
isf_dsa_status_t fsl_mag3110_i2c_3D_mag_Calibrate(isf_SensorHandle_t *pSensorHandle, void *pCalData)
isf_dsa_status_t fsl_mag3110_i2c_3D_mag_Shutdown(isf_SensorHandle_t *pSensorHandle)
isf_dsa_status_t fsl_mag3110_i2c_3D_mag_EndData(isf_SensorHandle_t *pSensorHandle)
isf_dsa_status_t fsl_mag3110_i2c_3D_mag_Initialize(isf_SensorHandle_t *pSensorHandle)
isf_dsa_status_t fsl_mag3110_i2c_3D_mag_ValidateSettings(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSubSettings)
isf_dsa_status_t fsl_mag3110_i2c_3D_mag_Configure(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
isf_SensorDataTypes_t mag3110_SupportedDataTypes[]
The mag3110.h contains the MAG3110 Magnetometer register definitions, access macros, and device access functions.
isf_dsa_DeviceInfoBlock_t devInfo
isf_SensorTypes_t mag3110_SupportedSensorTypes[]
Supported sensor and data types for MMA8652.
This defines the DSA adapter structure required for static initialization of the concrete instance of...
isf_SensorTypes_t * pSupportedSensorTypes
#define MAG3110_SET_FIELD(name, val)
Definition: mag3110.h:52
isf_dsa_status_t fsl_mag3110_i2c_3D_mag_StartData(isf_SensorHandle_t *pSensorHandle)
mag3110_Sensor_Specific_Settings_t MAG3110_1_Sensor_Specific_Config
This allows access to the sensor specific configuration for the target sensor.
Definition: MAG3110_1.c:51
const isf_dsa_Adapter_t MAG3110_1_Adapter
This creates the sensor adapter instance for the target sensor.
Definition: MAG3110_1.c:72
isf_dsa_status_t fsl_mag3110_i2c_3D_mag_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.