Merge pull request #10546 from iNavFlight/delta-formatting
[inav.git] / src / main / target / AOCODARCF7MINI / target.c
blob72140f50fac2f204c3732ade4848580d6114d1ee
1 /*
2 * @Author: g05047
3 * @Date: 2023-03-24 17:43:23
4 * @LastEditors: g05047
5 * @LastEditTime: 2023-05-11 15:49:30
6 * @Description: file content
7 */
8 /*
9 * This file is part of INAV.
11 * INAV is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation, either version 3 of the License, or
14 * (at your option) any later version.
16 * INAV is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with INAV. If not, see <http://www.gnu.org/licenses/>.
25 #include <stdint.h>
27 #include "platform.h"
29 #include "drivers/bus.h"
30 #include "drivers/io.h"
31 #include "drivers/pwm_mapping.h"
32 #include "drivers/timer.h"
33 #include "drivers/pinio.h"
34 #include "drivers/sensor.h"
36 BUSDEV_REGISTER_SPI_TAG(busdev_mpu6500, DEVHW_MPU6500, MPU6500_SPI_BUS, MPU6500_CS_PIN, NONE, 0, DEVFLAGS_NONE, IMU_MPU6500_ALIGN);
37 BUSDEV_REGISTER_SPI_TAG(busdev_mpu6000, DEVHW_MPU6000, MPU6000_SPI_BUS, MPU6000_CS_PIN, NONE, 0, DEVFLAGS_NONE, IMU_MPU6000_ALIGN);
39 timerHardware_t timerHardware[] = {
40 // DEF_TIM(TIM1, CH3, PA10, TIM_USE_PPM, 0, 0), // PPM, RX1
42 DEF_TIM(TIM3, CH1, PB4, TIM_USE_OUTPUT_AUTO, 0, 0), // S1 D(1, 4, 5)
43 DEF_TIM(TIM3, CH2, PB5, TIM_USE_OUTPUT_AUTO, 0, 0), // S2 D(1, 5, 4)
44 DEF_TIM(TIM3, CH3, PB0, TIM_USE_OUTPUT_AUTO, 0, 0), // S3 D(1, 7, 5)
45 DEF_TIM(TIM3, CH4, PB1, TIM_USE_OUTPUT_AUTO, 0, 0), // S4 D(1, 2, 5)
47 #if defined(AOCODARCF7MINI_V2)
48 DEF_TIM(TIM8, CH3, PC8, TIM_USE_OUTPUT_AUTO, 0, 0), // S5 D(2, 4, 7)
49 DEF_TIM(TIM8, CH4, PC9, TIM_USE_OUTPUT_AUTO, 0, 0), // S6 D(2, 7, 7)
50 DEF_TIM(TIM4, CH1, PB6, TIM_USE_OUTPUT_AUTO, 0, 0), // S7 D(1, 0, 2)
51 #else
52 DEF_TIM(TIM4, CH1, PB6, TIM_USE_OUTPUT_AUTO, 0, 0), // S5
53 DEF_TIM(TIM2, CH2, PB3, TIM_USE_OUTPUT_AUTO, 0, 0), // S6 D(1, 6, 3)
54 DEF_TIM(TIM2, CH1, PA15, TIM_USE_OUTPUT_AUTO, 0, 0), // S7
55 #endif
57 DEF_TIM(TIM4, CH2, PB7, TIM_USE_OUTPUT_AUTO, 0, 0), // S8 D(1, 3, 2)
59 DEF_TIM(TIM1, CH1, PA8, TIM_USE_LED, 0, 0), // LED
64 const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]);