/*
AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
Copyright (C) 2016..2018 Thomas Schöpping et al.
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
(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 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 .
*/
#include
#if ((AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_USE_MPU6050)) || defined(__DOXYGEN__)
/******************************************************************************/
/* LOCAL DEFINITIONS */
/******************************************************************************/
/******************************************************************************/
/* EXPORTED VARIABLES */
/******************************************************************************/
/******************************************************************************/
/* LOCAL TYPES */
/******************************************************************************/
/******************************************************************************/
/* LOCAL VARIABLES */
/******************************************************************************/
/******************************************************************************/
/* LOCAL FUNCTIONS */
/******************************************************************************/
/******************************************************************************/
/* EXPORTED FUNCTIONS */
/******************************************************************************/
#include
#include
#include
#include
#include
aos_utresult_t utAlldMpu6050Func(BaseSequentialStream* stream, aos_unittest_t* ut)
{
aos_utresult_t result = {0, 0};
const mpu6050_lld_register_t addr = 0x75; // register to read from
uint16_t const data; // buffer for data
const uint8_t num = 1; // read one register
const apalTime_t timeout = 100; // TODO: Check units
mpu6050_lld_read_register(((ut_mpu6050data_t*)ut->data)->mpu, addr, &data, num, ((ut_mpu6050data_t*)ut->data)->timeout);
/** registers to read:
0x75: WHO AM I (should return I2C-Adress without the last bit, which is determined by the state of the AO pin!) returns 0x68
*/
return result; // TODO: Adjust
}
#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_USE_MPU6050) */