Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of FXLS8471Q by
FXLS8471Q.h
- Committer:
- JimCarver
- Date:
- 2014-04-07
- Revision:
- 0:f89f2dc4b003
- Child:
- 1:c80be04510fe
File content as of revision 0:f89f2dc4b003:
#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