commit ed9a1bf53c3145e845296a606332dc10ee72ca76
Author: Thomas Schöpping <tschoepp@cit-ec.uni-bielefeld.de>
Date:   Tue Jun 23 16:47:35 2020 +0200

    MPU6050 driver reworked.
    Implementation is very rudimentary and incomplete yet.

diff --git a/drivers/MPU6050/v1/alld_MPU6050.c b/drivers/MPU6050/v1/alld_MPU6050.c
index 9b01e12..a1ce908 100644
--- a/drivers/MPU6050/v1/alld_MPU6050.c
+++ b/drivers/MPU6050/v1/alld_MPU6050.c
@@ -1,33 +1,25 @@
 /*
- * sd_hal_mpu6050.c
- *
- *  Created on: Feb 19, 2016
- *      Author: Sina Darvishi
- *  Edited on: Jan 15, 2019
- *      Editor: Simon Welzel
- */
+AMiRo-LLD is a compilation of low-level hardware drivers for the Autonomous Mini Robot (AMiRo) platform.
+Copyright (C) 2016..2020  Thomas Schöpping et al.
 
-/**
- * |----------------------------------------------------------------------
- * | Copyright (C) Sina Darvishi,2016
- * |
- * | This program is free software: you can redistribute it and/or modify
- * | it under the terms of the GNU General Public License as published by
- * | the Free Software Foundation, either version 3 of the License, or
- * | any later version.
- * |
- * | This program is distributed in the hope that it will be useful,
- * | but WITHOUT ANY WARRANTY; without even the implied warranty of
- * | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * | GNU General Public License for more details.
- * |
- * | You should have received a copy of the GNU General Public License
- * | along with this program.  If not, see <http://www.gnu.org/licenses/>.
- * |----------------------------------------------------------------------
- */
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
 
 #include <alld_MPU6050.h>
 
+#include <string.h>
+
 /******************************************************************************/
 /* LOCAL DEFINITIONS                                                          */
 /******************************************************************************/
@@ -52,7 +44,6 @@
 /* EXPORTED FUNCTIONS                                                         */
 /******************************************************************************/
 
-// from alld_ina219.c
 /**
  * @brief Read the value of one or more of the registers.
  * @param[in]   i2cd        i2c driver
@@ -63,13 +54,13 @@
  * @param[in]   timeout     timeout
  * @return                  An indicator whether the call was successfull
  */
-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_read_register(const MPU6050Driver* const mpu6050, const mpu6050_lld_register_t addr, uint8_t* const data, const uint8_t num, const apalTime_t timeout)
 {
-  apalDbgAssert(mpu6050 != 0);
-  apalDbgAssert(mpu6050->i2cd != 0);
-  apalDbgAssert(data != 0);
+  apalDbgAssert(mpu6050 != NULL);
+  apalDbgAssert(mpu6050->i2cd != NULL);
+  apalDbgAssert(data != NULL || num == 0);
 
-  return apalI2CMasterTransmit(mpu6050->i2cd, (MPU6050_LLD_I2C_ADDR_FIXED | mpu6050->addr), &addr, 1, data, num, timeout);
+  return apalI2CMasterTransmit(mpu6050->i2cd, (MPU6050_LLD_I2C_ADDR_FIXED | mpu6050->addr), (uint8_t*)&addr, 1, data, num, timeout);
 }
 
 /**
@@ -82,16 +73,14 @@ apalExitStatus_t mpu6050_lld_read_register(const MPU6050Driver* const mpu6050, c
  * @param[in]   timeout     timeout
  * @return                  An indicator whether the call was successfull
  */
-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)
+apalExitStatus_t mpu6050_lld_write_register(const MPU6050Driver* const mpu6050, const mpu6050_lld_register_t addr, const uint8_t* const data, const uint8_t num, const apalTime_t timeout)
 {
-  apalDbgAssert(mpu6050 != 0);
-  apalDbgAssert(mpu6050->i2cd != 0);
-  apalDbgAssert(data != 0);
+  apalDbgAssert(mpu6050 != NULL);
+  apalDbgAssert(mpu6050->i2cd != NULL);
+  apalDbgAssert(data != NULL || num == 0);
 
   uint8_t buffer[1+num];
   buffer[0] = addr;
-  for (uint8_t dataIdx = 0; dataIdx < num; dataIdx++) {
-    buffer[dataIdx+1] = data[dataIdx];
-  }
+  memcpy(&buffer[1], data, num);
   return apalI2CMasterTransmit(mpu6050->i2cd, (MPU6050_LLD_I2C_ADDR_FIXED | mpu6050->addr), buffer, 1+num, NULL, 0, timeout);
 }
