Ironcup Mar 2020
Dependencies: mbed mbed-rtos MotionSensor EthernetInterface
SensorsLibrary/FXAS21002.h@0:88faaa1afb83, 2016-04-11 (annotated)
- Committer:
- drelliak
- Date:
- Mon Apr 11 05:20:40 2016 +0000
- Revision:
- 0:88faaa1afb83
- Child:
- 9:bd0fb9d17803
Trekking Controller
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
drelliak | 0:88faaa1afb83 | 1 | /* Copyright (c) 2015 NXP Semiconductors. MIT License |
drelliak | 0:88faaa1afb83 | 2 | * |
drelliak | 0:88faaa1afb83 | 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software |
drelliak | 0:88faaa1afb83 | 4 | * and associated documentation files (the "Software"), to deal in the Software without |
drelliak | 0:88faaa1afb83 | 5 | * restriction, including without limitation the rights to use, copy, modify, merge, publish, |
drelliak | 0:88faaa1afb83 | 6 | * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the |
drelliak | 0:88faaa1afb83 | 7 | * Software is furnished to do so, subject to the following conditions: |
drelliak | 0:88faaa1afb83 | 8 | * |
drelliak | 0:88faaa1afb83 | 9 | * The above copyright notice and this permission notice shall be included in all copies or |
drelliak | 0:88faaa1afb83 | 10 | * substantial portions of the Software. |
drelliak | 0:88faaa1afb83 | 11 | * |
drelliak | 0:88faaa1afb83 | 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING |
drelliak | 0:88faaa1afb83 | 13 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
drelliak | 0:88faaa1afb83 | 14 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
drelliak | 0:88faaa1afb83 | 15 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
drelliak | 0:88faaa1afb83 | 16 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
drelliak | 0:88faaa1afb83 | 17 | */ |
drelliak | 0:88faaa1afb83 | 18 | |
drelliak | 0:88faaa1afb83 | 19 | #ifndef FXAS21002_H |
drelliak | 0:88faaa1afb83 | 20 | #define FXAS21002_H |
drelliak | 0:88faaa1afb83 | 21 | #include "mbed.h" |
drelliak | 0:88faaa1afb83 | 22 | |
drelliak | 0:88faaa1afb83 | 23 | #define FXAS21002_I2C_ADDRESS 0x40 |
drelliak | 0:88faaa1afb83 | 24 | |
drelliak | 0:88faaa1afb83 | 25 | #define FXAS21002_STATUS 0x00 |
drelliak | 0:88faaa1afb83 | 26 | #define FXAS21002_WHO_AM_I 0x0C |
drelliak | 0:88faaa1afb83 | 27 | #define FXAS21002_CTRL_REG0 0x0D |
drelliak | 0:88faaa1afb83 | 28 | #define FXAS21002_CTRL_REG1 0x13 |
drelliak | 0:88faaa1afb83 | 29 | #define FXAS21002_WHO_AM_I_VALUE 0xD1 |
drelliak | 0:88faaa1afb83 | 30 | |
drelliak | 0:88faaa1afb83 | 31 | class FXAS21002 |
drelliak | 0:88faaa1afb83 | 32 | { |
drelliak | 0:88faaa1afb83 | 33 | public: |
drelliak | 0:88faaa1afb83 | 34 | |
drelliak | 0:88faaa1afb83 | 35 | FXAS21002(PinName sda, PinName scl); |
drelliak | 0:88faaa1afb83 | 36 | |
drelliak | 0:88faaa1afb83 | 37 | void gyro_config(void); |
drelliak | 0:88faaa1afb83 | 38 | |
drelliak | 0:88faaa1afb83 | 39 | void acquire_gyro_data_dps(float * du); |
drelliak | 0:88faaa1afb83 | 40 | |
drelliak | 0:88faaa1afb83 | 41 | private: |
drelliak | 0:88faaa1afb83 | 42 | I2C gyroi2c; |
drelliak | 0:88faaa1afb83 | 43 | |
drelliak | 0:88faaa1afb83 | 44 | }; |
drelliak | 0:88faaa1afb83 | 45 | |
drelliak | 0:88faaa1afb83 | 46 | #endif |