Self test boot program for testing icarus sensors
Dependencies: BLE_API mbed nRF51822
Fork of BLE_UARTConsole by
Diff: MPU9250Sensor.cpp
- Revision:
- 11:70359785c2a7
- Parent:
- 10:3a24c970db40
- Child:
- 13:ef0ce8fa871f
--- a/MPU9250Sensor.cpp Tue Jan 27 13:25:37 2015 +0000 +++ b/MPU9250Sensor.cpp Thu Jan 29 12:24:01 2015 +0000 @@ -24,12 +24,10 @@ uint32_t MPU9250Sensor::verifyIntegrity(uint32_t* errorResult) { LOG("Start verfication of MPU9250 Sensor"); uint32_t errors = 0; - //Device id is 0xAD - //Device mems id is 0x1D - //Part id is 0xF2 -// uint32_t sensorId = readRegister32(DEVID_AD); + //who am I register value is 0x71 +// uint8_t sensorId = readRegister(MPU9250_WHOAMI); - // if (sensorId >> 8 !=0xAD1DF2){ +// if (sensorId !=0x71){ // errorResult[errors++] = ERROR_WRONG_DEVICE_ID; // LOG("Wrong sensorId: %X",sensorId); // } @@ -57,3 +55,18 @@ void MPU9250Sensor::getSensorDetails(sensor_t* sensorDetails) { } + +//uint8_t MPU9250Sensor::readRegister( uint8_t reg){ +// cs->write(DOWN); +// spi->write(reg| MPU9250_READ_FLAG); +// uint8_t val = spi->write(0x00); +// cs->write(UP); +// return (val); +//} +// +//void MPU9250Sensor::writeRegister( uint8_t reg, uint8_t cmd ){ +// cs->write(DOWN); +// spi->write(reg); +// spi->write(cmd); +// cs->write(UP); +//}