ISF  2.2 rev 5
Intelligent Sensing Framework for Kinetis with Processor Expert
FXAS21002_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 : FXAS21002_1.c
4 ** CDE edition : Standard
5 ** Project : ISF2P2_K64F_MQX_PROJ
6 ** Processor : MK64FN1M0VLL12
7 ** Component : ISF_KSDK_Sensor_FXAS21002_Gyrometer
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 : FXAS21002_1
16 ** Device Address : 0x20
17 ** Comm Channel : I2C1
18 ** Allowed Full-scale Ranges : ±250 dps (FXAS21002)
19 ** Sensor Specific Configuration : yes
20 ** CTRL_REG0 : yes
21 ** BW : 0
22 ** SPIW : 0
23 ** SEL : 0
24 ** HPF_EN : 0
25 ** FS : 3
26 ** CTRL_REG1 : yes
27 ** DR : 0
28 ** CTRL_REG3 : yes
29 ** WRAPTOONE : 0
30 ** EXTCTRLEN : 0
31 ** FS_DOUBLE : 0
32 ** Contents :
33 ** No public methods
34 **
35 ** (c) Copyright <company/user-name>, 2015,
36 http://www.<company>.com
37 mail: info@<company>.com
38 ** ###################################################################*/
39 /*!
40 ** @file FXAS21002_1.c
41 ** @version 01.00
42 ** @brief
43 **
44 */
45 /*!
46 ** @addtogroup FXAS21002_1_module FXAS21002_1 module documentation
47 ** @{
48 */
49 
50 /* MODULE FXAS21002_1. */
51 
52 #include "FXAS21002_1.h"
53 #include "isf_target.h"
54 #include "isf.h"
55 #include "isf_util.h"
56 
57 
59 {
60  .gyroFullScaleRange = 3, // Capture the accelerometer full-scale range for use in conversion routines.
61  .fsdouble = 0,
62  .regCount = 4, // Number of register pairs to follow
63  .regPairs =
64  {
65  // System and Control registers.
68  { FXAS21002_CTRL_REG2, 0 }, // Interrupt sources disabled, Active Low, Push-Pull Open Drain (defaults).
69  { FXAS21002_CTRL_REG3, (FXAS21002_SET_FIELD(WRAPTOONE,0)) | (FXAS21002_SET_FIELD(EXTCTRLEN,0)) | (FXAS21002_SET_FIELD(FSDOUBLE,0)) },
70  }
71  };
72 
73 /*!
74  * @brief This creates the sensor adapter instance for the target sensor.
75  *
76  */
78 {
80  .devInfo.pSupportedSensorDataTypes = fxas21002_SupportedDataTypes,
81  .devInfo.nNativeDataSetSize = sizeof(fxas21002_DataBuffer_t),
82  .control.Initialize = &fsl_fxas21002_i2cspi_3D_gyro_Initialize,
83  .control.ValidateSettings = &fsl_fxas21002_i2cspi_3D_gyro_ValidateSettings,
84  .control.Configure = &fsl_fxas21002_i2cspi_3D_gyro_Configure,
85  .control.StartData = &fsl_fxas21002_i2cspi_3D_gyro_StartData,
86  .control.EndData = &fsl_fxas21002_i2cspi_3D_gyro_EndData,
87  .control.Calibrate = &fsl_fxas21002_i2cspi_3D_gyro_Calibrate,
88  .control.Shutdown = &fsl_fxas21002_i2cspi_3D_gyro_Shutdown,
89  .control.Convert = &fsl_fxas21002_i2cspi_3D_gyro_Convert
90 };
91 
92 const i2c_device_t FXAS21002_1_DeviceInfo =
93 {
94  .baudRate_kbps = 400, // default baud rate (kbps).
95  .address = 32 // instance specific device address.
96 };
97 
98 
99 
100 /* END FXAS21002_1. */
101 
102 /*!
103 ** @}
104 */
105 /*
106 ** ###################################################################
107 **
108 ** This file was created by Processor Expert 10.5 [05.21]
109 ** for the Freescale Kinetis series of microcontrollers.
110 **
111 ** ###################################################################
112 */
ISF board support header files.
isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_Calibrate(isf_SensorHandle_t *pSensorHandle, void *pCalData)
This is the concrete implementation of the FXAS21002 sensor adapter for calibration ...
const i2c_device_t FXAS21002_1_DeviceInfo
This allows access to the sensor communications specific configuration.
Definition: FXAS21002_1.c:92
isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_EndData(isf_SensorHandle_t *pSensorHandle)
This is the concrete implementation of the FXAS21002 sensor adapter for End Data. ...
isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_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.
This structure defines the dummy DSA data buffer format.
isf_SensorTypes_t fxas21002_SupportedSensorTypes[]
Supported sensor and data types for FXAS21002.
isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_Configure(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
This is the concrete implementation of the FXAS21002 sensor adapter for configuration.
isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_StartData(isf_SensorHandle_t *pSensorHandle)
This is the concrete implementation of the FXAS21002 sensor adapter for start Data.
isf_dsa_DeviceInfoBlock_t devInfo
The isf_util.h file contains the utility method declarations and macros.
#define FXAS21002_SET_FIELD(name, val)
Definition: fxas21002.h:66
This defines the DSA adapter structure required for static initialization of the concrete instance of...
const isf_dsa_Adapter_t FXAS21002_1_Adapter
This creates the sensor adapter instance for the target sensor.
Definition: FXAS21002_1.c:77
isf_SensorTypes_t * pSupportedSensorTypes
isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_ValidateSettings(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
This is the concrete implementation of the FXAS21002 sensor adapter for validating current settings...
Main ISF header file. Contains code common to all ISF components.
isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_Shutdown(isf_SensorHandle_t *pSensorHandle)
This is the concrete implementation of the FXAS21002 sensor adapter for shutdown .
isf_SensorDataTypes_t fxas21002_SupportedDataTypes[]
isf_dsa_status_t fsl_fxas21002_i2cspi_3D_gyro_Initialize(isf_SensorHandle_t *pSensorHandle)
This is the concrete implementation of the FXAS21002 sensor adapter initialization.
fxas21002_Sensor_Specific_Settings_t FXAS21002_1_Sensor_Specific_Config
This allows access to the sensor specific configuration for the target sensor.
Definition: FXAS21002_1.c:58