SPI accelerometer library
Dependents: FRDMSTBC-A8471_SensorShield_HelloWorld
Fork of MMA8652FC by
Diff: FXLS8471.h
- Revision:
- 1:ac1a9afd8401
- Parent:
- 0:6642dad09196
- Child:
- 2:0eacd0e5db3b
diff -r 6642dad09196 -r ac1a9afd8401 FXLS8471.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/FXLS8471.h Wed Mar 23 05:34:00 2016 +0000
@@ -0,0 +1,45 @@
+ /* Copyright (c) 2015 NXP Semiconductors. MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
+* and associated documentation files (the "Software"), to deal in the Software without
+* restriction, including without limitation the rights to use, copy, modify, merge, publish,
+* distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
+* Software is furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in all copies or
+* substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#ifndef FXLS8471_H
+#define FXLS8471_H
+#include "mbed.h"
+
+#define FXLS8471_STATUS 0x00
+#define FXLS8471_WHO_AM_I 0x0D
+#define FXLS8471_CTRL_REG1 0x2A
+#define FXLS8471_CTRL_REG2 0x2B
+#define FXLS8471_WHO_AM_I_VALUE 0x6A
+
+class FXLS8471
+{
+ public:
+
+ FXLS8471(PinName MOSI, PinName MISO, PinName CLK, PinName CS);
+
+ void FXLS8471_config(void);
+
+ void acquire_FXLS8471_data_g(float * du);
+
+ private:
+ SPI FXLS8471_spi;
+ DigitalOut FXLS8471_cs;
+
+};
+
+#endif
\ No newline at end of file

NXP FRDMSTBC-A8471