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

Embed: (wiki syntax)

« Back to documentation index

IMU Class Reference

IMU Class Reference

Atmel Inertial One IMU Control Class. More...

#include <IMU.h>

Public Member Functions

 IMU (PinName sda, PinName scl)
 Creates IMU object and initializes all three chips.
data3d getGyroData (void)
 Gets current ADC data from all axes of gyro (uses burst read mode)
void setGyroLPF (char bw)
 Sets digital LPF bandwidth for all gyro channels - Not working currently.
int accX (void)
 Gets current X acceleration.
int accY (void)
 Gets current Y acceleration.
int accZ (void)
 Gets current Z acceleration.
data3d getAccData (void)
 Gets current acceleration on all axes.
void setAccLPF (char bw)
 Sets digital LPF filter bandwidth.
void setAccRange (char range)
 Sets accelerometer measurement range (+/-2, 4, or 8g's)
void accUpdateImage (void)
 Updates all image registers with data stored in EEPROM.
void accEEWriteEn (bool we)
 Set EEPROM write enable.

Detailed Description

Atmel Inertial One IMU Control Class.

Includes control routines for:

  • ITG-3200 3-axis, 16 bit gyroscope
  • BMA-150 3-axis, 10 bit accelerometer
  • AK8975 3-axis, 16 bit magnetometer

Datasheets:

http://www.atmel.com/dyn/resources/prod_documents/doc8354.pdf

http://invensense.com/mems/gyro/documents/PS-ITG-3200A.pdf

http://www.bosch-sensortec.com/content/language1/downloads/BMA150_DataSheet_Rev.1.5_30May2008.pdf

http://pdf1.alldatasheet.com/datasheet-pdf/view/219477/AKM/AK8973/+Q18W89VYpLawLCDwv+/datasheet.pdf

Definition at line 116 of file IMU.h.


Constructor & Destructor Documentation

IMU ( PinName  sda,
PinName  scl 
)

Creates IMU object and initializes all three chips.

Gyro: FS_SEL register is set to 0x03, as required by datasheet

Accelerometer:

Compass:

Parameters:
sdapin for I2C sda signal
sclpin for I2C scl signal

Definition at line 32 of file IMU.cpp.


Member Function Documentation

void accEEWriteEn ( bool  we )

Set EEPROM write enable.

Parameters:
weWrite enable value

Definition at line 201 of file IMU.cpp.

void accUpdateImage ( void   )

Updates all image registers with data stored in EEPROM.

Definition at line 196 of file IMU.cpp.

int accX ( void   )

Gets current X acceleration.

Returns:
Raw X acceleration, 10 bits signed

Definition at line 95 of file IMU.cpp.

int accY ( void   )

Gets current Y acceleration.

Returns:
Raw Y acceleration, 10 bits signed

Definition at line 109 of file IMU.cpp.

int accZ ( void   )

Gets current Z acceleration.

Returns:
Raw Z acceleration, 10 bits signed

Definition at line 123 of file IMU.cpp.

IMU::data3d getAccData ( void   )

Gets current acceleration on all axes.

Returns:
data3d struct of acceleration data, signed ints

Definition at line 137 of file IMU.cpp.

IMU::data3d getGyroData ( void   )

Gets current ADC data from all axes of gyro (uses burst read mode)

Returns:
data3d struct of X, Y, and Z axis gyro measurements (signed 16 bits)

Definition at line 51 of file IMU.cpp.

void setAccLPF ( char  bw )

Sets digital LPF filter bandwidth.

Parameters:
bwDigital LPF filter bandwidth

Definition at line 156 of file IMU.cpp.

void setAccRange ( char  range )

Sets accelerometer measurement range (+/-2, 4, or 8g's)

Parameters:
rangeRange of g measurements

Definition at line 176 of file IMU.cpp.

void setGyroLPF ( char  bw )

Sets digital LPF bandwidth for all gyro channels - Not working currently.

Parameters:
bwFilter Bandwidth (use defined bandwidths)

Definition at line 77 of file IMU.cpp.