|
enum | GYRO_CONTROL {
WHO_AM_I_G =0x0F,
CTRL_REG1_G =0x20,
CTRL_REG2_G =0x21,
CTRL_REG3_G =0x22,
CTRL_REG4_G =0x23,
CTRL_REG5_G =0x24,
REFERENCE_G =0x25,
STATUS_REG_G =0x27,
OUT_X_L_G =0x28,
OUT_X_H_G =0x29,
OUT_Y_L_G =0x2A,
OUT_Y_H_G =0x2B,
OUT_Z_L_G =0x2C,
OUT_Z_H_G =0x2D,
FIFO_CTRL_REG_G =0x2E,
FIFO_SRC_REG_G =0x2F,
INT1_CFG_G =0x30,
INT1_SRC_G =0x31,
INT1_THS_XH_G =0x32,
INT1_THS_XL_G =0x33,
INT1_THS_YH_G =0x34,
INT1_THS_YL_G =0x35,
INT1_THS_ZH_G =0x36,
INT1_THS_ZL_G =0x37,
INT1_DURATION_G =0x38
} |
| Register to address mapping for the Gyroscope. More...
|
|
enum | XM_CONTROL {
OUT_TEMP_L_XM =0x05,
OUT_TEMP_H_XM =0x06,
STATUS_REG_M =0x07,
OUT_X_L_M =0x08,
OUT_X_H_M =0x09,
OUT_Y_L_M =0x0A,
OUT_Y_H_M =0x0B,
OUT_Z_L_M =0x0C,
OUT_Z_H_M =0x0D,
WHO_AM_I_XM =0x0F,
INT_CTRL_REG_M =0x12,
INT_SRC_REG_M =0x13,
INT_THS_L_M =0x14,
INT_THS_H_M =0x15,
OFFSET_X_L_M =0x16,
OFFSET_X_H_M =0x17,
OFFSET_Y_L_M =0x18,
OFFSET_Y_H_M =0x19,
OFFSET_Z_L_M =0x1A,
OFFSET_Z_H_M =0x1B,
REFERENCE_X =0x1C,
REFERENCE_Y =0x1D,
REFERENCE_Z =0x1E,
CTRL_REG0_XM =0x1F,
CTRL_REG1_XM =0x20,
CTRL_REG2_XM =0x21,
CTRL_REG3_XM =0x22,
CTRL_REG4_XM =0x23,
CTRL_REG5_XM =0x24,
CTRL_REG6_XM =0x25,
CTRL_REG7_XM =0x26,
STATUS_REG_A =0x27,
OUT_X_L_A =0x28,
OUT_X_H_A =0x29,
OUT_Y_L_A =0x2A,
OUT_Y_H_A =0x2B,
OUT_Z_L_A =0x2C,
OUT_Z_H_A =0x2D,
FIFO_CTRL_REG =0x2E,
FIFO_SRC_REG =0x2F,
INT_GEN_1_REG =0x30,
INT_GEN_1_SRC =0x31,
INT_GEN_1_THS =0x32,
INT_GEN_1_DURATION =0x33,
INT_GEN_2_REG =0x34,
INT_GEN_2_SRC =0x35,
INT_GEN_2_THS =0x36,
INT_GEN_2_DURATION =0x37,
CLICK_CFG =0x38,
CLICK_SRC =0x39,
CLICK_THS =0x3A,
TIME_LIMIT =0x3B,
TIME_LATENCY =0x3C,
TIME_WINDOW =0x3D,
ACT_THS =0x3E,
ACT_DUR =0x3F
} |
| Register to address mapping for the accelometer / magnemeter. More...
|
|
enum | gyro_scale { G_SCALE_245DPS,
G_SCALE_500DPS,
G_SCALE_2000DPS
} |
|
enum | accel_scale {
A_SCALE_2G,
A_SCALE_4G,
A_SCALE_6G,
A_SCALE_8G,
A_SCALE_16G
} |
|
enum | mag_scale { M_SCALE_2GS,
M_SCALE_4GS,
M_SCALE_8GS,
M_SCALE_12GS
} |
|
enum | gyro_odr {
G_ODR_95_BW_125 = 0x0,
G_ODR_95_BW_25 = 0x1,
G_ODR_190_BW_125 = 0x4,
G_ODR_190_BW_25 = 0x5,
G_ODR_190_BW_50 = 0x6,
G_ODR_190_BW_70 = 0x7,
G_ODR_380_BW_20 = 0x8,
G_ODR_380_BW_25 = 0x9,
G_ODR_380_BW_50 = 0xA,
G_ODR_380_BW_100 = 0xB,
G_ODR_760_BW_30 = 0xC,
G_ODR_760_BW_35 = 0xD,
G_ODR_760_BW_50 = 0xE,
G_ODR_760_BW_100 = 0xF
} |
|
enum | accel_odr {
A_POWER_DOWN,
A_ODR_3125,
A_ODR_625,
A_ODR_125,
A_ODR_25,
A_ODR_50,
A_ODR_100,
A_ODR_200,
A_ODR_400,
A_ODR_800,
A_ODR_1600
} |
|
enum | accel_abw { A_ABW_773,
A_ABW_194,
A_ABW_362,
A_ABW_50
} |
|
enum | mag_odr {
M_ODR_3125,
M_ODR_625,
M_ODR_125,
M_ODR_25,
M_ODR_50,
M_ODR_100
} |
|
enum | i2c_address { LSM9DS0_XM =(0x1D<<1),
LSM9DS0_G =(0x6B<<1)
} |
|
|
void | calcaRes () |
| sets the aRes variable to the correct resolution of the accelometer readings More...
|
|
void | calcmRes () |
| sets the mRes variable to the correct resolution of the magenmeter readings More...
|
|
void | calcgRes () |
| sets the gRes variable to the correct resolution of the gyroscope readings More...
|
|
void | initGyro () |
| initialize the gyroscope, must be done before reading from the gyroscope More...
|
|
void | setGyroODR (enum gyro_odr gRate) |
| set the data capture rate of the gyroscope see the enum gyro_odr to see what values this can take. More...
|
|
void | setGyroScale (enum gyro_scale gScl) |
| set the scale of the gyroscope see enum gyro_Scale to see what values this can take. More...
|
|
void | initAccel (void) |
| initilize the accelometer, this must be called before using any accelometer fucntions More...
|
|
void | setAccelODR (enum accel_odr aRate) |
| see setGyroODR function More...
|
|
void | setAccelScale (enum accel_scale aScl) |
| see the setGyroScle function More...
|
|
void | initMag (void) |
|
void | setMagODR (enum mag_odr mRate) |
| see the setGyroODR function More...
|
|
void | setMagScale (enum mag_scale mScl) |
| see the setGyroScale function More...
|
|
float | calcGyro (int16_t gyro) |
| takes a raw gyro reading and returns the actual value More...
|
|
float | calcAccel (int16_t accel) |
|
float | calcMag (int16_t mag) |
|
void | imu_rbs (uint8_t address, uint8_t subAddress, uint8_t *dest, uint8_t count) |
| read multiple bytes from the imu More...
|
|
uint8_t | imu_rb (uint8_t address, uint8_t subAddress) |
| Read one byte from the device. More...
|
|
void | imu_wb (uint8_t address, uint8_t subAddress, uint8_t data) |
| Writes a byte to the register at the address specified by subAddress. More...
|
|
uint16_t | init_imu (enum gyro_scale gScl, enum accel_scale a_scl, enum mag_scale m_scl, enum gyro_odr g_odr, enum accel_odr a_odr, enum mag_odr m_odr) |
| Initilizes the IMU and enables all 9 axes and set the respective scales and data rates. More...
|
|
void | read_gyro (float *x, float *y, float *z) |
| Reads the gyroscope and calculates the real value from the raw reading. More...
|
|
void | read_accel (float *x, float *y, float *z) |
| Reads the accelometer and calculates the real value from the raw reading. More...
|
|
void | read_mag (float *x, float *y, float *z) |
| Reads the magnemeter and calculates the real value from the raw reading. More...
|
|
int16_t | readTemp () |
| Returns the temperature in Celcius. Will be 25 degrees, which is the optimal temparture for the gyroscope. Is used internally for self-calibration. More...
|
|