Created
May 26, 2014 10:13
-
-
Save treymarc/ac96e3b3d69b33586aed to your computer and use it in GitHub Desktop.
naze32pro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const timerHardware_t timerHardware[] = { | |
{ TIM1, GPIOA, Pin_8, TIM_Channel_1, TIM1_CC_IRQn, 1, Mode_AF_PP_PD}, | |
{ TIM1, GPIOA, Pin_9, TIM_Channel_2, TIM1_CC_IRQn, 1, Mode_AF_PP_PD}, | |
{ TIM1, GPIOA, Pin_10, TIM_Channel_3, TIM1_CC_IRQn, 1, Mode_AF_PP_PD}, | |
{ TIM3, GPIOB, Pin_4, TIM_Channel_1, TIM3_IRQn, 0, Mode_AF_PP_PD}, | |
{ TIM4, GPIOB, Pin_6, TIM_Channel_1, TIM4_IRQn, 0, Mode_AF_PP_PD}, | |
{ TIM4, GPIOB, Pin_7, TIM_Channel_2, TIM4_IRQn, 0, Mode_AF_PP_PD}, | |
{ TIM4, GPIOB, Pin_8, TIM_Channel_3, TIM4_IRQn, 0, Mode_AF_PP_PD}, | |
{ TIM4, GPIOB, Pin_9, TIM_Channel_4, TIM4_IRQn, 0, Mode_AF_PP_PD}, | |
{ TIM2, GPIOA, Pin_0, TIM_Channel_1, TIM2_IRQn, 0, Mode_AF_PP}, | |
{ TIM2, GPIOA, Pin_1, TIM_Channel_2, TIM2_IRQn, 0, Mode_AF_PP}, | |
{ TIM15, GPIOA, Pin_2, TIM_Channel_1, TIM1_BRK_TIM15_IRQn, 1, Mode_AF_PP_PD}, | |
{ TIM15, GPIOA, Pin_3, TIM_Channel_2, TIM1_BRK_TIM15_IRQn, 1, Mode_AF_PP_PD}, | |
{ TIM16, GPIOA, Pin_6, TIM_Channel_1, TIM1_UP_TIM16_IRQn, 1, Mode_AF_PP_PD}, | |
{ TIM17, GPIOA, Pin_7, TIM_Channel_1, TIM1_TRG_COM_TIM17_IRQn, 1, Mode_AF_PP_PD} | |
}; | |
#define MAX_TIMERS 7 | |
static const TIM_TypeDef *timers[MAX_TIMERS] = { | |
TIM1, TIM2, TIM3, TIM4, TIM15 , TIM16 , TIM17 }; | |
{ | |
GPIO_PinAFConfig(GPIOA, GPIO_PinSource0, GPIO_AF_1); | |
GPIO_PinAFConfig(GPIOA, GPIO_PinSource1, GPIO_AF_1); | |
GPIO_PinAFConfig(GPIOA, GPIO_PinSource2, GPIO_AF_9); | |
GPIO_PinAFConfig(GPIOA, GPIO_PinSource3, GPIO_AF_9); | |
GPIO_PinAFConfig(GPIOA, GPIO_PinSource6, GPIO_AF_1); | |
GPIO_PinAFConfig(GPIOA, GPIO_PinSource7, GPIO_AF_1); | |
GPIO_PinAFConfig(GPIOA, GPIO_PinSource8, GPIO_AF_6); | |
GPIO_PinAFConfig(GPIOA, GPIO_PinSource9, GPIO_AF_6); | |
GPIO_PinAFConfig(GPIOA, GPIO_PinSource10, GPIO_AF_6); | |
GPIO_PinAFConfig(GPIOB, GPIO_PinSource4, GPIO_AF_2); | |
GPIO_PinAFConfig(GPIOB, GPIO_PinSource6, GPIO_AF_2); | |
GPIO_PinAFConfig(GPIOB, GPIO_PinSource7, GPIO_AF_2); | |
GPIO_PinAFConfig(GPIOB, GPIO_PinSource8, GPIO_AF_2); | |
GPIO_PinAFConfig(GPIOB, GPIO_PinSource9, GPIO_AF_2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment