commit b6364b519575c41733beff4c8df8b935f373ee53
Author: Thomas Schöpping <tschoepp@cit-ec.uni-bielefeld.de>
Date:   Fri Feb 8 15:14:56 2019 +0100

    enhanced the MPU6050 driver (still very basic)

diff --git a/include/MPU6050/v1/alld_MPU6050_v1.h b/include/MPU6050/v1/alld_MPU6050_v1.h
index 16103f6..e60c1f6 100644
--- a/include/MPU6050/v1/alld_MPU6050_v1.h
+++ b/include/MPU6050/v1/alld_MPU6050_v1.h
@@ -40,14 +40,68 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #define MPU6050_LLD_I2C_MAXFREQUENCY    400000
 
-#define SD_MPU6050_DataRate_8KHz        0   /**< Sample rate set to 8 kHz */
-#define SD_MPU6050_DataRate_4KHz        1   /**< Sample rate set to 4 kHz */
-#define SD_MPU6050_DataRate_2KHz        3   /**< Sample rate set to 2 kHz */
-#define SD_MPU6050_DataRate_1KHz        7   /**< Sample rate set to 1 kHz */
-#define SD_MPU6050_DataRate_500Hz       15  /**< Sample rate set to 500 Hz */
-#define SD_MPU6050_DataRate_250Hz       31  /**< Sample rate set to 250 Hz */
-#define SD_MPU6050_DataRate_125Hz       63  /**< Sample rate set to 125 Hz */
-#define SD_MPU6050_DataRate_100Hz       79  /**< Sample rate set to 100 Hz */
+/* Default I2C address */
+#define MPU6050_LLD_I2C_ADDR_FIXED      0x68
+#define MPU6050_LLD_I2C_ADDR_AD0        0x01
+
+/* MPU6050 registers */
+#define MPU6050_LLD_AUX_VDDIO   0x01
+#define MPU6050_LLD_SMPLRT_DIV   0x19
+#define MPU6050_LLD_CONFIG    0x1A
+#define MPU6050_LLD_GYRO_CONFIG   0x1B
+#define MPU6050_LLD_ACCEL_CONFIG  0x1C
+#define MPU6050_LLD_MOTION_THRESH  0x1F
+#define MPU6050_LLD_INT_PIN_CFG   0x37
+#define MPU6050_LLD_INT_ENABLE   0x38
+#define MPU6050_LLD_INT_STATUS   0x3A
+#define MPU6050_LLD_ACCEL_XOUT_H  0x3B
+#define MPU6050_LLD_ACCEL_XOUT_L  0x3C
+#define MPU6050_LLD_ACCEL_YOUT_H  0x3D
+#define MPU6050_LLD_ACCEL_YOUT_L  0x3E
+#define MPU6050_LLD_ACCEL_ZOUT_H  0x3F
+#define MPU6050_LLD_ACCEL_ZOUT_L  0x40
+#define MPU6050_LLD_TEMP_OUT_H   0x41
+#define MPU6050_LLD_TEMP_OUT_L   0x42
+#define MPU6050_LLD_GYRO_XOUT_H   0x43
+#define MPU6050_LLD_GYRO_XOUT_L   0x44
+#define MPU6050_LLD_GYRO_YOUT_H   0x45
+#define MPU6050_LLD_GYRO_YOUT_L   0x46
+#define MPU6050_LLD_GYRO_ZOUT_H   0x47
+#define MPU6050_LLD_GYRO_ZOUT_L   0x48
+#define MPU6050_LLD_MOT_DETECT_STATUS 0x61
+#define MPU6050_LLD_SIGNAL_PATH_RESET 0x68
+#define MPU6050_LLD_MOT_DETECT_CTRL  0x69
+#define MPU6050_LLD_USER_CTRL   0x6A
+#define MPU6050_LLD_PWR_MGMT_1   0x6B
+#define MPU6050_LLD_PWR_MGMT_2   0x6C
+#define MPU6050_LLD_FIFO_COUNTH   0x72
+#define MPU6050_LLD_FIFO_COUNTL   0x73
+#define MPU6050_LLD_FIFO_R_W   0x74
+#define MPU6050_LLD_WHO_AM_I   0x75
+
+#define MPU6050_LLD_DataRate_8KHz        0   /**< Sample rate set to 8 kHz */
+#define MPU6050_LLD_DataRate_4KHz        1   /**< Sample rate set to 4 kHz */
+#define MPU6050_LLD_DataRate_2KHz        3   /**< Sample rate set to 2 kHz */
+#define MPU6050_LLD_DataRate_1KHz        7   /**< Sample rate set to 1 kHz */
+#define MPU6050_LLD_DataRate_500Hz       15  /**< Sample rate set to 500 Hz */
+#define MPU6050_LLD_DataRate_250Hz       31  /**< Sample rate set to 250 Hz */
+#define MPU6050_LLD_DataRate_125Hz       63  /**< Sample rate set to 125 Hz */
+#define MPU6050_LLD_DataRate_100Hz       79  /**< Sample rate set to 100 Hz */
+
+/* Who I am register value */
+#define MPU6050_I_AM    MPU6050_LLD_I2C_ADDR_FIXED
+
+/* Gyro sensitivities in degrees/s */
+#define MPU6050_LLD_GYRO_SENS_250  ((float) 131)
+#define MPU6050_LLD_GYRO_SENS_500  ((float) 65.5)
+#define MPU6050_LLD_GYRO_SENS_1000  ((float) 32.8)
+#define MPU6050_LLD_GYRO_SENS_2000  ((float) 16.4)
+
+/* Acce sensitivities in g/s */
+#define MPU6050_LLD_ACCE_SENS_2   ((float) 16384)
+#define MPU6050_LLD_ACCE_SENS_4   ((float) 8192)
+#define MPU6050_LLD_ACCE_SENS_8   ((float) 4096)
+#define MPU6050_LLD_ACCE_SENS_16  ((float) 2048)
 
 /******************************************************************************/
 /* SETTINGS                                                                   */
@@ -62,27 +116,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 /******************************************************************************/
 
 /**
- * @brief I2C address masks. TODO: Set to MPU6050 adresses!
- */
-enum {
-  MPU6050_LLD_I2C_ADDR_FIXED   = 0x0040u,
-  MPU6050_LLD_I2C_ADDR_A0      = 0x0001u,
-  MPU6050_LLD_I2C_ADDR_A1      = 0x0004u,
-};
-
-/**
- * @brief Registers. TODO: Adjust to MPU6050 registers
- */
-typedef enum {
-  MPU6050_LLD_REGISTER_CONFIGURATION = 0x00,
-  MPU6050_LLD_REGISTER_SHUNT_VOLTAGE = 0x01,
-  MPU6050_LLD_REGISTER_BUS_VOLTAGE   = 0x02,
-  MPU6050_LLD_REGISTER_POWER         = 0x03,
-  MPU6050_LLD_REGISTER_CURRENT       = 0x04,
-  MPU6050_LLD_REGISTER_CALIBRATION   = 0x05,
-} mpu6050_lld_register_t;
-
-/**
  * @brief  MPU6050 can have 2 different slave addresses, depends on it's input AD0 pin
  *         This feature allows you to use 2 different sensors with this library at the same time
  */
@@ -163,8 +196,6 @@ typedef union {
 typedef struct {
   apalI2CDriver_t* i2cd;
   apalI2Caddr_t addr;   /**<The address of the module for I2C communication */
-  uint16_t current_lsb_uA;
-  mpu6050_lld_cfg_t *config;
 } MPU6050Driver;
 
 /******************************************************************************/
@@ -178,8 +209,8 @@ typedef struct {
 #ifdef __cplusplus
 extern "C" {
 #endif
-  apalExitStatus_t mpu6050_lld_read_register(const MPU6050Driver* const mpu6050, const mpu6050_lld_register_t addr, uint16_t* const data, const uint8_t num, const apalTime_t timeout);
-  apalExitStatus_t mpu6050_lld_write_register(const MPU6050Driver* const mpu6050, const mpu6050_lld_register_t addr, const uint16_t* const data, const uint8_t num, const apalTime_t timeout);
+  apalExitStatus_t mpu6050_lld_read_register(const MPU6050Driver* const mpu6050, const uint8_t addr, uint8_t* const data, const uint8_t num, const apalTime_t timeout);
+  apalExitStatus_t mpu6050_lld_write_register(const MPU6050Driver* const mpu6050, const uint8_t addr, const uint8_t* const data, const uint8_t num, const apalTime_t timeout);
 #ifdef __cplusplus
 }
 #endif
