⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 openmcpwm1.c

📁 Mplab C30编译器
💻 C
字号:
#include <pwm12.h>

#ifdef _FLTA1IF

/*********************************************************************
* Function Name     : OpenMCPWM1
* Description       : This function configures PWM1 module for the 
*                     following parameters:
*                     period, sptime, PWM Mode, Clock Prescale,
*                     Output Postscale, high res mode, I/O pair mode, 
*                     I/O pair mode,I/O pair enable, Special event 
*                     postscale, Special event direction, override 
*                     synchronization.
* Parameters        : unsigned int period
*                     unsigned int sptime
*                     unsigned int config1
*                     unsigned int config2, 
*                     unsigned int config3
* Return Value      : None 
**********************************************************************/

void OpenMCPWM1(unsigned int period, unsigned int sptime, unsigned int 
               config1, unsigned int config2, unsigned int config3)
{
    P1TPER   = period;
    P1SECMP = sptime;
    PWM1CON1 = config2;
    PWM1CON2 = config3;
    P1TCON   = config1;
}

#else
#warning "Does not build on this target"
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -