44 #ifndef SENSOR_MPU9250_H 45 #define SENSOR_MPU9250_H 63 #define ACC_RANGE_2G 0 64 #define ACC_RANGE_4G 1 65 #define ACC_RANGE_8G 2 66 #define ACC_RANGE_16G 3 67 #define ACC_RANGE_INVALID 0xFF 70 #define MPU_AX_GYR 0x07 71 #define MPU_AX_ACC 0x38 72 #define MPU_AX_MAG 0x40 73 #define MPU_AX_ALL 0x7F 75 // Interrupt status bit 76 #define MPU_DATA_READY 0x01 77 #define MPU_MOVEMENT 0x40 79 // Magnetometer status 80 #define MAG_STATUS_OK 0x00 81 #define MAG_READ_ST_ERR 0x01 82 #define MAG_DATA_NOT_RDY 0x02 83 #define MAG_OVERFLOW 0x03 84 #define MAG_READ_DATA_ERR 0x04 85 #define MAG_BYPASS_FAIL 0x05 86 #define MAG_NO_POWER 0x06 bool SensorMpu9250_magTest(void)
Run a magnetometer self test.
void SensorMpu9250_registerCallback(SensorMpu9250CallbackFn_t pCallback)
Register an application defined call-back for interrupt processing.
bool SensorMpu9250_test(void)
Run a self-test of the gyro/accelerometer component.
void SensorMpu9250_magReset(void)
Reset the magnetometer.
void SensorMpu9250_enable(uint16_t config)
Enable data collection.
bool SensorMpu9250_gyroRead(uint16_t *pData)
Read data from the gyroscope.
uint8_t SensorMpu9250_accReadRange(void)
Read the accelerometer range.
void(* SensorMpu9250CallbackFn_t)(void)
Definition: SensorMpu9250.h:93
bool SensorMpu9250_accSetRange(uint8_t range)
Set the accelerometer range.
bool SensorMpu9250_powerIsOn(void)
get the state of the power supply to the MPU9250
bool SensorMpu9250_init(void)
This function initializes the MPU abstraction layer.
void SensorMpu9250_powerOff(void)
Remove power to the MPU9250.
void SensorMpu9250_powerOn(void)
Applies power to the MPU9250.
float SensorMpu9250_accConvert(int16_t data)
Convert raw data to G units.
uint8_t SensorMpu9250_magStatus(void)
Return the magnetometer status.
bool SensorMpu9250_reset(void)
This function resets the MPU.
uint8_t SensorMpu9250_irqStatus(void)
Read interrupt status register.
float SensorMpu9250_gyroConvert(int16_t data)
Convert raw data to deg/sec units.
bool SensorMpu9250_accRead(uint16_t *pData)
Read data from the accelerometer.
uint8_t SensorMpu9250_magRead(int16_t *pData)
Read data from the compass - X, Y, Z - 3 words.
bool SensorMpu9250_womEnable(uint8_t threshold)
Enable Wake On Motion functionality.