Interface library for the Atmel Inertial One IMU. Contains drivers for the ITG 3200 3 axis gyro, BMA-150 3 axis accelerometer, and AK8975 3 axis compass
Revision 2:262f9878bebf, committed 2012-02-02
- Comitter:
- Ductapemaster
- Date:
- Thu Feb 02 07:51:25 2012 +0000
- Parent:
- 1:1ea611e007f3
- Child:
- 3:39715110564f
- Commit message:
- playing with doxygen
Changed in this revision
IMU.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/IMU.h Thu Feb 02 07:43:59 2012 +0000 +++ b/IMU.h Thu Feb 02 07:51:25 2012 +0000 @@ -26,22 +26,6 @@ #include "mbed.h" - /** Atmel Inertial One IMU Control Library - * - * Includes control routines for: - * - ITG-3200 3-axis, 16 bit gyroscope - * - BMA-150 3-axis, 16 bit accelerometer - * - AK8975 3-axis, 16 bit magnetometer - * - * Datasheets: - * - * Inertial One: http://www.atmel.com/dyn/resources/prod_documents/doc8354.pdf - * Gyro: http://invensense.com/mems/gyro/documents/PS-ITG-3200A.pdf - * Accelerometer: http://www.bosch-sensortec.com/content/language1/downloads/BMA150_DataSheet_Rev.1.5_30May2008.pdf - * Magnetometer: http://pdf1.alldatasheet.com/datasheet-pdf/view/219477/AKM/AK8973/+Q18W89VYpLawLCDwv+/datasheet.pdf - * - */ - /* Defines */ //7 bit I2C Addresses, shifted left to allow for read/write bit as LSB @@ -85,23 +69,36 @@ // AK8973 Compass Registers + - // CLass and Prototype Functions - + /** Atmel Inertial One IMU Control Class + * + * Includes control routines for: + * - ITG-3200 3-axis, 16 bit gyroscope + * - BMA-150 3-axis, 16 bit accelerometer + * - AK8975 3-axis, 16 bit magnetometer + * + * Datasheets: + * + * Inertial One: http://www.atmel.com/dyn/resources/prod_documents/doc8354.pdf + * Gyro: http://invensense.com/mems/gyro/documents/PS-ITG-3200A.pdf + * Accelerometer: http://www.bosch-sensortec.com/content/language1/downloads/BMA150_DataSheet_Rev.1.5_30May2008.pdf + * Magnetometer: http://pdf1.alldatasheet.com/datasheet-pdf/view/219477/AKM/AK8973/+Q18W89VYpLawLCDwv+/datasheet.pdf + * + */ class IMU { public: - /** Creates IMU object and initializes all three chips - * - * Gyro: FS_SEL register is set to 0x03, as required by datasheet - * Accelerometer: - * Compass: - * - * @param sda - pin for I2C sda signal - * @param scl - pin for I2C scl signal - */ - + /** Creates IMU object and initializes all three chips + * + * Gyro: FS_SEL register is set to 0x03, as required by datasheet + * Accelerometer: + * Compass: + * + * @param sda - pin for I2C sda signal + * @param scl - pin for I2C scl signal + */ IMU(PinName sda, PinName scl); /* Gyro Methods */ @@ -110,35 +107,30 @@ * * @return Raw X axis ADC measurement (signed 16 bits) */ - int gyroX(void); /** Gets current Y axis gyro measurement * * @return Raw Y axis ADC measurement (signed 16 bits) */ - int gyroY(void); /** Gets current Z axis gyro measurement * * @return Raw Z axis ADC measurement (signed 16 bits) */ - int gyroZ(void); /** Gets current ADC data from all axes of gyro (uses burst read mode) * * @return Array of X, Y, and Z axis gyro measurements (signed 16 bits) */ - int[3] gyroXYZ(void); /** Sets digital LPF bandwidth for all gyro channels * * @param Filter Bandwidth (use defined bandwidths) */ - void gyroSetLPF(char _BW); /* Accelerometer Methods */ @@ -149,7 +141,7 @@ - private: + protected: I2C _i2c; //I2C object constructor