Accel
Fork of FXOS8700 by
FXOS8700.h@4:b7334257ebe8, 2017-04-10 (annotated)
- Committer:
- tdh50
- Date:
- Mon Apr 10 22:31:14 2017 +0000
- Revision:
- 4:b7334257ebe8
- Parent:
- 2:98ea52282575
- Child:
- 5:cbe52f68f6a0
Deleted unneeded mag code
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AswinSivakumar | 2:98ea52282575 | 1 | /* Copyright (c) 2015 NXP Semiconductors. MIT License |
AswinSivakumar | 0:a4ffc3c3e770 | 2 | * |
AswinSivakumar | 0:a4ffc3c3e770 | 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software |
AswinSivakumar | 0:a4ffc3c3e770 | 4 | * and associated documentation files (the "Software"), to deal in the Software without |
AswinSivakumar | 0:a4ffc3c3e770 | 5 | * restriction, including without limitation the rights to use, copy, modify, merge, publish, |
AswinSivakumar | 0:a4ffc3c3e770 | 6 | * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the |
AswinSivakumar | 0:a4ffc3c3e770 | 7 | * Software is furnished to do so, subject to the following conditions: |
AswinSivakumar | 0:a4ffc3c3e770 | 8 | * |
AswinSivakumar | 0:a4ffc3c3e770 | 9 | * The above copyright notice and this permission notice shall be included in all copies or |
AswinSivakumar | 0:a4ffc3c3e770 | 10 | * substantial portions of the Software. |
AswinSivakumar | 0:a4ffc3c3e770 | 11 | * |
AswinSivakumar | 0:a4ffc3c3e770 | 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING |
AswinSivakumar | 0:a4ffc3c3e770 | 13 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
AswinSivakumar | 0:a4ffc3c3e770 | 14 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
AswinSivakumar | 0:a4ffc3c3e770 | 15 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
AswinSivakumar | 0:a4ffc3c3e770 | 16 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
AswinSivakumar | 0:a4ffc3c3e770 | 17 | */ |
AswinSivakumar | 0:a4ffc3c3e770 | 18 | |
AswinSivakumar | 0:a4ffc3c3e770 | 19 | #ifndef FXOS8700_H |
AswinSivakumar | 0:a4ffc3c3e770 | 20 | #define FXOS8700_H |
AswinSivakumar | 0:a4ffc3c3e770 | 21 | #include "mbed.h" |
AswinSivakumar | 0:a4ffc3c3e770 | 22 | |
AswinSivakumar | 0:a4ffc3c3e770 | 23 | #define FXOS8700_I2C_ADDRESS (0x1E<<1) //pins SA0,SA1=0 |
AswinSivakumar | 0:a4ffc3c3e770 | 24 | |
AswinSivakumar | 0:a4ffc3c3e770 | 25 | #define FXOS8700_STATUS 0x00 |
AswinSivakumar | 0:a4ffc3c3e770 | 26 | #define FXOS8700_MDR_STATUS 0x32 |
AswinSivakumar | 0:a4ffc3c3e770 | 27 | #define FXOS8700_WHO_AM_I 0x0D |
AswinSivakumar | 0:a4ffc3c3e770 | 28 | #define FXOS8700_CTRL_REG1 0x2A |
AswinSivakumar | 0:a4ffc3c3e770 | 29 | #define FXOS8700_M_CTRL_REG1 0x5B |
AswinSivakumar | 0:a4ffc3c3e770 | 30 | #define FXOS8700_WHO_AM_I_VALUE 0xC7 |
AswinSivakumar | 0:a4ffc3c3e770 | 31 | |
AswinSivakumar | 0:a4ffc3c3e770 | 32 | class FXOS8700 |
AswinSivakumar | 0:a4ffc3c3e770 | 33 | { |
AswinSivakumar | 0:a4ffc3c3e770 | 34 | public: |
AswinSivakumar | 0:a4ffc3c3e770 | 35 | |
AswinSivakumar | 0:a4ffc3c3e770 | 36 | FXOS8700(PinName sda, PinName scl); |
AswinSivakumar | 0:a4ffc3c3e770 | 37 | |
AswinSivakumar | 0:a4ffc3c3e770 | 38 | void accel_config(void); |
AswinSivakumar | 0:a4ffc3c3e770 | 39 | |
AswinSivakumar | 0:a4ffc3c3e770 | 40 | void acquire_accel_data_g(float * da); |
AswinSivakumar | 0:a4ffc3c3e770 | 41 | |
AswinSivakumar | 0:a4ffc3c3e770 | 42 | private: |
AswinSivakumar | 0:a4ffc3c3e770 | 43 | I2C accelmagi2c; |
AswinSivakumar | 0:a4ffc3c3e770 | 44 | |
AswinSivakumar | 0:a4ffc3c3e770 | 45 | }; |
AswinSivakumar | 0:a4ffc3c3e770 | 46 | |
AswinSivakumar | 0:a4ffc3c3e770 | 47 | #endif |