amiro-os / modules / RT-STM32L476RG-NUCLEO64 / module.c @ 1678f270
History | View | Annotate | Download (2.852 KB)
| 1 |
/*
|
|---|---|
| 2 |
AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
|
| 3 |
Copyright (C) 2016..2018 Thomas Schöpping et al.
|
| 4 |
|
| 5 |
This program is free software: you can redistribute it and/or modify
|
| 6 |
it under the terms of the GNU General Public License as published by
|
| 7 |
the Free Software Foundation, either version 3 of the License, or
|
| 8 |
(at your option) any later version.
|
| 9 |
|
| 10 |
This program is distributed in the hope that it will be useful,
|
| 11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 13 |
GNU General Public License for more details.
|
| 14 |
|
| 15 |
You should have received a copy of the GNU General Public License
|
| 16 |
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 17 |
*/
|
| 18 |
|
| 19 |
/**
|
| 20 |
* @file
|
| 21 |
* @brief Structures and constant for the PowerManagement module.
|
| 22 |
*
|
| 23 |
* @addtogroup powermanagement_module
|
| 24 |
* @{
|
| 25 |
*/
|
| 26 |
|
| 27 |
#include "module.h" |
| 28 |
|
| 29 |
#include <amiroos.h> |
| 30 |
|
| 31 |
/*===========================================================================*/
|
| 32 |
/**
|
| 33 |
* @name Module specific functions
|
| 34 |
* @{
|
| 35 |
*/
|
| 36 |
/*===========================================================================*/
|
| 37 |
|
| 38 |
/** @} */
|
| 39 |
|
| 40 |
/*===========================================================================*/
|
| 41 |
/**
|
| 42 |
* @name ChibiOS/HAL configuration
|
| 43 |
* @{
|
| 44 |
*/
|
| 45 |
/*===========================================================================*/
|
| 46 |
|
| 47 |
CANConfig moduleHalCanConfig = {
|
| 48 |
/* mcr */ CAN_MCR_ABOM | CAN_MCR_AWUM | CAN_MCR_TXFP,
|
| 49 |
/* btr */ CAN_BTR_SJW(1) | CAN_BTR_TS2(3) | CAN_BTR_TS1(15) | CAN_BTR_BRP(1), |
| 50 |
}; |
| 51 |
|
| 52 |
SerialConfig moduleHalProgIfConfig = {
|
| 53 |
/* bit rate */ 115200, |
| 54 |
/* CR1 */ 0, |
| 55 |
/* CR1 */ 0, |
| 56 |
/* CR1 */ 0, |
| 57 |
}; |
| 58 |
|
| 59 |
/** @} */
|
| 60 |
|
| 61 |
|
| 62 |
/*===========================================================================*/
|
| 63 |
/**
|
| 64 |
* @name AMiRo-OS core configurations
|
| 65 |
* @{
|
| 66 |
*/
|
| 67 |
/*===========================================================================*/
|
| 68 |
|
| 69 |
#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__) |
| 70 |
ROMCONST char* moduleShellPrompt = "STM32L476-DevBoard"; |
| 71 |
#endif
|
| 72 |
|
| 73 |
|
| 74 |
MPU6050Driver moduleLldMpu6050 = {
|
| 75 |
/* I2C Driver */ &MODULE_HAL_I2C_MPU6050,
|
| 76 |
/* I²C address */ 0x68, |
| 77 |
/* current LSB (uA) */ 0x00u, |
| 78 |
/* configuration */ NULL, |
| 79 |
}; |
| 80 |
|
| 81 |
/* MPU6050 */
|
| 82 |
static int _utShellCmdCb_AlldMpu6050(BaseSequentialStream* stream, int argc, char* argv[]) |
| 83 |
{
|
| 84 |
(void)argc;
|
| 85 |
(void)argv;
|
| 86 |
aosUtRun(stream, &moduleUtAlldMpu6050, NULL);
|
| 87 |
return AOS_OK;
|
| 88 |
} |
| 89 |
|
| 90 |
static ut_mpu6050data_t _utAlldMpu6050Data = {
|
| 91 |
/* driver */ &moduleLldMpu6050,
|
| 92 |
/* timeout */ MICROSECONDS_PER_SECOND,
|
| 93 |
}; |
| 94 |
aos_unittest_t moduleUtAlldMpu6050 = {
|
| 95 |
/* name */ "MPU6050", |
| 96 |
/* info */ "accelerometer and gyroscope", |
| 97 |
/* test function */ utAlldMpu6050Func,
|
| 98 |
/* shell command */ {
|
| 99 |
/* name */ "unittest:Accelerometer&Gyroscope", |
| 100 |
/* callback */ _utShellCmdCb_AlldMpu6050,
|
| 101 |
/* next */ NULL, |
| 102 |
}, |
| 103 |
/* data */ &_utAlldMpu6050Data
|
| 104 |
}; |
| 105 |
|
| 106 |
/** @} */
|