Skip to content

Commit

Permalink
Refactor some targets [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalentity committed Sep 17, 2018
1 parent 1b91a27 commit 6ebec53
Show file tree
Hide file tree
Showing 32 changed files with 217 additions and 321 deletions.
26 changes: 14 additions & 12 deletions src/main/target/AIRBOTF4/target.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,20 @@
#include "drivers/bus.h"

const timerHardware_t timerHardware[] = {
{ TIM12, IO_TAG(PB14), TIM_Channel_1, 0, IOCFG_AF_PP_PD, GPIO_AF_TIM12, TIM_USE_PPM | TIM_USE_PWM }, // PPM / S.BUS input, above MOTOR1
{ TIM12, IO_TAG(PB15), TIM_Channel_2, 0, IOCFG_AF_PP_PD, GPIO_AF_TIM12, 0 }, // Connected: small CH2 pad, not used as PWM, definition inherited from REVO target - GPIO_PartialRemap_TIM3
{ TIM8, IO_TAG(PC6), TIM_Channel_1, 0, IOCFG_AF_PP_PD, GPIO_AF_TIM8, 0 }, // Connected: UART6 TX, not used as PWM, definition inherited from REVO target
{ TIM8, IO_TAG(PC7), TIM_Channel_2, 0, IOCFG_AF_PP_PD, GPIO_AF_TIM8, 0 }, // Connected: UART6 RX, not used as PWM, definition inherited from REVO target
{ TIM8, IO_TAG(PC8), TIM_Channel_3, 0, IOCFG_AF_PP_PD, GPIO_AF_TIM8, 0 }, // Connected: small CH5 pad, not used as PWM, definition inherited from REVO target
{ TIM8, IO_TAG(PC9), TIM_Channel_4, 0, IOCFG_AF_PP_PD, GPIO_AF_TIM8, 0 }, // Connected: small CH6 pad, not used as PWM, definition inherited from REVO target
{ TIM3, IO_TAG(PB0), TIM_Channel_3, 1, IOCFG_AF_PP_PD, GPIO_AF_TIM3, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR }, // MOTOR_1
{ TIM3, IO_TAG(PB1), TIM_Channel_4, 1, IOCFG_AF_PP_PD, GPIO_AF_TIM3, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR }, // MOTOR_2
{ TIM9, IO_TAG(PA3), TIM_Channel_2, 1, IOCFG_AF_PP_PD, GPIO_AF_TIM9, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // MOTOR_3
{ TIM2, IO_TAG(PA2), TIM_Channel_3, 1, IOCFG_AF_PP_PD, GPIO_AF_TIM2, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // MOTOR_4
{ TIM5, IO_TAG(PA1), TIM_Channel_2, 1, IOCFG_AF_PP_PD, GPIO_AF_TIM5, TIM_USE_MC_MOTOR | TIM_USE_MC_SERVO | TIM_USE_FW_SERVO }, // MOTOR_5 - GPIO_PartialRemap_TIM3
{ TIM1, IO_TAG(PA8), TIM_Channel_1, 1, IOCFG_AF_PP_PD, GPIO_AF_TIM1, TIM_USE_MC_MOTOR | TIM_USE_MC_SERVO | TIM_USE_FW_SERVO }, // MOTOR_6
DEF_TIM(TIM3, CH3, PB0, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR, 0, 0), // S1_OUT D1_ST7
DEF_TIM(TIM3, CH4, PB1, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR, 0, 0), // S2_OUT D1_ST2
DEF_TIM(TIM2, CH4, PA3, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO, 0, 1), // S3_OUT D1_ST6
DEF_TIM(TIM2, CH3, PA2, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO, 0, 0), // S4_OUT D1_ST1
DEF_TIM(TIM5, CH2, PA1, TIM_USE_MC_MOTOR | TIM_USE_MC_SERVO | TIM_USE_FW_SERVO | TIM_USE_ANY, 0, 0), // S5_OUT / LED
DEF_TIM(TIM1, CH1, PA8, TIM_USE_MC_MOTOR | TIM_USE_MC_SERVO | TIM_USE_FW_SERVO, 0, 0), // S6_OUT
DEF_TIM(TIM4, CH1, PB6, TIM_USE_ANY, 0, 0), // LED D1_ST0, n/a on older AIRBOTF4

DEF_TIM(TIM12, CH1, PB14, TIM_USE_PWM | TIM_USE_PPM, 0, 0), // PPM (5th pin on FlexiIO port)
DEF_TIM(TIM12, CH2, PB15, TIM_USE_PWM, 0, 0), // S2_IN
DEF_TIM(TIM8, CH1, PC6, TIM_USE_PWM | TIM_USE_FW_SERVO, 0, 0), // S3_IN
DEF_TIM(TIM8, CH2, PC7, TIM_USE_PWM | TIM_USE_FW_SERVO, 0, 0), // S4_IN
DEF_TIM(TIM8, CH3, PC8, TIM_USE_PWM | TIM_USE_FW_SERVO, 0, 0), // S5_IN
DEF_TIM(TIM8, CH4, PC9, TIM_USE_PWM | TIM_USE_FW_SERVO, 0, 0), // S6_IN
};

const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]);
5 changes: 0 additions & 5 deletions src/main/target/AIRBOTF4/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,7 @@
#define SENSORS_SET (SENSOR_ACC|SENSOR_MAG|SENSOR_BARO)

#define USE_LED_STRIP
// LED Strip can run off Pin 5 (PA1) of the MOTOR outputs.
#define WS2811_GPIO_AF GPIO_AF_TIM5
#define WS2811_PIN PA1
#define WS2811_DMA_STREAM DMA1_Stream4
#define WS2811_DMA_CHANNEL DMA_Channel_6
#define WS2811_DMA_HANDLER_IDENTIFER DMA1_ST4_HANDLER

#define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT

Expand Down
34 changes: 19 additions & 15 deletions src/main/target/AIRHEROF3/target.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,28 @@
#include "drivers/bus.h"

const timerHardware_t timerHardware[] = {
{ TIM2, IO_TAG(PA0), TIM_Channel_1, 0, IOCFG_AF_PP, GPIO_AF_1, TIM_USE_PPM | TIM_USE_PWM }, // PWM1 - RC1
{ TIM2, IO_TAG(PA1), TIM_Channel_2, 0, IOCFG_AF_PP, GPIO_AF_1, TIM_USE_PWM }, // PWM2 - RC2
{ TIM2, IO_TAG(PA2), TIM_Channel_3, 0, IOCFG_AF_PP, GPIO_AF_1, TIM_USE_PWM }, // PWM3 - RC3
{ TIM2, IO_TAG(PA3), TIM_Channel_4, 0, IOCFG_AF_PP, GPIO_AF_1, TIM_USE_PWM }, // PWM4 - RC4
{ TIM3, IO_TAG(PA6), TIM_Channel_1, 0, IOCFG_AF_PP, GPIO_AF_2, TIM_USE_PWM }, // PWM5 - RC5
{ TIM3, IO_TAG(PA7), TIM_Channel_2, 0, IOCFG_AF_PP, GPIO_AF_2, TIM_USE_PWM }, // PWM6 - RC6
DEF_TIM(TIM2, CH1, PA0, TIM_USE_PPM | TIM_USE_PWM, 0),
DEF_TIM(TIM2, CH2, PA1, TIM_USE_PWM, 0),
DEF_TIM(TIM2, CH3, PA2, TIM_USE_PWM, 0),
DEF_TIM(TIM2, CH4, PA3, TIM_USE_PWM, 0),
DEF_TIM(TIM3, CH1, PA6, TIM_USE_PWM | TIM_USE_ANY, 0),
DEF_TIM(TIM3, CH2, PA7, TIM_USE_PWM, 0),

//{ TIM3, IO_TAG(PB0), TIM_Channel_3, 0, IOCFG_AF_PP, GPIO_AF_2}, // PWM7 - not broken out
//{ TIM3, IO_TAG(PB1), TIM_Channel_4, 0, IOCFG_AF_PP, GPIO_AF_2}, // PWM8 - not broken out

{ TIM1, IO_TAG(PA8), TIM_Channel_1, 1, IOCFG_AF_PP, GPIO_AF_6, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR }, // PWM9 - OUT1
{ TIM1, IO_TAG(PA11), TIM_Channel_4, 1, IOCFG_AF_PP, GPIO_AF_11, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR }, // PWM10 - OUT2
{ TIM8, IO_TAG(PB6), TIM_Channel_1, 1, IOCFG_AF_PP, GPIO_AF_5, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // PWM11 - OUT3
{ TIM4, IO_TAG(PB7), TIM_Channel_2, 1, IOCFG_AF_PP, GPIO_AF_2, TIM_USE_MC_MOTOR | TIM_USE_MC_SERVO | TIM_USE_FW_SERVO }, // PWM12 - OUT4
#if 1
DEF_TIM(TIM1, CH1, PA8, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR, 0), // DMA1_CH2
DEF_TIM(TIM1, CH4, PA11, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR, 0), // DMA1_CH4
DEF_TIM(TIM8, CH1, PB6, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO, 0), // DMA2_CH3
DEF_TIM(TIM4, CH2, PB7, TIM_USE_MC_MOTOR | TIM_USE_MC_SERVO | TIM_USE_FW_SERVO, 0), // DMA1_CH4 - conflict with TIM1_CH4
#else
DEF_TIM(TIM1, CH1, PA8, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR, 0), // DMA1_CH2
DEF_TIM(TIM4, CH1, PA11, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO, 0), // DMA1_CH1
DEF_TIM(TIM8, CH1, PB6, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO, 0), // DMA2_CH3
DEF_TIM(TIM4, CH2, PB7, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO, 0), // DMA1_CH4
#endif

#if !defined(AIRHEROF3_QUAD)
{ TIM8, IO_TAG(PB8), TIM_Channel_2, 1, IOCFG_AF_PP, GPIO_AF_10, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // PWM13 - OUT5
{ TIM8, IO_TAG(PB9), TIM_Channel_3, 1, IOCFG_AF_PP, GPIO_AF_10, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO } // PWM14 - OUT6
DEF_TIM(TIM8, CH2, PB8, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO, 0), // DMA2_CH5
DEF_TIM(TIM8, CH3, PB9, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO, 0), // DMA2_CH1
#endif
};

Expand Down
4 changes: 0 additions & 4 deletions src/main/target/AIRHEROF3/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,7 @@

/*
#define USE_LED_STRIP
#define WS2811_TIMER TIM3
#define WS2811_PIN PA6
#define WS2811_DMA_CHANNEL DMA1_Channel6
#define WS2811_DMA_TC_FLAG DMA1_FLAG_TC6
#define WS2811_DMA_HANDLER_IDENTIFER DMA1_CH6_HANDLER
*/

#define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_VBAT | FEATURE_SOFTSERIAL)
Expand Down
23 changes: 11 additions & 12 deletions src/main/target/ALIENFLIGHTF3/target.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,18 @@

const timerHardware_t timerHardware[] = {
// up to 10 Motor Outputs
{ TIM15, IO_TAG(PB15), TIM_Channel_2, 1, IOCFG_AF_PP, GPIO_AF_1, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR }, // PWM1 - PB15 - TIM1_CH3N, TIM15_CH1N, *TIM15_CH2
{ TIM15, IO_TAG(PB14), TIM_Channel_1, 1, IOCFG_AF_PP, GPIO_AF_1, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR }, // PWM2 - PB14 - TIM1_CH2N, *TIM15_CH1
{ TIM1, IO_TAG(PA8), TIM_Channel_1, 1, IOCFG_AF_PP, GPIO_AF_6, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // PWM3 - PA8 - *TIM1_CH1, TIM4_ETR
{ TIM3, IO_TAG(PB0), TIM_Channel_3, 0, IOCFG_AF_PP, GPIO_AF_2, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // PWM4 - PB0 - *TIM3_CH3, TIM1_CH2N, TIM8_CH2N
{ TIM3, IO_TAG(PA6), TIM_Channel_1, 0, IOCFG_AF_PP, GPIO_AF_2, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // PWM5 - PA6 - *TIM3_CH1, TIM8_BKIN, TIM1_BKIN, TIM16_CH1
{ TIM2, IO_TAG(PA2), TIM_Channel_3, 0, IOCFG_AF_PP, GPIO_AF_1, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // PWM6 - PA2 - *TIM2_CH3, !TIM15_CH1
{ TIM3, IO_TAG(PB1), TIM_Channel_4, 0, IOCFG_AF_PP, GPIO_AF_2, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // PWM7 - PB1 - *TIM3_CH4, TIM1_CH3N, TIM8_CH3N
{ TIM17, IO_TAG(PA7), TIM_Channel_1, 1, IOCFG_AF_PP, GPIO_AF_1, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // PWM8 - PA7 - !TIM3_CH2, *TIM17_CH1, TIM1_CH1N, TIM8_CH1
{ TIM3, IO_TAG(PA4), TIM_Channel_2, 0, IOCFG_AF_PP, GPIO_AF_2, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // PWM9 - PA4 - *TIM3_CH2
{ TIM2, IO_TAG(PA1), TIM_Channel_2, 0, IOCFG_AF_PP, GPIO_AF_1, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // PWM10 - PA1 - *TIM2_CH2, TIM15_CH1N
DEF_TIM(TIM1, CH3N, PB15, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR, 0), // PWM1 - PB15 - NONE
DEF_TIM(TIM15, CH1, PB14, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR, 0), // PWM2 - PB14 - DMA1_CH5
DEF_TIM(TIM1, CH1, PA8, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO, 0), // PWM3 - PA8 - DMA1_CH2
DEF_TIM(TIM8, CH2N, PB0, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO, 0), // PWM4 - PB0 - DMA2_CH5
DEF_TIM(TIM16, CH1, PA6, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO, 0), // PWM5 - PA6 - DMA1_CH3
DEF_TIM(TIM2, CH3, PA2, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO, 0), // PWM6 - PA2 - DMA1_CH1
DEF_TIM(TIM8, CH3N, PB1, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO, 0), // PWM7 - PB1 - DMA2_CH1
DEF_TIM(TIM17, CH1, PA7, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO | TIM_USE_ANY, 0), // PWM8 - PA7 - DMA1_CH7
DEF_TIM(TIM3, CH2, PA4, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO, 0), // PWM9 - PA4 - DMA_NONE
DEF_TIM(TIM2, CH2, PA1, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO, 0), // PWM10 - PA1 - DMA1_CH7

// PPM PORT - Also USART2 RX (AF5)
{ TIM2, IO_TAG(PA3), TIM_Channel_4, 0, IOCFG_AF_PP_PD, GPIO_AF_1, TIM_USE_PPM } // PPM - PA3 - TIM2_CH4, TIM15_CH2 - PWM13
DEF_TIM(TIM2, CH4, PA3, TIM_USE_PPM, 0), // PPM - PA3 - DMA1_CH7
};

const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]);
26 changes: 13 additions & 13 deletions src/main/target/ALIENFLIGHTF4/target.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@
#include "drivers/timer.h"

const timerHardware_t timerHardware[] = {
{ TIM1, IO_TAG(PA8), TIM_Channel_1, 0, IOCFG_IPD, GPIO_AF_TIM1, TIM_USE_PPM | TIM_USE_PWM }, // PWM1 - PA8 RC1
{ TIM3, IO_TAG(PB0), TIM_Channel_3, 0, IOCFG_IPD, GPIO_AF_TIM3, TIM_USE_PWM }, // PWM2 - PB0 RC2
{ TIM3, IO_TAG(PB1), TIM_Channel_4, 0, IOCFG_IPD, GPIO_AF_TIM3, TIM_USE_PWM }, // PWM3 - PB1 RC3
{ TIM1, IO_TAG(PB14), TIM_Channel_2, 0, IOCFG_IPD, GPIO_AF_TIM1, TIM_USE_PWM }, // PWM4 - PA14 RC4
{ TIM1, IO_TAG(PB15), TIM_Channel_3, 0, IOCFG_IPD, GPIO_AF_TIM1, TIM_USE_PWM }, // PWM5 - PA15 RC5
{ TIM4, IO_TAG(PB8), TIM_Channel_3, 1, IOCFG_AF_PP, GPIO_AF_TIM4, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR }, // PWM6 - PB8 OUT1
{ TIM4, IO_TAG(PB9), TIM_Channel_4, 1, IOCFG_AF_PP, GPIO_AF_TIM4, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR }, // PWM7 - PB9 OUT2
{ TIM5, IO_TAG(PA0), TIM_Channel_1, 1, IOCFG_AF_PP, GPIO_AF_TIM5, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // PWM8 - PA0 OUT3
{ TIM5, IO_TAG(PA1), TIM_Channel_2, 1, IOCFG_AF_PP, GPIO_AF_TIM5, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // PWM9 - PA1 OUT4
{ TIM8, IO_TAG(PC6), TIM_Channel_1, 1, IOCFG_AF_PP, GPIO_AF_TIM8, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // PWM10 - PC6 OUT5
{ TIM8, IO_TAG(PC7), TIM_Channel_2, 1, IOCFG_AF_PP, GPIO_AF_TIM8, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // PWM11 - PC7 OUT6
{ TIM8, IO_TAG(PC8), TIM_Channel_3, 1, IOCFG_AF_PP, GPIO_AF_TIM8, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // PWM13 - PC8 OUT7
{ TIM8, IO_TAG(PC9), TIM_Channel_4, 1, IOCFG_AF_PP, GPIO_AF_TIM8, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // PWM13 - PC9 OUT8
DEF_TIM(TIM1, CH1, PA8, TIM_USE_PWM | TIM_USE_PPM, 0, 1), // PWM1 - PA8 RC1 - DMA2_ST1
DEF_TIM(TIM3, CH3, PB0, TIM_USE_PWM, 0, 0), // PWM2 - PB0 RC2 - DMA1_ST5
DEF_TIM(TIM3, CH4, PB1, TIM_USE_PWM, 0, 0), // PWM3 - PB1 RC3 - DMA1_ST7
DEF_TIM(TIM1, CH2, PB14, TIM_USE_PWM, 0, 1), // PWM4 - PA14 RC4 - DMA2_ST2
DEF_TIM(TIM1, CH3, PB15, TIM_USE_PWM | TIM_USE_LED, 0, 0), // PWM5 - PA15 RC5 - DMA2_ST6
DEF_TIM(TIM4, CH3, PB8, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR, 0, 0), // PWM6 - PB8 OUT1 - DMA1_ST7
DEF_TIM(TIM4, CH4, PB9, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR, 0, 0), // PWM7 - PB9 OUT2 - DMA_NONE
DEF_TIM(TIM5, CH1, PA0, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO, 0, 0), // PWM8 - PA0 OUT3 - DMA1_ST2
DEF_TIM(TIM5, CH2, PA1, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO, 0, 0), // PWM9 - PA1 OUT4 - DMA1_ST4
DEF_TIM(TIM8, CH1, PC6, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO, 0, 0), // PWM10 - PC6 OUT5 - DMA2_ST2
DEF_TIM(TIM8, CH2, PC7, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO, 0, 0), // PWM11 - PC7 OUT6 - DMA2_ST3
DEF_TIM(TIM8, CH3, PC8, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO, 0, 1), // PWM13 - PC8 OUT7 - DMA2_ST4
DEF_TIM(TIM8, CH4, PC9, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO, 0, 0), // PWM13 - PC9 OUT8 - DMA2_ST7
};

const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]);
29 changes: 13 additions & 16 deletions src/main/target/ALIENFLIGHTNGF7/target.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,20 @@
#include "drivers/pwm_mapping.h"
#include "drivers/timer.h"

#define TIM_EN TIMER_OUTPUT_ENABLED
#define TIM_EN_N TIMER_OUTPUT_ENABLED | TIMER_OUTPUT_N_CHANNEL

const timerHardware_t timerHardware[] = {
{ TIM1, IO_TAG(PA8), TIM_CHANNEL_1, 0, IOCFG_AF_PP_PD, GPIO_AF1_TIM1, TIM_USE_PPM | TIM_USE_PWM | TIM_USE_LED }, // PWM1 - PA8 RC1
{ TIM3, IO_TAG(PB1), TIM_CHANNEL_4, 0, IOCFG_AF_PP_PD, GPIO_AF2_TIM3, TIM_USE_PWM | TIM_USE_MC_SERVO }, // PWM2 - PB1 RC2
{ TIM12, IO_TAG(PB15), TIM_CHANNEL_2, 0, IOCFG_AF_PP_PD, GPIO_AF9_TIM12, TIM_USE_PWM | TIM_USE_MC_SERVO }, // PWM3 - PA15 RC3
{ TIM4, IO_TAG(PB8), TIM_CHANNEL_3, 0, IOCFG_AF_PP_PD, GPIO_AF2_TIM4, TIM_USE_PWM | TIM_USE_MC_SERVO }, // PWM4 - PB8 RC4
{ TIM4, IO_TAG(PB9), TIM_CHANNEL_4, 0, IOCFG_AF_PP_PD, GPIO_AF2_TIM4, TIM_USE_PWM | TIM_USE_MC_SERVO }, // PWM5 - PB9 RC5
{ TIM8, IO_TAG(PC6), TIM_CHANNEL_1, TIM_EN, IOCFG_AF_PP_PD, GPIO_AF3_TIM8, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // PWM6 - PC6 OUT1
{ TIM8, IO_TAG(PC7), TIM_CHANNEL_2, TIM_EN, IOCFG_AF_PP_PD, GPIO_AF3_TIM8, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // PWM7 - PC7 OUT2
{ TIM12, IO_TAG(PB14), TIM_CHANNEL_1, TIM_EN, IOCFG_AF_PP_PD, GPIO_AF9_TIM12, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // PWM9 - PA14 OUT3
{ TIM3, IO_TAG(PB0), TIM_CHANNEL_3, TIM_EN, IOCFG_AF_PP_PD, GPIO_AF2_TIM3, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // PWM10 - PB0 OUT4
{ TIM5, IO_TAG(PA0), TIM_CHANNEL_1, TIM_EN, IOCFG_AF_PP_PD, GPIO_AF2_TIM5, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // PWM11 - PA0 OUT5
{ TIM5, IO_TAG(PA1), TIM_CHANNEL_2, TIM_EN, IOCFG_AF_PP_PD, GPIO_AF2_TIM5, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // PWM12 - PA1 OUT6
{ TIM8, IO_TAG(PC8), TIM_CHANNEL_3, TIM_EN, IOCFG_AF_PP_PD, GPIO_AF3_TIM8, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // PWM13 - PC8 OUT7
{ TIM8, IO_TAG(PC9), TIM_CHANNEL_4, TIM_EN, IOCFG_AF_PP_PD, GPIO_AF3_TIM8, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // PWM14 - PC9 OUT8
DEF_TIM(TIM1, CH1, PA8, TIM_USE_PPM | TIM_USE_LED, 0, 1), // PPM - DMA2_ST1
DEF_TIM(TIM8, CH1, PC6, TIM_USE_MOTOR, 0, 0), // PWM1 - DMA2_ST2
DEF_TIM(TIM3, CH2, PC7, TIM_USE_MOTOR, 0, 0), // PWM2 - DMA1_ST5
DEF_TIM(TIM8, CH2N, PB14, TIM_USE_MOTOR, 0, 0), // PWM3 - DMA2_ST3
DEF_TIM(TIM3, CH3, PB0, TIM_USE_MOTOR, 0, 0), // PWM4 - DMA1_ST7
DEF_TIM(TIM5, CH1, PA0, TIM_USE_MOTOR, 0, 0), // PWM5 - DMA1_ST2
DEF_TIM(TIM8, CH3, PC8, TIM_USE_MOTOR, 0, 0), // PWM6 - DMA2_ST4
DEF_TIM(TIM5, CH2, PA1, TIM_USE_MOTOR, 0, 0), // PWM7 - DMA1_ST4
DEF_TIM(TIM8, CH4, PC9, TIM_USE_MOTOR, 0, 0), // PWM8 - DMA2_ST7
DEF_TIM(TIM3, CH4, PB1, TIM_USE_MOTOR, 0, 0), // PWM9 - DMA1_ST2
DEF_TIM(TIM1, CH3N, PB15, TIM_USE_MOTOR, 0, 0), // PWM10 - DMA2_ST6
DEF_TIM(TIM4, CH3, PB8, TIM_USE_MOTOR, 0, 0), // PWM11 - DMA1_ST7
DEF_TIM(TIM4, CH4, PB9, TIM_USE_MOTOR, 0, 0), // PWM12 - DMA_NONE
};

const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]);
Loading

0 comments on commit 6ebec53

Please sign in to comment.