微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > STM32 TIM重映射

STM32 TIM重映射

时间:11-10 来源:互联网 点击:

输出比较极性高

TIM_OC3Init(TIM3, &TIM_OCInitStructure);

TIM_OC3PreloadConfig(TIM3, TIM_OCPreload_Enable);//使能或者失能 TIM3 在 CCR3 上的预装载寄存器

/* PWM1 Mode configuration: Channel4 */

TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable;

TIM_OCInitStructure.TIM_Pulse = CCR4_Val;

TIM_OC4Init(TIM3, &TIM_OCInitStructure);

TIM_OC4PreloadConfig(TIM3, TIM_OCPreload_Enable);

/* TIM3 enable counter */

TIM_Cmd(TIM3, ENABLE);//开启时钟,别落下

}

/**

* @brief EXTI_Config Program.

* @param None

* @retval : None

*/

/**

* @brief Configures the nested vectored interrupt controller.

* @param None

* @retval : None

*/

#ifdef USE_FULL_ASSERT

/**

* @brief Reports the name of the source file and the source line number

* where the assert_param error has occurred.

* @param file: pointer to the source file name

* @param line: assert_param error line source number

* @retval : None

*/

voidassert_failed(uint8_t* file, uint32_t line)

{

/* User can add his own implementation to report the file name and line number,

ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */

/* Infinite loop */

while(1)

{

}

}

#endif

/**

* @}

*/

/******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top