2 * This file is part of INAV Project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
6 * You can obtain one at http://mozilla.org/MPL/2.0/.
8 * Alternatively, the contents of this file may be used under the terms
9 * of the GNU General Public License Version 3, as described below:
11 * This file is free software: you may copy, redistribute and/or modify
12 * it under the terms of the GNU General Public License as published by the
13 * Free Software Foundation, either version 3 of the License, or (at your
14 * option) any later version.
16 * This file is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
19 * Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program. If not, see http://www.gnu.org/licenses/.
29 #include "drivers/bus.h"
30 #include "drivers/io.h"
31 #include "drivers/pwm_mapping.h"
32 #include "drivers/timer.h"
33 #include "drivers/sensor.h"
35 BUSDEV_REGISTER_SPI_TAG(busdev_gyro1_mpu6000
, DEVHW_MPU6000
, GYRO1_SPI_BUS
, GYRO1_CS_PIN
, NONE
, 0, DEVFLAGS_NONE
, IMU_MPU6000_ALIGN
);
36 BUSDEV_REGISTER_SPI_TAG(busdev_gyro1_icm42688
, DEVHW_ICM42605
, GYRO1_SPI_BUS
, GYRO1_CS_PIN
, NONE
, 0, DEVFLAGS_NONE
, IMU_ICM42605_ALIGN
);
37 BUSDEV_REGISTER_SPI_TAG(busdev_gyro2_mpu6000
, DEVHW_MPU6000
, GYRO2_SPI_BUS
, GYRO2_CS_PIN
, NONE
, 1, DEVFLAGS_NONE
, IMU_MPU6000_ALIGN
);
38 BUSDEV_REGISTER_SPI_TAG(busdev_gyro2_icm42688
, DEVHW_ICM42605
, GYRO2_SPI_BUS
, GYRO2_CS_PIN
, NONE
, 1, DEVFLAGS_NONE
, IMU_ICM42605_ALIGN
);
40 timerHardware_t timerHardware
[] = {
41 DEF_TIM(TIM3
, CH3
, PB0
, TIM_USE_OUTPUT_AUTO
, 0, 0), // S1
42 DEF_TIM(TIM3
, CH4
, PB1
, TIM_USE_OUTPUT_AUTO
, 0, 1), // S2
44 DEF_TIM(TIM5
, CH1
, PA0
, TIM_USE_OUTPUT_AUTO
, 0, 2), // S3
45 DEF_TIM(TIM5
, CH2
, PA1
, TIM_USE_OUTPUT_AUTO
, 0, 3), // S4
46 DEF_TIM(TIM5
, CH3
, PA2
, TIM_USE_OUTPUT_AUTO
, 0, 4), // S5
47 DEF_TIM(TIM5
, CH4
, PA3
, TIM_USE_OUTPUT_AUTO
, 0, 5), // S6
49 DEF_TIM(TIM4
, CH1
, PD12
, TIM_USE_OUTPUT_AUTO
, 0, 6), // S7
50 DEF_TIM(TIM4
, CH2
, PD13
, TIM_USE_OUTPUT_AUTO
, 0, 7), // S8
51 DEF_TIM(TIM4
, CH3
, PD14
, TIM_USE_OUTPUT_AUTO
, 0, 0), // S9
52 DEF_TIM(TIM4
, CH4
, PD15
, TIM_USE_OUTPUT_AUTO
, 0, 0), // S10 DMA_NONE
54 DEF_TIM(TIM15
, CH1
, PE5
, TIM_USE_OUTPUT_AUTO
, 0, 0), // S11
55 DEF_TIM(TIM15
, CH2
, PE6
, TIM_USE_OUTPUT_AUTO
, 0, 0), // S12 DMA_NONE
57 DEF_TIM(TIM1
, CH1
, PA8
, TIM_USE_LED
, 0, 9), // RGB_LED
58 DEF_TIM(TIM2
, CH1
, PA15
, TIM_USE_BEEPER
, 0, 0), // BEEPER
61 const int timerHardwareCount
= sizeof(timerHardware
) / sizeof(timerHardware
[0]);