Rev 0.1 Simple operation of just X, Y, Z values in floating point G's
Dependents: Hello_FXLS8471Q Multi-Sensor sensor AerCloud_MutliTech_Socket_Modem_Example ... more
Diff: FXLS8471Q.h
- Revision:
- 0:f89f2dc4b003
- Child:
- 1:c80be04510fe
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/FXLS8471Q.h Mon Apr 07 00:58:10 2014 +0000 @@ -0,0 +1,42 @@ +#ifndef FXLS8471Q_H +#define FXLS8471Q_H + +#include "mbed.h" + +// FXLS8471Q internal register addresses + +#define FXLS8471Q_STATUS 0x00 +#define FXLS8471Q_WHOAMI 0x0D +#define FXLS8471Q_XYZ_DATA_CFG 0x0E +#define FXLS8471Q_CTRL_REG1 0x2A +#define FXLS8471Q_WHOAMI_VAL 0x6A + +class FXLS8471Q +{ +public: + /** + * MPL3115A2 constructor + * + * @param sda SDA pin + * @param sdl SCL pin + * @param addr addr of the I2C peripheral + */ +FXLS8471Q(PinName mosi, PinName miso, PinName scl, PinName cs); + +void ReadXYZ(float * a); + +private: + + SPI _spi; + DigitalOut _spi_cs; + //I2C _i2c; + /** Set the device in active mode + */ + void begin( void); + void RegWrite( int reg, int * d, int len); + void RegRead( int reg, int * d, int len); + + +}; + +#endif