Felix Rüdiger / MPU6050_lib

Dependents:   BLE_Nano_MPU6050Service

Files at this revision

API Documentation at this revision

Comitter:
fruediger
Date:
Wed Jul 22 12:20:10 2015 +0000
Parent:
2:32b13cc64cb0
Child:
4:5a52b575fbc6
Commit message:
port completed for the moment

Changed in this revision

MPU6050.cpp Show annotated file Show diff for this revision Revisions of this file
MPU6050.h Show annotated file Show diff for this revision Revisions of this file
--- a/MPU6050.cpp	Mon Jul 13 15:23:35 2015 +0000
+++ b/MPU6050.cpp	Wed Jul 22 12:20:10 2015 +0000
@@ -1062,4 +1062,389 @@
 {
     uint8_t tmp;
     return (this->read(REG_SIGNAL_PATH_RESET, &tmp) && this->write(REG_SIGNAL_PATH_RESET, tmp | TEMP_PATH_RESET_MASK));
+}
+
+bool MPU6050::getAccelerometerPowerOnDelay(PowerOnDelay* delay, float timeout_secs)
+{
+    uint8_t tmp;
+    if (this->read(REG_MOT_DETECT_CTRL, &tmp, timeout_secs))
+    {
+        *delay = static_cast<PowerOnDelay>(tmp & POWER_ON_DELAY_MASK);
+        return true;
+    }
+    
+    return false;
+}
+
+bool MPU6050::setAccelerometerPowerOnDelay(PowerOnDelay delay, float timeout_secs)
+{
+    uint8_t tmp;
+    return (this->read(REG_MOT_DETECT_CTRL, &tmp, timeout_secs)) && (this->write(REG_MOT_DETECT_CTRL, (tmp & (~POWER_ON_DELAY_MASK)) | delay, timeout_secs));
+}
+
+bool MPU6050::getFreefallDetectionDecrement(FreefallDetectionDecrement* dec,  float timeout_secs)
+{
+    uint8_t tmp;
+    if (this->read(REG_MOT_DETECT_CTRL, &tmp, timeout_secs))
+    {
+        *dec = static_cast<FreefallDetectionDecrement>(tmp & FF_DETECTION_DEC_MASK);
+        return true;
+    }
+    
+    return false;
+}
+
+bool MPU6050::setFreefallDetectionDecrement(FreefallDetectionDecrement dec, float timeout_secs)
+{
+    uint8_t tmp;
+    return (this->read(REG_MOT_DETECT_CTRL, &tmp, timeout_secs)) && (this->write(REG_MOT_DETECT_CTRL, (tmp & (~FF_DETECTION_DEC_MASK)) | dec, timeout_secs));
+}
+
+bool MPU6050::getMotionDetectionDecrement(MotionDetectionDecrement* dec, float timeout_secs)
+{
+    uint8_t tmp;
+    if (this->read(REG_MOT_DETECT_CTRL, &tmp, timeout_secs))
+    {
+        *dec = static_cast<MotionDetectionDecrement>(tmp & MOT_DETECTION_DEC_MASK);
+        return true;
+    }
+    
+    return false;
+}
+
+bool MPU6050::setMotionDetectionDecrement(MotionDetectionDecrement dec, float timeout_secs)
+{
+    uint8_t tmp;
+    return (this->read(REG_MOT_DETECT_CTRL, &tmp, timeout_secs)) && (this->write(REG_MOT_DETECT_CTRL, (tmp & (~MOT_DETECTION_DEC_MASK)) | dec, timeout_secs));
+}
+
+bool MPU6050::getFIFOEnabled(bool *enabled, float timeout_secs)
+{
+    uint8_t tmp;
+    if (this->read(REG_USER_CTRL, &tmp, timeout_secs))
+    {
+        *enabled = ((tmp & FIFO_EN_MASK) != 0);
+        return true;
+    }
+    
+    return false;
+}
+
+bool MPU6050::setFIFOEnabled(bool enabled, float timeout_secs)
+{
+    uint8_t tmp;
+    if (this->read(REG_USER_CTRL, &tmp, timeout_secs))
+    {
+        tmp &= ~(FIFO_EN_MASK);
+        return this->write(REG_USER_CTRL, enabled ? (tmp | FIFO_EN_MASK) : tmp, timeout_secs);
+    }
+    return false;
+}
+
+bool MPU6050::resetFIFO(float timeout_secs)
+{
+    uint8_t tmp;
+    return (this->read(REG_USER_CTRL, &tmp) && this->write(REG_USER_CTRL, tmp | FIFO_RESET_MASK));
+}
+
+bool MPU6050::resetSensors(float timeout_secs)
+{
+    uint8_t tmp;
+    return (this->read(REG_USER_CTRL, &tmp) && this->write(REG_USER_CTRL, tmp | SIG_COND_RESET_MASK));
+}
+
+bool MPU6050::reset(float timeout_secs)
+{
+    uint8_t tmp;
+    return (this->read(REG_PWR_MGMT_1, &tmp) && this->write(REG_PWR_MGMT_1, tmp | RESET_MASK));
+}
+
+bool MPU6050::getSleepEnabled(bool *enabled, float timeout_secs)
+{
+    uint8_t tmp;
+    if (this->read(REG_PWR_MGMT_1, &tmp, timeout_secs))
+    {
+        *enabled = ((tmp & SLEEP_EN_MASK) != 0);
+        return true;
+    }
+    
+    return false;
+}
+
+bool MPU6050::setSleepEnabled(bool enabled, float timeout_secs)
+{
+    uint8_t tmp;
+    if (this->read(REG_PWR_MGMT_1, &tmp, timeout_secs))
+    {
+        tmp &= ~(SLEEP_EN_MASK);
+        return this->write(REG_PWR_MGMT_1, enabled ? (tmp | SLEEP_EN_MASK) : tmp, timeout_secs);
+    }
+    return false;
+}
+
+bool MPU6050::getWakeCycleEnabled(bool *enabled, float timeout_secs)
+{
+    uint8_t tmp;
+    if (this->read(REG_PWR_MGMT_1, &tmp, timeout_secs))
+    {
+        *enabled = ((tmp & WAKE_CYCLE_EN_MASK) != 0);
+        return true;
+    }
+    
+    return false;
+}
+
+bool MPU6050::setWakeCycleEnabled(bool enabled, float timeout_secs)
+{
+    uint8_t tmp;
+    if (this->read(REG_PWR_MGMT_1, &tmp, timeout_secs))
+    {
+        tmp &= ~(WAKE_CYCLE_EN_MASK);
+        return this->write(REG_PWR_MGMT_1, enabled ? (tmp | WAKE_CYCLE_EN_MASK) : tmp, timeout_secs);
+    }
+    return false;
+}
+
+bool MPU6050::getTemperatureSensorEnabled(bool *enabled, float timeout_secs)
+{
+    uint8_t tmp;
+    if (this->read(REG_PWR_MGMT_1, &tmp, timeout_secs))
+    {
+        // this is an inverted state
+        *enabled = ((tmp & TEMP_EN_MASK) == 0);
+        return true;
+    }
+    
+    return false;
+}
+
+bool MPU6050::setTemperatureSensorEnabled(bool enabled, float timeout_secs)
+{
+    uint8_t tmp;
+    if (this->read(REG_PWR_MGMT_1, &tmp, timeout_secs))
+    {
+        tmp &= ~(TEMP_EN_MASK);
+        //this is an incverted state
+        return this->write(REG_PWR_MGMT_1, enabled ? tmp : (tmp | TEMP_EN_MASK), timeout_secs);
+    }
+    return false;
+}
+
+bool MPU6050::getClockSource(ClockSource* clockSource, float timeout_secs)
+{
+    uint8_t tmp;
+    if (this->read(REG_PWR_MGMT_1, &tmp, timeout_secs))
+    {
+        *clockSource = static_cast<ClockSource>(tmp & CLOCK_SOURCE_MASK);
+        return true;
+    }
+    
+    return false;
+}
+
+bool MPU6050::setClockSource(ClockSource clockSource, float timeout_secs)
+{
+    uint8_t tmp;
+    return (this->read(REG_PWR_MGMT_1, &tmp, timeout_secs)) && (this->write(REG_PWR_MGMT_1, (tmp & (~CLOCK_SOURCE_MASK)) | clockSource, timeout_secs));
+}
+
+bool MPU6050::getWakeFrequency(WakeFrequency* wakeFrequency, float timeout_secs)
+{
+    uint8_t tmp;
+    if (this->read(REG_PWR_MGMT_2, &tmp, timeout_secs))
+    {
+        *clockSource = static_cast<ClockSource>(tmp & WAKE_FREQ_MASK);
+        return true;
+    }
+    
+    return false;
+}
+
+bool MPU6050::setWakeFrequency(WakeFrequency wakeFrequency, float timeout_secs)
+{
+    uint8_t tmp;
+    return (this->read(REG_PWR_MGMT_2, &tmp, timeout_secs)) && (this->write(REG_PWR_MGMT_2, (tmp & (~WAKE_FREQ_MASK)) | clockSource, timeout_secs));
+}
+
+bool MPU6050::getGyroXStandbyEnabled(bool *enabled, float timeout_secs)
+{
+    uint8_t tmp;
+    if (this->read(REG_PWR_MGMT_2, &tmp, timeout_secs))
+    {
+        *enabled = ((tmp & GYRO_X_STB_EN_MASK) != 0);
+        return true;
+    }
+    
+    return false;
+}
+
+bool MPU6050::setGyroXStandbyEnabled(bool enabled, float timeout_secs)
+{
+    uint8_t tmp;
+    if (this->read(REG_PWR_MGMT_2, &tmp, timeout_secs))
+    {
+        tmp &= ~(GYRO_X_STB_EN_MASK);
+        return this->write(REG_PWR_MGMT_2, enabled ? (tmp | GYRO_X_STB_EN_MASK) : tmp, timeout_secs);
+    }
+    return false;
+}
+
+bool MPU6050::getGyroYStandbyEnabled(bool *enabled, float timeout_secs)
+{
+    uint8_t tmp;
+    if (this->read(REG_PWR_MGMT_2, &tmp, timeout_secs))
+    {
+        *enabled = ((tmp & GYRO_Y_STB_EN_MASK) != 0);
+        return true;
+    }
+    
+    return false;
+}
+
+bool MPU6050::setGyroYStandbyEnabled(bool enabled, float timeout_secs)
+{
+    uint8_t tmp;
+    if (this->read(REG_PWR_MGMT_2, &tmp, timeout_secs))
+    {
+        tmp &= ~(GYRO_Y_STB_EN_MASK);
+        return this->write(REG_PWR_MGMT_2, enabled ? (tmp | GYRO_Y_STB_EN_MASK) : tmp, timeout_secs);
+    }
+    return false;
+}
+
+bool MPU6050::getGyroZStandbyEnabled(bool *enabled, float timeout_secs)
+{
+    uint8_t tmp;
+    if (this->read(REG_PWR_MGMT_2, &tmp, timeout_secs))
+    {
+        *enabled = ((tmp & GYRO_Z_STB_EN_MASK) != 0);
+        return true;
+    }
+    
+    return false;
+}
+
+bool MPU6050::setGyroZStandbyEnabled(bool enabled, float timeout_secs)
+{
+    uint8_t tmp;
+    if (this->read(REG_PWR_MGMT_2, &tmp, timeout_secs))
+    {
+        tmp &= ~(GYRO_Z_STB_EN_MASK);
+        return this->write(REG_PWR_MGMT_2, enabled ? (tmp | GYRO_Z_STB_EN_MASK) : tmp, timeout_secs);
+    }
+    return false;
+}
+
+bool MPU6050::getAccelXStandbyEnabled(bool *enabled, float timeout_secs)
+{
+    uint8_t tmp;
+    if (this->read(REG_PWR_MGMT_2, &tmp, timeout_secs))
+    {
+        *enabled = ((tmp & ACCEL_X_STB_EN_MASK) != 0);
+        return true;
+    }
+    
+    return false;
+}
+
+bool MPU6050::setAccelXStandbyEnabled(bool enabled, float timeout_secs)
+{
+    uint8_t tmp;
+    if (this->read(REG_PWR_MGMT_2, &tmp, timeout_secs))
+    {
+        tmp &= ~(ACCEL_X_STB_EN_MASK);
+        return this->write(REG_PWR_MGMT_2, enabled ? (tmp | ACCEL_X_STB_EN_MASK) : tmp, timeout_secs);
+    }
+    return false;
+}
+
+bool MPU6050::getAccelYStandbyEnabled(bool *enabled, float timeout_secs)
+{
+    uint8_t tmp;
+    if (this->read(REG_PWR_MGMT_2, &tmp, timeout_secs))
+    {
+        *enabled = ((tmp & ACCEL_Y_STB_EN_MASK) != 0);
+        return true;
+    }
+    
+    return false;
+}
+
+bool MPU6050::setAccelYStandbyEnabled(bool enabled, float timeout_secs)
+{
+    uint8_t tmp;
+    if (this->read(REG_PWR_MGMT_2, &tmp, timeout_secs))
+    {
+        tmp &= ~(ACCEL_Y_STB_EN_MASK);
+        return this->write(REG_PWR_MGMT_2, enabled ? (tmp | ACCEL_Y_STB_EN_MASK) : tmp, timeout_secs);
+    }
+    return false;
+}
+
+bool MPU6050::getAccelZStandbyEnabled(bool *enabled, float timeout_secs)
+{
+    uint8_t tmp;
+    if (this->read(REG_PWR_MGMT_2, &tmp, timeout_secs))
+    {
+        *enabled = ((tmp & ACCEL_Z_STB_EN_MASK) != 0);
+        return true;
+    }
+    
+    return false;
+}
+
+bool MPU6050::setAccelZStandbyEnabled(bool enabled, float timeout_secs)
+{
+    uint8_t tmp;
+    if (this->read(REG_PWR_MGMT_2, &tmp, timeout_secs))
+    {
+        tmp &= ~(ACCEL_Z_STB_EN_MASK);
+        return this->write(REG_PWR_MGMT_2, enabled ? (tmp | ACCEL_Z_STB_EN_MASK) : tmp, timeout_secs);
+    }
+    return false;
+}
+
+bool MPU6050::getFIFOCount(uint16_t *count, float timeout_secs)
+{
+    uint8_t tmp[2];
+    if (this->read(REG_FIFO_COUNTH, tmp, 2, timeout_secs))
+    {
+        *count = (((int16_t)tmp[0]) << 8) | tmp[1];        
+        return true;
+    }
+    
+    return false;    
+}
+
+bool MPU6050::readFIFO(uint8_t *data, float timeout_secs)
+{
+    return this->read(REG_FIFO_R_W, data, timeout_secs);
+}
+
+bool MPU6050::writeFIFO(uint8_t data, float timeout_secs)
+{
+    return this->write(REG_FIFO_R_W, data, timeout_secs);
+}
+
+bool MPU6050::readFIFO(uint8_t *data, size_t lenght, float timeout_secs)
+{
+    return this->read(REG_FIFO_R_W, data, lenght, timeout_secs);
+}
+
+bool MPU6050::writeFIFO(uint8_t data, size_t lenght, float timeout_secs)
+{
+    return this->write(REG_FIFO_R_W, data, lenght, timeout_secs);
+}
+
+bool MPU6050::getDeviceId(uint8_t *id, float timeout_secs)
+{
+    
+    uint8_t tmp;
+    if (this->read(REG_WHO_AM_I, &tmp, timeout_secs))
+    {
+        *id = tmp & DEVICE_ID_MASK;
+        return true;
+    }
+    
+    return false;
 }
\ No newline at end of file
--- a/MPU6050.h	Mon Jul 13 15:23:35 2015 +0000
+++ b/MPU6050.h	Wed Jul 22 12:20:10 2015 +0000
@@ -271,14 +271,82 @@
         static const uint8_t ACCEL_PATH_RESET_MASK  = BYTE(00000010);
         static const uint8_t TEMP_PATH_RESET_MASK   = BYTE(00000001);
         
+        static const uint8_t POWER_ON_DELAY_MASK    = BYTE(00110000);
+        enum PowerOnDelay
+        {
+            POWER_ON_DELAY_0MS                      = BYTE(00000000),
+            POWER_ON_DELAY_1MS                      = BYTE(00010000),
+            POWER_ON_DELAY_2MS                      = BYTE(00100000),
+            POWER_ON_DELAY_3MS                      = BYTE(00110000)
+        };
+        
+        static const uint8_t FF_DETECTION_DEC_MASK  = BYTE(00001100);
+        enum FreefallDetectionDecrement
+        {
+            FF_DETECTION_DEC_RESET                  = BYTE(00000000),
+            FF_DETECTION_DEC_1                      = BYTE(00000100),
+            FF_DETECTION_DEC_2                      = BYTE(00001000),
+            FF_DETECTION_DEC_4                      = BYTE(00001100)
+        };
+        
+        static const uint8_t MOT_DETECTION_DEC_MASK = BYTE(00000011);
+        enum MotionDetectionDecrement
+        {
+            MOT_DETECTION_DEC_RESET                 = BYTE(00000000),
+            MOT_DETECTION_DEC_1                     = BYTE(00000001),
+            MOT_DETECTION_DEC_2                     = BYTE(00000010),
+            MOT_DETECTION_DEC_4                     = BYTE(00000011)
+        };
+        
+        static const uint8_t FIFO_EN_MASK           = BYTE(01000000);
+        static const uint8_t FIFO_RESET_MASK        = BYTE(00000100);
+        static const uint8_t SIG_COND_RESET_MASK    = BYTE(00000001);
+        
+        static const uint8_t RESET_MASK             = BYTE(10000000);
+        static const uint8_t SLEEP_EN_MASK          = BYTE(01000000);
+        static const uint8_t WAKE_CYCLE_EN_MASK     = BYTE(00100000);
+        static const uint8_t TEMP_EN_MASK           = BYTE(00001000);
+        
+        static const uint8_t CLOCK_SOURCE_MASK      = BYTE(00000111);
+        enum ClockSource
+        {
+            CLOCK_SRC_INTERNAL_8MHZ                 = BYTE(00000000),
+            CLOCK_SRC_PLL_GYRO_X_REF                = BYTE(00000001),
+            CLOCK_SRC_PLL_GYRO_Y_REF                = BYTE(00000010),
+            CLOCK_SRC_PLL_GYRO_Z_REF                = BYTE(00000011),
+            CLOCK_SRC_EXTERNAL_32KHZ                = BYTE(00000100),
+            CLOCK_SRC_EXTERNAL_19MHZ                = BYTE(00000101),
+            CLOCK_SRC_KEEP_RESET                    = BYTE(00000111)
+        };
+        
+        static const uint8_t WAKE_FREQ_MASK         = BYTE(11000000);
+        enum WakeFrequency
+        {
+            WAKE_FREQ_1_25Hz                        = BYTE(00000000),
+            WAKE_FREQ_2_5Hz                         = BYTE(01000000),
+            WAKE_FREQ_5Hz                           = BYTE(10000000),
+            WAKE_FREQ_10HZ                          = BYTE(11000000)
+        };
+        
+        static const uint8_t ACCEL_X_STB_EN_MASK    = BYTE(00100000);
+        static const uint8_t ACCEL_Y_STB_EN_MASK    = BYTE(00010000);
+        static const uint8_t ACCEL_Z_STB_EN_MASK    = BYTE(00001000);
+        static const uint8_t GYRO_X_STB_EN_MASK     = BYTE(00000100);
+        static const uint8_t GYRO_Y_STB_EN_MASK     = BYTE(00000010);
+        static const uint8_t GYRO_Z_STB_EN_MASK     = BYTE(00000001);
+        
+        static const uint8_t DEVICE_ID_MASK         = BYTE(01111110);
+        
+        static const uint8_t MPU6050_ID             = BYTE(00110100);   // should be 0x34
+        
         /**
          * basic members
          */
         
         MPU6050(PinName sda, PinName scl, BaseAddress address = ADDRESS_0) : i2c(sda, scl), baseAddress(address)
-        { i2c.frequency(500); }
+        { }
         
-        BaseAddress getAddress() { return baseAddress; }         
+        BaseAddress getAddress() { return baseAddress; }   
         
         /**
          * REG_AUX_VDDIO register
@@ -306,13 +374,13 @@
         
         /**
          * REG_GYRO_CONFIG register
-         */         
+         */      
         
         bool        getGyroXSelfTestEnabled(bool *enabled,  float timeout_secs = defaultTimeout_secs);
         bool        setGyroXSelfTestEnabled(bool enabled,   float timeout_secs = defaultTimeout_secs);
         
         bool        getGyroYSelfTestEnabled(bool *enabled,  float timeout_secs = defaultTimeout_secs);
-        bool        setGyroYSelfTestEnabled(bool enabled,   float timeout_secs = defaultTimeout_secs);   
+        bool        setGyroYSelfTestEnabled(bool enabled,   float timeout_secs = defaultTimeout_secs);    
         
         bool        getGyroZSelfTestEnabled(bool *enabled,  float timeout_secs = defaultTimeout_secs);
         bool        setGyroZSelfTestEnabled(bool enabled,   float timeout_secs = defaultTimeout_secs); 
@@ -540,7 +608,97 @@
         bool        resetTemperatureSignalPath(float timeout_secs = defaultTimeout_secs);
                  
         /**
-         * Read and write registers
+         * REG_MOT_DETECT_CTRL register
+         */
+         
+        bool        getAccelerometerPowerOnDelay(PowerOnDelay* delay,    float timeout_secs = defaultTimeout_secs);
+        bool        setAccelerometerPowerOnDelay(PowerOnDelay delay,     float timeout_secs = defaultTimeout_secs);
+        
+        bool        getFreefallDetectionDecrement(FreefallDetectionDecrement* dec,  float timeout_secs = defaultTimeout_secs);
+        bool        setFreefallDetectionDecrement(FreefallDetectionDecrement dec,   float timeout_secs = defaultTimeout_secs);
+        
+        bool        getMotionDetectionDecrement(MotionDetectionDecrement* dec,  float timeout_secs = defaultTimeout_secs);
+        bool        setMotionDetectionDecrement(MotionDetectionDecrement dec,   float timeout_secs = defaultTimeout_secs);
+        
+        /**
+         * REG_USER_CTRL register
+         */
+         
+        bool        getFIFOEnabled(bool *enabled,   float timeout_secs = defaultTimeout_secs);
+        bool        setFIFOEnabled(bool enabled,    float timeout_secs = defaultTimeout_secs);
+        
+        bool        resetFIFO(float timeout_secs = defaultTimeout_secs);
+        
+        bool        resetSensors(float timeout_secs = defaultTimeout_secs);
+        
+        /**
+         * REG_PWR_MGMT_1 register
+         */
+         
+        bool        reset(float timeout_secs = defaultTimeout_secs);
+        
+        bool        getSleepEnabled(bool *enabled,  float timeout_secs = defaultTimeout_secs);
+        bool        setSleepEnabled(bool enabled,   float timeout_secs = defaultTimeout_secs);
+        
+        bool        getWakeCycleEnabled(bool *enabled,  float timeout_secs = defaultTimeout_secs);
+        bool        setWakeCycleEnabled(bool enabled,   float timeout_secs = defaultTimeout_secs);
+        
+        bool        getTemperatureSensorEnabled(bool *enabled,  float timeout_secs = defaultTimeout_secs);
+        bool        setTemperatureSensorEnabled(bool enabled,   float timeout_secs = defaultTimeout_secs);
+        
+        bool        getClockSource(ClockSource* clockSource,    float timeout_secs = defaultTimeout_secs);
+        bool        setClockSource(ClockSource clockSource,     float timeout_secs = defaultTimeout_secs);
+        
+        /**
+         * REG_PWR_MGMT_2 register
+         */
+        
+        bool        getWakeFrequency(WakeFrequency* wakeFrequency,  float timeout_secs = defaultTimeout_secs);
+        bool        setWakeFrequency(WakeFrequency wakeFrequency,   float timeout_secs = defaultTimeout_secs);
+        
+        bool        getGyroXStandbyEnabled(bool *enabled,   float timeout_secs = defaultTimeout_secs);
+        bool        setGyroXStandbyEnabled(bool enabled,    float timeout_secs = defaultTimeout_secs);
+        
+        bool        getGyroYStandbyEnabled(bool *enabled,   float timeout_secs = defaultTimeout_secs);
+        bool        setGyroYStandbyEnabled(bool enabled,    float timeout_secs = defaultTimeout_secs);
+        
+        bool        getGyroZStandbyEnabled(bool *enabled,   float timeout_secs = defaultTimeout_secs);
+        bool        setGyroZStandbyEnabled(bool enabled,    float timeout_secs = defaultTimeout_secs);
+        
+        bool        getAccelXStandbyEnabled(bool *enabled,  float timeout_secs = defaultTimeout_secs);
+        bool        setAccelXStandbyEnabled(bool enabled,   float timeout_secs = defaultTimeout_secs);
+        
+        bool        getAccelYStandbyEnabled(bool *enabled,  float timeout_secs = defaultTimeout_secs);
+        bool        setAccelYStandbyEnabled(bool enabled,   float timeout_secs = defaultTimeout_secs);
+        
+        bool        getAccelZStandbyEnabled(bool *enabled,  float timeout_secs = defaultTimeout_secs);
+        bool        setAccelZStandbyEnabled(bool enabled,   float timeout_secs = defaultTimeout_secs);
+        
+        /**
+         * REG_FIFO_COUNTH
+         * REG_FIFO_COUNTL registers
+         */
+         
+        bool        getFIFOCount(uint16_t *count,   float timeout_secs = defaultTimeout_secs);
+        
+        /**
+         * REG_FIFO_R_W register
+         */
+         
+        bool        readFIFO(uint8_t *data, float timeout_secs = defaultTimeout_secs);
+        bool        writeFIFO(uint8_t data, float timeout_secs = defaultTimeout_secs);
+        
+        bool        readFIFO(uint8_t *data,     size_t length,  float timeout_secs = defaultTimeout_secs);
+        bool        writeFIFO(uint8_t *data,    size_t length,  float timeout_secs = defaultTimeout_secs);
+        
+        /**
+         * REG_WHO_AM_I register
+         */
+         
+        bool        getDeviceId(uint8_t *id,    float timeout_secs = defaultTimeout_secs);
+         
+        /**
+         * read and write registers
          */
          
         bool        read(Register reg,  uint8_t *data,  float timeout_secs = defaultTimeout_secs);