2 * This file is part of Cleanflight.
4 * Cleanflight is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * Cleanflight is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
22 #include "drivers/io.h"
23 #include "drivers/pwm_mapping.h"
24 #include "drivers/timer.h"
26 const timerHardware_t timerHardware
[USABLE_TIMER_CHANNEL_COUNT
] = {
27 { TIM15
, IO_TAG(PA3
), TIM_Channel_2
, 1, IOCFG_AF_PP
, GPIO_AF_9
, TIM_USE_PWM
| TIM_USE_PPM
}, // PWM1 / PPM / UART2 RX
28 { TIM15
, IO_TAG(PA2
), TIM_Channel_1
, 1, IOCFG_AF_PP
, GPIO_AF_9
, TIM_USE_PWM
}, // PWM2
30 { TIM3
, IO_TAG(PB1
), TIM_Channel_4
, 1, IOCFG_AF_PP
, GPIO_AF_2
, TIM_USE_MC_MOTOR
| TIM_USE_FW_SERVO
}, // ESC1
31 { TIM3
, IO_TAG(PC7
), TIM_Channel_2
, 1, IOCFG_AF_PP
, GPIO_AF_2
, TIM_USE_MC_MOTOR
| TIM_USE_FW_SERVO
}, // ESC2
32 { TIM3
, IO_TAG(PB0
), TIM_Channel_3
, 1, IOCFG_AF_PP
, GPIO_AF_2
, TIM_USE_MC_MOTOR
| TIM_USE_FW_SERVO
}, // ESC3
33 { TIM3
, IO_TAG(PC6
), TIM_Channel_1
, 1, IOCFG_AF_PP
, GPIO_AF_2
, TIM_USE_MC_MOTOR
| TIM_USE_FW_SERVO
}, // ESC4
35 { TIM8
, IO_TAG(PC8
), TIM_Channel_3
, 1, IOCFG_AF_PP
, GPIO_AF_2
, TIM_USE_MC_MOTOR
| TIM_USE_FW_MOTOR
}, // ESC5 (FW motor)
36 { TIM8
, IO_TAG(PC9
), TIM_Channel_4
, 1, IOCFG_AF_PP
, GPIO_AF_2
, TIM_USE_MC_MOTOR
| TIM_USE_FW_MOTOR
}, // ESC6 (FW motor)
38 { TIM2
, IO_TAG(PB10
), TIM_Channel_3
, 1, IOCFG_AF_PP
, GPIO_AF_1
, TIM_USE_PWM
}, // PWM3 - PB10 - *TIM2_CH3, UART3_TX (AF7)
39 { TIM2
, IO_TAG(PB11
), TIM_Channel_4
, 1, IOCFG_AF_PP
, GPIO_AF_1
, TIM_USE_PWM
}, // PWM4 - PB11 - *TIM2_CH4, UART3_RX (AF7)
41 // with DSHOT DMA1-CH3 conflicts with TIM3_CH4 / ESC1.
42 //{ TIM16, IO_TAG(PB8), TIM_Channel_1, 1, IOCFG_AF_PP, GPIO_AF_1 }, // What's PB8 ???
44 { TIM1
, IO_TAG(PA8
), TIM_Channel_1
, 1, IOCFG_AF_PP
, GPIO_AF_6
, TIM_USE_LED
}