microstrain_imu.h

00001 /*
00002   microstrain_imu.h
00003   
00004   Nicolas Williamson - Dec. 2009
00005 */
00006 
00007 #ifndef __H_MSIMU__
00008 #define __H_MSIMU__
00009 
00013 typedef enum msimu_commands {
00014   MSIMU_RAW_ACCEL_ANG_RATE = 0xC1, 
00015   MSIMU_ACCEL_ANG_RATE = 0xC2, 
00016   MSIMU_DELTA_ANGLE_DELTA_VEL = 0xC3, 
00017   MSIMU_SET_CONTINUOUS_MODE = 0xC4, 
00018   MSIMU_ORIENT_MATRIX = 0xC5, 
00019   MSIMU_ATTITUDE_UPDATE_MATRIX = 0xC6, 
00020   MSIMU_MAGNET_VECTOR = 0xC7, 
00021   MSIMU_ACCEL_ANG_RATE_ORIENT_MATRIX = 0xC8, 
00022   MSIMU_WRITE_ACCEL_BIAS_CORRECTION = 0xC9, 
00023   MSIMU_WRITE_GYRO_BIAS_CORRECTION = 0xCA, 
00024   MSIMU_ACCEL_ANG_RATE_MAGNET_VEC = 0xCB, 
00025   MSIMU_ACCEL_ANG_RATE_MAG_VEC_ORIENT_MATRIX = 0xCC, 
00026   MSIMU_CAPTURE_GYRO_BIAS = 0xCD, 
00027   MSIMU_EULER_ANGLES = 0xCE, 
00028   MSIMU_EULER_ANGS_ANG_RATE = 0xCF, 
00029   MSIMU_TRANSFER_QUANT_NON_VOLATILE_MEM = 0xD0, 
00030   MSIMU_TEMPERATURES = 0xD1, 
00031   MSIMU_GYRO_STAB_ACCEL_ANG_RATE_MAG_VEC = 0xD2, 
00032   MSIMU_DELTA_ANG_DELTA_VEL_MAG_VEC = 0xD3, 
00033   MSIMU_WRITE_WORD_EEPROM = 0xE4, 
00034   MSIMU_READ_WORD_EEPROM = 0xE5, 
00035   MSIMU_READ_FIRMWARE_VERSION_NUM = 0xE9, 
00036   MSIMU_STOP_CONTINUOUS_MODE = 0xFA, 
00037   MSIMU_BUILT_IN_TEST = 0xFB 
00038 } MSIMU_COMMAND;
00039 
00040 //Change it if you are not using MSIMU_EULER_ANGS_ANG_RATE
00044 typedef enum msimu_data{
00045   MSIMU_DATA_ROLL = 0,
00046   MSIMU_DATA_PITCH = 1,
00047   MSIMU_DATA_YAM = 2,
00048   MSIMU_DATA_ANGLE_RATE_X = 3,
00049   MSIMU_DATA_ANGLE_RATE_Y = 4,
00050   MSIMU_DATA_ANGLE_RATE_Z = 5,
00051   MSIMU_DATA_TIMER = 6
00052 } MSIMU_DATA; 
00053 
00054 // ******** Public Functions ******** //
00055 void msimu_update(void);
00056 void msimu_init(MSIMU_COMMAND command);
00057 float msimu_get_data_float(MSIMU_DATA index);
00058 int msimu_get_data_int(MSIMU_DATA index);
00059 void msimu_update(void);
00060 
00061 // ******** Private Functions ******** //
00062 void msimu_send_all(unsigned char *bytes, unsigned int length);
00063 void msimu_send_byte(unsigned char byte);
00064 void msimu_send_polled(MSIMU_COMMAND command);
00065 void msimu_set_continuous(MSIMU_COMMAND command);
00066 void msimu_isr(void) __irq;
00067 int msimu_get_length(MSIMU_COMMAND command);
00068 void msimu_parse_buffer(void);
00069 
00070 #endif /* __H_MSIMU__ */
00071 
Generated on Tue Jun 29 16:36:14 2010 by  doxygen 1.6.3