void TIM_BDTRConfig(TIM_TypeDef* TIMx, TIM_BDTRInitTypeDef *TIM_BDTRInitStruct)
typedef struct { uint_t16 TIM_OSSRState; uint_t16 TIM_OSSIState; uint_t16 TIM_LOCKLevel; uint_t16 TIM_DeadTime; uint_t16 TIM_Break; uint_t16 TIM_BreakPolarity; uint_t16 TIM_AutomaticOutput; } TIM_BDTRInitTypeDef;
TIM_OSSRState | 説明 |
TIM_OSSRState_Enable | TIM OSSR State is enabled |
TIM_OSSRState_Disable | TIM OSSR State is disabled |
TIM_OSSIState | 説明 |
TIM_OSSIState_Enable | TIM OSSI State is enabled |
TIM_OSSIState_Disable | TIM OSSI State is disabled |
TIM_LOCKLevel | 説明 |
TIM_LOCKLevel_OFF | No bit is locked. |
TIM_LOCKLevel_1 | LOCK level 1 is used. |
TIM_LOCKLevel_2 | LOCK level 2 is used. |
TIM_LOCKLevel_3 | LOCK level 3 is used. |
TIM_Break | 説明 |
TIM_Break_Enable | TIM Break Input is enabled |
TIM_Break_Disable | TIM Break Input is disabled |
TIM_BreakPolarity | 説明 |
TIM_BreakPolarity_Low | Sets the TIM Break input pin polarity to low. |
TIM_BreakPolarity_High | Sets the TIM Break Input pin polarity to high. |
TIM_AutomaticOutput | 説明 |
TIM_AutomaticOutput_Enable | Enables the TIM Automatic Output. |
TIM_AutomaticOutput_Disable | Disables the TIM Automatic Output. |
/* OSSR, OSSI, Automatic Output enable, Break, dead time and Lock Level configuration*/ TIM_BDTRInitTypeDef TIM_BDTRInitStructure; TIM_BDTRInitStructure.TIM_OSSRState = TIM_OSSRState_Enable; TIM_BDTRInitStructure.TIM_OSSIState = TIM_OSSIState_Enable; TIM_BDTRInitStructure.TIM_LOCKLevel = TIM_LOCKLevel_1; TIM_BDTRInitStructure.TIM_DeadTime = 0x05; TIM_BDTRInitStructure.TIM_Break = TIM_Break_Enable; TIM_BDTRInitStructure.TIM_BreakPolarity = TIM_BreakPolarity_High; TIM_BDTRInitStructure.TIM_AutomaticOutput = TIM_AutomaticOutput_Enable; TIM_BDTRConfig(TIM1, &TIM_BDTRInitStructure);