forked from trocache/RefKEIL
Added Start and Stop macros for PWM. Init no longer enable the MOE bit
This commit is contained in:
parent
d3c453a14a
commit
df5fe51a62
4 changed files with 4 additions and 2 deletions
|
@ -50,7 +50,6 @@ void MyTimer_PWM_Init(MyPWM_Struct_TypeDef * PWM)
|
|||
PWM->Timer->CCR1 = PWM->CCR;
|
||||
break;
|
||||
}
|
||||
PWM->Timer->BDTR |= (1<<MOE); //Main output enable
|
||||
PWM->Timer->CCER |= (1<<4*(PWM->channel-1)); //enable capture/compare registers
|
||||
}
|
||||
|
||||
|
|
|
@ -31,5 +31,7 @@ void MyTimer_PWM_Init(MyPWM_Struct_TypeDef * PWM);
|
|||
|
||||
#define MyTimer_Base_Start(Timer) (Timer->CR1 |= (0x01<<CEN))
|
||||
#define MyTimer_Base_Stop(Timer) (Timer->CR1 &= ~(0x01<<CEN))
|
||||
#define MyPWM_Base_Start(Timer) (Timer->BDTR |= (1<<MOE)) //Main output enable
|
||||
#define MyPWM_Base_Stop(Timer) (Timer->BDTR &= ~(1<<MOE)) //Main output enable
|
||||
|
||||
#endif
|
||||
|
|
|
@ -26,6 +26,7 @@ int main (void)
|
|||
//PWM enable
|
||||
MyPWM_Struct_TypeDef timer2channel2 = {TIM2,1,400};
|
||||
MyTimer_PWM_Init(&timer2channel2);
|
||||
MyPWM_Base_Start(TIM2);
|
||||
//TIM2->CCMR1 |= (0x6<<12);
|
||||
//TIM2->BDTR |= (1<<MOE);
|
||||
//TIM2->CCR2 = 10;
|
||||
|
|
|
@ -125,7 +125,7 @@
|
|||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGDARM</Key>
|
||||
<Name>(1010=895,198,1271,755,1)(1007=105,137,292,412,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(100=-1,-1,-1,-1,0)(110=-1,-1,-1,-1,0)(111=-1,-1,-1,-1,0)(1011=-1,-1,-1,-1,0)(180=-1,-1,-1,-1,0)(120=498,100,919,527,1)(121=491,538,912,965,1)(122=875,109,1296,536,0)(123=-1,-1,-1,-1,0)(140=-1,-1,-1,-1,0)(240=105,137,504,482,0)(190=-1,-1,-1,-1,0)(200=-1,-1,-1,-1,0)(170=-1,-1,-1,-1,0)(130=-1,-1,-1,-1,0)(131=1175,164,1769,915,1)(132=150,186,744,937,0)(133=-1,-1,-1,-1,0)(160=-1,-1,-1,-1,0)(161=-1,-1,-1,-1,0)(162=-1,-1,-1,-1,0)(210=-1,-1,-1,-1,0)(211=-1,-1,-1,-1,0)(220=-1,-1,-1,-1,0)(221=-1,-1,-1,-1,0)(230=-1,-1,-1,-1,0)(234=-1,-1,-1,-1,0)(231=-1,-1,-1,-1,0)(232=-1,-1,-1,-1,0)(233=-1,-1,-1,-1,0)(150=-1,-1,-1,-1,0)(151=-1,-1,-1,-1,0)</Name>
|
||||
<Name>(1010=895,198,1271,755,1)(1007=105,137,292,412,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(100=-1,-1,-1,-1,0)(110=-1,-1,-1,-1,0)(111=-1,-1,-1,-1,0)(1011=-1,-1,-1,-1,0)(180=-1,-1,-1,-1,0)(120=498,100,919,527,1)(121=491,538,912,965,1)(122=875,109,1296,536,0)(123=-1,-1,-1,-1,0)(140=-1,-1,-1,-1,0)(240=105,137,504,482,0)(190=-1,-1,-1,-1,0)(200=-1,-1,-1,-1,0)(170=-1,-1,-1,-1,0)(130=-1,-1,-1,-1,0)(131=1175,164,1769,915,1)(132=1172,171,1766,922,1)(133=-1,-1,-1,-1,0)(160=-1,-1,-1,-1,0)(161=-1,-1,-1,-1,0)(162=-1,-1,-1,-1,0)(210=-1,-1,-1,-1,0)(211=-1,-1,-1,-1,0)(220=-1,-1,-1,-1,0)(221=-1,-1,-1,-1,0)(230=-1,-1,-1,-1,0)(234=-1,-1,-1,-1,0)(231=-1,-1,-1,-1,0)(232=-1,-1,-1,-1,0)(233=-1,-1,-1,-1,0)(150=-1,-1,-1,-1,0)(151=-1,-1,-1,-1,0)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
|
|
Loading…
Reference in a new issue