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:
- 2:6aae25fe9ab4
- Parent:
- 1:c80be04510fe
- Child:
- 3:b1fd3a2572e2
--- 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