ISSDK  1.7
IoT Sensing Software Development Kit
drivers.h
Go to the documentation of this file.
1 /*
2  * The Clear BSD License
3  * Copyright (c) 2015 - 2016, Freescale Semiconductor, Inc.
4  * Copyright 2016-2017 NXP
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without modification,
8  * are permitted (subject to the limitations in the disclaimer below) provided
9  * that the following conditions are met:
10  *
11  * o Redistributions of source code must retain the above copyright notice, this list
12  * of conditions and the following disclaimer.
13  *
14  * o Redistributions in binary form must reproduce the above copyright notice, this
15  * list of conditions and the following disclaimer in the documentation and/or
16  * other materials provided with the distribution.
17  *
18  * o Neither the name of the copyright holder nor the names of its
19  * contributors may be used to endorse or promote products derived from this
20  * software without specific prior written permission.
21  *
22  * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE.
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
24  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
27  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
30  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33  */
34 
35 /*! \file drivers.h
36  \brief Provides function prototypes for driver level interfaces
37 
38  Users who are not using NXP hardware will need to supply their own drivers
39  in place of those defined here.
40 */
41 
42 #ifndef DRIVERS_H
43 #define DRIVERS_H
44 #include "Driver_I2C.h"
45 #include "Driver_SPI.h"
46 
47 // must #include "sensor_fusion.h" before this file
48 
49 /// @name SysTick Macros
50 /// The ARM SysTick counter is used to time various fusion options. Timings
51 /// are then conveyed to the NXP Sensor Fusion Toolbox, where they are displayed
52 /// for the developer. These functions should be portable to any ARM M0+, M3,
53 /// M4 or M4F device. If you are using a different CPU architecture, you will
54 /// need to provide an equivalent set of macros, remove the macro calls from
55 /// the fusion routines, or define a set of empty macros.
56 ///@{
57 void ARM_systick_enable(void);
58 void ARM_systick_start_ticks(int32_t *pstart);
60 void ARM_systick_delay_ms(uint32_t iSystemCoreClock, uint32_t delay_ms);
61 ///@}
62 
63 /// @name Sensor Drivers
64 /// Each physical sensor must be provided with one initialization function
65 /// and one "read" function. These must be installed by the user using the
66 /// installSensor method defined in SensorFusionGlobals. By "physical sensor",
67 /// we mean either individual sensor type (such as a 3-axis accelerometer) or
68 /// a combo-sensor such as the NXP FXOS8700 6-axis accel plus mag. The init()
69 /// function for each sensor is responsible for initializing all sensors contained
70 /// in that package. The read() function is responsible for reading those same
71 /// sensors and moving the results into the standard structures contained within
72 /// the SensorFusionGlobals object.
73 ///@{
74 int8_t MPL3115_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg);
75 int8_t FXOS8700_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg);
76 int8_t FXAS21002_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg);
77 int8_t MMA8652_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg);
78 int8_t FXLS8952_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg);
79 int8_t MAG3110_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg);
80 int8_t MMA8451_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg);
81 int8_t FXLS8471Q_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg);
82 int8_t FXLS8962_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg);
83 int8_t FXLS8972_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg);
84 
85 int8_t MPL3115_Read(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg);
86 int8_t FXOS8700_Read(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg);
87 int8_t FXAS21002_Read(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg);
88 int8_t MMA8652_Read(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg);
89 int8_t FXLS8952_Read(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg);
90 int8_t MAG3110_Read(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg);
91 int8_t MMA8451_Read(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg);
92 int8_t FXLS8471Q_Read(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg);
93 int8_t FXLS8962_Read(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg);
94 int8_t FXLS8972_Read(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg);
95 
96 int8_t MPL3115_Idle(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg);
97 int8_t FXOS8700_Idle(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg);
98 int8_t FXAS21002_Idle(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg);
99 int8_t MMA8652_Idle(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg);
100 int8_t FXLS8952_Idle(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg);
101 int8_t MAG3110_Idle(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg);
102 int8_t MMA8451_Idle(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg);
103 int8_t FXLS8471Q_Idle(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg);
104 int8_t FXLS8962_Idle(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg);
105 int8_t FXLS8972_Idle(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg);
106 
107 ///@}
108 
109 
110 #endif // DRIVERS_H
int8_t FXOS8700_Read(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t FXAS21002_Read(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t FXLS8471Q_Read(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t FXLS8952_Read(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t FXOS8700_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
SensorFusionGlobals sfg
int8_t MAG3110_Read(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
void ARM_systick_enable(void)
int8_t MPL3115_Read(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int32_t ARM_systick_elapsed_ticks(int32_t start_ticks)
int8_t FXAS21002_Idle(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t FXLS8972_Idle(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
The top level fusion structure.
int8_t MMA8652_Read(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
void ARM_systick_delay_ms(uint32_t iSystemCoreClock, uint32_t delay_ms)
int8_t FXLS8471Q_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t FXAS21002_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t FXOS8700_Idle(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t MPL3115_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t MMA8451_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t FXLS8972_Read(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t MMA8451_Read(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t FXLS8962_Idle(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t FXLS8972_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t MMA8652_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t MAG3110_Idle(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t MMA8451_Idle(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
typedef int32_t(DATA_FORMAT_Append_t))(void *pData
The interface function to append the data on the formated stream.
int8_t MPL3115_Idle(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
void ARM_systick_start_ticks(int32_t *pstart)
int8_t FXLS8962_Read(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t FXLS8962_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t FXLS8471Q_Idle(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
An instance of PhysicalSensor structure type should be allocated for each physical sensors (combo dev...
int8_t FXLS8952_Idle(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t MMA8652_Idle(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t FXLS8952_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t MAG3110_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)