291 void imu_rbs(uint8_t address, uint8_t subAddress, uint8_t * dest, uint8_t count);
300 uint8_t
imu_rb(uint8_t address, uint8_t subAddress);
308 void imu_wb(uint8_t address, uint8_t subAddress, uint8_t data);
342 void read_gyro(
float * x,
float * y,
float * z);
350 void read_accel(
float * x,
float * y,
float * z);
358 void read_mag(
float * x,
float * y,
float * z);
GYRO_CONTROL
Register to address mapping for the Gyroscope.
float calcMag(int16_t mag)
void read_mag(float *x, float *y, float *z)
Reads the magnemeter and calculates the real value from the raw reading.
void read_accel(float *x, float *y, float *z)
Reads the accelometer and calculates the real value from the raw reading.
void setAccelODR(enum accel_odr aRate)
see setGyroODR function
void initAccel(void)
initilize the accelometer, this must be called before using any accelometer fucntions ...
XM_CONTROL
Register to address mapping for the accelometer / magnemeter.
void read_gyro(float *x, float *y, float *z)
Reads the gyroscope and calculates the real value from the raw reading.
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.
void setMagODR(enum mag_odr mRate)
see the setGyroODR function
void calcmRes()
sets the mRes variable to the correct resolution of the magenmeter readings
void setMagScale(enum mag_scale mScl)
see the setGyroScale function
void imu_rbs(uint8_t address, uint8_t subAddress, uint8_t *dest, uint8_t count)
read multiple bytes from the imu
void calcaRes()
sets the aRes variable to the correct resolution of the accelometer readings
uint8_t imu_rb(uint8_t address, uint8_t subAddress)
Read one byte from the device.
void initGyro()
initialize the gyroscope, must be done before reading from the gyroscope
float calcGyro(int16_t gyro)
takes a raw gyro reading and returns the actual value
void setAccelScale(enum accel_scale aScl)
see the setGyroScle function
float calcAccel(int16_t accel)
int16_t readTemp()
Returns the temperature in Celcius. Will be 25 degrees, which is the optimal temparture for the gyros...
void setGyroScale(enum gyro_scale gScl)
set the scale of the gyroscope see enum gyro_Scale to see what values this can take.
void imu_wb(uint8_t address, uint8_t subAddress, uint8_t data)
Writes a byte to the register at the address specified by subAddress.
void calcgRes()
sets the gRes variable to the correct resolution of the gyroscope readings
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...