Needed for FXAS21000 NXP gyroscope
Fork of FXAS21000 by
Diff: FXAS21000.h
- Revision:
- 2:cd21ef326977
- Parent:
- 1:88a036a417bf
- Child:
- 3:a8f83b52f4df
--- a/FXAS21000.h Sat Apr 19 00:13:03 2014 +0000 +++ b/FXAS21000.h Mon Jun 02 17:06:32 2014 +0000 @@ -22,7 +22,9 @@ #include "mbed.h" -// MMA8652 Slave Address +/** + * MMA8652 Slave Address + */ #define FXAS21000_SLAVE_ADDR 0x40 // MMA8652 internal register addresses @@ -33,50 +35,54 @@ #define FXAS21000_CTRL_REG1 0x13 #define FXAS21000_WHOAMI_VAL 0xD1 +/** + * FXAS21000 gyroscope on I2C + */ class FXAS21000 { public: /** - * FXAS21000 constructor - * - * @param sda SDA pin - * @param sdl SCL pin - * - */ + * FXAS21000 constructor + * + * @param sda SDA pin + * @param sdl SCL pin + * + */ FXAS21000(PinName sda, PinName scl); /** - * Get the Gyro values - * Result is floating point degrees / second - * - * @param floating point array where the results will be placed - */ + * Get the Gyro values + * Result is floating point degrees / second + * + * @param floating point array where the results will be placed + */ void ReadXYZ(float * a); /** - * Get the Gyro values - * Result is signed 16 bit value - * - * @param int16_t point array where the results will be placed - */ + * Get the Gyro values + * Result is signed 16 bit value + * + * @param int16_t point array where the results will be placed + */ void ReadXYZraw(int16_t * t); /** - * Get the value of the WHO_AM_I register - * - * @returns DEVICE_ID value == 0xD1 - */ - //char getWhoAmI(); + * Get the value of the WHO_AM_I register + * + * @returns DEVICE_ID value == 0xD1 + */ char getWhoAmI(void); private: I2C _i2c; - /** Set the device in active mode - */ + + /** + * Set the device in active mode + */ void begin( void); void RegRead( char reg, char * d, int len);