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
Diff: FXLS8471Q.h
- Revision:
- 2:6aae25fe9ab4
- Parent:
- 1:c80be04510fe
- Child:
- 3:b1fd3a2572e2
diff -r c80be04510fe -r 6aae25fe9ab4 FXLS8471Q.h --- a/FXLS8471Q.h Sat Apr 19 01:26:12 2014 +0000 +++ b/FXLS8471Q.h Mon Jun 02 17:14:15 2014 +0000 @@ -31,51 +31,52 @@ #define FXLS8471Q_CTRL_REG1 0x2A #define FXLS8471Q_WHOAMI_VAL 0x6A +/** + * FXLS8471Q Xtrinsic accelerometer on SPI + */ class FXLS8471Q { public: - /** - * FXOS8700Q constructor - * - * @param mosi MOSI pin - * @param miso MISO pin - * @param scl SCL pin - * @param cs Device Chip Select pin - */ -FXLS8471Q(PinName mosi, PinName miso, PinName scl, PinName cs); + /** + * FXLS8471Q constructor + * + * @param mosi MOSI pin + * @param miso MISO pin + * @param scl SCL pin + * @param cs Device Chip Select pin + */ + FXLS8471Q(PinName mosi, PinName miso, PinName scl, PinName cs); - /** - * Get XYZ axis acceleration in G's - * - * @param res array where acceleration data will be stored - */ -void ReadXYZ(float * a); - - /** - * Get XYZ axis acceleration, signed 16 bit values - * - * @param res array where acceleration data will be stored - */ -void ReadXYZraw(int16_t * d); + /** + * Get XYZ axis acceleration in G's + * + * @param res array where acceleration data will be stored + */ + void ReadXYZ(float * a); - /** - * Get the value of the WHO_AM_I register - * - * @returns WHO_AM_I value - */ -char getWhoAmI(void); - + /** + * Get XYZ axis acceleration, signed 16 bit values + * + * @param res array where acceleration data will be stored + */ + void ReadXYZraw(int16_t * d); + + /** + * Get the value of the WHO_AM_I register + * + * @returns WHO_AM_I value + */ + char getWhoAmI(void); + private: SPI _spi; DigitalOut _spi_cs; void begin( void); - void RegWrite( int reg, int * d, int len); + void RegWrite( int reg, int * d, int len); void RegRead( int reg, int * d, int len); - - }; #endif