/
platform_cf2.c
85 lines (75 loc) · 2.42 KB
/
platform_cf2.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/**
* || ____ _ __
* +------+ / __ )(_) /_______________ _____ ___
* | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
* +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
* || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
*
* Crazyflie control firmware
*
* Copyright (C) 2011-2018 Bitcraze AB
*
* 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, in version 3.
*
* 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/>.
*
* Platform functionality for the CF2 platform
*/
#define DEBUG_MODULE "PLATFORM"
#include <string.h>
#include "platform.h"
#include "exti.h"
#include "nvic.h"
#include "debug.h"
static platformConfig_t configs[] = {
{
.deviceType = "CF20",
.deviceTypeName = "Crazyflie 2.0",
.sensorImplementation = SensorImplementation_mpu9250_lps25h,
.physicalLayoutAntennasAreClose = true,
.motorMap = motorMapDefaultBrushed,
},
{
.deviceType = "CF21",
.deviceTypeName = "Crazyflie 2.1",
.sensorImplementation = SensorImplementation_bmi088_bmp388,
.physicalLayoutAntennasAreClose = false,
.motorMap = motorMapDefaultBrushed,
},
{ // Old ID of Crzyflie Bolt
.deviceType = "RZ10",
.deviceTypeName = "Crazyflie Bolt",
.sensorImplementation = SensorImplementation_bmi088_spi_bmp388,
.physicalLayoutAntennasAreClose = false,
.motorMap = motorMapBoltBrushless,
},
{
.deviceType = "CB10",
.deviceTypeName = "Crazyflie Bolt",
.sensorImplementation = SensorImplementation_bmi088_spi_bmp388,
.physicalLayoutAntennasAreClose = false,
.motorMap = motorMapBoltBrushless,
}
};
const platformConfig_t* platformGetListOfConfigurations(int* nrOfConfigs) {
*nrOfConfigs = sizeof(configs) / sizeof(platformConfig_t);
return configs;
}
void platformInitHardware() {
//Low level init: Clock and Interrupt controller
nvicInit();
//EXTI interrupts
extiInit();
}
// Config functions ------------------------
const char* platformConfigGetPlatformName() {
return "cf2";
}