mbed library for MPU9250 (SPI interface)
Dependents: InvertedPendulum2017
Diff: Lib_MPU9250.h
- Revision:
- 2:c142d5a352c5
- Parent:
- 1:5334e111af53
--- a/Lib_MPU9250.h Fri Apr 20 18:13:45 2018 +0000 +++ b/Lib_MPU9250.h Wed May 02 10:56:50 2018 +0000 @@ -207,6 +207,11 @@ BIT_I2C_IF_DIS = 0x10 } MPU9250BIT; +typedef enum _MPU9250IF{ + MPU9250_SPI = 0x00, + MPU9250_I2C = 0x10 +} MPU9250IF; + class MPU9250{ public: MPU9250( PinName cs, PinName mosi, PinName miso, PinName sck ); // constructor( SPI ) @@ -216,6 +221,8 @@ void begin( void ); void reset( void ); + uint8_t getWhoAmI( void ); + void setAccelRange( MPU9250BIT range ); void setGyroRange( MPU9250BIT range ); void setDLPF( MPU9250BIT range ); @@ -249,6 +256,7 @@ SPI* _spi; I2C* _i2c; uint8_t _i2c_addr; + MPU9250IF _imu_if; float _accscale; float _gyroscale;